@camera.ui/server 2.2.5-beta.0 → 2.2.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (427) hide show
  1. package/dist/interface/assets/{404-Bdbp69ox.js → 404-6ZpTZ3KD.js} +1 -1
  2. package/dist/interface/assets/{About-DmtCok-y.js → About-DNvcZ3EY.js} +1 -1
  3. package/dist/interface/assets/{Assistant-D-Lv6JtY.js → Assistant-kFFjOesz.js} +1 -1
  4. package/dist/interface/assets/{Automation-LQ3TssrU.js → Automation-DPH-VMGf.js} +3 -3
  5. package/dist/interface/assets/{AutomationImport-B_ra3G3_.js → AutomationImport-Db74ZBgg.js} +2 -2
  6. package/dist/interface/assets/{AutomationStore-DSXSaQjp.js → AutomationStore-CFnapdvO.js} +2 -2
  7. package/dist/interface/assets/{AutomationStoreDetail-B5_Meb6R.js → AutomationStoreDetail-BCmfVMtC.js} +2 -2
  8. package/dist/interface/assets/{Automations-DHfPRe8W.js → Automations-D41at64b.js} +2 -2
  9. package/dist/interface/assets/{Camera-CDbfvtJv.js → Camera-BhFx-a1S.js} +2 -2
  10. package/dist/interface/assets/{CameraConsole-DX-IRmd_.js → CameraConsole-C89mOigo.js} +1 -1
  11. package/dist/interface/assets/{Cameras-D9m2bxWj.js → Cameras-TiX75P_R.js} +1 -1
  12. package/dist/interface/assets/{Camview-DKOYY6TI.js → Camview-Bs3Ze0VB.js} +1 -1
  13. package/dist/interface/assets/{CertificateUpload-B8ccb3n-.js → CertificateUpload-DBfJBo-w.js} +1 -1
  14. package/dist/interface/assets/{Config-DCIUUWCv.js → Config-CiCqmjhC.js} +1 -1
  15. package/dist/interface/assets/{ConfigActionAssistant-6IUzZeNW.js → ConfigActionAssistant-DCW9F-o_.js} +1 -1
  16. package/dist/interface/assets/{ConfigActionCameraControl-EXuiNMuG.js → ConfigActionCameraControl-V170tTXG.js} +1 -1
  17. package/dist/interface/assets/{ConfigActionDelay-Cs4sYEk-.js → ConfigActionDelay-D1CZOls9.js} +1 -1
  18. package/dist/interface/assets/{ConfigActionHttp-gUM6RQ6Y.js → ConfigActionHttp-ZOsjh7jZ.js} +1 -1
  19. package/dist/interface/assets/{ConfigActionImageInput-CPl5kVgO.js → ConfigActionImageInput-Dq5NtDno.js} +1 -1
  20. package/dist/interface/assets/{ConfigActionMqtt-BeBMCOJ-.js → ConfigActionMqtt-Cyk0f9mh.js} +1 -1
  21. package/dist/interface/assets/{ConfigActionNotification-DJFHdFDN.js → ConfigActionNotification-Ca6IygV-.js} +1 -1
  22. package/dist/interface/assets/{ConfigActionNotificationControl-BXoztPTs.js → ConfigActionNotificationControl-CCiWBmJq.js} +1 -1
  23. package/dist/interface/assets/{ConfigActionOutput-BGrFWqZ1.js → ConfigActionOutput-B4zPAsNS.js} +1 -1
  24. package/dist/interface/assets/{ConfigActionPlugin-CdIIMcJZ.js → ConfigActionPlugin-C25suoOA.js} +1 -1
  25. package/dist/interface/assets/{ConfigActionSensor-MRVGJ22A.js → ConfigActionSensor-CgIBk5qS.js} +1 -1
  26. package/dist/interface/assets/{ConfigActionSnapshot-CxA4f5ag.js → ConfigActionSnapshot-Dj4_bcR-.js} +1 -1
  27. package/dist/interface/assets/{ConfigActionVariable-DmU4seLh.js → ConfigActionVariable-CDlIj4Ji.js} +1 -1
  28. package/dist/interface/assets/{ConfigConditionIfElse-Tgdrk7lo.js → ConfigConditionIfElse-B9Q2pZxM.js} +1 -1
  29. package/dist/interface/assets/{ConfigConditionSensorState-CyyzoL6Q.js → ConfigConditionSensorState-DrOBPrDB.js} +1 -1
  30. package/dist/interface/assets/{ConfigConditionSwitch-DprK5AbR.js → ConfigConditionSwitch-BdfA75Z4.js} +1 -1
  31. package/dist/interface/assets/{ConfigConditionTime-CDruEvBp.js → ConfigConditionTime-CCpFkanY.js} +1 -1
  32. package/dist/interface/assets/{ConfigSensorValueInput-BhlgTOW9.js → ConfigSensorValueInput-B7Qc06SA.js} +1 -1
  33. package/dist/interface/assets/{ConfigTriggerDetection-4vdEST9Y.js → ConfigTriggerDetection-QOLhT23F.js} +1 -1
  34. package/dist/interface/assets/{ConfigTriggerGeofence-1B0BdCOw.js → ConfigTriggerGeofence-HUhmtzd_.js} +1 -1
  35. package/dist/interface/assets/{ConfigTriggerManual-BQLDqwZh.js → ConfigTriggerManual-Bpyy9Jzz.js} +1 -1
  36. package/dist/interface/assets/{ConfigTriggerMqtt-B3YNOB6U.js → ConfigTriggerMqtt-wxB4LtkP.js} +1 -1
  37. package/dist/interface/assets/{ConfigTriggerSchedule-DhbJGOT7.js → ConfigTriggerSchedule-D7X5Oa5t.js} +1 -1
  38. package/dist/interface/assets/{ConfigTriggerSensor-iMPg_Pmb.js → ConfigTriggerSensor-DM7qewdx.js} +1 -1
  39. package/dist/interface/assets/{ConfigTriggerSystem-MaNZTO3h.js → ConfigTriggerSystem-CK573JKn.js} +1 -1
  40. package/dist/interface/assets/{ConfigTriggerWebhook-B3WfXjPv.js → ConfigTriggerWebhook-yoouSRHG.js} +1 -1
  41. package/dist/interface/assets/{Console-BQLINPCG.js → Console-BCL2lVJv.js} +1 -1
  42. package/dist/interface/assets/{CuiAssistantConversation-yCRlgjtr.js → CuiAssistantConversation-BmjsGo2l.js} +1 -1
  43. package/dist/interface/assets/{CuiAutomationRunsDialog-CJ0mzDLL.js → CuiAutomationRunsDialog-BFZjtF9o.js} +1 -1
  44. package/dist/interface/assets/CuiBottomSheet-CVHz2Vrq.js +1 -0
  45. package/dist/interface/assets/{CuiBottomSheet-BbP0T2v3.js → CuiBottomSheet-DLtu4FrC.js} +1 -1
  46. package/dist/interface/assets/{CuiCameraPipCard-1EhYM5kQ.js → CuiCameraPipCard-BGZQsVHc.js} +1 -1
  47. package/dist/interface/assets/{CuiCameraRecordings-D2jG47AV.js → CuiCameraRecordings-5pcLjdf8.js} +1 -1
  48. package/dist/interface/assets/{CuiCameraShares-IpkomKkl.js → CuiCameraShares-CNNvqXns.js} +1 -1
  49. package/dist/interface/assets/CuiCameraTable-BDN5NGr2.js +1 -0
  50. package/dist/interface/assets/{CuiCameraTable-DlL-z_na.js → CuiCameraTable-DF_IOFyD.js} +1 -1
  51. package/dist/interface/assets/{CuiChartTable-B0EPcrgv.js → CuiChartTable-rOLdUaOa.js} +1 -1
  52. package/dist/interface/assets/{CuiConsole-D8Xk2LXY.js → CuiConsole-B75tQO-y.js} +1 -1
  53. package/dist/interface/assets/{CuiDataTable-DtRTB560.js → CuiDataTable-C8ZywwaZ.js} +1 -1
  54. package/dist/interface/assets/{CuiLightControl-CtL3sA8k.js → CuiLightControl-D6PaG8aL.js} +1 -1
  55. package/dist/interface/assets/{CuiList-Bn7DT_Ao.js → CuiList-B8wJe291.js} +1 -1
  56. package/dist/interface/assets/{CuiMarkdownContent-CyJxfnFA.js → CuiMarkdownContent-D-S1LZy3.js} +1 -1
  57. package/dist/interface/assets/CuiMarkdownContent-yHrnDzQd.js +1 -0
  58. package/dist/interface/assets/{CuiPluginCard-B-4x6Mno.js → CuiPluginCard-aGMkvpeM.js} +2 -2
  59. package/dist/interface/assets/{CuiPluginCategoryChip-Dih4zKtO.js → CuiPluginCategoryChip-BCgADU71.js} +1 -1
  60. package/dist/interface/assets/{CuiPluginOAuthButton-D-Y9KYJz.js → CuiPluginOAuthButton-mrm1vDAP.js} +2 -2
  61. package/dist/interface/assets/{CuiPluginTrustBadge-_g3Ctrg4.js → CuiPluginTrustBadge-J3818in1.js} +1 -1
  62. package/dist/interface/assets/{CuiQRCode-D6hzmPzV.js → CuiQRCode-Dv4w0udN.js} +1 -1
  63. package/dist/interface/assets/{CuiSchema-Dh8Mu4BK.js → CuiSchema-Cn5geGt7.js} +1 -1
  64. package/dist/interface/assets/{CuiTopNavbarItem-CgX21E5K.js → CuiTopNavbarItem-cP_SiDnw.js} +1 -1
  65. package/dist/interface/assets/{Faces-CgDoKVkp.js → Faces-b611-5Ep.js} +1 -1
  66. package/dist/interface/assets/{FirstSteps-CZSTX7Ot.js → FirstSteps-DcVdjoXr.js} +1 -1
  67. package/dist/interface/assets/{Floorplan-CRvmaf45.js → Floorplan-CZu7D3L2.js} +1 -1
  68. package/dist/interface/assets/{Instances-DRkhTQKC.js → Instances-BGM2M_vr.js} +1 -1
  69. package/dist/interface/assets/{Logs-CIDJSpdH.js → Logs-BXDALPw6.js} +1 -1
  70. package/dist/interface/assets/{Menu-CM_F1jfd.js → Menu-DV63hDK5.js} +1 -1
  71. package/dist/interface/assets/{Metrics-DgJEg-ZK.js → Metrics-CrojTUIw.js} +1 -1
  72. package/dist/interface/assets/{OAuthDeviceFlow-BZ9LcgmJ.js → OAuthDeviceFlow-E2q5BNUN.js} +1 -1
  73. package/dist/interface/assets/{Plugin-BBDpg6U_.js → Plugin-BFovKMPD.js} +1 -1
  74. package/dist/interface/assets/{PluginConsole-DxVlTuNy.js → PluginConsole-BLG5Srww.js} +1 -1
  75. package/dist/interface/assets/{PluginDetail-fLGD3R-u.js → PluginDetail-Dghf_z9y.js} +2 -2
  76. package/dist/interface/assets/{PluginSchema-CewD2H-K.js → PluginSchema-C3u0PCYu.js} +1 -1
  77. package/dist/interface/assets/PluginSearch-DQb6r45_.js +1 -0
  78. package/dist/interface/assets/{PluginSearch-5wX7WEcz.js → PluginSearch-XaJOsyFA.js} +2 -2
  79. package/dist/interface/assets/{PluginUpdateProgress-B7Lj0ttd.js → PluginUpdateProgress-tMIWjHFs.js} +1 -1
  80. package/dist/interface/assets/{Plugins-DVQ476iL.js → Plugins-DgKXf65s.js} +1 -1
  81. package/dist/interface/assets/{RecentEventsFilter-CWNBI2Ge.js → RecentEventsFilter-DlzWA8QR.js} +1 -1
  82. package/dist/interface/assets/{Recordings-DSRgRVhN.js → Recordings-DC47F4WC.js} +1 -1
  83. package/dist/interface/assets/{SensorEdit-B1mYmxDV.js → SensorEdit-BDeJ0tjj.js} +1 -1
  84. package/dist/interface/assets/{SensorHistory-D1kKroxp.js → SensorHistory-C8oPVJEX.js} +1 -1
  85. package/dist/interface/assets/{Sensors-yAc1M-oO.js → Sensors-C29BBaNa.js} +2 -2
  86. package/dist/interface/assets/{Settings-DBKgECRK.js → Settings-bn3Pokuq.js} +1 -1
  87. package/dist/interface/assets/SettingsAccount-B-SSNfmo.js +1 -0
  88. package/dist/interface/assets/{SettingsAccount-CM3XGNL6.js → SettingsAccount-BXClgcHw.js} +1 -1
  89. package/dist/interface/assets/SettingsAppearance-1KCm8sJO.js +1 -0
  90. package/dist/interface/assets/{SettingsAppearance-C-nllv3m.js → SettingsAppearance-C5rHbPxY.js} +1 -1
  91. package/dist/interface/assets/{SettingsAssistant-ClRO04fv.js → SettingsAssistant-ndgpk0jF.js} +1 -1
  92. package/dist/interface/assets/{SettingsBackup-Cq_eLVCR.js → SettingsBackup-Cw0OoGGY.js} +1 -1
  93. package/dist/interface/assets/{SettingsList-Bklt3TQO.js → SettingsList--FB27rY6.js} +1 -1
  94. package/dist/interface/assets/{SettingsMqtt-BLkP0en6.js → SettingsMqtt-DrHwxyfj.js} +1 -1
  95. package/dist/interface/assets/{SettingsNotifications-CeUKfEnH.js → SettingsNotifications-CHFxYyBM.js} +1 -1
  96. package/dist/interface/assets/{SettingsPermissions-Cpka-k3Q.js → SettingsPermissions-CtR3k4N9.js} +1 -1
  97. package/dist/interface/assets/{SettingsRecordings-k20qTe7K.js → SettingsRecordings-YTMBWiO2.js} +1 -1
  98. package/dist/interface/assets/{SettingsRemote-CdUj0nZ1.js → SettingsRemote-DTZo7Tnk.js} +1 -1
  99. package/dist/interface/assets/{SettingsSystem-6OChvWL7.js → SettingsSystem-C9L3_BPg.js} +2 -2
  100. package/dist/interface/assets/{SettingsUsers-B57uZ8jn.js → SettingsUsers-BK6d7cMj.js} +1 -1
  101. package/dist/interface/assets/{Terminal-WMgVSORW.js → Terminal-DWa4f8GL.js} +1 -1
  102. package/dist/interface/assets/{Training-BkWlywj_.js → Training-BsgWYOlp.js} +1 -1
  103. package/dist/interface/assets/{Updates-Dwrd6PQl.js → Updates-CSvohiVI.js} +2 -2
  104. package/dist/interface/assets/{VariableInput-CDJXnzEV.js → VariableInput-CiWT5dul.js} +1 -1
  105. package/dist/interface/assets/{VariableSuggestions-CNq7O1o-.js → VariableSuggestions-pbXYBWuw.js} +1 -1
  106. package/dist/interface/assets/{VersionsHandler-C0A8Ryhn.js → VersionsHandler-BE-YNUTe.js} +1 -1
  107. package/dist/interface/assets/{VirtualSensorCreate-zEehu8Fg.js → VirtualSensorCreate-Ba4XwvcD.js} +1 -1
  108. package/dist/interface/assets/{Workers-Be7q2vOK.js → Workers-BtHqRqzx.js} +1 -1
  109. package/dist/interface/assets/{account-6TLZf1iz.js → account-BxoX10XU.js} +1 -1
  110. package/dist/interface/assets/{alert-circle-CWUV5Xzc.js → alert-circle-pr3uC6jZ.js} +1 -1
  111. package/dist/interface/assets/{alert-outline-8Rb4Kt7A.js → alert-outline-DHaYL1DY.js} +1 -1
  112. package/dist/interface/assets/{api-CSl3-BNZ.js → api--1J-SAjn.js} +1 -1
  113. package/dist/interface/assets/{api-vegsDz6n.js → api-C7-TgfI0.js} +3 -3
  114. package/dist/interface/assets/{arrow-left-CR_6L2Na.js → arrow-left-5ht64ZGB.js} +1 -1
  115. package/dist/interface/assets/{assistant-jARIkvB1.js → assistant-Cl_fhAuJ.js} +1 -1
  116. package/dist/interface/assets/{assistantModels-frQFfeed.js → assistantModels-DPcZCyld.js} +1 -1
  117. package/dist/interface/assets/{auth-Bov4B1jy.js → auth-CbzQl7TC.js} +1 -1
  118. package/dist/interface/assets/{automations-CJe7TvLk.js → automations-tJ_M8mwQ.js} +1 -1
  119. package/dist/interface/assets/{back-filled-xrzKyz1B.js → back-filled-BncmhmK7.js} +1 -1
  120. package/dist/interface/assets/{bell-ring-CP1gJErL.js → bell-ring-BrHmFuCb.js} +1 -1
  121. package/dist/interface/assets/{brain-BTo05kAx.js → brain-DbFpT7Cq.js} +1 -1
  122. package/dist/interface/assets/{cameraSources-CDiYtBzG.js → cameraSources-BoPq2cHU.js} +1 -1
  123. package/dist/interface/assets/{cctv-jOxIizQH.js → cctv-DO-BmfXS.js} +1 -1
  124. package/dist/interface/assets/{check-circle-CXfnFKFA.js → check-circle-DefdZO6b.js} +1 -1
  125. package/dist/interface/assets/{check-circle-outline-BXLVwqwM.js → check-circle-outline-DLeND8yu.js} +1 -1
  126. package/dist/interface/assets/{chevron-down-BmHRUHVR.js → chevron-down-COQqnpYB.js} +1 -1
  127. package/dist/interface/assets/{chevron-up-BIxCAmMr.js → chevron-up-D1Xd7VoH.js} +1 -1
  128. package/dist/interface/assets/{clock-outline-D9YYXYjG.js → clock-outline-DLIhBBQh.js} +1 -1
  129. package/dist/interface/assets/{close-Gg5h2MPz.js → close-C_pY8d5W.js} +1 -1
  130. package/dist/interface/assets/{close-circle-DmuCMtNe.js → close-circle-CUM5zI7N.js} +1 -1
  131. package/dist/interface/assets/{cloud-check-CB0qNXSP.js → cloud-check-CqURJGod.js} +1 -1
  132. package/dist/interface/assets/cloudHandoff-U-ME7kxo.js +1 -0
  133. package/dist/interface/assets/{config-iO2vrtak.js → config-ConCokYZ.js} +1 -1
  134. package/dist/interface/assets/{content-copy-DBYFzNui.js → content-copy-M0zk9eVL.js} +1 -1
  135. package/dist/interface/assets/{copy-CF7J0cxP.js → copy-DbP_BYcc.js} +1 -1
  136. package/dist/interface/assets/{cube-scan-Bzsgslh2.js → cube-scan-DUOB_hmY.js} +1 -1
  137. package/dist/interface/assets/{delete-CRNIa5a0.js → delete-rtnOkwr8.js} +1 -1
  138. package/dist/interface/assets/{dist-CKsmPF0O.js → dist-Ce8wBKXN.js} +1 -1
  139. package/dist/interface/assets/{dots-vertical-C4DlXZyp.js → dots-vertical-BBZiQrJI.js} +1 -1
  140. package/dist/interface/assets/{download-C4gHcSTT.js → download-CV7ETeuV.js} +1 -1
  141. package/dist/interface/assets/esm-B0uV7sCS.js +1 -0
  142. package/dist/interface/assets/esm-B2yI2eHV.js +1 -0
  143. package/dist/interface/assets/esm-BGznyI26.js +1 -0
  144. package/dist/interface/assets/esm-BU06bvS2.js +1 -0
  145. package/dist/interface/assets/esm-CDZvvPo-.js +1 -0
  146. package/dist/interface/assets/esm-CQhKa6pe.js +1 -0
  147. package/dist/interface/assets/esm-C_cunepi.js +1 -0
  148. package/dist/interface/assets/esm-D7Wl3e71.js +1 -0
  149. package/dist/interface/assets/esm-DF51BosK.js +1 -0
  150. package/dist/interface/assets/esm-DGnwYAQM.js +1 -0
  151. package/dist/interface/assets/esm-DOPi7vcu.js +1 -0
  152. package/dist/interface/assets/esm-DhUjXDgk.js +1 -0
  153. package/dist/interface/assets/esm-Dy2zOjxI.js +1 -0
  154. package/dist/interface/assets/esm-kUcKqIWx.js +1 -0
  155. package/dist/interface/assets/{eventIcons-BPQ-zSnz.js → eventIcons-CCFi3Fbj.js} +1 -1
  156. package/dist/interface/assets/{eye-off-D7-qb6Nm.js → eye-off-CvhN3zxZ.js} +1 -1
  157. package/dist/interface/assets/{eye-off-outline-DO1W1tdl.js → eye-off-outline-CCqCZfJ6.js} +1 -1
  158. package/dist/interface/assets/{flowSchema-B0vIoy4y.js → flowSchema-CmXSZKQe.js} +1 -1
  159. package/dist/interface/assets/{help-circle-outline-BrCQn_fb.js → help-circle-outline-CQl2D4oN.js} +1 -1
  160. package/dist/interface/assets/{history-uQmxYRH-.js → history-BXFIMe6V.js} +1 -1
  161. package/dist/interface/assets/{home-CPvD8R_d.js → home-D7fG7atW.js} +1 -1
  162. package/dist/interface/assets/{information-outline-Bo2TPoHa.js → information-outline-1WzSLz5m.js} +1 -1
  163. package/dist/interface/assets/{intercomService-IAAXcRPG.js → intercomService-DyUZK0Im.js} +1 -1
  164. package/dist/interface/assets/{lan-pTYzHgPx.js → lan-CbNzy3jQ.js} +1 -1
  165. package/dist/interface/assets/{main-DQgH1fon.js → main-D4ZrTpOr.js} +2 -2
  166. package/dist/interface/assets/{microphone-Crj84LWD.js → microphone-CRLenDoX.js} +1 -1
  167. package/dist/interface/assets/{minus-DTDhg2EM.js → minus-COYpQ3vD.js} +1 -1
  168. package/dist/interface/assets/{mqtt-DfpSLxes.js → mqtt-C_RLsZgN.js} +1 -1
  169. package/dist/interface/assets/native-Chu05rXa.js +1 -0
  170. package/dist/interface/assets/native-DtAgV_35.js +1 -0
  171. package/dist/interface/assets/{nodeDefinitions-Jb3-KbSO.js → nodeDefinitions-DgM5EMJ0.js} +1 -1
  172. package/dist/interface/assets/{notifications-jTSwwN1i.js → notifications-B8VdKX2U.js} +1 -1
  173. package/dist/interface/assets/{pause-B7ud2O8d.js → pause-DvYzloru.js} +1 -1
  174. package/dist/interface/assets/{pencil-CuQeB4kE.js → pencil-Cd5KnMGq.js} +1 -1
  175. package/dist/interface/assets/{pencil-outline-BsdKHhHl.js → pencil-outline-BiVfpCP6.js} +1 -1
  176. package/dist/interface/assets/plugin-CWPz0s-n.js +1 -0
  177. package/dist/interface/assets/{plugins-ChyJXprl.js → plugins-CqWe1lUn.js} +1 -1
  178. package/dist/interface/assets/{plus-x5XqrG-6.js → plus-CjwCt143.js} +1 -1
  179. package/dist/interface/assets/{plus-Jda3x3mB.js → plus-IEiNd6x0.js} +1 -1
  180. package/dist/interface/assets/{power-et3ptczv.js → power-C4NWLKUx.js} +1 -1
  181. package/dist/interface/assets/{radar-D0eG7gya.js → radar-DBqhxkLO.js} +1 -1
  182. package/dist/interface/assets/{refresh-zUwVhGRH.js → refresh-DBLQ62l4.js} +1 -1
  183. package/dist/interface/assets/{restore-D2nuKfs4.js → restore-mXNfiEUq.js} +1 -1
  184. package/dist/interface/assets/{ring-resize-MiubMIoG.js → ring-resize-DrTdJJZT.js} +1 -1
  185. package/dist/interface/assets/{rooms-BMWJpAXC.js → rooms-CIxV7WRD.js} +1 -1
  186. package/dist/interface/assets/{round-alt-arrow-left-bold-DJ2t35Ab.js → round-alt-arrow-left-bold-BlJgH1Gs.js} +1 -1
  187. package/dist/interface/assets/{search-CSFYlWFv.js → search-CGxnUtuo.js} +1 -1
  188. package/dist/interface/assets/{sensorIcons-dUp8Tone.js → sensorIcons-CtsJEtFd.js} +1 -1
  189. package/dist/interface/assets/{sensorSlots-CosoVMys.js → sensorSlots-B0rJeEuw.js} +1 -1
  190. package/dist/interface/assets/{sensors-DLdbNuoj.js → sensors-CyseZmxe.js} +1 -1
  191. package/dist/interface/assets/{server-D-qkU2-U.js → server-BvOtzDbz.js} +1 -1
  192. package/dist/interface/assets/{settings-b9NE6YOU.js → settings-wlG-pPuL.js} +1 -1
  193. package/dist/interface/assets/{source-branch-DA1N9TmJ.js → source-branch-AyOkkO8S.js} +1 -1
  194. package/dist/interface/assets/{theme-DhneHMji.js → theme-CqKA1ClW.js} +1 -1
  195. package/dist/interface/assets/{trash-2-D3UqAJmg.js → trash-2-BKLI42HM.js} +1 -1
  196. package/dist/interface/assets/{trash-can-outline-B7IPK5NP.js → trash-can-outline-BFiV5RfR.js} +1 -1
  197. package/dist/interface/assets/{trash-fill-DIW5RIZu.js → trash-fill-hfLSPgsP.js} +1 -1
  198. package/dist/interface/assets/{trash2-D_pJJ_Dw.js → trash2-lr9UJJWi.js} +1 -1
  199. package/dist/interface/assets/{types-DDpq8alD.js → types-48CQutaE.js} +1 -1
  200. package/dist/interface/assets/{types-DdyAGRju.js → types-BRmIeoRR.js} +1 -1
  201. package/dist/interface/assets/{types-CngwbyEy.js → types-BlFbLEIJ.js} +1 -1
  202. package/dist/interface/assets/{undo-CNP-pN7J.js → undo-nleJllpv.js} +1 -1
  203. package/dist/interface/assets/{ungrouped-e2tQIZD2.js → ungrouped-D4Eyspkn.js} +1 -1
  204. package/dist/interface/assets/{updates-DnVisGT3.js → updates-iwZh9X-d.js} +1 -1
  205. package/dist/interface/assets/{upload-DeHCHra3.js → upload-1FIs_qFI.js} +1 -1
  206. package/dist/interface/assets/{upload-BzANK-MP.js → upload-BOBHxpZk.js} +1 -1
  207. package/dist/interface/assets/{useAppVersion-gtzMlM4b.js → useAppVersion-m7hrV2QZ.js} +1 -1
  208. package/dist/interface/assets/{useAssistantActions-BIHVky9T.js → useAssistantActions-BY-FVxFl.js} +1 -1
  209. package/dist/interface/assets/{useBackupRestore-DfgufKp3.js → useBackupRestore-BJSrIE1j.js} +1 -1
  210. package/dist/interface/assets/{useCameraOptions-B9yEPgGd.js → useCameraOptions-U3cPq_8f.js} +1 -1
  211. package/dist/interface/assets/{useKeyboardInset-1sUlRSeV.js → useKeyboardInset-Ce6esuI4.js} +1 -1
  212. package/dist/interface/assets/{useLogsSocket-C2QUQqkZ.js → useLogsSocket-BprgpXs0.js} +1 -1
  213. package/dist/interface/assets/{useNavLayout-Br4MtSjQ.js → useNavLayout-DKsBYcN-.js} +1 -1
  214. package/dist/interface/assets/{usePermissions-B8pw9jk1.js → usePermissions-MJCC2mYf.js} +1 -1
  215. package/dist/interface/assets/{usePluginUpdates-Cx9PwENn.js → usePluginUpdates-DaoikUxc.js} +1 -1
  216. package/dist/interface/assets/{usePushRegistration-CLEyagJM.js → usePushRegistration-MBn4GqtF.js} +2 -2
  217. package/dist/interface/assets/{useServerRestart-BBp4cko_.js → useServerRestart-_gMUanhL.js} +1 -1
  218. package/dist/interface/assets/{useStreamStatus-BrPjpyzs.js → useStreamStatus-C1aDump3.js} +1 -1
  219. package/dist/interface/assets/{useTabSwipe-B4edrv6o.js → useTabSwipe-SnHqt6pf.js} +1 -1
  220. package/dist/interface/assets/{useUpdateChannel-DugwYo8J.js → useUpdateChannel-BpYMuseR.js} +1 -1
  221. package/dist/interface/assets/{useUpdatesSocket-CgCXGGVg.js → useUpdatesSocket-8rAwSOk0.js} +1 -1
  222. package/dist/interface/assets/useUserOptions-BWz8j6Bt.js +1 -0
  223. package/dist/interface/assets/{variable-Dv4JwY3Y.js → variable-BH_88zve.js} +1 -1
  224. package/dist/interface/assets/{vendor-CP-WYrgy.js → vendor-CFZm55ei.js} +11 -11
  225. package/dist/interface/assets/{vendor-cameraui-D0VXSxSF.js → vendor-cameraui-DTALowLr.js} +46 -46
  226. package/dist/interface/assets/{vendor-capacitor--M3rv96M.js → vendor-capacitor-NUBkdqQG.js} +2 -2
  227. package/dist/interface/assets/{vendor-chart-UrRD4pPC.js → vendor-chart-BQ9z8Beo.js} +1 -1
  228. package/dist/interface/assets/{vendor-core-Ba81bBNM.js → vendor-core-DF66V0xE.js} +1 -1
  229. package/dist/interface/assets/{vendor-dnd-DiqNDDW5.js → vendor-dnd-55LKiquc.js} +1 -1
  230. package/dist/interface/assets/{vendor-draggabilly-Cc8Eip6N.js → vendor-draggabilly-C2H7F3yh.js} +1 -1
  231. package/dist/interface/assets/{vendor-markdown-BcxN-Nmd.js → vendor-markdown-CvrBrdq-.js} +1 -1
  232. package/dist/interface/assets/{vendor-primevue-LZEE4d1W.js → vendor-primevue-CpTHHdUJ.js} +1 -1
  233. package/dist/interface/assets/{vendor-vueflow-C5XdKBYg.js → vendor-vueflow-DGnDS4SG.js} +1 -1
  234. package/dist/interface/assets/web-1T-T_0WZ.js +1 -0
  235. package/dist/interface/assets/web-62WbTjlc.js +1 -0
  236. package/dist/interface/assets/web-BjKL51lK-6pj2Scsz.js +1 -0
  237. package/dist/interface/assets/web-BtY56waW.js +1 -0
  238. package/dist/interface/assets/web-Bv7Xkik0.js +1 -0
  239. package/dist/interface/assets/web-BvBEXTJW.js +1 -0
  240. package/dist/interface/assets/web-CFeS7fH5.js +1 -0
  241. package/dist/interface/assets/web-CUtMdd2B.js +1 -0
  242. package/dist/interface/assets/web-D6yoMUkZ.js +1 -0
  243. package/dist/interface/assets/web-DIOYyMNl.js +1 -0
  244. package/dist/interface/assets/web-D_hRP2qx.js +1 -0
  245. package/dist/interface/assets/web-DsY8tWI-.js +1 -0
  246. package/dist/interface/assets/web-DvetlpoV.js +1 -0
  247. package/dist/interface/assets/web-kt-Rh6Kp.js +1 -0
  248. package/dist/interface/assets/{webhook-UyZZIMaa.js → webhook-JRvzS9ld.js} +1 -1
  249. package/dist/interface/assets/workbox-window.prod.es5-Bd3XD_Q4.js +1 -0
  250. package/dist/interface/assets/{zoom-in-BdZ7kiwk.js → zoom-in-CWYu7bwA.js} +1 -1
  251. package/dist/interface/ha/{404-CkAIe5nc.js → 404-m6-uXJZq.js} +1 -1
  252. package/dist/interface/ha/{About-C7HxP7hM.js → About-CNVuMwKe.js} +4 -4
  253. package/dist/interface/ha/{Assistant-DJYxiCOY.js → Assistant-C8ffhO3m.js} +6 -6
  254. package/dist/interface/ha/{Automation-CfNHCeIm.js → Automation-C6tJrgcC.js} +33 -33
  255. package/dist/interface/ha/{AutomationImport-Dn3C1604.js → AutomationImport-DH1bdVRV.js} +7 -7
  256. package/dist/interface/ha/{AutomationStore-D63G9w2Y.js → AutomationStore-Ckn6ExG6.js} +5 -5
  257. package/dist/interface/ha/{AutomationStoreDetail-HoUC8cSY.js → AutomationStoreDetail-BDXaoPzo.js} +7 -7
  258. package/dist/interface/ha/{Automations-BOlE1Evb.js → Automations-B5uu-r94.js} +5 -5
  259. package/dist/interface/ha/{Camera-6Vvo7nee.js → Camera-B4CwxT3A.js} +7 -7
  260. package/dist/interface/ha/{CameraConsole-DYSNDW4P.js → CameraConsole-BzaY7lMs.js} +3 -3
  261. package/dist/interface/ha/{Cameras-CxgwXUaG.js → Cameras-B1vU95xU.js} +9 -9
  262. package/dist/interface/ha/{Camview-DPjoUMSP.js → Camview-BcgBR-RV.js} +5 -5
  263. package/dist/interface/ha/{CertificateUpload-BVJWfTRx.js → CertificateUpload-BqyveJeF.js} +1 -1
  264. package/dist/interface/ha/{Config-BzBFIWVF.js → Config-C81MLCdk.js} +8 -8
  265. package/dist/interface/ha/{ConfigActionAssistant-BpHf4Pdi.js → ConfigActionAssistant-DQfehzH6.js} +6 -6
  266. package/dist/interface/ha/{ConfigActionCameraControl-CmbCTwZ8.js → ConfigActionCameraControl-C3MnsSHv.js} +4 -4
  267. package/dist/interface/ha/{ConfigActionDelay-2xePO25t.js → ConfigActionDelay-CQDVG521.js} +1 -1
  268. package/dist/interface/ha/{ConfigActionHttp-BxN2KOA6.js → ConfigActionHttp-VqM0i3cV.js} +4 -4
  269. package/dist/interface/ha/{ConfigActionImageInput-CrXUZ-cM.js → ConfigActionImageInput-D7Maj3R-.js} +2 -2
  270. package/dist/interface/ha/{ConfigActionMqtt-DYq-6_S6.js → ConfigActionMqtt-Cm51kwWp.js} +6 -6
  271. package/dist/interface/ha/{ConfigActionNotification-DPUSAVLI.js → ConfigActionNotification-L5oaXgIQ.js} +5 -5
  272. package/dist/interface/ha/{ConfigActionNotificationControl-h4zta4Db.js → ConfigActionNotificationControl-DUa2iWvF.js} +3 -3
  273. package/dist/interface/ha/{ConfigActionOutput-Dwa0-7cq.js → ConfigActionOutput-6e9FLeyi.js} +2 -2
  274. package/dist/interface/ha/{ConfigActionPlugin-DXx1a-Hr.js → ConfigActionPlugin-DfWMHSOu.js} +6 -6
  275. package/dist/interface/ha/{ConfigActionSensor-CfLIHqS8.js → ConfigActionSensor-KMyKW8a4.js} +5 -5
  276. package/dist/interface/ha/{ConfigActionSnapshot-O0OBVq-R.js → ConfigActionSnapshot-BXUyBDrZ.js} +3 -3
  277. package/dist/interface/ha/{ConfigActionVariable-CbaIxRRe.js → ConfigActionVariable-5gjlEinD.js} +2 -2
  278. package/dist/interface/ha/{ConfigConditionIfElse-B7ax92bG.js → ConfigConditionIfElse-KVINr4wM.js} +4 -4
  279. package/dist/interface/ha/{ConfigConditionSensorState-B5XIrEGU.js → ConfigConditionSensorState-DfA7Z-rZ.js} +5 -5
  280. package/dist/interface/ha/{ConfigConditionSwitch-DJSz6bI5.js → ConfigConditionSwitch-MMBCtsCG.js} +5 -5
  281. package/dist/interface/ha/{ConfigConditionTime-CRn4k6uE.js → ConfigConditionTime-BFHFgE8n.js} +1 -1
  282. package/dist/interface/ha/{ConfigSensorValueInput-fE2SBn1B.js → ConfigSensorValueInput-BGPONs-v.js} +4 -4
  283. package/dist/interface/ha/{ConfigTriggerDetection-BuShu78G.js → ConfigTriggerDetection-Bl5RLc9-.js} +3 -3
  284. package/dist/interface/ha/{ConfigTriggerGeofence-pBgXBkb6.js → ConfigTriggerGeofence-C2P-lZvJ.js} +3 -3
  285. package/dist/interface/ha/{ConfigTriggerManual-3hhEe1f3.js → ConfigTriggerManual-BHrZRxUA.js} +1 -1
  286. package/dist/interface/ha/{ConfigTriggerMqtt-Dyf_TLfU.js → ConfigTriggerMqtt-DxE9E_We.js} +2 -2
  287. package/dist/interface/ha/{ConfigTriggerSchedule-ldJM8l6b.js → ConfigTriggerSchedule-DBaslXZn.js} +1 -1
  288. package/dist/interface/ha/{ConfigTriggerSensor-C5YUm9ff.js → ConfigTriggerSensor-BW6R5G1E.js} +2 -2
  289. package/dist/interface/ha/{ConfigTriggerSystem-CylHWw4i.js → ConfigTriggerSystem-WTcomTVB.js} +3 -3
  290. package/dist/interface/ha/{ConfigTriggerWebhook-ZlHsaLu4.js → ConfigTriggerWebhook-BuweCREC.js} +2 -2
  291. package/dist/interface/ha/{Console-PNAQjW_1.js → Console--3yf5q4a.js} +5 -5
  292. package/dist/interface/ha/{CuiAutomationRunsDialog-D_q8K7QO.js → CuiAutomationRunsDialog-Bjx5DXXc.js} +4 -4
  293. package/dist/interface/ha/{CuiBottomSheet-BbJG-998.js → CuiBottomSheet-CUWIERuK.js} +2 -2
  294. package/dist/interface/ha/{CuiCameraRecordings-BSI8Yn3v.js → CuiCameraRecordings-DDBEVW_L.js} +4 -4
  295. package/dist/interface/ha/{CuiCameraShares-DKHZJT-z.js → CuiCameraShares-BaPKNvSs.js} +2 -2
  296. package/dist/interface/ha/{CuiCameraTable-BTdP1pEP.js → CuiCameraTable-CA7TQUBj.js} +3 -3
  297. package/dist/interface/ha/{CuiChartTable-aFRfsewt.js → CuiChartTable-Cjck-ymw.js} +4 -4
  298. package/dist/interface/ha/{CuiConsole-BD9jYvrD.js → CuiConsole-4y2SrBqu.js} +4 -4
  299. package/dist/interface/ha/{CuiDataTable-C2lOduPV.js → CuiDataTable-3tEK7pxb.js} +2 -2
  300. package/dist/interface/ha/{CuiList-Dr0Kypm1.js → CuiList-1RbiYIWw.js} +1 -1
  301. package/dist/interface/ha/{CuiPluginCard-C-gpcLCH.js → CuiPluginCard-BfRbo1oT.js} +9 -9
  302. package/dist/interface/ha/{CuiPluginOAuthButton-B763Rz1n.js → CuiPluginOAuthButton-DcZ5KJTX.js} +4 -4
  303. package/dist/interface/ha/{CuiPluginTrustBadge-j5PKYI-V.js → CuiPluginTrustBadge-DG9TJtBN.js} +1 -1
  304. package/dist/interface/ha/{CuiQRCode-D7WV4czh.js → CuiQRCode-D_pWqA6W.js} +3 -3
  305. package/dist/interface/ha/{CuiSchema-BfsT0mAh.js → CuiSchema-BYnQRNtd.js} +4 -4
  306. package/dist/interface/ha/{CuiTopNavbarItem-BwpXgGJ-.js → CuiTopNavbarItem-BLPX9F5P.js} +1 -1
  307. package/dist/interface/ha/{Faces-C0e-m9EY.js → Faces-Do8dklvm.js} +4 -4
  308. package/dist/interface/ha/{FirstSteps-DsDmM44G.js → FirstSteps-1jyVgIMo.js} +6 -6
  309. package/dist/interface/ha/{Floorplan-Bei9kIhS.js → Floorplan-DqpGLQc-.js} +6 -6
  310. package/dist/interface/ha/{Instances-BY5G1zFD.js → Instances-ChgYCEv4.js} +4 -4
  311. package/dist/interface/ha/{Logs-DDycObDv.js → Logs-Dhi1-h8b.js} +8 -8
  312. package/dist/interface/ha/{Menu-9r_oFG_-.js → Menu-C6ZrgRfI.js} +4 -4
  313. package/dist/interface/ha/{Metrics-BMTIXqn6.js → Metrics-BNTz7Ktd.js} +9 -9
  314. package/dist/interface/ha/{OAuthDeviceFlow-Dee5fynX.js → OAuthDeviceFlow-DjWARnbi.js} +4 -4
  315. package/dist/interface/ha/{Plugin-B5o4pLyu.js → Plugin-juDjFBUz.js} +8 -8
  316. package/dist/interface/ha/{PluginConsole-REtxP1Wi.js → PluginConsole-DqwmWMS6.js} +4 -4
  317. package/dist/interface/ha/{PluginDetail-BHrKifvP.js → PluginDetail-Dg0s42Rn.js} +6 -6
  318. package/dist/interface/ha/{PluginSearch-oNHMMeJD.js → PluginSearch-CER_e1EL.js} +5 -5
  319. package/dist/interface/ha/{PluginUpdateProgress-CqllA4eR.js → PluginUpdateProgress-D3viAJ-T.js} +3 -3
  320. package/dist/interface/ha/{Plugins-B6y7z5yD.js → Plugins-D6Q_xWx9.js} +9 -9
  321. package/dist/interface/ha/{RecentEventsFilter-C1deXNIS.js → RecentEventsFilter-DXlTE7iI.js} +1 -1
  322. package/dist/interface/ha/{Recordings-CyhOVNoM.js → Recordings-BEb8EGDn.js} +7 -7
  323. package/dist/interface/ha/{SensorEdit-CnUU2PEv.js → SensorEdit-BjGyc2MJ.js} +5 -5
  324. package/dist/interface/ha/{SensorHistory-z5hDuybW.js → SensorHistory-Dm4WiNdC.js} +3 -3
  325. package/dist/interface/ha/{Sensors-wpoB-X4r.js → Sensors-5vAka-K6.js} +7 -7
  326. package/dist/interface/ha/{Settings-C6wTksxb.js → Settings-Cb4v7LRJ.js} +4 -4
  327. package/dist/interface/ha/{SettingsAccount-DByg5uzj.js → SettingsAccount-DeZOlBDQ.js} +6 -6
  328. package/dist/interface/ha/{SettingsAppearance-QgPo4M8O.js → SettingsAppearance-CDyMzncv.js} +6 -6
  329. package/dist/interface/ha/{SettingsAssistant-Bg4BhUgb.js → SettingsAssistant-DqGnG1RI.js} +6 -6
  330. package/dist/interface/ha/{SettingsBackup-BgtZSRub.js → SettingsBackup-BnqZ-qlE.js} +4 -4
  331. package/dist/interface/ha/{SettingsList-DB3j7buh.js → SettingsList-CAIX3jD9.js} +3 -3
  332. package/dist/interface/ha/{SettingsMqtt-DVx0z8vf.js → SettingsMqtt-Dxqjg4OT.js} +4 -4
  333. package/dist/interface/ha/{SettingsNotifications-osO2kMMO.js → SettingsNotifications-PAst5uDP.js} +6 -6
  334. package/dist/interface/ha/{SettingsPermissions-D_RGxpFE.js → SettingsPermissions-DFbjoUf-.js} +2 -2
  335. package/dist/interface/ha/{SettingsRecordings-BFEp160g.js → SettingsRecordings-GwPkWVQl.js} +6 -6
  336. package/dist/interface/ha/{SettingsRemote-DQW4FhFn.js → SettingsRemote-CzYyIfWg.js} +6 -6
  337. package/dist/interface/ha/{SettingsSystem-Cs1MHOTi.js → SettingsSystem-BC8IIFe2.js} +9 -9
  338. package/dist/interface/ha/{SettingsUsers-BtbuHlRZ.js → SettingsUsers-DS6HTws4.js} +5 -5
  339. package/dist/interface/ha/{Terminal-BuXCoMle.js → Terminal-DHXMgeMz.js} +6 -6
  340. package/dist/interface/ha/{Training-CnsWyeaJ.js → Training-CBSlZKBT.js} +3 -3
  341. package/dist/interface/ha/{Updates-BxU1Jpru.js → Updates-DTod9Jwm.js} +6 -6
  342. package/dist/interface/ha/{VariableInput-DgENnHvk.js → VariableInput-CuhqW4K7.js} +1 -1
  343. package/dist/interface/ha/{VariableSuggestions-Cn7J50Mp.js → VariableSuggestions-D15u2aH6.js} +1 -1
  344. package/dist/interface/ha/{VersionsHandler-DQTSSqti.js → VersionsHandler-Bafq9Ej7.js} +9 -9
  345. package/dist/interface/ha/{VirtualSensorCreate-Bsr6zTQp.js → VirtualSensorCreate-DCc5pfdG.js} +2 -2
  346. package/dist/interface/ha/{Workers-0jZDuLbP.js → Workers-BFJWJvkK.js} +8 -8
  347. package/dist/interface/ha/{api-VnpXqKYj.js → api-CMboY32E.js} +47 -40
  348. package/dist/interface/ha/{api-B8xb-N_g.js → api-CibPJ53n.js} +1 -1
  349. package/dist/interface/ha/{assistant-DDwonneA.js → assistant-B5j5Rwlf.js} +1 -1
  350. package/dist/interface/ha/{auth-CXX7ago-.js → auth-C9gqBg0w.js} +1 -1
  351. package/dist/interface/ha/{automationBlueprint-BUkXOKb1.js → automationBlueprint-DS2u4IQM.js} +3 -3
  352. package/dist/interface/ha/cameraui-cards.js +1 -1
  353. package/dist/interface/ha/{cards-CMel6uVq.js → cards-PAF_pPbZ.js} +7 -7
  354. package/dist/interface/ha/{config-9vwosYC8.js → config-DoZvm13z.js} +1 -1
  355. package/dist/interface/ha/{dist-jxJIsKjm.js → dist-DLZYY_4u.js} +55 -52
  356. package/dist/interface/ha/{intercomService-Dwd0bhSN.js → intercomService-WdbgAuZn.js} +189 -181
  357. package/dist/interface/ha/{mqtt-Fm_GzbBi.js → mqtt-Bq2AL0mf.js} +1 -1
  358. package/dist/interface/ha/{notifications-CwSeoLx0.js → notifications-Cb1PNQoG.js} +1 -1
  359. package/dist/interface/ha/{plugins-CgqO91Hg.js → plugins-BAng0szW.js} +1 -1
  360. package/dist/interface/ha/{protocol-BB4jdtUC-BcZnYd-h.js → protocol-BB4jdtUC-CbXTLEB7.js} +6 -4
  361. package/dist/interface/ha/{rooms-DGnhPCGr.js → rooms-BulA3xbr.js} +1 -1
  362. package/dist/interface/ha/{server-BqNJbXKJ.js → server-Ndqx0RmV.js} +1 -1
  363. package/dist/interface/ha/{types-Ca-1kOA9.js → types-CSqHjs73.js} +1 -1
  364. package/dist/interface/ha/{ungrouped-B1RIFH36.js → ungrouped-CEyEfdNm.js} +4 -4
  365. package/dist/interface/ha/{updates-Dn9WR43I.js → updates-BK41HPRa.js} +5 -5
  366. package/dist/interface/ha/{useAppVersion-FMZfQhEd.js → useAppVersion-PLf1za07.js} +2 -2
  367. package/dist/interface/ha/{useAssistantActions-B6KFp1pU.js → useAssistantActions-Uf0kmQ_Z.js} +1 -1
  368. package/dist/interface/ha/{useLogsSocket-Ch8C8inE.js → useLogsSocket-CRUB4tiT.js} +1 -1
  369. package/dist/interface/ha/{useNavLayout-DPjjtXVR.js → useNavLayout-hpvRlYIg.js} +1 -1
  370. package/dist/interface/ha/{usePermissions-DuuC_X9H.js → usePermissions-CEX3lAii.js} +1 -1
  371. package/dist/interface/ha/{useServerRestart-DoozgL8o.js → useServerRestart-BN_2Gvwy.js} +1 -1
  372. package/dist/interface/ha/{useTabSwipe-CxXAmZNc.js → useTabSwipe-BhBi1bXW.js} +2 -2
  373. package/dist/interface/ha/{useUpdateChannel-CBwS4cI2.js → useUpdateChannel-DoPFCimM.js} +2 -2
  374. package/dist/interface/ha/{useUpdatesSocket-GrlBqyU4.js → useUpdatesSocket-CQ2qyv6W.js} +1 -1
  375. package/dist/interface/ha/{useUserOptions-54hnf6hX.js → useUserOptions-Ck6NrMAe.js} +1 -1
  376. package/dist/interface/ha/{vue-i18n-BBObX4QY.js → vue-i18n-CxWAK5Gn.js} +541 -528
  377. package/dist/interface/index.html +67 -67
  378. package/dist/interface/sw.js +1 -1
  379. package/dist/server/package.json +7 -6
  380. package/dist/server/requirements.txt +1 -1
  381. package/dist/server/src/camera/controller.d.ts +2 -1
  382. package/dist/server/src/camera/controller.js +30 -20
  383. package/dist/server/src/camera/controller.js.map +1 -1
  384. package/dist/server/src/camera/utils.d.ts +1 -0
  385. package/dist/server/src/camera/utils.js +84 -38
  386. package/dist/server/src/camera/utils.js.map +1 -1
  387. package/package.json +7 -6
  388. package/dist/interface/assets/CuiBottomSheet-BpMMQhmJ.js +0 -1
  389. package/dist/interface/assets/CuiCameraTable-CNclH1KS.js +0 -1
  390. package/dist/interface/assets/CuiMarkdownContent-BFa5gUZe.js +0 -1
  391. package/dist/interface/assets/PluginSearch-rDbuXm2z.js +0 -1
  392. package/dist/interface/assets/SettingsAccount-i2nzGFdV.js +0 -1
  393. package/dist/interface/assets/SettingsAppearance-DCgu01FJ.js +0 -1
  394. package/dist/interface/assets/cloudHandoff-BoV37fDI.js +0 -1
  395. package/dist/interface/assets/esm-2nC0_qfD.js +0 -1
  396. package/dist/interface/assets/esm-5ij5yeYw.js +0 -1
  397. package/dist/interface/assets/esm-B7WAXxd1.js +0 -1
  398. package/dist/interface/assets/esm-BF0RZje6.js +0 -1
  399. package/dist/interface/assets/esm-BSpFwAXD.js +0 -1
  400. package/dist/interface/assets/esm-C6ZQtRp-.js +0 -1
  401. package/dist/interface/assets/esm-Cp0yoO9D.js +0 -1
  402. package/dist/interface/assets/esm-Cwvl7oSa.js +0 -1
  403. package/dist/interface/assets/esm-DICA8W-V.js +0 -1
  404. package/dist/interface/assets/esm-DP8Ax-oq.js +0 -1
  405. package/dist/interface/assets/esm-DWOHxqOV.js +0 -1
  406. package/dist/interface/assets/esm-cynfGnag.js +0 -1
  407. package/dist/interface/assets/esm-gQ1ovTKo.js +0 -1
  408. package/dist/interface/assets/esm-jaStWfus.js +0 -1
  409. package/dist/interface/assets/native-CEh02TWu.js +0 -1
  410. package/dist/interface/assets/native-DxU_bhe3.js +0 -1
  411. package/dist/interface/assets/plugin-DRu2N4CD.js +0 -1
  412. package/dist/interface/assets/useUserOptions-DTlKtp_u.js +0 -1
  413. package/dist/interface/assets/web-771Nph0i.js +0 -1
  414. package/dist/interface/assets/web-BGEzD1BX.js +0 -1
  415. package/dist/interface/assets/web-BjKL51lK-Q2ZqYaHQ.js +0 -1
  416. package/dist/interface/assets/web-BvtLpTUy.js +0 -1
  417. package/dist/interface/assets/web-C9hWWX9T.js +0 -1
  418. package/dist/interface/assets/web-CIwUdOBC.js +0 -1
  419. package/dist/interface/assets/web-CpaCeLiq.js +0 -1
  420. package/dist/interface/assets/web-DJN-qQx6.js +0 -1
  421. package/dist/interface/assets/web-DMGPhsii.js +0 -1
  422. package/dist/interface/assets/web-Dd6usIKp.js +0 -1
  423. package/dist/interface/assets/web-DeXV8b3y.js +0 -1
  424. package/dist/interface/assets/web-EZ83Sgj4.js +0 -1
  425. package/dist/interface/assets/web-EZcS3dL0.js +0 -1
  426. package/dist/interface/assets/web-Ycu87MZJ.js +0 -1
  427. package/dist/interface/assets/workbox-window.prod.es5-fQWwwJhH.js +0 -1
@@ -8,16 +8,16 @@ import{r as e,t}from"./rolldown-runtime-C0FnF6B9.js";function n(e){let t=Object.
8
8
  `,t+1),i=n===-1?``:r.slice(n+1);String(e.stack).endsWith(i)||(e.stack+=`
9
9
  `+r)}}catch{}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=Td(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&mf.assertOptions(n,{silentJSONParsing:hf.transitional(hf.boolean),forcedJSONParsing:hf.transitional(hf.boolean),clarifyTimeoutError:hf.transitional(hf.boolean),legacyInterceptorReqResOrdering:hf.transitional(hf.boolean),advertiseZstdAcceptEncoding:hf.transitional(hf.boolean),validateStatusUndefinedResolves:hf.transitional(hf.boolean)},!1),r!=null&&(K.isFunction(r)?t.paramsSerializer={serialize:r}:mf.assertOptions(r,{encode:hf.function,serialize:hf.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),mf.assertOptions(t,{baseUrl:hf.spelling(`baseURL`),withXsrfToken:hf.spelling(`withXSRFToken`)},!0),t.method=(K.getSafeProp(t,`method`)||K.getSafeProp(this.defaults,`method`)||`get`).toLowerCase();let a=i&&K.merge(i.common,i[t.method]);i&&K.forEach(Qu.concat(`common`),e=>{delete i[e]}),t.headers=hu.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||Lu;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[uf.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e?e(f):f}catch(e){if(!t){l=Promise.reject(e);break}try{let n=t.call(this,e);K.isThenable(n)&&(l=Promise.resolve(n).then(()=>uf.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=uf.call(this,f)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=Td(this.defaults,e),ju(Sd(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};K.forEach([`delete`,`get`,`head`,`options`],function(e){gf.prototype[e]=function(t,n){return this.request(Td(n||{},{method:e,url:t,data:n&&K.hasOwnProp(n,`data`)?n.data:void 0}))}}),K.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(Td(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}gf.prototype[e]=t(),e!==`query`&&(gf.prototype[e+`Form`]=t(!0))});var _f=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-->0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new id(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function vf(e){return function(t){return e.apply(null,t)}}function yf(e){return K.isObject(e)&&e.isAxiosError===!0}var bf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(bf).forEach(([e,t])=>{bf[t]===void 0&&(bf[t]=e)});function xf(e){let t=new gf(e),n=Dc(gf.prototype.request,t);return K.extend(n,gf.prototype,t,{allOwnKeys:!0}),K.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return xf(Td(e,t))},n}var Sf=xf(td);Sf.Axios=gf,Sf.CanceledError=id,Sf.CancelToken=_f,Sf.isCancel=rd,Sf.VERSION=Kd,Sf.toFormData=Eu,Sf.AxiosError=q,Sf.Cancel=Sf.CanceledError,Sf.all=function(e){return Promise.all(e)},Sf.spread=vf,Sf.isAxiosError=yf,Sf.mergeConfig=Td,Sf.AxiosHeaders=hu,Sf.formToJSON=e=>Zu(K.isHTMLForm(e)?new FormData(e):e),Sf.getAdapter=cf.getAdapter,Sf.HttpStatusCode=bf,Sf.default=Sf;var{Axios:Cf,AxiosError:wf,CanceledError:Tf,isCancel:Ef,CancelToken:Df,VERSION:Of,all:kf,Cancel:Af,isAxiosError:jf,spread:Mf,toFormData:Nf,AxiosHeaders:Pf,HttpStatusCode:Ff,formToJSON:If,getAdapter:Lf,mergeConfig:Rf,create:zf}=Sf,Bf=t((()=>{var e;(function(e){(function(t){var n=typeof globalThis==`object`?globalThis:typeof global==`object`?global:typeof self==`object`?self:typeof this==`object`?this:s(),r=i(e);n.Reflect!==void 0&&(r=i(n.Reflect,r)),t(r,n),n.Reflect===void 0&&(n.Reflect=e);function i(e,t){return function(n,r){Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}function a(){try{return Function(`return this;`)()}catch{}}function o(){try{return(0,eval)(`(function() { return this; })()`)}catch{}}function s(){return a()||o()}})(function(e,t){var n=Object.prototype.hasOwnProperty,r=typeof Symbol==`function`,i=r&&Symbol.toPrimitive!==void 0?Symbol.toPrimitive:`@@toPrimitive`,a=r&&Symbol.iterator!==void 0?Symbol.iterator:`@@iterator`,o=typeof Object.create==`function`,s={__proto__:[]}instanceof Array,c=!o&&!s,l={create:o?function(){return L(Object.create(null))}:s?function(){return L({__proto__:null})}:function(){return L({})},has:c?function(e,t){return n.call(e,t)}:function(e,t){return t in e},get:c?function(e,t){return n.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},u=Object.getPrototypeOf(Function),d=typeof Map==`function`&&typeof Map.prototype.entries==`function`?Map:Ee(),f=typeof Set==`function`&&typeof Set.prototype.entries==`function`?Set:De(),p=typeof WeakMap==`function`?WeakMap:Oe(),m=r?Symbol.for(`@reflect-metadata:registry`):void 0,h=Se(),g=Ce(h);function v(e,t,n,r){if(P(n)){if(!ue(e)||!fe(t))throw TypeError();return O(e,t)}if(!ue(e)||!I(t)||!I(r)&&!P(r)&&!F(r))throw TypeError();return F(r)&&(r=void 0),n=le(n),k(e,t,n,r)}e(`decorate`,v);function y(e,t){function n(n,r){if(!I(n)||!P(r)&&!pe(r))throw TypeError();te(e,t,n,r)}return n}e(`metadata`,y);function b(e,t,n,r){if(!I(n))throw TypeError();return P(r)||(r=le(r)),te(e,t,n,r)}e(`defineMetadata`,b);function x(e,t,n){if(!I(t))throw TypeError();return P(n)||(n=le(n)),ee(e,t,n)}e(`hasMetadata`,x);function S(e,t,n){if(!I(t))throw TypeError();return P(n)||(n=le(n)),A(e,t,n)}e(`hasOwnMetadata`,S);function C(e,t,n){if(!I(t))throw TypeError();return P(n)||(n=le(n)),j(e,t,n)}e(`getMetadata`,C);function w(e,t,n){if(!I(t))throw TypeError();return P(n)||(n=le(n)),M(e,t,n)}e(`getOwnMetadata`,w);function T(e,t){if(!I(e))throw TypeError();return P(t)||(t=le(t)),ne(e,t)}e(`getMetadataKeys`,T);function E(e,t){if(!I(e))throw TypeError();return P(t)||(t=le(t)),N(e,t)}e(`getOwnMetadataKeys`,E);function D(e,t,n){if(!I(t)||(P(n)||(n=le(n)),!I(t)))throw TypeError();P(n)||(n=le(n));var r=Te(t,n,!1);return!P(r)&&r.OrdinaryDeleteMetadata(e,t,n)}e(`deleteMetadata`,D);function O(e,t){for(var n=e.length-1;n>=0;--n){var r=e[n],i=r(t);if(!P(i)&&!F(i)){if(!fe(i))throw TypeError();t=i}}return t}function k(e,t,n,r){for(var i=e.length-1;i>=0;--i){var a=e[i],o=a(t,n,r);if(!P(o)&&!F(o)){if(!I(o))throw TypeError();r=o}}return r}function ee(e,t,n){if(A(e,t,n))return!0;var r=be(t);return!F(r)&&ee(e,r,n)}function A(e,t,n){var r=Te(t,n,!1);return!P(r)&&se(r.OrdinaryHasOwnMetadata(e,t,n))}function j(e,t,n){if(A(e,t,n))return M(e,t,n);var r=be(t);if(!F(r))return j(e,r,n)}function M(e,t,n){var r=Te(t,n,!1);if(!P(r))return r.OrdinaryGetOwnMetadata(e,t,n)}function te(e,t,n,r){Te(n,r,!0).OrdinaryDefineOwnMetadata(e,t,n,r)}function ne(e,t){var n=N(e,t),r=be(e);if(r===null)return n;var i=ne(r,t);if(i.length<=0)return n;if(n.length<=0)return i;for(var a=new f,o=[],s=0,c=n;s<c.length;s++){var l=c[s],u=a.has(l);u||(a.add(l),o.push(l))}for(var d=0,p=i;d<p.length;d++){var l=p[d],u=a.has(l);u||(a.add(l),o.push(l))}return o}function N(e,t){var n=Te(e,t,!1);return n?n.OrdinaryOwnMetadataKeys(e,t):[]}function re(e){if(e===null)return 1;switch(typeof e){case`undefined`:return 0;case`boolean`:return 2;case`string`:return 3;case`symbol`:return 4;case`number`:return 5;case`object`:return e===null?1:6;default:return 6}}function P(e){return e===void 0}function F(e){return e===null}function ie(e){return typeof e==`symbol`}function I(e){return typeof e==`object`?e!==null:typeof e==`function`}function ae(e,t){switch(re(e)){case 0:return e;case 1:return e;case 2:return e;case 3:return e;case 4:return e;case 5:return e}var n=t===3?`string`:t===5?`number`:`default`,r=he(e,i);if(r!==void 0){var a=r.call(e,n);if(I(a))throw TypeError();return a}return oe(e,n==="default"?`number`:n)}function oe(e,t){if(t===`string`){var n=e.toString;if(de(n)){var r=n.call(e);if(!I(r))return r}var i=e.valueOf;if(de(i)){var r=i.call(e);if(!I(r))return r}}else{var i=e.valueOf;if(de(i)){var r=i.call(e);if(!I(r))return r}var a=e.toString;if(de(a)){var r=a.call(e);if(!I(r))return r}}throw TypeError()}function se(e){return!!e}function ce(e){return``+e}function le(e){var t=ae(e,3);return ie(t)?t:ce(t)}function ue(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:Object.prototype.toString.call(e)===`[object Array]`}function de(e){return typeof e==`function`}function fe(e){return typeof e==`function`}function pe(e){switch(re(e)){case 3:return!0;case 4:return!0;default:return!1}}function me(e,t){return e===t||e!==e&&t!==t}function he(e,t){var n=e[t];if(n!=null){if(!de(n))throw TypeError();return n}}function ge(e){var t=he(e,a);if(!de(t))throw TypeError();var n=t.call(e);if(!I(n))throw TypeError();return n}function _e(e){return e.value}function ve(e){var t=e.next();return!t.done&&t}function ye(e){var t=e.return;t&&t.call(e)}function be(e){var t=Object.getPrototypeOf(e);if(typeof e!=`function`||e===u||t!==u)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(r==null||r===Object.prototype)return t;var i=r.constructor;return typeof i!=`function`||i===e?t:i}function xe(){var e;!P(m)&&t.Reflect!==void 0&&!(m in t.Reflect)&&typeof t.Reflect.defineMetadata==`function`&&(e=we(t.Reflect));var n,r,i,a=new p,o={registerProvider:s,getProvider:l,setProvider:h};return o;function s(t){if(!Object.isExtensible(o))throw Error(`Cannot add provider to a frozen registry.`);switch(!0){case e===t:break;case P(n):n=t;break;case n===t:break;case P(r):r=t;break;case r===t:break;default:i===void 0&&(i=new f),i.add(t)}}function c(t,a){if(!P(n)){if(n.isProviderFor(t,a))return n;if(!P(r)){if(r.isProviderFor(t,a))return n;if(!P(i))for(var o=ge(i);;){var s=ve(o);if(!s)return;var c=_e(s);if(c.isProviderFor(t,a))return ye(o),c}}}if(!P(e)&&e.isProviderFor(t,a))return e}function l(e,t){var n=a.get(e),r;return P(n)||(r=n.get(t)),P(r)?(r=c(e,t),P(r)||(P(n)&&(n=new d,a.set(e,n)),n.set(t,r)),r):r}function u(e){if(P(e))throw TypeError();return n===e||r===e||!P(i)&&i.has(e)}function h(e,t,n){if(!u(n))throw Error(`Metadata provider not registered.`);var r=l(e,t);if(r!==n){if(!P(r))return!1;var i=a.get(e);P(i)&&(i=new d,a.set(e,i)),i.set(t,n)}return!0}}function Se(){var e;return!P(m)&&I(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[m]),P(e)&&(e=xe()),!P(m)&&I(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,m,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}function Ce(e){var t=new p,n={isProviderFor:function(e,n){var r=t.get(e);return!P(r)&&r.has(n)},OrdinaryDefineOwnMetadata:o,OrdinaryHasOwnMetadata:i,OrdinaryGetOwnMetadata:a,OrdinaryOwnMetadataKeys:s,OrdinaryDeleteMetadata:c};return h.registerProvider(n),n;function r(r,i,a){var o=t.get(r),s=!1;if(P(o)){if(!a)return;o=new d,t.set(r,o),s=!0}var c=o.get(i);if(P(c)){if(!a)return;if(c=new d,o.set(i,c),!e.setProvider(r,i,n))throw o.delete(i),s&&t.delete(r),Error(`Wrong provider for target.`)}return c}function i(e,t,n){var i=r(t,n,!1);return!P(i)&&se(i.has(e))}function a(e,t,n){var i=r(t,n,!1);if(!P(i))return i.get(e)}function o(e,t,n,i){r(n,i,!0).set(e,t)}function s(e,t){var n=[],i=r(e,t,!1);if(P(i))return n;for(var a=ge(i.keys()),o=0;;){var s=ve(a);if(!s)return n.length=o,n;var c=_e(s);try{n[o]=c}catch(e){try{ye(a)}finally{throw e}}o++}}function c(e,n,i){var a=r(n,i,!1);if(P(a)||!a.delete(e))return!1;if(a.size===0){var o=t.get(n);P(o)||(o.delete(i),o.size===0&&t.delete(o))}return!0}}function we(e){var t=e.defineMetadata,n=e.hasOwnMetadata,r=e.getOwnMetadata,i=e.getOwnMetadataKeys,a=e.deleteMetadata,o=new p;return{isProviderFor:function(e,t){var n=o.get(e);return!P(n)&&n.has(t)?!0:i(e,t).length?(P(n)&&(n=new f,o.set(e,n)),n.add(t),!0):!1},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:n,OrdinaryGetOwnMetadata:r,OrdinaryOwnMetadataKeys:i,OrdinaryDeleteMetadata:a}}function Te(e,t,n){var r=h.getProvider(e,t);if(!P(r))return r;if(n){if(h.setProvider(e,t,g))return g;throw Error(`Illegal state.`)}}function Ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype[`@@iterator`]=function(){return this},e.prototype[a]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,me(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,i)},t.prototype.entries=function(){return new n(this._keys,this._values,o)},t.prototype[`@@iterator`]=function(){return this.entries()},t.prototype[a]=function(){return this.entries()},t.prototype._find=function(e,t){if(!me(this._cacheKey,e)){this._cacheIndex=-1;for(var n=0;n<this._keys.length;n++)if(me(this._keys[n],e)){this._cacheIndex=n;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function i(e,t){return t}function o(e,t){return[e,t]}}function De(){return function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype[`@@iterator`]=function(){return this.keys()},e.prototype[a]=function(){return this.keys()},e}()}function Oe(){var e=l.create(),t=r();return function(){function e(){this._key=r()}return e.prototype.has=function(e){var t=i(e,!1);return t!==void 0&&l.has(t,this._key)},e.prototype.get=function(e){var t=i(e,!1);return t===void 0?void 0:l.get(t,this._key)},e.prototype.set=function(e,t){var n=i(e,!0);return n[this._key]=t,this},e.prototype.delete=function(e){var t=i(e,!1);return t!==void 0&&delete t[this._key]},e.prototype.clear=function(){this._key=r()},e}();function r(){var t;do t=`@@WeakMap@@`+s();while(l.has(e,t));return e[t]=!0,t}function i(e,r){if(!n.call(e,t)){if(!r)return;Object.defineProperty(e,t,{value:l.create()})}return e[t]}function a(e,t){for(var n=0;n<t;++n)e[n]=Math.random()*255|0;return e}function o(e){if(typeof Uint8Array==`function`){var t=new Uint8Array(e);return typeof crypto<`u`?crypto.getRandomValues(t):typeof msCrypto<`u`?msCrypto.getRandomValues(t):a(t,e),t}return a(Array(e),e)}function s(){var e=o(16);e[6]=e[6]&79|64,e[8]=e[8]&191|128;for(var t=``,n=0;n<16;++n){var r=e[n];(n===4||n===6||n===8)&&(t+=`-`),r<16&&(t+=`0`),t+=r.toString(16).toLowerCase()}return t}}function L(e){return e.__=void 0,delete e.__,e}})})(e||={})})),Vf=Object.create(null);Vf.open=`0`,Vf.close=`1`,Vf.ping=`2`,Vf.pong=`3`,Vf.message=`4`,Vf.upgrade=`5`,Vf.noop=`6`;var Hf=Object.create(null);Object.keys(Vf).forEach(e=>{Hf[Vf[e]]=e});var Uf={type:`error`,data:`parser error`},Wf=typeof Blob==`function`||typeof Blob<`u`&&Object.prototype.toString.call(Blob)===`[object BlobConstructor]`,Gf=typeof ArrayBuffer==`function`,Kf=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,qf=({type:e,data:t},n,r)=>Wf&&t instanceof Blob?n?r(t):Jf(t,r):Gf&&(t instanceof ArrayBuffer||Kf(t))?n?r(t):Jf(new Blob([t]),r):r(Vf[e]+(t||``)),Jf=(e,t)=>{let n=new FileReader;return n.onload=function(){let e=n.result.split(`,`)[1];t(`b`+(e||``))},n.readAsDataURL(e)};function Yf(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}var Xf;function Zf(e,t){if(Wf&&e.data instanceof Blob)return e.data.arrayBuffer().then(Yf).then(t);if(Gf&&(e.data instanceof ArrayBuffer||Kf(e.data)))return t(Yf(e.data));qf(e,!1,e=>{Xf||=new TextEncoder,t(Xf.encode(e))})}var Qf=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,$f=typeof Uint8Array>`u`?[]:new Uint8Array(256);for(let e=0;e<64;e++)$f[Qf.charCodeAt(e)]=e;var ep=e=>{let t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);let l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=$f[e.charCodeAt(r)],o=$f[e.charCodeAt(r+1)],s=$f[e.charCodeAt(r+2)],c=$f[e.charCodeAt(r+3)],u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l},tp=typeof ArrayBuffer==`function`,np=(e,t)=>{if(typeof e!=`string`)return{type:`message`,data:ip(e,t)};let n=e.charAt(0);return n===`b`?{type:`message`,data:rp(e.substring(1),t)}:Hf[n]?e.length>1?{type:Hf[n],data:e.substring(1)}:{type:Hf[n]}:Uf},rp=(e,t)=>tp?ip(ep(e),t):{base64:!0,data:e},ip=(e,t)=>{switch(t){case`blob`:return e instanceof Blob?e:new Blob([e]);default:return e instanceof ArrayBuffer?e:e.buffer}},ap=``,op=(e,t)=>{let n=e.length,r=Array(n),i=0;e.forEach((e,a)=>{qf(e,!1,e=>{r[a]=e,++i===n&&t(r.join(ap))})})},sp=(e,t)=>{let n=e.split(ap),r=[];for(let e=0;e<n.length;e++){let i=np(n[e],t);if(r.push(i),i.type===`error`)break}return r};function cp(){return new TransformStream({transform(e,t){Zf(e,n=>{let r=n.length,i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);let e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);let e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!=`string`&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}var lp;function up(e){return e.reduce((e,t)=>e+t.length,0)}function dp(e,t){if(e[0].length===t)return e.shift();let n=new Uint8Array(t),r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function fp(e,t){lp||=new TextDecoder;let n=[],r=0,i=-1,a=!1;return new TransformStream({transform(o,s){for(n.push(o);;){if(r===0){if(up(n)<1)break;let e=dp(n,1);a=(e[0]&128)==128,i=e[0]&127,r=i<126?3:i===126?1:2}else if(r===1){if(up(n)<2)break;let e=dp(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(r===2){if(up(n)<8)break;let e=dp(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),a=t.getUint32(0);if(a>2**21-1){s.enqueue(Uf);break}i=a*2**32+t.getUint32(4),r=3}else{if(up(n)<i)break;let e=dp(n,i);s.enqueue(np(a?e:lp.decode(e),t)),r=0}if(i===0||i>e){s.enqueue(Uf);break}}}})}function pp(e){if(e)return mp(e)}function mp(e){for(var t in pp.prototype)e[t]=pp.prototype[t];return e}pp.prototype.on=pp.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},pp.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},pp.prototype.off=pp.prototype.removeListener=pp.prototype.removeAllListeners=pp.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},pp.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},pp.prototype.emitReserved=pp.prototype.emit,pp.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},pp.prototype.hasListeners=function(e){return!!this.listeners(e).length};var hp=typeof Promise==`function`&&typeof Promise.resolve==`function`?e=>Promise.resolve().then(e):(e,t)=>t(e,0),gp=typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)(),_p=`arraybuffer`;function vp(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}var yp=gp.setTimeout,bp=gp.clearTimeout;function xp(e,t){t.useNativeTimers?(e.setTimeoutFn=yp.bind(gp),e.clearTimeoutFn=bp.bind(gp)):(e.setTimeoutFn=gp.setTimeout.bind(gp),e.clearTimeoutFn=gp.clearTimeout.bind(gp))}var Sp=1.33;function Cp(e){return typeof e==`string`?wp(e):Math.ceil((e.byteLength||e.size)*Sp)}function wp(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function Tp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ep(e){let t=``;for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t}function Dp(e){let t={},n=e.split(`&`);for(let e=0,r=n.length;e<r;e++){let r=n[e].split(`=`);t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}var Op=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type=`TransportError`}},kp=class extends pp{constructor(e){super(),this.writable=!1,xp(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved(`error`,new Op(e,t,n)),this}open(){return this.readyState=`opening`,this.doOpen(),this}close(){return(this.readyState===`opening`||this.readyState===`open`)&&(this.doClose(),this.onClose()),this}send(e){this.readyState===`open`&&this.write(e)}onOpen(){this.readyState=`open`,this.writable=!0,super.emitReserved(`open`)}onData(e){let t=np(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved(`packet`,e)}onClose(e){this.readyState=`closed`,super.emitReserved(`close`,e)}pause(e){}createUri(e,t={}){return e+`://`+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(`:`)===-1?e:`[`+e+`]`}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?`:`+this.opts.port:``}_query(e){let t=Ep(e);return t.length?`?`+t:``}},Ap=class extends kp{constructor(){super(...arguments),this._polling=!1}get name(){return`polling`}doOpen(){this._poll()}pause(e){this.readyState=`pausing`;let t=()=>{this.readyState=`paused`,e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once(`pollComplete`,function(){--e||t()})),this.writable||(e++,this.once(`drain`,function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved(`poll`)}onData(e){sp(e,this.socket.binaryType).forEach(e=>{if(this.readyState===`opening`&&e.type===`open`&&this.onOpen(),e.type===`close`)return this.onClose({description:`transport closed by the server`}),!1;this.onPacket(e)}),this.readyState!==`closed`&&(this._polling=!1,this.emitReserved(`pollComplete`),this.readyState===`open`&&this._poll())}doClose(){let e=()=>{this.write([{type:`close`}])};this.readyState===`open`?e():this.once(`open`,e)}write(e){this.writable=!1,op(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved(`drain`)})})}uri(){let e=this.opts.secure?`https`:`http`,t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=Tp()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}},jp=!1;try{jp=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{}var Mp=jp;function Np(){}var Pp=class extends Ap{constructor(e){if(super(e),typeof location<`u`){let t=location.protocol===`https:`,n=location.port;n||=t?`443`:`80`,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:`POST`,data:e});n.on(`success`,t),n.on(`error`,(e,t)=>{this.onError(`xhr post error`,e,t)})}doPoll(){let e=this.request();e.on(`data`,this.onData.bind(this)),e.on(`error`,(e,t)=>{this.onError(`xhr poll error`,e,t)}),this.pollXhr=e}},Fp=class e extends pp{constructor(e,t,n){super(),this.createRequest=e,xp(this,n),this._opts=n,this._method=n.method||`GET`,this._uri=t,this._data=n.data===void 0?null:n.data,this._create()}_create(){var t;let n=vp(this._opts,`agent`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`autoUnref`);n.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch{}if(this._method===`POST`)try{r.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{r.setRequestHeader(`Accept`,`*/*`)}catch{}(t=this._opts.cookieJar)==null||t.addCookies(r),`withCredentials`in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;r.readyState===3&&((e=this._opts.cookieJar)==null||e.parseCookies(r.getResponseHeader(`set-cookie`))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status==`number`?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}typeof document<`u`&&(this._index=e.requestsCount++,e.requests[this._index]=this)}_onError(e){this.emitReserved(`error`,e,this._xhr),this._cleanup(!0)}_cleanup(t){if(this._xhr!==void 0&&this._xhr!==null){if(this._xhr.onreadystatechange=Np,t)try{this._xhr.abort()}catch{}typeof document<`u`&&delete e.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved(`data`,e),this.emitReserved(`success`),this._cleanup())}abort(){this._cleanup()}};if(Fp.requestsCount=0,Fp.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,Ip);else if(typeof addEventListener==`function`){let e=`onpagehide`in gp?`pagehide`:`unload`;addEventListener(e,Ip,!1)}}function Ip(){for(let e in Fp.requests)Fp.requests.hasOwnProperty(e)&&Fp.requests[e].abort()}var Lp=(function(){let e=zp({xdomain:!1});return e&&e.responseType!==null})(),Rp=class extends Pp{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Lp&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Fp(zp,this.uri(),e)}};function zp(e){let t=e.xdomain;try{if(typeof XMLHttpRequest<`u`&&(!t||Mp))return new XMLHttpRequest}catch{}if(!t)try{return new gp[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}var Bp=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,Vp=class extends kp{get name(){return`websocket`}doOpen(){let e=this.uri(),t=this.opts.protocols,n=Bp?{}:vp(this.opts,`agent`,`perMessageDeflate`,`pfx`,`key`,`passphrase`,`cert`,`ca`,`ciphers`,`rejectUnauthorized`,`localAddress`,`protocolVersion`,`origin`,`maxPayload`,`family`,`checkServerIdentity`);this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved(`error`,e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:`websocket connection closed`,context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError(`websocket error`,e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;qf(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch{}r&&hp(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?`wss`:`ws`,t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Tp()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Hp=gp.WebSocket||gp.MozWebSocket,Up={websocket:class extends Vp{createSocket(e,t,n){return Bp?new Hp(e,t,n):t?new Hp(e,t):new Hp(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends kp{get name(){return`webtransport`}doOpen(){try{this._transport=new WebTransport(this.createUri(`https`),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved(`error`,e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError(`webtransport error`,e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=fp(2**53-1,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=cp();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),i())}).catch(e=>{})};i();let a={type:`open`};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this._writer.write(a).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&hp(()=>{this.writable=!0,this.emitReserved(`drain`)},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)==null||e.close()}},polling:Rp},Wp=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Gp=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];function Kp(e){if(e.length>8e3)throw`URI too long`;let t=e,n=e.indexOf(`[`),r=e.indexOf(`]`);n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,`;`)+e.substring(r,e.length));let i=Wp.exec(e||``),a={},o=14;for(;o--;)a[Gp[o]]=i[o]||``;return n!=-1&&r!=-1&&(a.source=t,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,`:`),a.authority=a.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`),a.ipv6uri=!0),a.pathNames=qp(a,a.path),a.queryKey=Jp(a,a.query),a}function qp(e,t){let n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.slice(0,1)==`/`||t.length===0)&&n.splice(0,1),t.slice(-1)==`/`&&n.splice(n.length-1,1),n}function Jp(e,t){let n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var Yp=typeof addEventListener==`function`&&typeof removeEventListener==`function`,Xp=[];Yp&&addEventListener(`offline`,()=>{Xp.forEach(e=>e())},!1);var Zp=class e extends pp{constructor(e,t){if(super(),this.binaryType=_p,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e==`object`&&(t=e,e=null),e){let n=Kp(e);t.hostname=n.host,t.secure=n.protocol===`https`||n.protocol===`wss`,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=Kp(t.host).host);xp(this,t),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,t.hostname&&!t.port&&(t.port=this.secure?`443`:`80`),this.hostname=t.hostname||(typeof location<`u`?location.hostname:`localhost`),this.port=t.port||(typeof location<`u`&&location.port?location.port:this.secure?`443`:`80`),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:`/engine.io`,agent:!1,withCredentials:!1,upgrade:!0,timestampParam:`t`,rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,``)+(this.opts.addTrailingSlash?`/`:``),typeof this.opts.query==`string`&&(this.opts.query=Dp(this.opts.query)),Yp&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener(`beforeunload`,this._beforeunloadEventListener,!1)),this.hostname!==`localhost`&&(this._offlineEventListener=()=>{this._onClose(`transport close`,{description:`network connection lost`})},Xp.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved(`error`,`No transports available`)},0);return}let t=this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1?`websocket`:this.transports[0];this.readyState=`opening`;let n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on(`drain`,this._onDrain.bind(this)).on(`packet`,this._onPacket.bind(this)).on(`error`,this._onError.bind(this)).on(`close`,e=>this._onClose(`transport close`,e))}onOpen(){this.readyState=`open`,e.priorWebsocketSuccess=this.transport.name===`websocket`,this.emitReserved(`open`),this.flush()}_onPacket(e){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`)switch(this.emitReserved(`packet`,e),this.emitReserved(`heartbeat`),e.type){case`open`:this.onHandshake(JSON.parse(e.data));break;case`ping`:this._sendPacket(`pong`),this.emitReserved(`ping`),this.emitReserved(`pong`),this._resetPingTimeout();break;case`error`:let t=Error(`server error`);t.code=e.data,this._onError(t);break;case`message`:this.emitReserved(`data`,e.data),this.emitReserved(`message`,e.data)}}onHandshake(e){this.emitReserved(`handshake`,e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!==`closed`&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose(`ping timeout`)},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved(`drain`):this.flush()}flush(){if(this.readyState!==`closed`&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved(`flush`)}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name===`polling`&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let n=this.writeBuffer[t].data;if(n&&(e+=Cp(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,hp(()=>{this._onClose(`ping timeout`)},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket(`message`,e,t,n),this}send(e,t,n){return this._sendPacket(`message`,e,t,n),this}_sendPacket(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState===`closing`||this.readyState===`closed`)return;n||={},n.compress=!1!==n.compress;let i={type:e,data:t,options:n};this.emitReserved(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}close(){let e=()=>{this._onClose(`forced close`),this.transport.close()},t=()=>{this.off(`upgrade`,t),this.off(`upgradeError`,t),e()},n=()=>{this.once(`upgrade`,t),this.once(`upgradeError`,t)};return(this.readyState===`opening`||this.readyState===`open`)&&(this.readyState=`closing`,this.writeBuffer.length?this.once(`drain`,()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(t){if(e.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState===`opening`)return this.transports.shift(),this._open();this.emitReserved(`error`,t),this._onClose(`transport error`,t)}_onClose(e,t){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners(`close`),this.transport.close(),this.transport.removeAllListeners(),Yp&&(this._beforeunloadEventListener&&removeEventListener(`beforeunload`,this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=Xp.indexOf(this._offlineEventListener);e!==-1&&Xp.splice(e,1)}this.readyState=`closed`,this.id=null,this.emitReserved(`close`,e,t),this.writeBuffer=[],this._prevBufferLen=0}}};Zp.protocol=4;var Qp=class extends Zp{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState===`open`&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;Zp.priorWebsocketSuccess=!1;let r=()=>{n||(t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,e=>{if(!n){if(e.type===`pong`&&e.data===`probe`){if(this.upgrading=!0,this.emitReserved(`upgrading`,t),!t)return;Zp.priorWebsocketSuccess=t.name===`websocket`,this.transport.pause(()=>{n||this.readyState!==`closed`&&(l(),this.setTransport(t),t.send([{type:`upgrade`}]),this.emitReserved(`upgrade`,t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error(`probe error`);e.transport=t.name,this.emitReserved(`upgradeError`,e)}}}))};function i(){n||(n=!0,l(),t.close(),t=null)}let a=e=>{let n=Error(`probe error: `+e);n.transport=t.name,i(),this.emitReserved(`upgradeError`,n)};function o(){a(`transport closed`)}function s(){a(`socket closed`)}function c(e){t&&e.name!==t.name&&i()}let l=()=>{t.removeListener(`open`,r),t.removeListener(`error`,a),t.removeListener(`close`,o),this.off(`close`,s),this.off(`upgrading`,c)};t.once(`open`,r),t.once(`error`,a),t.once(`close`,o),this.once(`close`,s),this.once(`upgrading`,c),this._upgrades.indexOf(`webtransport`)!==-1&&e!==`webtransport`?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}},$p=class extends Qp{constructor(e,t={}){let n=typeof e==`object`,r=n?{...e}:{...t};(!r.transports||r.transports&&typeof r.transports[0]==`string`)&&(r.transports=(r.transports||[`polling`,`websocket`,`webtransport`]).map(e=>Up[e]).filter(e=>!!e)),super(n?r:e,r)}};$p.protocol;function em(e,t=``,n){let r=e;n||=typeof location<`u`&&location,e??=n.protocol+`//`+n.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=n===void 0?`https://`+e:n.protocol+`//`+e),r=Kp(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port=`80`:/^(http|ws)s$/.test(r.protocol)&&(r.port=`443`)),r.path=r.path||`/`;let i=r.host.indexOf(`:`)===-1?r.host:`[`+r.host+`]`;return r.id=r.protocol+`://`+i+`:`+r.port+t,r.href=r.protocol+`://`+i+(n&&n.port===r.port?``:`:`+r.port),r}var tm=typeof ArrayBuffer==`function`,nm=e=>typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,rm=Object.prototype.toString,im=typeof Blob==`function`||typeof Blob<`u`&&rm.call(Blob)===`[object BlobConstructor]`,am=typeof File==`function`||typeof File<`u`&&rm.call(File)===`[object FileConstructor]`;function om(e){return tm&&(e instanceof ArrayBuffer||nm(e))||im&&e instanceof Blob||am&&e instanceof File}function sm(e,t){if(!e||typeof e!=`object`)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(sm(e[t]))return!0;return!1}if(om(e))return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return sm(e.toJSON(),!0);for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&sm(e[t]))return!0;return!1}function cm(e){let t=[],n=e.data,r=e;return r.data=lm(n,t),r.attachments=t.length,{packet:r,buffers:t}}function lm(e,t,n){if(!e)return e;if(om(e)){let n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=lm(e[r],t);return n}if(typeof e==`object`&&!(e instanceof Date)){if(e.toJSON&&typeof e.toJSON==`function`&&!n)return lm(e.toJSON(),t,!0);let r={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=lm(e[n],t));return r}return e}function um(e,t){return e.data=dm(e.data,t),delete e.attachments,e}function dm(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num==`number`&&e.num>=0&&e.num<t.length)return t[e.num];throw Error(`illegal attachments`)}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=dm(e[n],t);else if(typeof e==`object`)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=dm(e[n],t));return e}var fm=e({Decoder:()=>hm,Encoder:()=>mm,PacketType:()=>J,isPacketValid:()=>Sm,protocol:()=>5}),pm=[`connect`,`connect_error`,`disconnect`,`disconnecting`,`newListener`,`removeListener`],J;(function(e){e[e.CONNECT=0]=`CONNECT`,e[e.DISCONNECT=1]=`DISCONNECT`,e[e.EVENT=2]=`EVENT`,e[e.ACK=3]=`ACK`,e[e.CONNECT_ERROR=4]=`CONNECT_ERROR`,e[e.BINARY_EVENT=5]=`BINARY_EVENT`,e[e.BINARY_ACK=6]=`BINARY_ACK`})(J||={});var mm=class{constructor(e){this.replacer=e}encode(e){return(e.type===J.EVENT||e.type===J.ACK)&&sm(e)?this.encodeAsBinary({type:e.type===J.EVENT?J.BINARY_EVENT:J.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=``+e.type;return(e.type===J.BINARY_EVENT||e.type===J.BINARY_ACK)&&(t+=e.attachments+`-`),e.nsp&&e.nsp!==`/`&&(t+=e.nsp+`,`),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=cm(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},hm=class e extends pp{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e==`function`?{reviver:e}:e)}add(e){let t;if(typeof e==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);t=this.decodeString(e);let n=t.type===J.BINARY_EVENT;n||t.type===J.BINARY_ACK?(t.type=n?J.EVENT:J.ACK,this.reconstructor=new gm(t)):super.emitReserved(`decoded`,t)}else if(om(e)||e.base64){if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved(`decoded`,t));else throw Error(`got binary data when not reconstructing a packet`)}else throw Error(`Unknown type: `+e)}decodeString(t){let n=0,r={type:Number(t.charAt(0))};if(J[r.type]===void 0)throw Error(`unknown packet type `+r.type);if(r.type===J.BINARY_EVENT||r.type===J.BINARY_ACK){let e=n+1;for(;t.charAt(++n)!==`-`&&n!=t.length;);let i=t.substring(e,n);if(i!=Number(i)||t.charAt(n)!==`-`)throw Error(`Illegal attachments`);let a=Number(i);if(!vm(a)||a<1)throw Error(`Illegal attachments`);if(a>this.opts.maxAttachments)throw Error(`too many attachments`);r.attachments=a}if(t.charAt(n+1)===`/`){let e=n+1;for(;++n&&t.charAt(n)!==`,`&&n!==t.length;);r.nsp=t.substring(e,n)}else r.nsp=`/`;let i=t.charAt(n+1);if(i!==``&&Number(i)==i){let e=n+1;for(;++n;){let e=t.charAt(n);if(e==null||Number(e)!=e){--n;break}if(n===t.length)break}r.id=Number(t.substring(e,n+1))}if(t.charAt(++n)){let i=this.tryParse(t.substr(n));if(e.isPayloadValid(r.type,i))r.data=i;else throw Error(`invalid payload`)}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case J.CONNECT:return bm(t);case J.DISCONNECT:return t===void 0;case J.CONNECT_ERROR:return typeof t==`string`||bm(t);case J.EVENT:case J.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&pm.indexOf(t[0])===-1);case J.ACK:case J.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&=(this.reconstructor.finishedReconstruction(),null)}},gm=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let e=um(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function _m(e){return typeof e==`string`}var vm=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e};function ym(e){return e===void 0||vm(e)}function bm(e){return Object.prototype.toString.call(e)===`[object Object]`}function xm(e,t){switch(e){case J.CONNECT:return t===void 0||bm(t);case J.DISCONNECT:return t===void 0;case J.EVENT:return Array.isArray(t)&&(typeof t[0]==`number`||typeof t[0]==`string`&&pm.indexOf(t[0])===-1);case J.ACK:return Array.isArray(t);case J.CONNECT_ERROR:return typeof t==`string`||bm(t);default:return!1}}function Sm(e){return _m(e.nsp)&&ym(e.id)&&xm(e.type,e.data)}function Cm(e,t,n){return e.on(t,n),function(){e.off(t,n)}}var wm=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Tm=class extends pp{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[Cm(e,`open`,this.onopen.bind(this)),Cm(e,`packet`,this.onpacket.bind(this)),Cm(e,`error`,this.onerror.bind(this)),Cm(e,`close`,this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState===`open`&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift(`message`),this.emit.apply(this,e),this}emit(e,...t){if(wm.hasOwnProperty(e))throw Error(`"`+e.toString()+`" is a reserved event name`);if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let n={type:J.EVENT,data:t};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof t[t.length-1]==`function`){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}let r=this.io.engine?.transport?.writable,i=this.connected&&!this.io.engine?._hasPingExpired();return this.flags.volatile&&!r||(i?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){let n=this.flags.timeout??this._opts.ackTimeout;if(n===void 0){this.acks[e]=t;return}let r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error(`operation has timed out`))},n),i=(...e)=>{this.io.clearTimeoutFn(r),t.apply(this,e)};i.withError=!0,this.acks[e]=i}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]==`function`&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>(this._queue[0],e===null?(this._queue.shift(),t&&t(null,...r)):n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];(!t.pending||e)&&(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth==`function`?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:J.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved(`connect_error`,e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved(`disconnect`,e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error(`socket has been disconnected`))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case J.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved(`connect_error`,Error(`It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)`));break;case J.EVENT:case J.BINARY_EVENT:this.onevent(e);break;case J.ACK:case J.BINARY_ACK:this.onack(e);break;case J.DISCONNECT:this.ondisconnect();break;case J.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved(`connect_error`,t)}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]==`string`&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,t.packet({type:J.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];typeof t==`function`&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved(`connect`)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose(`io server disconnect`)}destroy(){this.subs&&=(this.subs.forEach(e=>e()),void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:J.DISCONNECT}),this.destroy(),this.connected&&this.onclose(`io client disconnect`),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};function Em(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Em.prototype.duration=function(){var e=this.ms*this.factor**+this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},Em.prototype.reset=function(){this.attempts=0},Em.prototype.setMin=function(e){this.ms=e},Em.prototype.setMax=function(e){this.max=e},Em.prototype.setJitter=function(e){this.jitter=e};var Dm=class extends pp{constructor(e,t){super(),this.nsps={},this.subs=[],e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.opts=t,xp(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor??.5),this.backoff=new Em({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState=`closed`,this.uri=e;let n=t.parser||fm;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)==null||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)==null||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)==null||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf(`open`))return this;this.engine=new $p(this.uri,this.opts);let t=this.engine,n=this;this._readyState=`opening`,this.skipReconnect=!1;let r=Cm(t,`open`,function(){n.onopen(),e&&e()}),i=t=>{this.cleanup(),this._readyState=`closed`,this.emitReserved(`error`,t),e?e(t):this.maybeReconnectOnOpen()},a=Cm(t,`error`,i);if(!1!==this._timeout){let e=this._timeout,n=this.setTimeoutFn(()=>{r(),i(Error(`timeout`)),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState=`open`,this.emitReserved(`open`);let e=this.engine;this.subs.push(Cm(e,`ping`,this.onping.bind(this)),Cm(e,`data`,this.ondata.bind(this)),Cm(e,`error`,this.onerror.bind(this)),Cm(e,`close`,this.onclose.bind(this)),Cm(this.decoder,`decoded`,this.ondecoded.bind(this)))}onping(){this.emitReserved(`ping`)}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose(`parse error`,e)}}ondecoded(e){hp(()=>{this.emitReserved(`packet`,e)},this.setTimeoutFn)}onerror(e){this.emitReserved(`error`,e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Tm(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let e of t)if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose(`forced close`)}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)==null||n.close(),this.backoff.reset(),this._readyState=`closed`,this.emitReserved(`close`,e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved(`reconnect_failed`),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved(`reconnect_attempt`,e.backoff.attempts),!e.skipReconnect&&e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved(`reconnect_error`,t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved(`reconnect`,e)}},Om={};function km(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};let n=em(e,t.path||`/socket.io`),r=n.source,i=n.id,a=n.path,o=Om[i]&&a in Om[i].nsps,s=t.forceNew||t[`force new connection`]||!1===t.multiplex||o,c;return s?c=new Dm(r,t):(Om[i]||(Om[i]=new Dm(r,t)),c=Om[i]),n.query&&!t.query&&(t.query=n.queryKey),c.socket(n.path,t)}Object.assign(km,{Manager:Dm,Socket:Tm,io:km,connect:km});var Am=`modulepreload`,jm=function(e,t){return new URL(e,t).href},Mm={},Nm=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=jm(t,n),t=s(t),t in Mm)return;Mm[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Am,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Pm=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function Fm(e,t){return e>>>t|e<<32-t}function Im(e){let t=new TextEncoder().encode(e),n=t.length*8,r=t.length+1,i=r+(56-r%64+64)%64+8,a=new Uint8Array(i);a.set(t),a[t.length]=128;let o=new DataView(a.buffer);o.setUint32(i-8,Math.floor(n/4294967296)),o.setUint32(i-4,n>>>0);let s=1779033703,c=3144134277,l=1013904242,u=2773480762,d=1359893119,f=2600822924,p=528734635,m=1541459225,h=new Uint32Array(64);for(let e=0;e<i;e+=64){for(let t=0;t<16;t++)h[t]=o.getUint32(e+t*4);for(let e=16;e<64;e++){let t=h[e-15]??0,n=h[e-2]??0,r=Fm(t,7)^Fm(t,18)^t>>>3,i=Fm(n,17)^Fm(n,19)^n>>>10;h[e]=(h[e-16]??0)+r+(h[e-7]??0)+i>>>0}let t=s,n=c,r=l,i=u,a=d,g=f,v=p,y=m;for(let e=0;e<64;e++){let o=Fm(a,6)^Fm(a,11)^Fm(a,25),s=a&g^~a&v,c=y+o+s+(Pm[e]??0)+(h[e]??0)>>>0,l=(Fm(t,2)^Fm(t,13)^Fm(t,22))+(t&n^t&r^n&r)>>>0;y=v,v=g,g=a,a=i+c>>>0,i=r,r=n,n=t,t=c+l>>>0}s=s+t>>>0,c=c+n>>>0,l=l+r>>>0,u=u+i>>>0,d=d+a>>>0,f=f+g>>>0,p=p+v>>>0,m=m+y>>>0}let g=e=>(e>>>0).toString(16).padStart(8,`0`);return g(s)+g(c)+g(l)+g(u)+g(d)+g(f)+g(p)+g(m)}function Lm(e){return`sha256:${Im(e)}`}function Rm(e,t){if(e===null)return`null`;if(typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e))return JSON.stringify(e);if(typeof e!=`object`)throw TypeError(`Interrupt values must be JSON-compatible.`);if(t.has(e))throw TypeError(`Interrupt values must not cycle.`);if(!Array.isArray(e)&&Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Interrupt values must use plain JSON objects.`);t.add(e);let n;if(Array.isArray(e)){let r=[];for(let n=0;n<e.length;n++)r.push(Rm(e[n],t));n=`[${r.join(`,`)}]`}else{let r=e;n=`{${Object.keys(r).sort().map(e=>`${JSON.stringify(e)}:${Rm(r[e],t)}`).join(`,`)}}`}return t.delete(e),n}function zm(e){return Rm(e,new WeakSet)}function Bm(e,t=Lm){if(typeof e!=`string`)throw TypeError(`Interrupt digests require canonical JSON text.`);return t(e)}function Vm(e){typeof e==`object`&&e&&!Object.isFrozen(e)&&(Object.values(e).forEach(Vm),Object.freeze(e))}function Hm(e){let t=JSON.parse(zm(e));return Vm(t),t}function Um(e){return(typeof e==`object`||typeof e==`function`)&&e!==null}function Wm(e){if(!Um(e)||!(`~standard`in e))return!1;let t=e[`~standard`];return typeof t!=`object`||!t||!(`version`in t)||t.version!==1||!(`jsonSchema`in t)||typeof t.jsonSchema!=`object`||t.jsonSchema===null||!(`input`in t.jsonSchema)?!1:typeof t.jsonSchema.input==`function`}function Gm(e){return Um(e)&&`~standard`in e&&typeof e[`~standard`]==`object`&&e[`~standard`]!==null&&`version`in e[`~standard`]&&e[`~standard`].version===1&&`validate`in e[`~standard`]&&typeof e[`~standard`].validate==`function`}var Km=new WeakMap,qm=new WeakMap,Jm=new WeakMap;function Ym(e,t){if(!Wm(e))throw TypeError(`${t} must be a Standard Schema with a JSON Schema converter.`);try{let t=e[`~standard`].jsonSchema.input({target:`draft-07`});if(t===void 0)throw TypeError(`The exported schema is undefined.`);if(typeof t==`function`)throw TypeError(`The exported schema must not be a function.`);if(Array.isArray(t)||!t||typeof t!=`object`||![Object.prototype,null].includes(Object.getPrototypeOf(t)))throw TypeError(`The exported schema must be a plain JSON object.`);let n={};for(let[e,r]of Object.entries(t))e!==`$schema`&&(n[e]=r);return{json:n,canonicalJson:zm(n)}}catch(e){throw TypeError(`${t} could not export compatible JSON Schema: ${e instanceof Error?e.message:String(e)}`)}}function Xm(e,t){try{zm(e)}catch(e){throw TypeError(`${t} must be JSON-compatible: ${e instanceof Error?e.message:String(e)}`)}}function Zm(e,t){if(typeof e!=`string`||e.trim()===``)throw TypeError(`${t} must be a non-empty string.`);return e}function Qm(e){if(typeof e!=`string`||!Number.isFinite(Date.parse(e)))throw TypeError(`Interrupt expiresAt must be a valid date string.`);return e}function $m(e){return e!==null&&(typeof e==`object`||typeof e==`function`)&&`then`in e&&typeof e.then==`function`}function eh(e,t){if(!Gm(e))return t;let n=e[`~standard`].validate(t);if($m(n))throw TypeError(`Interrupt payloadSchema validation must be synchronous.`);if(n.issues!==void 0)throw TypeError(`Interrupt payload is invalid: ${n.issues.map(e=>e.message).join(` `)}`);return n.value}function th(e){Zm(e.id,`Interrupt definition id`);let t=e.responseSchema===void 0?void 0:Ym(e.responseSchema,`responseSchema`),n=Object.prototype.hasOwnProperty.call(e,`payloadSchema`),r=n?Ym(e.payloadSchema,`payloadSchema`):void 0,i={...t?{responseSchemaCanonicalJson:t.canonicalJson,responseSchemaHash:Bm(t.canonicalJson)}:{},...r?{payloadSchemaCanonicalJson:r.canonicalJson,payloadSchemaHash:Bm(r.canonicalJson)}:{}},a={id:e.id,payloadSchema:e.payloadSchema,responseSchema:e.responseSchema,interrupt(e){return s(e,!1)}},o=t=>{let n=e.payloadSchema;if(n===void 0)throw TypeError(`This interrupt definition does not accept a payload.`);return eh(n,t)},s=(e,t)=>{for(let t of Object.keys(e))if(![`key`,`payload`,`reason`,`message`,`expiresAt`].includes(t))throw TypeError(`Interrupt input field ${t} is not allowed.`);let r=Zm(e.key,`Interrupt key`),i=Zm(e.reason,`Interrupt reason`),s=Zm(e.message,`Interrupt message`);if(`payload`in e){if(!n)throw TypeError(`This interrupt definition does not accept a payload.`);e.payload!==void 0&&Xm(e.payload,`Interrupt payload`)}let c=`payload`in e?t?e.payload:o(e.payload):void 0,l=c===void 0?void 0:Hm(c),u=e.expiresAt===void 0?void 0:Qm(e.expiresAt),d=Object.freeze({definition:a,key:r,...n&&l!==void 0?{payload:l}:{},reason:i,message:s,...u===void 0?{}:{expiresAt:u}});return t||Jm.set(d,Hm({key:r,reason:i,message:s,...u===void 0?{}:{expiresAt:u},...c===void 0?{}:{payload:c}})),d};return Km.set(a,i),qm.set(a,s),Object.freeze(a)}var nh=typeof window<`u`,rh=(e,t=!1)=>t?Symbol.for(e):Symbol(e),ih=(e,t,n)=>ah({l:e,k:t,s:n}),ah=e=>JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),oh=e=>typeof e==`number`&&isFinite(e),sh=e=>Ch(e)===`[object Date]`,ch=e=>Ch(e)===`[object RegExp]`,lh=e=>wh(e)&&Object.keys(e).length===0,uh=Object.assign,dh=Object.create,fh=(e=null)=>dh(e),ph,mh=()=>ph||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:fh(),hh=Object.prototype.hasOwnProperty;function gh(e,t){return hh.call(e,t)}var _h=Array.isArray,vh=e=>typeof e==`function`,Y=e=>typeof e==`string`,yh=e=>typeof e==`boolean`,bh=e=>typeof e==`object`&&!!e,xh=e=>bh(e)&&vh(e.then)&&vh(e.catch),Sh=Object.prototype.toString,Ch=e=>Sh.call(e),wh=e=>Ch(e)===`[object Object]`,Th=e=>e==null?``:_h(e)||wh(e)&&e.toString===Sh?JSON.stringify(e,null,2):String(e);function Eh(e,t=``){return e.reduce((e,n,r)=>r===0?e+n:e+t+n,``)}function Dh(e,t){typeof console<`u`&&(console.warn(`[intlify] `+e),t&&console.warn(t.stack))}function Oh(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/\//g,`&#x2F;`).replace(/=/g,`&#x3D;`)}function kh(e){return e.replace(/&(?![a-z0-9#]{2,6};)/gi,`&amp;`).replace(/"/g,`&quot;`).replace(/'/g,`&apos;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}var Ah=/^javascript:/i,jh=/^(?:href|src|action|formaction)$/i,Mh=/&#(?:x([0-9a-f]+)|(\d+));?/gi,Nh=/&(?:Tab|NewLine);/g,Ph=/&colon;?/gi,Fh=/[\u0000-\u0020\u007f-\u009f]/g,Ih=/(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i,Lh=/(^|[\s"'<>/])on(\w+\s*=)/gi,Rh=/(^|[\s"'<>/])((?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;function zh(e,t,n){let r=t||n;if(!r)return e;let i=Number.parseInt(r,t?16:10);return i<=127?String.fromCharCode(i):e}function Bh(e){let t=e.replace(Mh,zh).replace(Nh,``).replace(Ph,`:`).replace(Fh,``);return Ah.test(t)}function Vh(e){let t=/url\s*\(/gi,n=``,r=0,i;for(;(i=t.exec(e))!==null;){let a=i.index,o=t.lastIndex-1,s=o+1,c=1,l=null;for(;s<e.length;s++){let t=e[s];if(l){t===l&&(l=null);continue}if(t===`"`||t===`'`)l=t;else if(t===`(`)c++;else if(t===`)`&&(c--,c===0))break}if(c!==0)break;let u=e.slice(o+1,s).trim(),d=u.startsWith(`"`)&&u.endsWith(`"`)||u.startsWith(`'`)&&u.endsWith(`'`)?u.slice(1,-1).trim():u;n+=e.slice(r,a),n+=Bh(d)?`url(about:blank)`:e.slice(a,s+1),r=s+1}return n+e.slice(r)}function Hh(e,t){return jh.test(e)&&Bh(t)?`about:blank`:kh(e.toLowerCase()===`style`?Vh(t):t)}function Uh(e){return e=e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(e,t,n)=>`${t}="${Hh(t,n)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(e,t,n)=>`${t}='${Hh(t,n)}'`),Ih.test(e)&&(e=e.replace(Lh,`$1&#111;n$2`)),e=e.replace(Rh,(e,t,n,r)=>Bh(r)?`${t}${n}about:blank`:e),e}var Wh=e=>!bh(e)||_h(e);function Gh(e,t){if(Wh(e)||Wh(t))throw Error(`Invalid value`);let n=[{src:e,des:t}];for(;n.length;){let{src:e,des:t}=n.pop();Object.keys(e).forEach(r=>{if(r===`__proto__`)return;let i=e[r];if(_h(i)){let e=[];e.length=i.length,t[r]=e,n.push({src:i,des:e})}else bh(i)?((!bh(t[r])||_h(t[r]))&&(t[r]=fh()),n.push({src:i,des:t[r]})):t[r]=i})}}function Kh(e,t,n){return{line:e,column:t,offset:n}}function qh(e,t,n){let r={start:e,end:t};return n!=null&&(r.source=n),r}var X={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16};X.EXPECTED_TOKEN,X.INVALID_TOKEN_IN_PLACEHOLDER,X.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,X.UNKNOWN_ESCAPE_SEQUENCE,X.INVALID_UNICODE_ESCAPE_SEQUENCE,X.UNBALANCED_CLOSING_BRACE,X.UNTERMINATED_CLOSING_BRACE,X.EMPTY_PLACEHOLDER,X.NOT_ALLOW_NEST_PLACEHOLDER,X.INVALID_LINKED_FORMAT,X.MUST_HAVE_MESSAGES_IN_PLURAL,X.UNEXPECTED_EMPTY_LINKED_MODIFIER,X.UNEXPECTED_EMPTY_LINKED_KEY,X.UNEXPECTED_LEXICAL_ANALYSIS,X.UNHANDLED_CODEGEN_NODE_TYPE,X.UNHANDLED_MINIFIER_NODE_TYPE;function Jh(e,t,n={}){let{domain:r,messages:i,args:a}=n,o=SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=r,o}function Yh(e){throw e}var Xh=` `,Zh=`\r`,Qh=`
10
10
  `,$h=`\u2028`,eg=`\u2029`;function tg(e){let t=e,n=0,r=1,i=1,a=0,o=e=>t[e]===Zh&&t[e+1]===Qh,s=e=>t[e]===Qh,c=e=>t[e]===eg,l=e=>t[e]===$h,u=e=>o(e)||s(e)||c(e)||l(e),d=()=>n,f=()=>r,p=()=>i,m=()=>a,h=e=>o(e)||c(e)||l(e)?Qh:t[e],g=()=>h(n),v=()=>h(n+a);function y(){return a=0,u(n)&&(r++,i=0),o(n)&&n++,n++,i++,t[n]}function b(){return o(n+a)&&a++,a++,t[n+a]}function x(){n=0,r=1,i=1,a=0}function S(e=0){a=e}function C(){let e=n+a;for(;e!==n;)y();a=0}return{index:d,line:f,column:p,peekOffset:m,charAt:h,currentChar:g,currentPeek:v,next:y,peek:b,reset:x,resetPeek:S,skipToPeek:C}}var ng=void 0,rg=`'`,ig=`tokenizer`;function ag(e,t={}){let n=t.location!==!1,r=tg(e),i=()=>r.index(),a=()=>Kh(r.line(),r.column(),r.index()),o=a(),s=i(),c={currentType:13,offset:s,startLoc:o,endLoc:o,lastType:13,lastOffset:s,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:``},l=()=>c,{onError:u}=t;function d(e,t,r,...i){let a=l();if(t.column+=r,t.offset+=r,u){let r=Jh(e,n?qh(a.startLoc,t):null,{domain:ig,args:i});u(r)}}function f(e,t,r){e.endLoc=a(),e.currentType=t;let i={type:t};return n&&(i.loc=qh(e.startLoc,e.endLoc)),r!=null&&(i.value=r),i}let p=e=>f(e,13);function m(e,t){return e.currentChar()===t?(e.next(),t):(d(X.EXPECTED_TOKEN,a(),0,t),``)}function h(e){let t=``;for(;e.currentPeek()===Xh||e.currentPeek()===Qh;)t+=e.currentPeek(),e.peek();return t}function g(e){let t=h(e);return e.skipToPeek(),t}function v(e){if(e===ng)return!1;let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t===95}function y(e){if(e===ng)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function b(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=v(e.currentPeek());return e.resetPeek(),r}function x(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=y(e.currentPeek()===`-`?e.peek():e.currentPeek());return e.resetPeek(),r}function S(e,t){let{currentType:n}=t;if(n!==2)return!1;h(e);let r=e.currentPeek()===rg;return e.resetPeek(),r}function C(e,t){let{currentType:n}=t;if(n!==7)return!1;h(e);let r=e.currentPeek()===`.`;return e.resetPeek(),r}function w(e,t){let{currentType:n}=t;if(n!==8)return!1;h(e);let r=v(e.currentPeek());return e.resetPeek(),r}function T(e,t){let{currentType:n}=t;if(n!==7&&n!==11)return!1;h(e);let r=e.currentPeek()===`:`;return e.resetPeek(),r}function E(e,t){let{currentType:n}=t;if(n!==9)return!1;let r=()=>{let t=e.currentPeek();return t===`{`?v(e.peek()):t===`@`||t===`|`||t===`:`||t===`.`||t===Xh||!t?!1:t===Qh?(e.peek(),r()):O(e,!1)},i=r();return e.resetPeek(),i}function D(e){h(e);let t=e.currentPeek()===`|`;return e.resetPeek(),t}function O(e,t=!0){let n=(t=!1,r=``)=>{let i=e.currentPeek();return i===`{`||i===`@`||!i?t:i===`|`?r!==Xh&&r!==Qh:i===Xh?(e.peek(),n(!0,Xh)):i!==Qh||(e.peek(),n(!0,Qh))},r=n();return t&&e.resetPeek(),r}function k(e,t){let n=e.currentChar();if(n!==ng)return t(n)?(e.next(),n):null}function ee(e){let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===95||t===36}function A(e){return k(e,ee)}function j(e){let t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||t===95||t===36||t===45}function M(e){return k(e,j)}function te(e){let t=e.charCodeAt(0);return t>=48&&t<=57}function ne(e){return k(e,te)}function N(e){let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function re(e){return k(e,N)}function P(e){let t=``,n=``;for(;t=ne(e);)n+=t;return n}function F(e){let t=``;for(;;){let n=e.currentChar();if(n===`\\`){let r=e.peek();r===`{`||r===`}`||r===`@`||r===`|`||r===`\\`?(t+=n+r,e.next(),e.next()):(e.resetPeek(),t+=n,e.next())}else if(n===`{`||n===`}`||n===`@`||n===`|`||!n)break;else if(n===Xh||n===Qh){if(O(e))t+=n,e.next();else if(D(e))break;else t+=n,e.next()}else t+=n,e.next()}return t}function ie(e){g(e);let t=``,n=``;for(;t=M(e);)n+=t;let r=e.currentChar();if(r&&r!==`}`&&r!==ng&&r!==Xh&&r!==Qh&&r!==` `){let t=ue(e);return d(X.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n+t),n+t}return e.currentChar()===ng&&d(X.UNTERMINATED_CLOSING_BRACE,a(),0),n}function I(e){g(e);let t=``;return e.currentChar()===`-`?(e.next(),t+=`-${P(e)}`):t+=P(e),e.currentChar()===ng&&d(X.UNTERMINATED_CLOSING_BRACE,a(),0),t}function ae(e){return e!==rg&&e!==Qh}function oe(e){g(e),m(e,`'`);let t=``,n=``;for(;t=k(e,ae);)n+=t===`\\`?se(e):t;let r=e.currentChar();return r===Qh||r===ng?(d(X.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,a(),0),r===Qh&&(e.next(),m(e,`'`)),n):(m(e,`'`),n)}function se(e){let t=e.currentChar();switch(t){case`\\`:case`'`:return e.next(),`\\${t}`;case`u`:return ce(e,t,4);case`U`:return ce(e,t,6);default:return d(X.UNKNOWN_ESCAPE_SEQUENCE,a(),0,t),``}}function ce(e,t,n){m(e,t);let r=``;for(let i=0;i<n;i++){let n=re(e);if(!n){d(X.INVALID_UNICODE_ESCAPE_SEQUENCE,a(),0,`\\${t}${r}${e.currentChar()}`);break}r+=n}return`\\${t}${r}`}function le(e){return e!==`{`&&e!==`}`&&e!==Xh&&e!==Qh}function ue(e){g(e);let t=``,n=``;for(;t=k(e,le);)n+=t;return n}function de(e){let t=``,n=``;for(;t=A(e);)n+=t;return n}function fe(e){let t=n=>{let r=e.currentChar();return r===`{`||r===`@`||r===`|`||r===`(`||r===`)`||!r||r===Xh?n:(n+=r,e.next(),t(n))};return t(``)}function pe(e){g(e);let t=m(e,`|`);return g(e),t}function me(e,t){let n=null;switch(e.currentChar()){case`{`:return t.braceNest>=1&&d(X.NOT_ALLOW_NEST_PLACEHOLDER,a(),0),e.next(),n=f(t,2,`{`),g(e),t.braceNest++,n;case`}`:return t.braceNest>0&&t.currentType===2&&d(X.EMPTY_PLACEHOLDER,a(),0),e.next(),n=f(t,3,`}`),t.braceNest--,t.braceNest>0&&g(e),t.inLinked&&t.braceNest===0&&(t.inLinked=!1),n;case`@`:return t.braceNest>0&&d(X.UNTERMINATED_CLOSING_BRACE,a(),0),n=he(e,t)||p(t),t.braceNest=0,n;default:{let r=!0,i=!0,o=!0;if(D(e))return t.braceNest>0&&d(X.UNTERMINATED_CLOSING_BRACE,a(),0),n=f(t,1,pe(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(t.currentType===4||t.currentType===5||t.currentType===6))return d(X.UNTERMINATED_CLOSING_BRACE,a(),0),t.braceNest=0,ge(e,t);if(r=b(e,t))return n=f(t,4,ie(e)),g(e),n;if(i=x(e,t))return n=f(t,5,I(e)),g(e),n;if(o=S(e,t))return n=f(t,6,oe(e)),g(e),n;if(!r&&!i&&!o)return n=f(t,12,ue(e)),d(X.INVALID_TOKEN_IN_PLACEHOLDER,a(),0,n.value),g(e),n;break}}return n}function he(e,t){let{currentType:n}=t,r=null,i=e.currentChar();switch((n===7||n===8||n===11||n===9)&&(i===Qh||i===Xh)&&d(X.INVALID_LINKED_FORMAT,a(),0),i){case`@`:return e.next(),r=f(t,7,`@`),t.inLinked=!0,r;case`.`:return g(e),e.next(),f(t,8,`.`);case`:`:return g(e),e.next(),f(t,9,`:`);default:return D(e)?(r=f(t,1,pe(e)),t.braceNest=0,t.inLinked=!1,r):C(e,t)||T(e,t)?(g(e),he(e,t)):w(e,t)?(g(e),f(t,11,de(e))):E(e,t)?(g(e),i===`{`?me(e,t)||r:f(t,10,fe(e))):(n===7&&d(X.INVALID_LINKED_FORMAT,a(),0),t.braceNest=0,t.inLinked=!1,ge(e,t))}}function ge(e,t){let n={type:13};if(t.braceNest>0)return me(e,t)||p(t);if(t.inLinked)return he(e,t)||p(t);switch(e.currentChar()){case`{`:return me(e,t)||p(t);case`}`:return d(X.UNBALANCED_CLOSING_BRACE,a(),0),e.next(),f(t,3,`}`);case`@`:return he(e,t)||p(t);default:if(D(e))return n=f(t,1,pe(e)),t.braceNest=0,t.inLinked=!1,n;if(O(e))return f(t,0,F(e))}return n}function _e(){let{currentType:e,offset:t,startLoc:n,endLoc:o}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=n,c.lastEndLoc=o,c.offset=i(),c.startLoc=a(),r.currentChar()===ng?f(c,13):ge(r,c)}return{nextToken:_e,currentOffset:i,currentPosition:a,context:l}}var og=`parser`,sg=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,cg=/\\([\\@{}|])/g;function lg(e,t){return t}function ug(e,t,n){switch(e){case`\\\\`:return`\\`;case`\\'`:return`'`;default:{let e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):`�`}}}function dg(e={}){let t=e.location!==!1,{onError:n}=e;function r(e,r,i,a,...o){let s=e.currentPosition();if(s.offset+=a,s.column+=a,n){let e=Jh(r,t?qh(i,s):null,{domain:og,args:o});n(e)}}function i(e,n,r){let i={type:e};return t&&(i.start=n,i.end=n,i.loc={start:r,end:r}),i}function a(e,n,r,i){t&&(e.end=n,e.loc&&(e.loc.end=r))}function o(e,t){let n=e.context(),r=i(3,n.offset,n.startLoc);return r.value=t.replace(cg,lg),a(r,e.currentOffset(),e.currentPosition()),r}function s(e,t){let{lastOffset:n,lastStartLoc:r}=e.context(),o=i(5,n,r);return o.index=parseInt(t,10),e.nextToken(),a(o,e.currentOffset(),e.currentPosition()),o}function c(e,t){let{lastOffset:n,lastStartLoc:r}=e.context(),o=i(4,n,r);return o.key=t,e.nextToken(),a(o,e.currentOffset(),e.currentPosition()),o}function l(e,t){let{lastOffset:n,lastStartLoc:r}=e.context(),o=i(9,n,r);return o.value=t.replace(sg,ug),e.nextToken(),a(o,e.currentOffset(),e.currentPosition()),o}function u(e){let t=e.nextToken(),n=e.context(),{lastOffset:o,lastStartLoc:s}=n,c=i(8,o,s);return t.type===11?(t.value??r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,0,fg(t)),c.value=t.value||``,a(c,e.currentOffset(),e.currentPosition()),{node:c}):(r(e,X.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,0),c.value=``,a(c,o,s),{nextConsumeToken:t,node:c})}function d(e,t){let n=e.context(),r=i(7,n.offset,n.startLoc);return r.value=t,a(r,e.currentOffset(),e.currentPosition()),r}function f(e){let t=e.context(),n=i(6,t.offset,t.startLoc),o=e.nextToken();if(o.type===8){let t=u(e);n.modifier=t.node,o=t.nextConsumeToken||e.nextToken()}switch(o.type!==9&&r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,fg(o)),o=e.nextToken(),o.type===2&&(o=e.nextToken()),o.type){case 10:o.value??r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,fg(o)),n.key=d(e,o.value||``);break;case 4:o.value??r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,fg(o)),n.key=c(e,o.value||``);break;case 5:o.value??r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,fg(o)),n.key=s(e,o.value||``);break;case 6:o.value??r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,fg(o)),n.key=l(e,o.value||``);break;default:{r(e,X.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc,0);let s=e.context(),c=i(7,s.offset,s.startLoc);return c.value=``,a(c,s.offset,s.startLoc),n.key=c,a(n,s.offset,s.startLoc),{nextConsumeToken:o,node:n}}}return a(n,e.currentOffset(),e.currentPosition()),{node:n}}function p(e){let t=e.context(),n=i(2,t.currentType===1?e.currentOffset():t.offset,t.currentType===1?t.endLoc:t.startLoc);n.items=[];let u=null;do{let i=u||e.nextToken();switch(u=null,i.type){case 0:i.value??r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,fg(i)),n.items.push(o(e,i.value||``));break;case 5:i.value??r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,fg(i)),n.items.push(s(e,i.value||``));break;case 4:i.value??r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,fg(i)),n.items.push(c(e,i.value||``));break;case 6:i.value??r(e,X.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,fg(i)),n.items.push(l(e,i.value||``));break;case 7:{let t=f(e);n.items.push(t.node),u=t.nextConsumeToken||null;break}}}while(t.currentType!==13&&t.currentType!==1);return a(n,t.currentType===1?t.lastOffset:e.currentOffset(),t.currentType===1?t.lastEndLoc:e.currentPosition()),n}function m(e,t,n,o){let s=e.context(),c=o.items.length===0,l=i(1,t,n);l.cases=[],l.cases.push(o);do{let t=p(e);c||=t.items.length===0,l.cases.push(t)}while(s.currentType!==13);return c&&r(e,X.MUST_HAVE_MESSAGES_IN_PLURAL,n,0),a(l,e.currentOffset(),e.currentPosition()),l}function h(e){let t=e.context(),{offset:n,startLoc:r}=t,i=p(e);return t.currentType===13?i:m(e,n,r,i)}function g(n){let o=ag(n,uh({},e)),s=o.context(),c=i(0,s.offset,s.startLoc);return t&&c.loc&&(c.loc.source=n),c.body=h(o),e.onCacheKey&&(c.cacheKey=e.onCacheKey(n)),s.currentType!==13&&r(o,X.UNEXPECTED_LEXICAL_ANALYSIS,s.lastStartLoc,0,n[s.offset]||``),a(c,o.currentOffset(),o.currentPosition()),c}return{parse:g}}function fg(e){if(e.type===13)return`EOF`;let t=(e.value||``).replace(/\r?\n/gu,`\\n`);return t.length>10?t.slice(0,9)+`…`:t}function pg(e,t={}){let n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}function mg(e,t){for(let n=0;n<e.length;n++)hg(e[n],t)}function hg(e,t){switch(e.type){case 1:mg(e.cases,t),t.helper(`plural`);break;case 2:mg(e.items,t);break;case 6:hg(e.key,t),t.helper(`linked`),t.helper(`type`);break;case 5:t.helper(`interpolate`),t.helper(`list`);break;case 4:t.helper(`interpolate`),t.helper(`named`)}}function gg(e,t={}){let n=pg(e);n.helper(`normalize`),e.body&&hg(e.body,n);let r=n.context();e.helpers=Array.from(r.helpers)}function _g(e){let t=e.body;return t.type===2?vg(t):t.cases.forEach(e=>vg(e)),e}function vg(e){if(e.items.length===1){let t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{let t=[];for(let n=0;n<e.items.length;n++){let r=e.items[n];if(r.type!==3&&r.type!==9||r.value==null)break;t.push(r.value)}if(t.length===e.items.length){e.static=Eh(t);for(let t=0;t<e.items.length;t++){let n=e.items[t];(n.type===3||n.type===9)&&delete n.value}}}}function yg(e){switch(e.t=e.type,e.type){case 0:{let t=e;yg(t.body),t.b=t.body,delete t.body;break}case 1:{let t=e,n=t.cases;for(let e=0;e<n.length;e++)yg(n[e]);t.c=n,delete t.cases;break}case 2:{let t=e,n=t.items;for(let e=0;e<n.length;e++)yg(n[e]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{let t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{let t=e;yg(t.key),t.k=t.key,delete t.key,t.modifier&&(yg(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{let t=e;t.i=t.index,delete t.index;break}case 4:{let t=e;t.k=t.key,delete t.key;break}}delete e.type}function bg(e,t){let{filename:n,breakLineCode:r,needIndent:i}=t,a=t.location!==!1,o={filename:n,code:``,column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:i,indentLevel:0};a&&e.loc&&(o.source=e.loc.source);let s=()=>o;function c(e,t){o.code+=e}function l(e,t=!0){let n=t?r:``;c(i?n+` `.repeat(e):n)}function u(e=!0){let t=++o.indentLevel;e&&l(t)}function d(e=!0){let t=--o.indentLevel;e&&l(t)}function f(){l(o.indentLevel)}return{context:s,push:c,indent:u,deindent:d,newline:f,helper:e=>`_${e}`,needIndent:()=>o.needIndent}}function xg(e,t){let{helper:n}=e;e.push(`${n(`linked`)}(`),Tg(e,t.key),t.modifier?(e.push(`, `),Tg(e,t.modifier),e.push(`, _type`)):e.push(`, undefined, _type`),e.push(`)`)}function Sg(e,t){let{helper:n,needIndent:r}=e;e.push(`${n(`normalize`)}([`),e.indent(r());let i=t.items.length;for(let n=0;n<i&&(Tg(e,t.items[n]),n!==i-1);n++)e.push(`, `);e.deindent(r()),e.push(`])`)}function Cg(e,t){let{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n(`plural`)}([`),e.indent(r());let i=t.cases.length;for(let n=0;n<i&&(Tg(e,t.cases[n]),n!==i-1);n++)e.push(`, `);e.deindent(r()),e.push(`])`)}}function wg(e,t){t.body?Tg(e,t.body):e.push(`null`)}function Tg(e,t){let{helper:n}=e;switch(t.type){case 0:wg(e,t);break;case 1:Cg(e,t);break;case 2:Sg(e,t);break;case 6:xg(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n(`interpolate`)}(${n(`list`)}(${t.index}))`,t);break;case 4:e.push(`${n(`interpolate`)}(${n(`named`)}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t)}}var Eg=(e,t={})=>{let n=Y(t.mode)?t.mode:`normal`,r=Y(t.filename)?t.filename:`message.intl`;t.sourceMap;let i=t.breakLineCode==null?n===`arrow`?`;`:`
11
- `:t.breakLineCode,a=t.needIndent?t.needIndent:n!==`arrow`,o=e.helpers||[],s=bg(e,{filename:r,breakLineCode:i,needIndent:a});s.push(n===`normal`?`function __msg__ (ctx) {`:`(ctx) => {`),s.indent(a),o.length>0&&(s.push(`const { ${Eh(o.map(e=>`${e}: _${e}`),`, `)} } = ctx`),s.newline()),s.push(`return `),Tg(s,e),s.deindent(a),s.push(`}`),delete e.helpers;let{code:c,map:l}=s.context();return{ast:e,code:c,map:l?l.toJSON():void 0}};function Dg(e,t={}){let n=uh({},t),r=!!n.jit,i=!!n.minify,a=n.optimize==null||n.optimize,o=dg(n).parse(e);return r?(a&&_g(o),i&&yg(o),{ast:o,code:``}):(gg(o,n),Eg(o,n))}function Og(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(mh().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!=`boolean`&&(mh().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function kg(e){return bh(e)&&zg(e)===0&&(gh(e,`b`)||gh(e,`body`))}var Ag=[`b`,`body`];function jg(e){return Kg(e,Ag)}var Mg=[`c`,`cases`];function Ng(e){return Kg(e,Mg,[])}var Pg=[`s`,`static`];function Fg(e){return Kg(e,Pg)}var Ig=[`i`,`items`];function Lg(e){return Kg(e,Ig,[])}var Rg=[`t`,`type`];function zg(e){return Kg(e,Rg)}var Bg=[`v`,`value`];function Vg(e,t){let n=Kg(e,Bg);if(n!=null)return n;throw Jg(t)}var Hg=[`m`,`modifier`];function Ug(e){return Kg(e,Hg)}var Wg=[`k`,`key`];function Gg(e){let t=Kg(e,Wg);if(t)return t;throw Jg(6)}function Kg(e,t,n){for(let n=0;n<t.length;n++){let r=t[n];if(gh(e,r)&&e[r]!=null)return e[r]}return n}var qg=[...Ag,...Mg,...Pg,...Ig,...Wg,...Hg,...Bg,...Rg];function Jg(e){return Error(`unhandled node type: ${e}`)}function Yg(e){return t=>Xg(t,e)}function Xg(e,t){let n=jg(t);if(n==null)throw Jg(0);if(zg(n)===1){let t=Ng(n);return e.plural(t.reduce((t,n)=>[...t,Zg(e,n)],[]))}return Zg(e,n)}function Zg(e,t){let n=Fg(t);if(n!=null)return e.type===`text`?n:e.normalize([n]);{let n=Lg(t).reduce((t,n)=>[...t,Qg(e,n)],[]);return e.normalize(n)}}function Qg(e,t){let n=zg(t);switch(n){case 3:return Vg(t,n);case 9:return Vg(t,n);case 4:{let r=t;if(gh(r,`k`)&&r.k)return e.interpolate(e.named(r.k));if(gh(r,`key`)&&r.key)return e.interpolate(e.named(r.key));throw Jg(n)}case 5:{let r=t;if(gh(r,`i`)&&oh(r.i))return e.interpolate(e.list(r.i));if(gh(r,`index`)&&oh(r.index))return e.interpolate(e.list(r.index));throw Jg(n)}case 6:{let n=t,r=Ug(n),i=Gg(n);return e.linked(Qg(e,i),r?Qg(e,r):void 0,e.type)}case 7:return Vg(t,n);case 8:return Vg(t,n);default:throw Error(`unhandled node on format message part: ${n}`)}}var $g=e=>e,e_=fh();function t_(e,t={}){let n=!1,r=t.onError||Yh;return t.onError=e=>{n=!0,r(e)},{...Dg(e,t),detectError:n}}function n_(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Y(e)){yh(t.warnHtmlMessage)&&t.warnHtmlMessage;let n=(t.onCacheKey||$g)(e),r=e_[n];if(r)return r;let{ast:i,detectError:a}=t_(e,{...t,location:!1,jit:!0}),o=Yg(i);return a?o:e_[n]=o}{let t=e.cacheKey;return t?e_[t]||(e_[t]=Yg(e)):Yg(e)}}var r_=null;function i_(e){r_=e}function a_(e,t,n){r_&&r_.emit(`i18n:init`,{timestamp:Date.now(),i18n:e,version:t,meta:n})}var o_=s_(`function:translate`);function s_(e){return t=>r_&&r_.emit(e,t)}var c_={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function l_(e){return Jh(e,null,void 0)}c_.INVALID_ARGUMENT,c_.INVALID_DATE_ARGUMENT,c_.INVALID_ISO_DATE_ARGUMENT,c_.NOT_SUPPORT_NON_STRING_MESSAGE,c_.NOT_SUPPORT_LOCALE_PROMISE_VALUE,c_.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,c_.NOT_SUPPORT_LOCALE_TYPE;function u_(e,t){return t.locale==null?f_(e.locale):f_(t.locale)}var d_;function f_(e){if(Y(e))return e;if(vh(e)){if(e.resolvedOnce&&d_!=null)return d_;if(e.constructor.name===`Function`){let t=e();if(xh(t))throw l_(c_.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return d_=t}throw l_(c_.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw l_(c_.NOT_SUPPORT_LOCALE_TYPE)}function p_(e,t,n){return[...new Set([n,..._h(t)?t:bh(t)?Object.keys(t).filter(e=>e!=="default"):Y(t)?[t]:[n]])]}function m_(e,t,n){let r=Y(n)?n:A_,i=e;i.__localeChainCache||=new Map;let a=ah(t),o=i.__localeChainCache.get(r);o||(o=new Map,i.__localeChainCache.set(r,o));let s=o.get(a);if(s)return s;let c=[],l=[n];for(;_h(l);)l=h_(c,l,t);let u=_h(t)||!wh(t)?t:t.default?t.default:null;return l=Y(u)?[u]:u,_h(l)&&h_(c,l,!1),o.set(a,c),c}function h_(e,t,n){let r=!0;for(let i=0;i<t.length&&yh(r);i++){let a=t[i];Y(a)&&(r=g_(e,t[i],n))}return r}function g_(e,t,n){let r,i=t.split(`-`);do r=__(e,i.join(`-`),n),i.splice(-1,1);while(i.length&&r===!0);return r}function __(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r=t[t.length-1]!==`!`;let i=t.replace(/!/g,``);e.push(i),(_h(n)||wh(n))&&n[i]&&(r=n[i])}return r}var v_=[];v_[0]={w:[0],i:[3,0],"[":[4],o:[7]},v_[1]={w:[1],".":[2],"[":[4],o:[7]},v_[2]={w:[2],i:[3,0],0:[3,0]},v_[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},v_[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},v_[5]={"'":[4,0],o:8,l:[5,0]},v_[6]={'"':[4,0],o:8,l:[6,0]};var y_=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function b_(e){return y_.test(e)}function x_(e){let t=e.charCodeAt(0);return t===e.charCodeAt(e.length-1)&&(t===34||t===39)?e.slice(1,-1):e}function S_(e){if(e==null)return`o`;switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return`i`;case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return`w`}return`i`}function C_(e){let t=e.trim();return e.charAt(0)===`0`&&isNaN(parseInt(e))?!1:b_(t)?x_(t):`*`+t}function w_(e){let t=[],n=-1,r=0,i=0,a,o,s,c,l,u,d,f=[];f[0]=()=>{o===void 0?o=s:o+=s},f[1]=()=>{o!==void 0&&(t.push(o),o=void 0)},f[2]=()=>{f[0](),i++},f[3]=()=>{if(i>0)i--,r=4,f[0]();else{if(i=0,o===void 0||(o=C_(o),o===!1))return!1;f[1]()}};function p(){let t=e[n+1];if(r===5&&t===`'`||r===6&&t===`"`)return n++,s=`\\`+t,f[0](),!0}for(;r!==null;)if(n++,a=e[n],!(a===`\\`&&p())){if(c=S_(a),d=v_[r],l=d[c]||d.l||8,l===8||(r=l[0],l[1]!==void 0&&(u=f[l[1]],u&&(s=a,u()===!1))))return;if(r===7)return t}}var T_=new Map;function E_(e,t){return bh(e)?e[t]:null}function D_(e,t){if(!bh(e))return null;let n=T_.get(t);if(n||(n=w_(t),n&&T_.set(t,n)),!n)return null;let r=n.length,i=e,a=0;for(;a<r;){let e=n[a];if(qg.includes(e)&&kg(i)||!bh(i)||!gh(i,e))return null;let t=i[e];if(t===void 0||vh(i))return null;i=t,a++}return i}var O_={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,INVALID_NUMBER_ARGUMENT:8,INVALID_DATE_ARGUMENT:9};O_.NOT_FOUND_KEY,O_.FALLBACK_TO_TRANSLATE,O_.CANNOT_FORMAT_NUMBER,O_.FALLBACK_TO_NUMBER_FORMAT,O_.CANNOT_FORMAT_DATE,O_.FALLBACK_TO_DATE_FORMAT,O_.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER,O_.INVALID_NUMBER_ARGUMENT,O_.INVALID_DATE_ARGUMENT;var k_=`11.4.10`,A_=`en-US`,j_=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function M_(){return{upper:(e,t)=>t===`text`&&Y(e)?e.toUpperCase():t===`vnode`&&bh(e)&&`__v_isVNode`in e?e.children.toUpperCase():e,lower:(e,t)=>t===`text`&&Y(e)?e.toLowerCase():t===`vnode`&&bh(e)&&`__v_isVNode`in e?e.children.toLowerCase():e,capitalize:(e,t)=>t===`text`&&Y(e)?j_(e):t===`vnode`&&bh(e)&&`__v_isVNode`in e?j_(e.children):e}}var N_;function P_(e){N_=e}var F_;function I_(e){F_=e}var L_;function R_(e){L_=e}var z_=null,B_=e=>{z_=e},V_=()=>z_,H_=null,U_=e=>{H_=e},W_=()=>H_,G_=0;function K_(e={}){let t=vh(e.onWarn)?e.onWarn:Dh,n=Y(e.version)?e.version:k_,r=Y(e.locale)||vh(e.locale)?e.locale:A_,i=vh(r)?A_:r,a=_h(e.fallbackLocale)||wh(e.fallbackLocale)||Y(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:i,o=wh(e.messages)?e.messages:q_(i),s=wh(e.datetimeFormats)?e.datetimeFormats:q_(i),c=wh(e.numberFormats)?e.numberFormats:q_(i),l=uh(fh(),e.modifiers,M_()),u=e.pluralRules||fh(),d=vh(e.missing)?e.missing:null,f=yh(e.missingWarn)||ch(e.missingWarn)?e.missingWarn:!0,p=yh(e.fallbackWarn)||ch(e.fallbackWarn)?e.fallbackWarn:!0,m=!!e.fallbackFormat,h=!!e.unresolving,g=vh(e.postTranslation)?e.postTranslation:null,v=wh(e.processor)?e.processor:null,y=!yh(e.warnHtmlMessage)||e.warnHtmlMessage,b=!!e.escapeParameter,x=vh(e.messageCompiler)?e.messageCompiler:N_,S=vh(e.messageResolver)?e.messageResolver:F_||E_,C=vh(e.localeFallbacker)?e.localeFallbacker:L_||p_,w=bh(e.fallbackContext)?e.fallbackContext:void 0,T=e,E=bh(T.__datetimeFormatters)?T.__datetimeFormatters:new Map,D=bh(T.__numberFormatters)?T.__numberFormatters:new Map,O=bh(T.__meta)?T.__meta:{};G_++;let k={version:n,cid:G_,locale:r,fallbackLocale:a,messages:o,modifiers:l,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:h,postTranslation:g,processor:v,warnHtmlMessage:y,escapeParameter:b,messageCompiler:x,messageResolver:S,localeFallbacker:C,fallbackContext:w,onWarn:t,__meta:O};return k.datetimeFormats=s,k.numberFormats=c,k.__datetimeFormatters=E,k.__numberFormatters=D,__INTLIFY_PROD_DEVTOOLS__&&a_(k,n,O),k}var q_=e=>({[e]:fh()});function J_(e,t,n,r,i){let{missing:a,onWarn:o}=e;if(a!==null){let r=a(e,n,t,i);return Y(r)?r:t}return t}function Y_(e,t,n){let r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function X_(e,t){return e!==t&&e.split(`-`)[0]===t.split(`-`)[0]}function Z_(e,t){let n=t.indexOf(e);if(n===-1)return!1;for(let r=n+1;r<t.length;r++)if(X_(e,t[r]))return!0;return!1}function Q_(e,t,n,r,i,a,o){let{fallbackLocale:s,localeFallbacker:c,onWarn:l}=e,u=c(e,s,n);for(let n=0;n<u.length;n++){let a=u[n],s=(r[a]||{})[t];if(wh(s)&&Y(a))return a;J_(e,t,a,i,o)}return null}function $_(e,t,n){let r=`${e}__${t}`;return wh(n)&&!lh(n)&&(r=`${r}__${JSON.stringify(n)}`),r}function ev(e,t,n){for(let r in n){let n=`${t}__${r}`;for(let t of e.keys())(t===n||t.startsWith(`${n}__`))&&e.delete(t)}}function tv(e,t,n,r){let[,i,a,o]=e,s=n;return Y(i)?t.key=i:wh(i)&&Object.keys(i).forEach(e=>{r.includes(e)?s[e]=i[e]:t[e]=i[e]}),Y(a)?t.locale=a:wh(a)&&(s=a),wh(o)&&(s=o),s}var nv=typeof Intl<`u`;nv&&Intl.DateTimeFormat,nv&&Intl.NumberFormat;function rv(e,...t){let{datetimeFormats:n,unresolving:r,onWarn:i}=e,{__datetimeFormatters:a}=e;if(!Y(t[0])&&!sh(t[0])&&!oh(t[0]))return``;let[o,s,c,l]=av(...t),u=yh(c.missingWarn)?c.missingWarn:e.missingWarn,d=yh(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=!!c.part,p=u_(e,c);if(!Y(o)||o===``){let e=new Intl.DateTimeFormat(p.replace(/!/g,``),l);return f?e.formatToParts(s):e.format(s)}let m=Q_(e,o,p,n,u,d,`datetime format`);if(!Y(m))return r?-1:o;let h=n[m][o],g=$_(m,o,l),v=a.get(g);return v||(v=new Intl.DateTimeFormat(m,uh({},h,l)),a.set(g,v)),f?v.formatToParts(s):v.format(s)}var iv=[`localeMatcher`,`weekday`,`era`,`year`,`month`,`day`,`hour`,`minute`,`second`,`timeZoneName`,`formatMatcher`,`hour12`,`timeZone`,`dateStyle`,`timeStyle`,`calendar`,`dayPeriod`,`numberingSystem`,`hourCycle`,`fractionalSecondDigits`];function av(...e){let[t]=e,n=fh(),r=fh(),i;if(Y(t)){let e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw l_(c_.INVALID_ISO_DATE_ARGUMENT);let n=e[3]?e[3].trim().startsWith(`T`)?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();i=new Date(n);try{i.toISOString()}catch{throw l_(c_.INVALID_ISO_DATE_ARGUMENT)}}else if(sh(t)){if(isNaN(t.getTime()))throw l_(c_.INVALID_DATE_ARGUMENT);i=t}else if(oh(t))i=t;else throw l_(c_.INVALID_ARGUMENT);let a=tv(e,n,r,iv);return[n.key||``,i,n,a]}function ov(e,t,n){ev(e.__datetimeFormatters,t,n)}function sv(e,...t){let{numberFormats:n,unresolving:r,onWarn:i}=e,{__numberFormatters:a}=e;if(!oh(t[0]))return``;let[o,s,c,l]=lv(...t),u=yh(c.missingWarn)?c.missingWarn:e.missingWarn,d=yh(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=!!c.part,p=u_(e,c);if(!Y(o)||o===``){let e=new Intl.NumberFormat(p.replace(/!/g,``),l);return f?e.formatToParts(s):e.format(s)}let m=Q_(e,o,p,n,u,d,`number format`);if(!Y(m))return r?-1:o;let h=n[m][o],g=$_(m,o,l),v=a.get(g);return v||(v=new Intl.NumberFormat(m,uh({},h,l)),a.set(g,v)),f?v.formatToParts(s):v.format(s)}var cv=[`localeMatcher`,`style`,`currency`,`currencyDisplay`,`currencySign`,`useGrouping`,`minimumIntegerDigits`,`minimumFractionDigits`,`maximumFractionDigits`,`minimumSignificantDigits`,`maximumSignificantDigits`,`compactDisplay`,`notation`,`signDisplay`,`unit`,`unitDisplay`,`roundingMode`,`roundingPriority`,`roundingIncrement`,`trailingZeroDisplay`];function lv(...e){let[t]=e,n=fh(),r=fh();if(!oh(t))throw l_(c_.INVALID_ARGUMENT);let i=t,a=tv(e,n,r,cv);return[n.key||``,i,n,a]}function uv(e,t,n){ev(e.__numberFormatters,t,n)}var dv=e=>e,fv=e=>``,pv=`text`,mv=e=>e.length===0?``:Eh(e),hv=Th;function gv(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function _v(e){let t=oh(e.pluralIndex)?e.pluralIndex:-1;return oh(e.named?.count)?e.named.count:oh(e.named?.n)?e.named.n:t}function vv(e={}){let t=e.locale,n=_v(e),r=Y(t)&&vh(e.pluralRules?.[t])?e.pluralRules[t]:gv,i=r===gv?void 0:gv,a=e=>e[r(n,e.length,i)],o=e.list||[],s=e=>o[e],c=e.named||fh();oh(e.pluralIndex)&&(c.count||=e.pluralIndex,c.n||=e.pluralIndex);let l=e=>c[e];function u(t,n){return(vh(e.messages)?e.messages(t,!!n):bh(e.messages)?e.messages[t]:!1)||(e.parent?e.parent.message(t):fv)}let d=t=>e.modifiers?e.modifiers[t]:dv,f=vh(e.processor?.normalize)?e.processor.normalize:mv,p=vh(e.processor?.interpolate)?e.processor.interpolate:hv,m={list:s,named:l,plural:a,linked:(e,...t)=>{let[n,r]=t,i=`text`,a=``;t.length===1?bh(n)?(a=n.modifier||a,i=n.type||i):Y(n)&&(a=n||a):t.length===2&&(Y(n)&&(a=n||a),Y(r)&&(i=r||i));let o=u(e,!0)(m),s=o===``||o===void 0?e:o,c=i===`vnode`&&_h(s)&&a?s[0]:s;return a?d(a)(c,i):c},message:u,type:Y(e.processor?.type)?e.processor.type:pv,interpolate:p,normalize:f,values:uh(fh(),o,c)};return m}var yv=()=>``,bv=e=>vh(e);function xv(e,...t){let{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:a,fallbackLocale:o,messages:s}=e,[c,l]=Ev(...t),u=yh(l.missingWarn)?l.missingWarn:e.missingWarn,d=yh(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=yh(l.escapeParameter)?l.escapeParameter:e.escapeParameter,p=!!l.resolvedMessage,m=Y(l.default)||yh(l.default)?yh(l.default)?a?c:()=>c:l.default:n?a?c:()=>c:null,h=n||m!=null&&(Y(m)||vh(m)),g=u_(e,l);f&&Sv(l);let[v,y,b]=p?[c,g,s[g]||fh()]:Cv(e,c,g,o,d,u),x=v,S=c;if(!p&&!(Y(x)||kg(x)||bv(x))&&h&&(x=m,S=x),!p&&(!(Y(x)||kg(x)||bv(x))||!Y(y)))return i?-1:c;let C=!1,w=bv(x)?x:wv(e,c,y,x,S,()=>{C=!0});if(C)return x;let T=Tv(e,w,vv(Ov(e,y,b,l))),E=r?r(T,c):T;if(f&&Y(E)&&(E=Uh(E)),__INTLIFY_PROD_DEVTOOLS__){let t={timestamp:Date.now(),key:Y(c)?c:bv(x)?x.key:``,locale:y||(bv(x)?x.locale:``),format:Y(x)?x:bv(x)?x.source:``,message:E};t.meta=uh({},e.__meta,V_()||{}),o_(t)}return E}function Sv(e){_h(e.list)?e.list=e.list.map(e=>Y(e)?Oh(e):e):bh(e.named)&&Object.keys(e.named).forEach(t=>{Y(e.named[t])&&(e.named[t]=Oh(e.named[t]))})}function Cv(e,t,n,r,i,a){let{messages:o,onWarn:s,messageResolver:c,localeFallbacker:l}=e,u=l(e,r,n),d=fh(),f,p=null;for(let n=0;n<u.length&&(f=u[n],d=o[f]||fh(),(p=c(d,t))===null&&(p=d[t]),!(Y(p)||kg(p)||bv(p)));n++)if(!Z_(f,u)){let n=J_(e,t,f,a,`translate`);n!==t&&(p=n)}return[p,f,d]}function wv(e,t,n,r,i,a){let{messageCompiler:o,warnHtmlMessage:s}=e;if(bv(r)){let e=r;return e.locale=e.locale||n,e.key=e.key||t,e}if(o==null){let e=(()=>r);return e.locale=n,e.key=t,e}let c=o(r,Dv(e,n,i,r,s,a));return c.locale=n,c.key=t,c.source=r,c}function Tv(e,t,n){return t(n)}function Ev(...e){let[t,n,r]=e,i=fh();if(!Y(t)&&!oh(t)&&!bv(t)&&!kg(t))throw l_(c_.INVALID_ARGUMENT);let a=oh(t)?String(t):(bv(t),t);return oh(n)?i.plural=n:Y(n)?i.default=n:wh(n)&&!lh(n)?i.named=n:_h(n)&&(i.list=n),oh(r)?i.plural=r:Y(r)?i.default=r:wh(r)&&uh(i,r),[a,i]}function Dv(e,t,n,r,i,a){return{locale:t,key:n,warnHtmlMessage:i,onError:e=>{throw a&&a(e),e},onCacheKey:e=>ih(t,n,e)}}function Ov(e,t,n,r){let{modifiers:i,pluralRules:a,messageResolver:o,fallbackLocale:s,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,d={locale:t,modifiers:i,pluralRules:a,messages:(r,i)=>{let a=o(n,r);if(a==null&&(u||i)){let[n,,i]=Cv(u||e,r,t,s,c,l);a=n??o(i,r)}if(Y(a)||kg(a)){let n=!1,i=wv(e,r,t,a,r,()=>{n=!0});return n?yv:i}return bv(a)?a:yv}};return e.processor&&(d.processor=e.processor),r.list&&(d.list=r.list),r.named&&(d.named=r.named),oh(r.plural)&&(d.pluralIndex=r.plural),d}Og();var kv=`VUE_QUERY_CLIENT`;function Av(e){return`${kv}${e?`:${e}`:``}`}function jv(e,t){Object.keys(e).forEach(n=>{e[n]=t[n]})}function Mv(e,t,n=``,r=0){if(t){let i=t(e,n,r);if(i===void 0&&Qt(e)||i!==void 0)return i}if(Array.isArray(e))return e.map((e,n)=>Mv(e,t,String(n),r+1));if(typeof e==`object`&&Pv(e)){let n=Object.entries(e).map(([e,n])=>[e,Mv(n,t,e,r+1)]);return Object.fromEntries(n)}return e}function Nv(e,t){return Mv(e,t)}function Z(e,t=!1){return Nv(e,(e,n,r)=>{if(r===1&&n===`queryKey`)return Z(e,!0);if(t&&Fv(e))return Z(e(),t);if(Qt(e))return Z(B(e),t)})}function Pv(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Fv(e){return typeof e==`function`}function Iv(e=``){if(!Jn())throw Error(`vue-query hooks can only be used inside setup() function or functions that support injection context.`);let t=qn(Av(e));if(!t)throw Error(`No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.`);return t}var Lv={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Rv=new class{#e=Lv;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function zv(e){setTimeout(e,0)}var Bv=typeof window>`u`||`Deno`in globalThis;function Vv(){}function Hv(e,t){return typeof e==`function`?e(t):e}function Uv(e){return typeof e==`number`&&e>=0&&e!==1/0}function Wv(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Gv(e,t){return typeof e==`function`?e(t):e}function Kv(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Jv(o,t.options))return!1}else if(!Xv(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function qv(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Yv(t.options.mutationKey)!==Yv(a))return!1}else if(!Xv(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Jv(e,t){return(t?.queryKeyHashFn||Yv)(e)}function Yv(e){return JSON.stringify(e,(e,t)=>ty(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Xv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!Xv(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Xv(e[r],t[r]))return!1;return!0}return!1}var Zv=Object.prototype.hasOwnProperty;function Qv(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ey(e)&&ey(t);if(!r&&!(ty(e)&&ty(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Zv.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Qv(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function $v(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ey(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ty(e){if(!ny(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ny(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ny(e){return Object.prototype.toString.call(e)===`[object Object]`}function ry(e){return new Promise(t=>{Rv.setTimeout(t,e)})}function iy(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Qv(e,t)}function ay(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function oy(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var sy=Symbol();function cy(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===sy?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ly(e,t){return typeof e==`function`?e(...t):!!e}function uy(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var dy=()=>Bv,fy=()=>dy(),py={isServer:fy,setIsServer(e){dy=e}},my=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hy=new class extends my{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},gy=zv;function _y(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=gy,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var vy=_y(),yy=new class extends my{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function by(e){return Math.min(1e3*2**e,3e4)}function xy(e){return(e??`online`)!==`online`||yy.isOnline()}var Sy=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Cy(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Vv);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Sy(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>hy.isFocused()&&(e.networkMode===`always`||yy.isOnline())&&e.canRun(),p=()=>xy(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(fy()?0:3),a=e.retryDelay??by,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),ry(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():g().then(v),s)}}var wy=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uv(this.gcTime)&&(this.#e=Rv.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(fy()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Rv.clearTimeout(this.#e),this.#e=void 0)}};function Ty(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{uy(e,()=>t.signal,()=>n=!0)},u=cy(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?oy:ay;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Dy:Ey,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ey(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Ey(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Dy(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Oy=class extends wy{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=jy(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=jy(this.options);e.data!==void 0&&(this.setState(Ay(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=iy(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Vv).catch(Vv):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Gv(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sy||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Gv(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Wv(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=cy(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ty(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Cy({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Sy&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Sy){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ky(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ay(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),vy.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ky(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xy(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ay(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function jy(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var My=class extends my{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Py(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fy(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fy(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Gv(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!$v(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Iy(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Gv(this.options.enabled,this.#t)!==Gv(t.enabled,this.#t)||Gv(this.options.staleTime,this.#t)!==Gv(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Gv(this.options.enabled,this.#t)!==Gv(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return $v(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Vv)),t}#h(e){return!fy()&&Gv(this.options.enabled,this.#t)!==!1&&Uv(e)}#g(){this.#b();let e=Gv(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Wv(this.#r.dataUpdatedAt,e)+1;this.#u=Rv.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=Rv.setInterval(()=>{(this.options.refetchIntervalInBackground||hy.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(Rv.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(Rv.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Py(e,t),o=i&&Iy(e,n,t,r);(a||o)&&(l={...l,...ky(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=iy(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=iy(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&g,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:Ly(e,t),refetch:this.refetch,isEnabled:Gv(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),$v(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();vy.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Ny(e,t){return Gv(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Gv(t.retryOnMount,e)!==!1)}function Py(e,t){return Ny(e,t)||e.state.data!==void 0&&Fy(e,t,t.refetchOnMount)}function Fy(e,t,n){if(Gv(t.enabled,e)!==!1&&Gv(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Ly(e,t)}return!1}function Iy(e,t,n,r){return(e!==t||Gv(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ly(e,n)}function Ly(e,t){return Gv(t.enabled,e)!==!1&&e.isStaleByTime(Gv(t.staleTime,e))}var Ry=class extends wy{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||zy(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Cy({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),vy.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function zy(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var By=class extends my{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Ry({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Vy(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Vy(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Vy(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Vy(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){vy.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>qv(t,e))}findAll(e={}){return this.getAll().filter(t=>qv(e,t))}notify(e){vy.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return vy.batch(()=>Promise.all(e.map(e=>e.continue().catch(Vv))))}};function Vy(e){return e.options.scope?.id}var Hy=class extends my{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),$v(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Yv(t.mutationKey)!==Yv(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??zy();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){vy.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Uy(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Wy=class extends my{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,vy.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!$v(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Uy(e,n).forEach(e=>{e.destroy()}),Uy(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=Qv(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new My(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&vy.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Gy=class extends my{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Jv(r,t),a=this.get(i);return a||(a=new Oy({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){vy.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Kv(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Kv(e,t)):t}notify(e){vy.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){vy.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){vy.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ky=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Gy,this.#t=e.mutationCache||new By,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=hy.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=yy.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Gv(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Hv(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return vy.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;vy.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return vy.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=vy.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Vv).catch(Vv)}invalidateQueries(e,t={}){return vy.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=vy.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Vv)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Vv)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Gv(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Gv(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Vv).catch(Vv)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Vv).catch(Vv)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return yy.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Yv(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Xv(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Yv(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Xv(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Jv(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===sy&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},qy=class extends Gy{find(e){return super.find(Z(e))}findAll(e={}){return super.findAll(Z(e))}},Jy=class extends By{find(e){return super.find(Z(e))}findAll(e={}){return super.findAll(Z(e))}},Yy=class extends Ky{constructor(e={}){let t={defaultOptions:e.defaultOptions,queryCache:e.queryCache||new qy,mutationCache:e.mutationCache||new Jy};super(t),this.isRestoring=z(!1)}isFetching(e={}){return super.isFetching(Z(e))}isMutating(e={}){return super.isMutating(Z(e))}getQueryData(e){return super.getQueryData(Z(e))}ensureQueryData(e){return super.ensureQueryData(Z(e))}getQueriesData(e){return super.getQueriesData(Z(e))}setQueryData(e,t,n={}){return super.setQueryData(Z(e),t,Z(n))}setQueriesData(e,t,n={}){return super.setQueriesData(Z(e),t,Z(n))}getQueryState(e){return super.getQueryState(Z(e))}removeQueries(e={}){return super.removeQueries(Z(e))}resetQueries(e={},t={}){return super.resetQueries(Z(e),Z(t))}cancelQueries(e={},t={}){return super.cancelQueries(Z(e),Z(t))}invalidateQueries(e={},t={}){let n=Z(e),r=Z(t);if(super.invalidateQueries({...n,refetchType:`none`},r),n.refetchType===`none`)return Promise.resolve();let i={...n,type:n.refetchType??n.type??`active`};return jn().then(()=>super.refetchQueries(i,r))}refetchQueries(e={},t={}){return super.refetchQueries(Z(e),Z(t))}query(e){return super.query(Z(e))}fetchQuery(e){return super.fetchQuery(Z(e))}prefetchQuery(e){return super.prefetchQuery(Z(e))}infiniteQuery(e){return super.infiniteQuery(Z(e))}fetchInfiniteQuery(e){return super.fetchInfiniteQuery(Z(e))}prefetchInfiniteQuery(e){return super.prefetchInfiniteQuery(Z(e))}setDefaultOptions(e){super.setDefaultOptions(Z(e))}setQueryDefaults(e,t){super.setQueryDefaults(Z(e),Z(t))}getQueryDefaults(e){return super.getQueryDefaults(Z(e))}setMutationDefaults(e,t){super.setMutationDefaults(Z(e),Z(t))}getMutationDefaults(e){return super.getMutationDefaults(Z(e))}},Xy={install:(e,t={})=>{let n=Av(t.queryClientKey),r;r=`queryClient`in t&&t.queryClient?t.queryClient:new Yy(`queryClientConfig`in t?t.queryClientConfig:void 0),py.isServer()||r.mount();let i=()=>{};if(t.clientPersister){r.isRestoring&&(r.isRestoring.value=!0);let[e,n]=t.clientPersister(r);i=e,n.then(()=>{r.isRestoring&&(r.isRestoring.value=!1),t.clientPersisterOnSuccess?.(r)})}let a=()=>{r.unmount(),i()};if(e.onUnmount)e.onUnmount(a);else{let t=e.unmount;e.unmount=function(){a(),t()}}e.provide(n,r)}};function Zy(e,t,n){let r=n||Iv(),i=G(()=>{let e=t;typeof e==`function`&&(e=e());let n=Z(e);typeof n.enabled==`function`&&(n.enabled=n.enabled());let i=r.defaultQueryOptions(n);return i._optimisticResults=r.isRestoring?.value?`isRestoring`:`optimistic`,i}),a=new e(r,i.value),o=i.value.shallow?Vt(a.getCurrentResult()):Bt(a.getCurrentResult()),s=()=>{};r.isRestoring&&$n(r.isRestoring,e=>{e||(s(),s=a.subscribe(e=>{jv(o,e)}))},{immediate:!0});let c=()=>{a.setOptions(i.value),jv(o,a.getCurrentResult())};$n(i,c),Oe(()=>{s()});let l=(...e)=>(c(),o.refetch(...e)),u=()=>new Promise((e,t)=>{let n=()=>{},r=()=>{if(i.value.enabled!==!1){a.setOptions(i.value);let r=a.getOptimisticResult(i.value);r.isStale?(n(),a.fetchOptimistic(i.value).then(e,n=>{ly(i.value.throwOnError,[n,a.getCurrentQuery()])?t(n):e(a.getCurrentResult())})):(n(),e(r))}};r(),n=$n(i,r)});$n(()=>o.error,e=>{if(o.isError&&!o.isFetching&&ly(i.value.throwOnError,[e,a.getCurrentQuery()]))throw e});let d=sn(i.value.shallow?Ut(o):Ht(o));for(let e in o)typeof o[e]==`function`&&(d[e]=o[e]);return d.suspense=u,d.refetch=l,d}function Qy(e,t){return Zy(My,e,t)}function $y({queries:e,...t},n){let r=n||Iv(),i=G(()=>B(typeof e==`function`?e():e).map(e=>{let t=Z(e);typeof t.enabled==`function`&&(t.enabled=e.enabled());let n=r.defaultQueryOptions(t);return n._optimisticResults=r.isRestoring?.value?`isRestoring`:`optimistic`,n})),a=new Wy(r,i.value,t),o=()=>{let[e,n]=a.getOptimisticResult(i.value,t.combine);return n(e.map((e,n)=>({...e,refetch:async(...e)=>{let[{[n]:r}]=a.getOptimisticResult(i.value,t.combine);return r.refetch(...e)}})))},s=$t(o()),c=()=>{};return r.isRestoring&&$n(r.isRestoring,e=>{e||(c(),c=a.subscribe(()=>{s.value=o()}),s.value=o())},{immediate:!0}),$n(i,e=>{a.setQueries(e,t),s.value=o()}),Oe(()=>{c()}),t.shallow?Ut(s):Ht(s)}function eb(e,t){let n=t||Iv(),r=G(()=>{let t=typeof e==`function`?e():e;return n.defaultMutationOptions(Z(t))}),i=new Hy(n,r.value),a=r.value.shallow?Vt(i.getCurrentResult()):Bt(i.getCurrentResult()),o=i.subscribe(e=>{jv(a,e)}),s=(...e)=>{i.mutate(e[0],e[1]).catch(()=>{})};$n(r,()=>{i.setOptions(r.value)}),Oe(()=>{o()});let c=sn(r.value.shallow?Ut(a):Ht(a));return $n(()=>a.error,e=>{if(e&&ly(r.value.throwOnError,[e]))throw e}),{...c,mutate:s,mutateAsync:a.mutate,reset:a.reset}}function tb(e,t,n){if(typeof t==`string`)e.style.viewTransitionName=t;else if(t&&typeof t==`object`){let[n,r]=Object.entries(t)?.[0]||[];r?e.style.viewTransitionName=n:e.style.viewTransitionName=`none`}else throw Error(`[vue-view-transitions]: The value of \`v-${n}\` should be either "string" or "object" but got "${typeof t}"`)}function nb(){return{install(e){e.directive(`view-transition-name`,{beforeMount(e,t){tb(e,t.value,`view-transition-name`)},beforeUpdate(e,t){tb(e,t.value,`view-transition-name`)}}),e.directive(`trans`,{beforeMount(e,t){tb(e,t.value,`trans`)},beforeUpdate(e,t){tb(e,t.value,`trans`)}})}}}function rb(e){let t={};return document.startViewTransition?t.captured=new Promise(n=>{let r=document.startViewTransition(async()=>{n(),e&&await e()});t.updateCallbackDone=r.updateCallbackDone,t.ready=r.ready,t.finished=r.finished,t.skipTransition=r.skipTransition.bind(r)}):(t.captured=Promise.resolve(),t.updateCallbackDone=t.ready=t.finished=e?Promise.resolve(e()):Promise.resolve(),t.skipTransition=()=>{},console.error(`[vue-view-transitions]: This browser doesn't support View Transitions Api, please check: https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#browser_compatibility`)),t}function ib(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}var ab=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})(),ob=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},sb={INIT:`@@redux/INIT`+ob(),REPLACE:`@@redux/REPLACE`+ob(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+ob()}};function cb(e){if(typeof e!=`object`||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function lb(e,t,n){var r;if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(ib(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(ib(1));return n(lb)(e,t)}if(typeof e!=`function`)throw Error(ib(2));var i=e,a=t,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){if(c)throw Error(ib(3));return a}function d(e){if(typeof e!=`function`)throw Error(ib(4));if(c)throw Error(ib(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw Error(ib(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),o=null}}}function f(e){if(!cb(e))throw Error(ib(7));if(e.type===void 0)throw Error(ib(8));if(c)throw Error(ib(9));try{c=!0,a=i(a,e)}finally{c=!1}for(var t=o=s,n=0;n<t.length;n++){var r=t[n];r()}return e}function p(e){if(typeof e!=`function`)throw Error(ib(10));i=e,f({type:sb.REPLACE})}function m(){var e,t=d;return e={subscribe:function(e){if(typeof e!=`object`||!e)throw Error(ib(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}},e[ab]=function(){return this},e}return f({type:sb.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:p},r[ab]=m,r}function Q(e,t,...n){if(ub()&&t===void 0)throw Error(`invariant requires an error message argument`);if(!e){let e;if(t===void 0)e=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{let r=0;e=Error(t.replace(/%s/g,function(){return n[r++]})),e.name=`Invariant Violation`}throw e.framesToPop=1,e}}function ub(){return typeof process<`u`&&!0}function db(e,t,n){return t.split(`.`).reduce((e,t)=>e&&e[t]?e[t]:n||null,e)}function fb(e,t){return e.filter(e=>e!==t)}function pb(e){return typeof e==`object`}function mb(e,t){let n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);let i=[];return n.forEach((e,t)=>{e===1&&i.push(t)}),i}function hb(e,t){return e.filter(e=>t.indexOf(e)>-1)}var gb=`dnd-core/INIT_COORDS`,_b=`dnd-core/BEGIN_DRAG`,vb=`dnd-core/PUBLISH_DRAG_SOURCE`,yb=`dnd-core/HOVER`,bb=`dnd-core/DROP`,xb=`dnd-core/END_DRAG`;function Sb(e,t){return{type:gb,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var Cb={type:gb,payload:{clientOffset:null,sourceClientOffset:null}};function wb(e){return function(t=[],n={publishSource:!0}){let{publishSource:r=!0,clientOffset:i,getSourceClientOffset:a}=n,o=e.getMonitor(),s=e.getRegistry();e.dispatch(Sb(i)),Tb(t,o,s);let c=Ob(t,o);if(c==null){e.dispatch(Cb);return}let l=null;if(i){if(!a)throw Error(`getSourceClientOffset must be defined`);Eb(a),l=a(c)}e.dispatch(Sb(i,l));let u=s.getSource(c).beginDrag(o,c);return u==null?void 0:(Db(u),s.pinSource(c),{type:_b,payload:{itemType:s.getSourceType(c),item:u,sourceId:c,clientOffset:i||null,sourceClientOffset:l||null,isSourcePublic:!!r}})}}function Tb(e,t,n){Q(!t.isDragging(),`Cannot call beginDrag while dragging.`),e.forEach(function(e){Q(n.getSource(e),`Expected sourceIds to be registered.`)})}function Eb(e){Q(typeof e==`function`,`When clientOffset is provided, getSourceClientOffset must be a function.`)}function Db(e){Q(pb(e),`Item must be an object.`)}function Ob(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function kb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ab(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){kb(e,t,n[t])})}return e}function jb(e){return function(t={}){let n=e.getMonitor(),r=e.getRegistry();Mb(n),Fb(n).forEach((i,a)=>{let o={type:bb,payload:{dropResult:Ab({},t,Nb(i,a,r,n))}};e.dispatch(o)})}}function Mb(e){Q(e.isDragging(),`Cannot call drop while not dragging.`),Q(!e.didDrop(),`Cannot call drop twice during one drag operation.`)}function Nb(e,t,n,r){let i=n.getTarget(e),a=i?i.drop(r,e):void 0;return Pb(a),a===void 0&&(a=t===0?{}:r.getDropResult()),a}function Pb(e){Q(e===void 0||pb(e),`Drop result must either be an object or undefined.`)}function Fb(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Ib(e){return function(){let t=e.getMonitor(),n=e.getRegistry();Lb(t);let r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:xb}}}function Lb(e){Q(e.isDragging(),`Cannot call endDrag while not dragging.`)}function Rb(e,t){return t===null?e===null:Array.isArray(e)?e.some(e=>e===t):e===t}function zb(e){return function(t,{clientOffset:n}={}){Bb(t);let r=t.slice(0),i=e.getMonitor(),a=e.getRegistry();return Hb(r,a,i.getItemType()),Vb(r,i,a),Ub(r,i,a),{type:yb,payload:{targetIds:r,clientOffset:n||null}}}}function Bb(e){Q(Array.isArray(e),`Expected targetIds to be an array.`)}function Vb(e,t,n){Q(t.isDragging(),`Cannot call hover while not dragging.`),Q(!t.didDrop(),`Cannot call hover after drop.`);for(let t=0;t<e.length;t++){let r=e[t];Q(e.lastIndexOf(r)===t,`Expected targetIds to be unique in the passed array.`),Q(n.getTarget(r),`Expected targetIds to be registered.`)}}function Hb(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];Rb(t.getTargetType(i),n)||e.splice(r,1)}}function Ub(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}function Wb(e){return function(){if(e.getMonitor().isDragging())return{type:vb}}}function Gb(e){return{beginDrag:wb(e),publishDragSource:Wb(e),hover:zb(e),drop:jb(e),endDrag:Ib(e)}}var Kb=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function n(n){return(...r)=>{let i=n.apply(e,r);i!==void 0&&t(i)}}let r=Gb(this);return Object.keys(r).reduce((e,t)=>{let i=r[t];return e[t]=n(i),e},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function qb(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Jb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Yb(e){let{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:Jb(qb(t,r),n)}function Xb(e){let{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:Jb(t,n)}var Zb=[],Qb=[];Zb.__IS_NONE__=!0,Qb.__IS_ALL__=!0;function $b(e,t){return e===Zb?!1:e===Qb||t===void 0||hb(t,e).length>0}var ex=class{subscribeToStateChange(e,t={}){let{handlerIds:n}=t;Q(typeof e==`function`,`listener must be a function.`),Q(n===void 0||Array.isArray(n),`handlerIds, when specified, must be an array of strings.`);let r=this.store.getState().stateId;return this.store.subscribe(()=>{let t=this.store.getState(),i=t.stateId;try{i===r||i===r+1&&!$b(t.dirtyHandlerIds,n)||e()}finally{r=i}})}subscribeToOffsetChange(e){Q(typeof e==`function`,`listener must be a function.`);let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return Q(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return Q(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:Rb(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return Q(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:n}=t;if(!this.isDragging())return!1;let r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!Rb(r,i))return!1;let a=this.getTargetIds();if(!a.length)return!1;let o=a.indexOf(e);return n?o===a.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Yb(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Xb(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},tx=typeof global<`u`?global:self,nx=tx.MutationObserver||tx.WebKitMutationObserver;function rx(e){return function(){let t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}function ix(e){let t=1,n=new nx(e),r=document.createTextNode(``);return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}var ax=typeof nx==`function`?ix:rx,ox=class{enqueueTask(e){let{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=ax(this.flush),this.requestErrorThrow=rx(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},sx=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},cx=class{create(e){let t=this.freeTasks,n=t.length?t.pop():new sx(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}},lx=new ox,ux=new cx(lx.registerPendingError);function dx(e){lx.enqueueTask(ux.create(e))}var fx=`dnd-core/ADD_SOURCE`,px=`dnd-core/ADD_TARGET`,mx=`dnd-core/REMOVE_SOURCE`,hx=`dnd-core/REMOVE_TARGET`;function gx(e){return{type:fx,payload:{sourceId:e}}}function _x(e){return{type:px,payload:{targetId:e}}}function vx(e){return{type:mx,payload:{sourceId:e}}}function yx(e){return{type:hx,payload:{targetId:e}}}function bx(e){Q(typeof e.canDrag==`function`,`Expected canDrag to be a function.`),Q(typeof e.beginDrag==`function`,`Expected beginDrag to be a function.`),Q(typeof e.endDrag==`function`,`Expected endDrag to be a function.`)}function xx(e){Q(typeof e.canDrop==`function`,`Expected canDrop to be a function.`),Q(typeof e.hover==`function`,`Expected hover to be a function.`),Q(typeof e.drop==`function`,`Expected beginDrag to be a function.`)}function Sx(e,t){if(t&&Array.isArray(e)){e.forEach(e=>Sx(e,!1));return}Q(typeof e==`string`||typeof e==`symbol`,t?`Type can only be a string, a symbol, or an array of either.`:`Type can only be a string or a symbol.`)}var Cx;(function(e){e.SOURCE=`SOURCE`,e.TARGET=`TARGET`})(Cx||={});var wx=0;function Tx(){return wx++}function Ex(e){let t=Tx().toString();switch(e){case Cx.SOURCE:return`S${t}`;case Cx.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function Dx(e){switch(e[0]){case`S`:return Cx.SOURCE;case`T`:return Cx.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function Ox(e,t){let n=e.entries(),r=!1;do{let{done:e,value:[,i]}=n.next();if(i===t)return!0;r=!!e}while(!r);return!1}var kx=class{addSource(e,t){Sx(e),bx(t);let n=this.addHandler(Cx.SOURCE,e,t);return this.store.dispatch(gx(n)),n}addTarget(e,t){Sx(e,!0),xx(t);let n=this.addHandler(Cx.TARGET,e,t);return this.store.dispatch(_x(n)),n}containsHandler(e){return Ox(this.dragSources,e)||Ox(this.dropTargets,e)}getSource(e,t=!1){return Q(this.isSourceId(e),`Expected a valid source ID.`),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return Q(this.isTargetId(e),`Expected a valid target ID.`),this.dropTargets.get(e)}getSourceType(e){return Q(this.isSourceId(e),`Expected a valid source ID.`),this.types.get(e)}getTargetType(e){return Q(this.isTargetId(e),`Expected a valid target ID.`),this.types.get(e)}isSourceId(e){return Dx(e)===Cx.SOURCE}isTargetId(e){return Dx(e)===Cx.TARGET}removeSource(e){Q(this.getSource(e),`Expected an existing source.`),this.store.dispatch(vx(e)),dx(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){Q(this.getTarget(e),`Expected an existing target.`),this.store.dispatch(yx(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);Q(t,`Expected an existing source.`),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){Q(this.pinnedSource,`No source is pinned at the time.`),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){let r=Ex(e);return this.types.set(r,t),e===Cx.SOURCE?this.dragSources.set(r,n):e===Cx.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},Ax=(e,t)=>e===t;function jx(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Mx(e,t,n=Ax){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function Nx(e=Zb,t){switch(t.type){case yb:break;case fx:case px:case hx:case mx:return Zb;case _b:case vb:case xb:case bb:default:return Qb}let{targetIds:n=[],prevTargetIds:r=[]}=t.payload,i=mb(n,r);if(!(i.length>0||!Mx(n,r)))return Zb;let a=r[r.length-1],o=n[n.length-1];return a!==o&&(a&&i.push(a),o&&i.push(o)),i}function Px(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Px(e,t,n[t])})}return e}var Ix={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Lx(e=Ix,t){let{payload:n}=t;switch(t.type){case gb:case _b:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case yb:return jx(e.clientOffset,n.clientOffset)?e:Fx({},e,{clientOffset:n.clientOffset});case xb:case bb:return Ix;default:return e}}function Rx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Rx(e,t,n[t])})}return e}var Bx={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Vx(e=Bx,t){let{payload:n}=t;switch(t.type){case _b:return zx({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case vb:return zx({},e,{isSourcePublic:!0});case yb:return zx({},e,{targetIds:n.targetIds});case hx:return e.targetIds.indexOf(n.targetId)===-1?e:zx({},e,{targetIds:fb(e.targetIds,n.targetId)});case bb:return zx({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case xb:return zx({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Hx(e=0,t){switch(t.type){case fx:case px:return e+1;case mx:case hx:return e-1;default:return e}}function Ux(e=0){return e+1}function Wx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Wx(e,t,n[t])})}return e}function Kx(e={},t){return{dirtyHandlerIds:Nx(e.dirtyHandlerIds,{type:t.type,payload:Gx({},t.payload,{prevTargetIds:db(e,`dragOperation.targetIds`,[])})}),dragOffset:Lx(e.dragOffset,t),refCount:Hx(e.refCount,t),dragOperation:Vx(e.dragOperation,t),stateId:Ux(e.stateId)}}function qx(e,t=void 0,n={},r=!1){let i=Jx(r),a=new Kb(i,new ex(i,new kx(i))),o=e(a,t,n);return a.receiveBackend(o),a}function Jx(e){let t=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__;return lb(Kx,e&&t&&t({name:`dnd-core`,instanceId:`dnd-core`}))}var Yx=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),Xx=t(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n():e.getSize=n()})(window,function(){function e(e){let t=parseFloat(e);return e.indexOf(`%`)==-1&&!isNaN(t)&&t}let t=[`paddingLeft`,`paddingRight`,`paddingTop`,`paddingBottom`,`marginLeft`,`marginRight`,`marginTop`,`marginBottom`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`borderBottomWidth`];t.length;function n(){let e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};return t.forEach(t=>{e[t]=0}),e}function r(r){if(typeof r==`string`&&(r=document.querySelector(r)),!(r&&typeof r==`object`&&r.nodeType))return;let i=getComputedStyle(r);if(i.display==`none`)return n();let a={};a.width=r.offsetWidth,a.height=r.offsetHeight;let o=a.isBorderBox=i.boxSizing==`border-box`;t.forEach(e=>{let t=i[e],n=parseFloat(t);a[e]=isNaN(n)?0:n});let s=a.paddingLeft+a.paddingRight,c=a.paddingTop+a.paddingBottom,l=a.marginLeft+a.marginRight,u=a.marginTop+a.marginBottom,d=a.borderLeftWidth+a.borderRightWidth,f=a.borderTopWidth+a.borderBottomWidth,p=e(i.width);p!==!1&&(a.width=p+(o?0:s+d));let m=e(i.height);return m!==!1&&(a.height=m+(o?0:c+f)),a.innerWidth=a.width-(s+d),a.innerHeight=a.height-(c+f),a.outerWidth=a.width+l,a.outerHeight=a.height+u,a}return r})})),Zx=t(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n():e.EvEmitter=n()})(typeof window<`u`?window:e,function(){function e(){}let t=e.prototype;return t.on=function(e,t){if(!e||!t)return this;let n=this._events=this._events||{},r=n[e]=n[e]||[];return r.includes(t)||r.push(t),this},t.once=function(e,t){if(!e||!t)return this;this.on(e,t);let n=this._onceEvents=this._onceEvents||{},r=n[e]=n[e]||{};return r[t]=!0,this},t.off=function(e,t){let n=this._events&&this._events[e];if(!n||!n.length)return this;let r=n.indexOf(t);return r!=-1&&n.splice(r,1),this},t.emitEvent=function(e,t){let n=this._events&&this._events[e];if(!n||!n.length)return this;n=n.slice(0),t||=[];let r=this._onceEvents&&this._onceEvents[e];for(let i of n)r&&r[i]&&(this.off(e,i),delete r[i]),i.apply(this,t);return this},t.allOff=function(){return delete this._events,delete this._onceEvents,this},e})})),Qx=t(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n(e,Zx()):e.Unidragger=n(e,e.EvEmitter)})(typeof window<`u`?window:e,function(e,t){function n(){}let r=n.prototype=Object.create(t.prototype);r.handleEvent=function(e){let t=`on`+e.type;this[t]&&this[t](e)};let i,a;`ontouchstart`in e?(i=`touchstart`,a=[`touchmove`,`touchend`,`touchcancel`]):e.PointerEvent?(i=`pointerdown`,a=[`pointermove`,`pointerup`,`pointercancel`]):(i=`mousedown`,a=[`mousemove`,`mouseup`]),r.touchActionValue=`none`,r.bindHandles=function(){this._bindHandles(`addEventListener`,this.touchActionValue)},r.unbindHandles=function(){this._bindHandles(`removeEventListener`,``)},r._bindHandles=function(t,n){this.handles.forEach(r=>{r[t](i,this),r[t](`click`,this),e.PointerEvent&&(r.style.touchAction=n)})},r.bindActivePointerEvents=function(){a.forEach(t=>{e.addEventListener(t,this)})},r.unbindActivePointerEvents=function(){a.forEach(t=>{e.removeEventListener(t,this)})},r.withPointer=function(e,t){t.pointerId===this.pointerIdentifier&&this[e](t,t)},r.withTouch=function(e,t){let n;for(let e of t.changedTouches)e.identifier===this.pointerIdentifier&&(n=e);n&&this[e](t,n)},r.onmousedown=function(e){this.pointerDown(e,e)},r.ontouchstart=function(e){this.pointerDown(e,e.changedTouches[0])},r.onpointerdown=function(e){this.pointerDown(e,e)};let o=[`TEXTAREA`,`INPUT`,`SELECT`,`OPTION`],s=[`radio`,`checkbox`,`button`,`submit`,`image`,`file`];return r.pointerDown=function(e,t){let n=o.includes(e.target.nodeName),r=s.includes(e.target.type),i=!n||r;this.isPointerDown||e.button||!i||(this.isPointerDown=!0,this.pointerIdentifier=t.pointerId===void 0?t.identifier:t.pointerId,this.pointerDownPointer={pageX:t.pageX,pageY:t.pageY},this.bindActivePointerEvents(),this.emitEvent(`pointerDown`,[e,t]))},r.onmousemove=function(e){this.pointerMove(e,e)},r.onpointermove=function(e){this.withPointer(`pointerMove`,e)},r.ontouchmove=function(e){this.withTouch(`pointerMove`,e)},r.pointerMove=function(e,t){let n={x:t.pageX-this.pointerDownPointer.pageX,y:t.pageY-this.pointerDownPointer.pageY};this.emitEvent(`pointerMove`,[e,t,n]),!this.isDragging&&this.hasDragStarted(n)&&this.dragStart(e,t),this.isDragging&&this.dragMove(e,t,n)},r.hasDragStarted=function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3},r.dragStart=function(e,t){this.isDragging=!0,this.isPreventingClicks=!0,this.emitEvent(`dragStart`,[e,t])},r.dragMove=function(e,t,n){this.emitEvent(`dragMove`,[e,t,n])},r.onmouseup=function(e){this.pointerUp(e,e)},r.onpointerup=function(e){this.withPointer(`pointerUp`,e)},r.ontouchend=function(e){this.withTouch(`pointerUp`,e)},r.pointerUp=function(e,t){this.pointerDone(),this.emitEvent(`pointerUp`,[e,t]),this.isDragging?this.dragEnd(e,t):this.staticClick(e,t)},r.dragEnd=function(e,t){this.isDragging=!1,setTimeout(()=>delete this.isPreventingClicks),this.emitEvent(`dragEnd`,[e,t])},r.pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this.unbindActivePointerEvents(),this.emitEvent(`pointerDone`)},r.onpointercancel=function(e){this.withPointer(`pointerCancel`,e)},r.ontouchcancel=function(e){this.withTouch(`pointerCancel`,e)},r.pointerCancel=function(e,t){this.pointerDone(),this.emitEvent(`pointerCancel`,[e,t])},r.onclick=function(e){this.isPreventingClicks&&e.preventDefault()},r.staticClick=function(e,t){let n=e.type===`mouseup`;n&&this.isIgnoringMouseUp||(this.emitEvent(`staticClick`,[e,t]),n&&(this.isIgnoringMouseUp=!0,setTimeout(()=>{delete this.isIgnoringMouseUp},400)))},n})})),$x={class:`controll`},eS={class:`controll__item controll__item--circle`},tS={class:`controll__pan controll__item--circle__inner`},nS={class:`controll__pan__up controll__item--circle__inner__up`},rS={class:`controll__pan__right controll__item--circle__inner__right`},iS={class:`controll__pan__down controll__item--circle__inner__down`},aS={class:`controll__pan__left controll__item--circle__inner__left`},oS={class:`controll__home controll__item controll__item--list-item`},sS={class:`controll__zoom-in controll__item controll__item--list-item`},cS={class:`controll__zoom-in controll__item controll__item--list-item`},lS=Mr({__name:`ControlButtons`,emits:[`buttondown`,`buttonup`],setup(e,{emit:t}){let n=t;function r(e,t){n(`buttondown`,{key:t})}function i(e,t){n(`buttonup`,{key:t})}return(e,t)=>(H(),uo(`div`,{id:`v-zoomable-control-btns`,class:`controll__buttons`,onDblclick:t[31]||=vc(()=>{},[`stop`]),onMousedown:t[32]||=vc(()=>{},[`stop`])},[U(`ul`,$x,[U(`li`,eS,[U(`ul`,tS,[U(`li`,nS,[U(`a`,{onPointerdown:t[0]||=e=>r(e,`pan-up`),onPointerup:t[1]||=e=>i(e,`pan-up`),onPointercancel:t[2]||=e=>i(e,`pan-up`),onPointerleave:t[3]||=e=>i(e,`pan-up`),onContextmenu:t[4]||=vc(()=>{},[`prevent`])},t[33]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-chevron-up`},[U(`polyline`,{points:`18 15 12 9 6 15`})],-1)],32)]),U(`li`,rS,[U(`a`,{onPointerdown:t[5]||=e=>r(e,`pan-right`),onPointerup:t[6]||=e=>i(e,`pan-right`),onPointercancel:t[7]||=e=>i(e,`pan-right`),onPointerleave:t[8]||=e=>i(e,`pan-right`),onContextmenu:t[9]||=vc(()=>{},[`prevent`])},t[34]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-chevron-right`},[U(`polyline`,{points:`9 18 15 12 9 6`})],-1)],32)]),U(`li`,iS,[U(`a`,{onPointerdown:t[10]||=e=>r(e,`pan-down`),onPointerup:t[11]||=e=>i(e,`pan-down`),onPointercancel:t[12]||=e=>i(e,`pan-down`),onPointerleave:t[13]||=e=>i(e,`pan-down`),onContextmenu:t[14]||=vc(()=>{},[`prevent`])},t[35]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-chevron-down`},[U(`polyline`,{points:`6 9 12 15 18 9`})],-1)],32)]),U(`li`,aS,[U(`a`,{onPointerdown:t[15]||=e=>r(e,`pan-left`),onPointercancel:t[16]||=e=>i(e,`pan-left`),onPointerup:t[17]||=e=>i(e,`pan-left`),onPointerleave:t[18]||=e=>i(e,`pan-left`),onContextmenu:t[19]||=vc(()=>{},[`prevent`])},t[36]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-chevron-left`},[U(`polyline`,{points:`15 18 9 12 15 6`})],-1)],32)])])]),U(`li`,oS,[U(`a`,{onPointerdown:t[20]||=e=>r(e,`home`)},t[37]||=[xo(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-minimize-2" data-v-3ba139de><polyline points="4 14 10 14 10 20" data-v-3ba139de></polyline><polyline points="20 10 14 10 14 4" data-v-3ba139de></polyline><line x1="14" y1="10" x2="21" y2="3" data-v-3ba139de></line><line x1="3" y1="21" x2="10" y2="14" data-v-3ba139de></line></svg>`,1)],32)]),U(`li`,sS,[U(`a`,{onPointerdown:t[21]||=e=>r(e,`zoom-in`),onPointerup:t[22]||=e=>i(e,`zoom-in`),onPointercancel:t[23]||=e=>i(e,`zoom-in`),onPointerleave:t[24]||=e=>i(e,`zoom-in`),onContextmenu:t[25]||=vc(()=>{},[`prevent`])},t[38]||=[xo(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-zoom-in" data-v-3ba139de><circle cx="11" cy="11" r="8" data-v-3ba139de></circle><line x1="21" y1="21" x2="16.65" y2="16.65" data-v-3ba139de></line><line x1="11" y1="8" x2="11" y2="14" data-v-3ba139de></line><line x1="8" y1="11" x2="14" y2="11" data-v-3ba139de></line></svg>`,1)],32)]),U(`li`,cS,[U(`a`,{onPointerdown:t[26]||=e=>r(e,`zoom-out`),onPointerup:t[27]||=e=>i(e,`zoom-out`),onPointercancel:t[28]||=e=>i(e,`zoom-out`),onPointerleave:t[29]||=e=>i(e,`zoom-out`),onContextmenu:t[30]||=vc(()=>{},[`prevent`])},t[39]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-zoom-out`},[U(`circle`,{cx:`11`,cy:`11`,r:`8`}),U(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`}),U(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`})],-1)],32)])])],32))}}),uS=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},dS=uS(lS,[[`__scopeId`,`data-v-3ba139de`]]);function fS(){let e=0;function t(t,n,r,i){t(),e=window.setTimeout(()=>{e=window.setInterval(()=>{n()},i)},r)}function n(){e&&=(window.clearInterval(e),0)}return{startHold:t,clearHold:n}}var pS=`control-btn`;function mS({props:e,transform:t}){let n=fS();function r(r){n.startHold(()=>{t.changeZoom(r*e.buttonZoomStep*.5,pS)},()=>{t.changeZoom(r*e.buttonZoomStep*.5,pS)},300,50)}function i(t){if(!e.disabled)switch(t.key){case`home`:s();break;case`zoom-in`:r(1);break;case`zoom-out`:r(-1);break;case`pan-left`:o({x:1,y:0});break;case`pan-right`:o({x:-1,y:0});break;case`pan-up`:o({x:0,y:1});break;case`pan-down`:o({x:0,y:-1})}}function a(e){n.clearHold()}function o(r){n.startHold(()=>{t.changePan(r.x*e.buttonPanStep,r.y*e.buttonPanStep,pS)},()=>{t.changePan(r.x*e.buttonPanStep,r.y*e.buttonPanStep,pS)},300,50)}function s(){t.goHome(pS)}return{onButtonDown:i,onButtonUp:a}}function hS({props:e,transform:t}){let n={x:0,y:0};function r(t){e.disabled||t.pointerType!==`mouse`||!e.mouseEnabled||(n={x:t.clientX,y:t.clientY},document.addEventListener(`pointermove`,a,{passive:!1}),document.addEventListener(`pointerup`,function(e){document.removeEventListener(`pointermove`,a)}),document.addEventListener(`pointerleave`,function(e){document.removeEventListener(`pointermove`,a)}),document.addEventListener(`pointercancel`,function(e){document.removeEventListener(`pointermove`,a)}))}function i(n){if(e.disabled||!e.dblClickEnabled||!e.zoomEnabled)return;let r={x:n.clientX,y:n.clientY};t.changeZoom(e.dblClickZoomStep,`dblClick`,r)}function a(r){if(e.disabled||!e.panEnabled||r.pointerType!==`mouse`||!e.mouseEnabled)return;let i={x:r.clientX-n.x,y:r.clientY-n.y};t.changePan(i.x,i.y,r.pointerType),n={x:r.clientX,y:r.clientY},r.preventDefault()}return{onPointerDown:r,onDblClick:i}}function gS({props:e,transform:t}){let n=z({}),r=z(0),i=null;function a(n){if(e.disabled||!e.touchEnabled||!e.panEnabled&&!e.zoomEnabled||(n.preventDefault(),n.touches.length<1))return;let a=n.touches.item(0);if(!a)return;let s=0,c={x:a.clientX,y:a.clientY};if(n.touches.length===2){let e=n.touches.item(1),i=o({x:a?a.clientX:0,y:a?a.clientY:0},{x:e?e.clientX:0,y:e?e.clientY:0});r.value<=0?(r.value=i.distance,s=0):(s=i.distance/r.value*t.zoom.value-t.zoom.value,r.value=i.distance),c=i.center}if(e.zoomEnabled&&t.changeZoom(s,`touch`,c),i===null){i={x:c.x,y:c.y};return}let l={x:c.x-i.x,y:c.y-i.y};e.panEnabled&&t.changePan(l.x,l.y,`touch`),i={x:c.x,y:c.y}}function o(e,t){return{distance:Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),center:{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}}function s(t){e.disabled||!e.touchEnabled||(i=null,document.addEventListener(`touchmove`,a,{passive:!1}),document.addEventListener(`touchend`,function(e){t.touches.length<2&&(r.value=-1),document.removeEventListener(`touchmove`,a)}))}return{onTouchStart:s,touchCount:G(()=>Object.keys(n.value).length)}}function _S({props:e,onChange:t,container:n,target:r}){let i=z({x:0,y:0}),a=z(0);$r(()=>{a.value=e.minZoom,i.value={x:e.pan==null?e.initialPanX:e.pan.x,y:e.pan==null?e.initialPanY:e.pan.y},e.zoom?a.value=e.zoom:e.initialZoom>=e.minZoom&&e.initialZoom<=e.maxZoom&&(a.value=e.initialZoom)}),$n(()=>e.zoom,()=>{isNaN(e.zoom)||(a.value=e.zoom)}),$n(()=>e.pan,()=>{e.pan&&(i.value.x=e.pan.x,i.value.y=e.pan.y)},{deep:!0});function o(r,o,c){if(isNaN(r)||r===0)return;let l=a.value,u=a.value+r;if(u>e.maxZoom?u=e.maxZoom:u<e.minZoom&&(u=e.minZoom),!(Math.abs(l-u)<1e-4)){if(a.value=u,e.zoomOrigin===`center`&&(c=vS(n.value)),e.zoomOrigin!==`content-center`){c||=vS(n.value);let e=yS(n.value,i.value),t={x:(u-l)*((e.x-c.x)/l),y:(u-l)*((e.y-c.y)/l)};s(t.x,t.y,`zoom`)}t(`zoom`,{zoom:u,delta:{zoom:r,pan:{x:0,y:0}},pan:{x:i.value.x,y:i.value.y,deltaX:0,deltaY:0},type:o})}}function s(e,n,r){isNaN(e)&&(e=0),isNaN(n)&&(n=0),i.value={x:i.value.x+e,y:i.value.y+n},t(`panned`,{zoom:a.value,delta:{zoom:0,pan:{x:e,y:n}},pan:{x:i.value.x,y:i.value.y,deltaX:e,deltaY:n},type:r})}function c(n){a.value=e.initialZoom,t(`zoom`,{zoom:a.value,pan:{x:i.value.x,y:i.value.y,deltaX:0,deltaY:0},type:n});let r={x:e.initialPanX-i.value.x,y:e.initialPanY-i.value.y};i.value={x:e.initialPanX,y:e.initialPanY},t(`panned`,{zoom:a.value,pan:{x:i.value.x,y:i.value.y,deltaX:r.x,deltaY:r.y},type:n})}return{zoom:G(()=>a.value),pan:G(()=>i.value),setZoom:e=>{a.value=e},setPan:e=>{i.value=e},changeZoom:o,changePan:s,goHome:c}}function vS(e){let t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}function yS(e,t){let n=vS(e);return{x:n.x+t.x,y:n.y+t.y}}function bS({props:e,transform:t}){function n(n){if(e.disabled||!e.wheelEnabled||!e.zoomEnabled)return;let r=Math.abs(n.deltaY)>0?n.deltaY:n.deltaX,i=e.wheelZoomStep*-1*r/Math.abs(r),a={x:n.clientX,y:n.clientY};t.changeZoom(i,`wheel`,a),n.preventDefault()}return{onWheel:n}}function xS({props:e,onChange:t,container:n,target:r}){let i=_S({props:e,onChange:t,container:n,target:r}),a=gS({props:e,transform:i}),o=bS({props:e,transform:i}),s=hS({props:e,transform:i}),c=mS({props:e,transform:i});return{zoom:i.zoom,pan:i.pan,setZoom:i.setZoom,setPan:i.setPan,onWheel:o.onWheel,onTouchStart:a.onTouchStart,onButtonUp:c.onButtonUp,onButtonDown:c.onButtonDown,onPointerDown:s.onPointerDown,onDblClick:s.onDblClick}}var SS=uS(Mr({__name:`VueZoomable`,props:{zoom:{type:Number,default:null},pan:{type:Object,default:null},selector:{type:String,default:`* > *`},maxZoom:{type:Number,default:3},minZoom:{type:Number,default:.5},initialPanX:{type:Number,default:0},initialPanY:{type:Number,default:0},initialZoom:{type:Number,default:.5},dblClickZoomStep:{type:Number,default:.4},wheelZoomStep:{type:Number,default:.4},panEnabled:{type:Boolean,default:!0},zoomEnabled:{type:Boolean,default:!0},mouseEnabled:{type:Boolean,default:!0},touchEnabled:{type:Boolean,default:!0},dblClickEnabled:{type:Boolean,default:!0},wheelEnabled:{type:Boolean,default:!0},enableControlButton:{type:Boolean,default:!0},buttonPanStep:{type:Number,default:15},buttonZoomStep:{type:Number,default:.1},disabled:{type:Boolean,default:!1},zoomOrigin:{type:String,default:`pointer`}},emits:[`panned`,`zoom`,`update:zoom`,`update:pan`],setup(e,{emit:t}){let n=t,r=e,i=z(),a=G(()=>i.value?.querySelector(r.selector)),o=xS({props:r,onChange:s,container:i,target:a});function s(e,t){e===`zoom`?n(`update:zoom`,t.zoom):e===`panned`&&n(`update:pan`,t.pan),n(e,t)}let c=G(()=>`translate(${o.pan.value.x}px, ${o.pan.value.y}px) scale(${o.zoom.value})`);function l(){a.value&&(a.value.style.transform=c.value,a.value.style.transformOrigin=`center center`,a.value.style.transition=`transform 0.07s ease-out`,a.value.style.transformBox=`fill-box`)}return $n(c,()=>{l()},{flush:`post`}),$r(()=>{l()}),(e,t)=>(H(),uo(`div`,{ref_key:`container`,ref:i,class:de(e.$style.container),onDblclick:t[0]||=(...e)=>B(o).onDblClick&&B(o).onDblClick(...e),onPointerdown:t[1]||=(...e)=>B(o).onPointerDown&&B(o).onPointerDown(...e),onWheel:t[2]||=(...e)=>B(o).onWheel&&B(o).onWheel(...e),onTouchstart:t[3]||=(...e)=>B(o).onTouchStart&&B(o).onTouchStart(...e)},[vi(e.$slots,`default`,{},void 0,!0),vi(e.$slots,`buttons`,{},()=>[B(r).enableControlButton?(H(),fo(dS,{key:0,onButtondown:B(o).onButtonDown,onButtonup:B(o).onButtonUp},null,8,[`onButtondown`,`onButtonup`])):So(``,!0)],!0)],34))}}),[[`__cssModules`,{$style:{container:`_container_irdvc_2`,buttons:`_buttons_irdvc_11`}}],[`__scopeId`,`data-v-fce7d501`]]),CS;(function(e){e.Unimplemented=`UNIMPLEMENTED`,e.Unavailable=`UNAVAILABLE`})(CS||={});var wS=class extends Error{constructor(e,t,n){super(e),this.message=e,this.code=t,this.data=n}},TS=e=>e?.androidBridge?`android`:e?.webkit?.messageHandlers?.bridge?`ios`:`web`,ES=e=>{let t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},r=n.Plugins=n.Plugins||{},i=()=>t===null?TS(e):t.name,a=()=>i()!==`web`,o=e=>!!(l.get(e)?.platforms.has(i())||s(e)),s=e=>n.PluginHeaders?.find(t=>t.name===e),c=t=>e.console.error(t),l=new Map;return n.convertFileSrc||=e=>e,n.getPlatform=i,n.handleError=c,n.isNativePlatform=a,n.isPluginAvailable=o,n.registerPlugin=(e,a={})=>{let o=l.get(e);if(o)return console.warn(`Capacitor plugin "${e}" already registered. Cannot register plugins twice.`),o.proxy;let c=i(),u=s(e),d,f=async()=>(!d&&c in a?d=d=typeof a[c]==`function`?await a[c]():a[c]:t!==null&&!d&&`web`in a&&(d=d=typeof a.web==`function`?await a.web():a.web),d),p=(t,r)=>{if(u){let i=u?.methods.find(e=>r===e.name);if(i)return i.rtype===`promise`?t=>n.nativePromise(e,r.toString(),t):(t,i)=>n.nativeCallback(e,r.toString(),t,i);if(t)return t[r]?.bind(t)}else if(t)return t[r]?.bind(t);else throw new wS(`"${e}" plugin is not implemented on ${c}`,CS.Unimplemented)},m=t=>{let n,r=(...r)=>{let i=f().then(i=>{let a=p(i,t);if(a){let e=a(...r);return n=e?.remove,e}throw new wS(`"${e}.${t}()" is not implemented on ${c}`,CS.Unimplemented)});return t===`addListener`&&(i.remove=async()=>n()),i};return r.toString=()=>`${t.toString()}() { [capacitor code] }`,Object.defineProperty(r,"name",{value:t,writable:!1,configurable:!1}),r},h=m(`addListener`),g=m(`removeListener`),v=(e,t)=>{let n=h({eventName:e},t),r=async()=>{let r=await n;g({eventName:e,callbackId:r},t)},i=new Promise(e=>n.then(()=>e({remove:r})));return i.remove=async()=>{console.warn(`Using addListener() without 'await' is deprecated.`),await r()},i},y=new Proxy({},{get(e,t){switch(t){case`$$typeof`:return;case`toJSON`:return()=>({});case`addListener`:return u?v:h;case`removeListener`:return g;default:return m(t)}}});return r[e]=y,l.set(e,{name:e,proxy:y,platforms:new Set([...Object.keys(a),...u?[c]:[]])}),y},n.Exception=wS,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},DS=(e=>e.Capacitor=ES(e))(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}),OS=DS.registerPlugin,kS=class{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,t){let n=!1;this.listeners[e]||(this.listeners[e]=[],n=!0),this.listeners[e].push(t);let r=this.windowListeners[e];return r&&!r.registered&&this.addWindowListener(r),n&&this.sendRetainedArgumentsForEvent(e),Promise.resolve({remove:async()=>this.removeListener(e,t)})}async removeAllListeners(){this.listeners={};for(let e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t,n){let r=this.listeners[e];if(!r){if(n){let n=this.retainedEventArguments[e];n||=[],n.push(t),this.retainedEventArguments[e]=n}return}r.forEach(e=>e(t))}hasListeners(e){return!!this.listeners[e]?.length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:e=>{this.notifyListeners(t,e)}}}unimplemented(e=`not implemented`){return new DS.Exception(e,CS.Unimplemented)}unavailable(e=`not available`){return new DS.Exception(e,CS.Unavailable)}async removeListener(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&this.listeners[e].splice(r,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){let t=this.retainedEventArguments[e];t&&(delete this.retainedEventArguments[e],t.forEach(t=>{this.notifyListeners(e,t)}))}},AS=OS(`WebView`),jS=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),MS=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent),NS=class extends kS{async getCookies(){let e=document.cookie,t={};return e.split(`;`).forEach(e=>{if(e.length<=0)return;let[n,r]=e.replace(/=/,`CAP_COOKIE`).split(`CAP_COOKIE`);n=MS(n).trim(),r=MS(r).trim(),t[n]=r}),t}async setCookie(e){try{let t=jS(e.key),n=jS(e.value),r=e.expires?`; expires=${e.expires.replace(`expires=`,``)}`:``,i=(e.path||`/`).replace(`path=`,``),a=e.url!=null&&e.url.length>0?`domain=${e.url}`:``;document.cookie=`${t}=${n||``}${r}; path=${i}; ${a};`}catch(e){return Promise.reject(e)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(e){return Promise.reject(e)}}async clearCookies(){try{let e=document.cookie.split(`;`)||[];for(let t of e)document.cookie=t.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)}}},PS=OS(`CapacitorCookies`,{web:()=>new NS}),FS=async e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=r.result;t(e.indexOf(`,`)>=0?e.split(`,`)[1]:e)},r.onerror=e=>n(e),r.readAsDataURL(e)}),IS=(e={})=>{let t=Object.keys(e);return Object.keys(e).map(e=>e.toLocaleLowerCase()).reduce((n,r,i)=>(n[r]=e[t[i]],n),{})},LS=(e,t=!0)=>e?Object.entries(e).reduce((e,n)=>{let[r,i]=n,a,o;return Array.isArray(i)?(o=``,i.forEach(e=>{a=t?encodeURIComponent(e):e,o+=`${r}=${a}&`}),o.slice(0,-1)):(a=t?encodeURIComponent(i):i,o=`${r}=${a}`),`${e}&${o}`},``).substr(1):null,RS=(e,t={})=>{let n=Object.assign({method:e.method||`GET`,headers:e.headers},t),r=IS(e.headers)[`content-type`]||``;if(typeof e.data==`string`)n.body=e.data;else if(r.includes(`application/x-www-form-urlencoded`)){let t=new URLSearchParams;for(let[n,r]of Object.entries(e.data||{}))t.set(n,r);n.body=t.toString()}else if(r.includes(`multipart/form-data`)||e.data instanceof FormData){let t=new FormData;if(e.data instanceof FormData)e.data.forEach((e,n)=>{t.append(n,e)});else for(let n of Object.keys(e.data))t.append(n,e.data[n]);n.body=t;let r=new Headers(n.headers);r.delete(`content-type`),n.headers=r}else(r.includes(`application/json`)||typeof e.data==`object`)&&(n.body=JSON.stringify(e.data));return n},zS=class extends kS{async request(e){let t=RS(e,e.webFetchExtra),n=LS(e.params,e.shouldEncodeUrlParams),r=n?`${e.url}?${n}`:e.url,i=await fetch(r,t),a=i.headers.get(`content-type`)||``,{responseType:o=`text`}=i.ok?e:{};a.includes(`application/json`)&&(o=`json`);let s,c;switch(o){case`arraybuffer`:case`blob`:c=await i.blob(),s=await FS(c);break;case`json`:s=await i.json();break;default:s=await i.text()}let l={};return i.headers.forEach((e,t)=>{l[t]=e}),{data:s,headers:l,status:i.status,url:i.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`}))}},BS=OS(`CapacitorHttp`,{web:()=>new zS}),VS;(function(e){e.Dark=`DARK`,e.Light=`LIGHT`,e.Default=`DEFAULT`})(VS||={});var HS;(function(e){e.StatusBar=`StatusBar`,e.NavigationBar=`NavigationBar`})(HS||={});var US=class extends kS{async setStyle(){this.unavailable(`not available for web`)}async setAnimation(){this.unavailable(`not available for web`)}async show(){this.unavailable(`not available for web`)}async hide(){this.unavailable(`not available for web`)}},WS=OS(`SystemBars`,{web:()=>new US}),GS=OS(`Badge`,{web:()=>Nm(()=>import(`./web-DJN-qQx6.js`).then(e=>new e.BadgeWeb),[],import.meta.url)}),KS={};function qS(e){return e.getIsPending!==void 0}function JS(e){if(qS(e))return e;let t=!0,n=e.then(e=>(t=!1,e),e=>{throw t=!1,e});return n.getIsPending=function(){return t},n}function YS(e){let t={},n=e.attributes;if(!n)return t;for(let e=n.length-1;e>=0;e--)t[n[e].name]=n[e].value;return t}function XS(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function ZS(e,t){let{class:n,style:r,...i}=YS(e),{class:a,style:o,...s}=XS(t);return{class:[n,a],style:[r,o],...i,...s}}var QS=Mr({inheritAttrs:!1,__name:`InlineSvg`,props:{src:{},title:{default:void 0},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0},uniqueIds:{type:[Boolean,String],default:!1},uniqueIdsBase:{default:``}},emits:[`loaded`,`unloaded`,`error`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=Ei(),o=z(),s=z(),c=z(),l=Math.random().toString(36).substring(2);t({svgElSource:o,request:c}),$n(()=>r.src,e=>{d(e)}),d(r.src);function u(e){if(e=e.cloneNode(!0),r.uniqueIds){let t=typeof r.uniqueIds==`string`?r.uniqueIds:l;e=h(e,t,r.uniqueIdsBase)}return e=r.transformSource(e),r.title&&m(e,r.title),e.innerHTML}function d(e){KS[e]||(KS[e]=f(e)),o.value&&KS[e].getIsPending()&&!r.keepDuringLoading&&(o.value=null,i(`unloaded`)),KS[e].then(e=>{o.value=e,jn(()=>{i(`loaded`,s.value)})}).catch(t=>{o.value&&(o.value=void 0,i(`unloaded`)),delete KS[e],i(`error`,t)})}function f(e){return JS(new Promise((t,n)=>{let r=new XMLHttpRequest;r.open(`GET`,e,!0),c.value=r,r.onload=()=>{if(r.status>=200&&r.status<400)try{let e=new DOMParser().parseFromString(r.responseText,`text/xml`).getElementsByTagName(`svg`)[0];e?t(e):n(Error(`Loaded file is not valid SVG"`))}catch(e){n(e)}else n(Error(`Error loading SVG`))},r.onerror=n,r.send()}))}let p=()=>o.value?Jo(`svg`,{...ZS(o.value,a),innerHTML:u(o.value),ref:s}):null;function m(e,t){let n=e.getElementsByTagName(`title`);if(n.length)n[0].textContent=t;else{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`title`);n.textContent=t,e.insertBefore(n,e.firstChild)}}function h(e,t,n=``){let r=[`id`,`href`,`xlink:href`,`xlink:role`,`xlink:arcrole`],i=[`href`,`xlink:href`],a=(e,t)=>i.includes(e)&&(t?!t.includes(`#`):!1);return[...e.children].forEach(e=>{var i;if((i=e.attributes)!=null&&i.length){let i=Object.values(e.attributes).map(e=>{let r=/url\((.*?)\)/.exec(e.value);return r!=null&&r[1]&&(e.value=e.value.replace(r[0],`url(${n}${r[1]}_${t})`)),e});r.forEach(e=>{let n=i.find(t=>t.name===e);n&&!a(e,n.value)&&(n.value=`${n.value}_${t}`)})}return e.children.length?h(e,t,n):e}),e}return(e,t)=>(H(),fo(p))}});function $S(e){return typeof e==`function`}function eC(e){return e==null}var tC=e=>e!==null&&!!e&&typeof e==`object`&&!Array.isArray(e);function nC(e){return Number(e)>=0}function rC(e){let t=parseFloat(e);return isNaN(t)?e:t}function iC(e){return typeof e==`object`&&!!e}function aC(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}function oC(e){if(!iC(e)||aC(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function sC(e,t){return Object.keys(t).forEach(n=>{if(oC(t[n])&&oC(e[n])){e[n]||(e[n]={}),sC(e[n],t[n]);return}e[n]=t[n]}),e}function cC(e){let t=e.split(`.`);if(!t.length)return``;let n=String(t[0]);for(let e=1;e<t.length;e++){if(nC(t[e])){n+=`[${t[e]}]`;continue}n+=`.${t[e]}`}return n}var lC={};function uC(e){return lC[e]}function dC(e,t,n){typeof n.value==`object`&&(n.value=$(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t===`__proto__`?Object.defineProperty(e,t,n):e[t]=n.value}function $(e){if(typeof e!=`object`)return e;var t=0,n,r,i,a=Object.prototype.toString.call(e);if(a===`[object Object]`?i=Object.create(e.__proto__||null):a===`[object Array]`?i=Array(e.length):a===`[object Set]`?(i=new Set,e.forEach(function(e){i.add($(e))})):a===`[object Map]`?(i=new Map,e.forEach(function(e,t){i.set($(t),$(e))})):a===`[object Date]`?i=new Date(+e):a===`[object RegExp]`?i=new RegExp(e.source,e.flags):a===`[object DataView]`?i=new e.constructor($(e.buffer)):a===`[object ArrayBuffer]`?i=e.slice(0):a.slice(-6)===`Array]`&&(i=new e.constructor(e)),i){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)dC(i,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(i,n=r[t])&&i[n]===e[n]||dC(i,n,Object.getOwnPropertyDescriptor(e,n))}return i||e}var fC=Symbol(`vee-validate-form`),pC=Symbol(`vee-validate-form-context`),mC=Symbol(`vee-validate-field-instance`),hC=Symbol(`Default empty value`),gC=typeof window<`u`;function _C(e){return $S(e)&&!!e.__locatorRef}function vC(e){return tC(e)&&`~standard`in e}function yC(e){return e===`checkbox`||e===`radio`}function bC(e){return tC(e)||Array.isArray(e)}function xC(e){return Array.isArray(e)?e.length===0:tC(e)&&Object.keys(e).length===0}function SC(e){return/^\[.+\]$/i.test(e)}function CC(e){return wC(e)&&e.multiple}function wC(e){return e.tagName===`SELECT`}function TC(e,t){let n=![!1,null,void 0,0].includes(t.multiple)&&!Number.isNaN(t.multiple);return e===`select`&&`multiple`in t&&n}function EC(e,t){return!TC(e,t)&&t.type!==`file`&&!yC(t.type)}function DC(e){return OC(e)&&e.target&&`submit`in e.target}function OC(e){return e?!!(typeof Event<`u`&&$S(Event)&&e instanceof Event||e&&e.srcElement):!1}function kC(e,t){return t in e&&e[t]!==hC}function AC(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!AC(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!AC(r[1],t.get(r[0])))return!1;return!0}if(MC(e)&&MC(t))return e.size===t.size&&e.name===t.name&&e.lastModified===t.lastModified&&e.type===t.type;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(e=jC(e),t=jC(t),i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){var a=i[r];if(!AC(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function jC(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function MC(e){return gC?e instanceof File:!1}function NC(e){if(e.path?.length){let t=``;for(let n of e.path){let e=typeof n==`object`?n.key:n;if(typeof e==`string`||typeof e==`number`)t+=t?`.${e}`:e;else return null}return t}return null}function PC(e){return SC(e)?e.replace(/\[|\]/gi,``):e}function FC(e,t,n){return e?SC(t)?e[PC(t)]:(t||``).split(/\.|\[(\d+)\]/).filter(Boolean).reduce((e,t)=>bC(e)&&t in e?e[t]:n,e):n}function IC(e,t,n){if(SC(t)){e[PC(t)]=n;return}let r=t.split(/\.|\[(\d+)\]/).filter(Boolean),i=e;for(let e=0;e<r.length;e++){if(e===r.length-1){i[r[e]]=n;return}(!(r[e]in i)||eC(i[r[e]]))&&(i[r[e]]=nC(r[e+1])?[]:{}),i=i[r[e]]}}function LC(e,t){if(Array.isArray(e)&&nC(t)){e.splice(Number(t),1);return}tC(e)&&delete e[t]}function RC(e,t){if(SC(t)){delete e[PC(t)];return}let n=t.split(/\.|\[(\d+)\]/).filter(Boolean),r=e;for(let e=0;e<n.length;e++){if(e===n.length-1){LC(r,n[e]);break}if(!(n[e]in r)||eC(r[n[e]]))break;r=r[n[e]]}let i=n.map((t,r)=>FC(e,n.slice(0,r).join(`.`)));for(let t=i.length-1;t>=0;t--)if(xC(i[t])){if(t===0){LC(e,n[0]);continue}LC(i[t-1],n[t-1])}}function zC(e){return Object.keys(e)}function BC(e,t=void 0){return Mo()?.provides[e]||qn(e,t)}function VC(e,t,n){if(Array.isArray(e)){let n=[...e],r=n.findIndex(e=>AC(e,t));return r>=0?n.splice(r,1):n.push(t),n}return AC(e,t)?n:t}function HC(e,t=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{let t=e(...i);r.forEach(e=>e(t)),r=[]},t),new Promise(e=>r.push(e))}}function UC(e,t){return tC(t)&&t.number?rC(e):e}function WC(e,t){let n;return async function(...r){let i=e(...r);n=i;let a=await i;return i===n?(n=void 0,t(a,r)):a}}function GC(e){return Array.isArray(e)?e:e?[e]:[]}function KC(e,t){let n={};for(let r in e)t.includes(r)||(n[r]=e[r]);return n}function qC(e){let t=null,n=[];return function(...r){let i=jn(()=>{if(t!==i)return;let a=e(...r);n.forEach(e=>e(a)),n=[],t=null});return t=i,new Promise(e=>n.push(e))}}function JC(e,t){let n={};for(let r of e){let e=t(r);n[e]||(n[e]={path:e,messages:[]}),`messages`in r?n[e].messages.push(...r.messages):n[e].messages.push(r.message)}return Object.values(n)}function YC(e){return JC(e,e=>e.path?NC(e)??``:``)}function XC(e,t,n){return t.slots.default?typeof e==`string`||!e?t.slots.default(n()):{default:()=>{var e;return(e=t.slots).default?.call(e,n())}}:t.slots.default}function ZC(e){if(QC(e))return e._value}function QC(e){return`_value`in e}function $C(e){return e.type===`range`?Number.isNaN(e.valueAsNumber)?e.value:e.valueAsNumber:e.value}function ew(e){if(!OC(e))return e;let t=e.target;if(yC(t.type)&&QC(t))return ZC(t);if(t.type===`file`&&t.files){let e=Array.from(t.files);return t.multiple?e:e[0]}if(CC(t))return Array.from(t.options).filter(e=>e.selected&&!e.disabled).map(ZC);if(wC(t)){let e=Array.from(t.options).find(e=>e.selected);return e?ZC(e):t.value}return $C(t)}function tw(e){let t={};return Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),e?tC(e)&&e._$$isNormalized?e:tC(e)?Object.keys(e).reduce((t,n)=>{let r=nw(e[n]);return e[n]!==!1&&(t[n]=rw(r)),t},t):typeof e==`string`?e.split(`|`).reduce((e,t)=>{let n=iw(t);return n.name&&(e[n.name]=rw(n.params)),e},t):t:t}function nw(e){return e===!0?[]:Array.isArray(e)||tC(e)?e:[e]}function rw(e){let t=e=>typeof e==`string`&&e[0]===`@`?aw(e.slice(1)):e;return Array.isArray(e)?e.map(t):e instanceof RegExp?[e]:Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{})}var iw=e=>{let t=[],n=e.split(`:`)[0];return e.includes(`:`)&&(t=e.split(`:`).slice(1).join(`:`).split(`,`)),{name:n,params:t}};function aw(e){let t=t=>FC(t,e)??t[e];return t.__locatorRef=e,t}function ow(e){return Array.isArray(e)?e.filter(_C):zC(e).filter(t=>_C(e[t])).map(t=>e[t])}var sw=Object.assign({},{generateMessage:({field:e})=>`${e} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0}),cw=()=>sw;async function lw(e,t,n={}){let r=n?.bails,i=await uw({name:n?.name||`{field}`,rules:t,label:n?.label,bails:r??!0,formData:n?.values||{}},e);return Object.assign(Object.assign({},i),{valid:!i.errors.length})}async function uw(e,t){let n=e.rules;if(vC(n))return dw(t,Object.assign(Object.assign({},e),{rules:n}));if($S(n)||Array.isArray(n)){let r={field:e.label||e.name,name:e.name,label:e.label,form:e.formData,value:t},i=Array.isArray(n)?n:[n],a=i.length,o=[];for(let n=0;n<a;n++){let a=i[n],s=await a(t,r);if(typeof s==`string`||Array.isArray(s)||!s){if(Array.isArray(s))o.push(...s);else{let e=typeof s==`string`?s:pw(r);o.push(e)}if(e.bails)return{errors:o}}}return{errors:o}}let r=Object.assign(Object.assign({},e),{rules:tw(n)}),i=[],a=Object.keys(r.rules),o=a.length;for(let n=0;n<o;n++){let o=a[n],s=await fw(r,t,{name:o,params:r.rules[o]});if(s.error&&(i.push(s.error),e.bails))return{errors:i}}return{errors:i}}async function dw(e,t){let n=await t.rules[`~standard`].validate(e);if(!n.issues)return{value:n.value,errors:[]};let r=[];for(let e of n.issues)e.message&&r.push(e.message);return{errors:r}}async function fw(e,t,n){let r=uC(n.name);if(!r)throw Error(`No such validator '${n.name}' exists.`);let i=mw(n.params,e.formData),a={field:e.label||e.name,name:e.name,label:e.label,value:t,form:e.formData,rule:Object.assign(Object.assign({},n),{params:i})},o=await r(t,i,a);return typeof o==`string`?{error:o}:{error:o?void 0:pw(a)}}function pw(e){let t=cw().generateMessage;return t?t(e):`Field is invalid`}function mw(e,t){let n=e=>_C(e)?e(t):e;return Array.isArray(e)?e.map(n):Object.keys(e).reduce((t,r)=>(t[r]=n(e[r]),t),{})}async function hw(e,t){let n=await e[`~standard`].validate($(t)),r={},i={};if(!n.issues)return{valid:!0,results:{},errors:{},values:n.value,source:`schema`};let a=YC(n.issues||[]);for(let e of a){let t=e.messages,n=e.path;r[n]={valid:!t.length,errors:t},t.length&&(i[n]=t[0])}return{valid:!a.length,results:r,errors:i,values:void 0,source:`schema`}}async function gw(e,t,n){let r=zC(e).map(async r=>{let i=n?.names?.[r],a=await lw(FC(t,r),e[r],{name:i?.name||r,label:i?.label,values:t,bails:n?.bailsMap?.[r]??!0});return Object.assign(Object.assign({},a),{path:r})}),i=!0,a=await Promise.all(r),o={},s={};for(let e of a)o[e.path]={valid:e.valid,errors:e.errors},e.valid||(i=!1,s[e.path]=e.errors[0]);return{valid:i,results:o,errors:s,source:`schema`}}var _w=0;function vw(e,t){let{value:n,initialValue:r,setInitialValue:i}=yw(e,t.modelValue,t.form);if(!t.form){let{errors:t,setErrors:a}=Sw(),o=_w>=2**53-1?0:++_w,s=xw(n,r,t);function c(e){`value`in e&&(n.value=e.value),`errors`in e&&a(e.errors),`touched`in e&&(s.touched=e.touched??s.touched),`initialValue`in e&&i(e.initialValue)}return{id:o,path:e,value:n,initialValue:r,meta:s,flags:{pendingUnmount:{[o]:!1},pendingReset:!1},errors:t,setState:c}}let a=t.form.createPathState(e,{bails:t.bails,label:t.label,type:t.type,validate:t.validate}),o=G(()=>a.errors);function s(r){var a,o;`value`in r&&(n.value=r.value),`errors`in r&&((a=t.form)==null||a.setFieldError(B(e),r.errors)),`touched`in r&&((o=t.form)==null||o.setFieldTouched(B(e),r.touched??!1)),`initialValue`in r&&i(r.initialValue)}return{id:Array.isArray(a.id)?a.id[a.id.length-1]:a.id,path:e,value:n,errors:o,meta:a,initialValue:r,flags:a.__flags,setState:s}}function yw(e,t,n){let r=z(B(t));function i(){return n?FC(n.initialValues.value,B(e),B(r)):B(r)}function a(t){if(!n){r.value=t;return}n.setFieldInitialValue(B(e),t,!0)}let o=G(i);if(!n)return{value:z(i()),initialValue:o,setInitialValue:a};let s=bw(t,n,o,e);return n.stageInitialValue(B(e),s,!0),{value:G({get(){return FC(n.values,B(e))},set(t){n.setFieldValue(B(e),t,!1)}}),initialValue:o,setInitialValue:a}}function bw(e,t,n,r){return Qt(e)?B(e):e===void 0?FC(t.values,B(r),B(n)):e}function xw(e,t,n){let r=Bt({touched:!1,pending:!1,valid:!0,validated:!!B(n).length,initialValue:G(()=>B(t)),dirty:G(()=>!AC(B(e),B(t)))});return $n(n,e=>{r.valid=!e.length},{immediate:!0,flush:`sync`}),r}function Sw(){let e=z([]);return{errors:e,setErrors:t=>{e.value=GC(t)}}}function Cw(e,t,n){return yC(n?.type)?Ew(e,t,n):ww(e,t,n)}function ww(e,t,n){let{initialValue:r,validateOnMount:i,bails:a,type:o,checkedValue:s,label:c,validateOnValueUpdate:l,uncheckedValue:u,controlled:d,keepValueOnUnmount:f,syncVModel:p,form:m}=Tw(n),h=d?BC(fC):void 0,g=m||h,v=G(()=>cC(V(e))),y=G(()=>{if(V(g?.schema))return;let e=B(t);return vC(e)||$S(e)||Array.isArray(e)?e:tw(e)}),{id:b,value:x,initialValue:S,meta:C,setState:w,errors:T,flags:E}=vw(v,{modelValue:r,form:g,bails:a,label:c,type:o,validate:y.value?j:void 0}),D=G(()=>T.value[0]);p&&Dw({value:x,prop:p,handleChange:M,shouldValidate:()=>l&&!E.pendingReset});let O=(e,t=!1)=>{C.touched=!0,t&&ee()};async function k(e){if(g?.validateSchema){let{results:t}=await g.validateSchema(e);return t[V(v)]??{valid:!0,errors:[]}}return y.value?lw(x.value,y.value,{name:V(v),label:V(c),values:g?.values??{},bails:a}):{valid:!0,errors:[]}}let ee=WC(async()=>(C.pending=!0,C.validated=!0,k(`validated-only`)),e=>E.pendingUnmount[F.id]?e:(w({errors:e.errors}),C.pending=!1,C.valid=e.valid,e)),A=WC(async()=>k(`silent`),e=>(C.valid=e.valid,e));function j(e){return e?.mode===`silent`?A():ee()}function M(e,t=!0){re(ew(e),t)}$r(()=>{if(i)return ee();(!g||!g.validateSchema)&&A()});function te(e){C.touched=e}function ne(e){let t=e&&`value`in e?e.value:S.value;w({value:$(t),initialValue:$(t),touched:e?.touched??!1,errors:e?.errors||[]}),C.pending=!1,C.validated=!1,A()}let N=Mo();function re(e,t=!0){x.value=N&&p?UC(e,N.props.modelModifiers):e,(t?ee:A)()}function P(e){w({errors:Array.isArray(e)?e:[e]})}let F={id:b,name:v,label:c,value:G({get(){return x.value},set(e){re(e,l)}}),meta:C,errors:T,errorMessage:D,type:o,checkedValue:s,uncheckedValue:u,bails:a,keepValueOnUnmount:f,resetField:ne,handleReset:()=>ne(),validate:j,handleChange:M,handleBlur:O,setState:w,setTouched:te,setErrors:P,setValue:re};return Kn(mC,F),Qt(t)&&typeof B(t)!=`function`&&$n(t,(e,t)=>{AC(e,t)||(C.validated?ee():A())},{deep:!0}),g?($n(G(()=>{let e=y.value;return!e||$S(e)||vC(e)||Array.isArray(e)?{}:Object.keys(e).reduce((t,n)=>{let r=ow(e[n]).map(e=>e.__locatorRef).reduce((e,t)=>{let n=FC(g.values,t)||g.values[t];return n!==void 0&&(e[t]=n),e},{});return Object.assign(t,r),t},{})}),(e,t)=>{Object.keys(e).length&&(AC(e,t)||(C.validated?ee():A()))}),ni(()=>{let e=V(F.keepValueOnUnmount)??V(g.keepValuesOnUnmount),t=V(v);if(e||!g||E.pendingUnmount[F.id]){g?.removePathState(t,b);return}E.pendingUnmount[F.id]=!0;let n=g.getPathState(t);if(Array.isArray(n?.id)&&n?.multiple?n?.id.includes(F.id):n?.id===F.id){if(n?.multiple&&Array.isArray(n.value)){let e=n.value.findIndex(e=>AC(e,V(F.checkedValue)));if(e>-1){let r=[...n.value];r.splice(e,1),g.setFieldValue(t,r)}Array.isArray(n.id)&&n.id.splice(n.id.indexOf(F.id),1)}else g.unsetPathValue(V(v));g.removePathState(t,b)}}),F):F}function Tw(e){let t=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!e?.syncVModel,r=typeof e?.syncVModel==`string`?e.syncVModel:`modelValue`,i=n&&!(`initialValue`in(e||{}))?Ow(Mo(),r):e?.initialValue;if(!e)return Object.assign(Object.assign({},t()),{initialValue:i});let a=e.controlled??!0,o=e?.syncVModel||!1;return Object.assign(Object.assign(Object.assign({},t()),e||{}),{initialValue:i,controlled:a??!0,checkedValue:e?.checkedValue,syncVModel:o})}function Ew(e,t,n){let r=n?.controlled?BC(fC):void 0,i=n?.checkedValue,a=n?.uncheckedValue;function o(t){let o=t.handleChange,s=G(()=>{let e=V(t.value),n=V(i);return Array.isArray(e)?e.findIndex(e=>AC(e,n))>=0:AC(n,e)});function c(c,l=!0){if(s.value===c?.target?.checked){l&&t.validate();return}let u=V(e),d=r?.getPathState(u),f=ew(c),p=V(i)??f;r&&d?.multiple&&d.type===`checkbox`?p=VC(FC(r.values,u)||[],p,void 0):n?.type===`checkbox`&&(p=VC(V(t.value),p,V(a))),o(p,l)}return Object.assign(Object.assign({},t),{checked:s,checkedValue:i,uncheckedValue:a,handleChange:c})}return o(ww(e,t,n))}function Dw({prop:e,value:t,handleChange:n,shouldValidate:r}){let i=Mo();if(!i||!e)return;let a=typeof e==`string`?e:`modelValue`,o=`update:${a}`;a in i.props&&($n(t,e=>{AC(e,Ow(i,a))||i.emit(o,e)}),$n(()=>Ow(i,a),e=>{if(e===hC&&t.value===void 0)return;let i=e===hC?void 0:e;AC(i,t.value)||n(i,r())}))}function Ow(e,t){if(e)return e.props[t]}var kw=Mr({name:`Field`,inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>cw().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:hC},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},controlled:{type:Boolean,default:!0},keepValue:{type:Boolean,default:void 0}},setup(e,t){let n=un(e,`rules`),r=un(e,`name`),i=un(e,`label`),a=un(e,`uncheckedValue`),o=un(e,`keepValue`),{errors:s,value:c,errorMessage:l,validate:u,handleChange:d,handleBlur:f,setTouched:p,resetField:m,handleReset:h,meta:g,checked:v,setErrors:y,setValue:b}=Cw(r,n,{validateOnMount:e.validateOnMount,bails:e.bails,controlled:e.controlled,type:t.attrs.type,initialValue:Mw(e,t),checkedValue:t.attrs.value,uncheckedValue:a,label:i,validateOnValueUpdate:e.validateOnModelUpdate,keepValueOnUnmount:o,syncVModel:!0}),x=function(e,t=!0){d(e,t)},S=G(()=>{let{validateOnInput:n,validateOnChange:r,validateOnBlur:i,validateOnModelUpdate:a}=jw(e);function o(e){f(e,i),$S(t.attrs.onBlur)&&t.attrs.onBlur(e)}function s(e){x(e,n),$S(t.attrs.onInput)&&t.attrs.onInput(e)}function c(e){x(e,r),$S(t.attrs.onChange)&&t.attrs.onChange(e)}let l={name:e.name,onBlur:o,onInput:s,onChange:c};return l[`onUpdate:modelValue`]=e=>x(e,a),l}),C=G(()=>{let n=Object.assign({},S.value);return yC(t.attrs.type)&&v&&(n.checked=v.value),EC(Aw(e,t),t.attrs)&&(n.value=c.value),n}),w=G(()=>Object.assign(Object.assign({},S.value),{modelValue:c.value}));function T(){return{field:C.value,componentField:w.value,value:c.value,meta:g,errors:s.value,errorMessage:l.value,validate:u,resetField:m,handleChange:x,handleInput:e=>x(e,!1),handleReset:h,handleBlur:S.value.onBlur,setTouched:p,setErrors:y,setValue:b}}return t.expose({value:c,meta:g,errors:s,errorMessage:l,setErrors:y,setTouched:p,setValue:b,reset:m,validate:u,handleChange:d}),()=>{let n=fi(Aw(e,t)),r=XC(n,t,T);return n?Jo(n,Object.assign(Object.assign({},t.attrs),C.value),r):r}}});function Aw(e,t){let n=e.as||``;return!e.as&&!t.slots.default&&(n=`input`),n}function jw(e){let{validateOnInput:t,validateOnChange:n,validateOnBlur:r,validateOnModelUpdate:i}=cw();return{validateOnInput:e.validateOnInput??t,validateOnChange:e.validateOnChange??n,validateOnBlur:e.validateOnBlur??r,validateOnModelUpdate:e.validateOnModelUpdate??i}}function Mw(e,t){return yC(t.attrs.type)?kC(e,`modelValue`)?e.modelValue:void 0:kC(e,`modelValue`)?e.modelValue:t.attrs.value}var Nw=kw,Pw=0,Fw=[`bails`,`fieldsCount`,`id`,`multiple`,`type`,`validate`];function Iw(e){let t=e?.initialValues||{};return $(Object.assign({},V(t)))}function Lw(e){let t=Pw++,n=e?.name||`Form`,r=0,i=z(!1),a=z(!1),o=z(0),s=[],c=Bt(Iw(e)),l=z([]),u=z({}),d=z({}),f=qC(()=>{d.value=l.value.reduce((e,t)=>(e[cC(V(t.path))]=t,e),{})});function p(e,t){let n=M(e);if(!n){typeof e==`string`&&(u.value[cC(e)]=GC(t));return}if(typeof e==`string`){let t=cC(e);u.value[t]&&delete u.value[t]}n.errors=GC(t),n.valid=!n.errors.length}function m(e){zC(e).forEach(t=>{p(t,e[t])})}e?.initialErrors&&m(e.initialErrors);let h=G(()=>{let e=l.value.reduce((e,t)=>(t.errors.length&&(e[V(t.path)]=t.errors),e),{});return Object.assign(Object.assign({},u.value),e)}),g=G(()=>zC(h.value).reduce((e,t)=>{let n=h.value[t];return n?.length&&(e[t]=n[0]),e},{})),v=G(()=>l.value.reduce((e,t)=>(e[V(t.path)]={name:V(t.path)||``,label:t.label||``},e),{})),y=G(()=>l.value.reduce((e,t)=>(e[V(t.path)]=t.bails??!0,e),{})),b=Object.assign({},e?.initialErrors||{}),x=e?.keepValuesOnUnmount??!1,{initialValues:S,originalInitialValues:C,setInitialValues:w}=zw(l,c,e),T=Rw(l,c,C,g),E=G(()=>l.value.reduce((e,t)=>{let n=FC(c,V(t.path));return IC(e,V(t.path),n),e},{})),D=e?.validationSchema;function O(e,t){let n=G(()=>FC(S.value,V(e))),i=d.value[V(e)],a=t?.type===`checkbox`||t?.type===`radio`;if(i&&a){i.multiple=!0;let e=r++;return Array.isArray(i.id)?i.id.push(e):i.id=[i.id,e],i.fieldsCount++,i.__flags.pendingUnmount[e]=!1,i}let o=G(()=>FC(c,V(e))),s=V(e),u=ne.findIndex(e=>e===s);u!==-1&&ne.splice(u,1);let p=r++,m=Bt({id:p,path:e,touched:!1,pending:!1,valid:!0,validated:!!b[s]?.length,initialValue:n,errors:$t([]),bails:t?.bails??!1,label:t?.label,type:t?.type||`default`,value:o,multiple:!1,__flags:{pendingUnmount:{[p]:!1},pendingReset:!1},fieldsCount:1,validate:t?.validate,dirty:G(()=>!AC(B(o),B(n)))});return l.value.push(m),d.value[s]=m,f(),g.value[s]&&!b[s]&&jn(()=>{ve(s,{mode:`silent`})}),Qt(e)&&$n(e,e=>{f();let t=$(o.value);d.value[e]=m,jn(()=>{IC(c,e,t)})}),m}let k=HC(Se,5),ee=HC(Se,5),A=WC(async e=>await(e===`silent`?k():ee()),(e,[t])=>{let n=zC(ae.errorBag.value),r=[...new Set([...zC(e.results),...l.value.map(e=>e.path),...n])].sort().reduce((n,r)=>{let i=r,a=M(i)||te(i),o=e.results[i]?.errors||[],s=V(a?.path)||i,c=Bw({errors:o,valid:!o.length},n.results[s]);return n.results[s]=c,c.valid||(n.errors[s]=c.errors[0]),a&&u.value[s]&&delete u.value[s],a?(a.valid=c.valid,t===`silent`||t===`validated-only`&&!a.validated||p(a,c.errors),n):(p(s,o),n)},{valid:e.valid,results:{},errors:{},source:e.source});return e.values&&(r.values=e.values,r.source=e.source),zC(r.results).forEach(e=>{let n=M(e);n&&t!==`silent`&&(t!==`validated-only`||n.validated)&&p(n,r.results[e]?.errors)}),r});function j(e){l.value.forEach(e)}function M(e){let t=typeof e==`string`?cC(e):e;return typeof t==`string`?d.value[t]:t}function te(e){return l.value.filter(t=>e.startsWith(V(t.path))).reduce((e,t)=>e?t.path.length>e.path.length?t:e:t,void 0)}let ne=[],N;function re(e){return ne.push(e),N||=jn(()=>{[...ne].sort().reverse().forEach(e=>{RC(c,e)}),ne=[],N=null}),N}function P(e){return function(t,n){return function(r){return r instanceof Event&&(r.preventDefault(),r.stopPropagation()),j(e=>e.touched=!0),i.value=!0,o.value++,_e().then(i=>{let a=$(c);if(i.valid&&typeof t==`function`){let n=$(E.value),o=e?n:a;return i.values&&(o=i.source===`schema`?i.values:Object.assign({},o,i.values)),t(o,{evt:r,controlledValues:n,setErrors:m,setFieldError:p,setTouched:me,setFieldTouched:ue,setValues:ce,setFieldValue:oe,resetForm:ge,resetField:he})}!i.valid&&typeof n==`function`&&n({values:a,evt:r,errors:i.errors,results:i.results})}).then(e=>(i.value=!1,e),e=>{throw i.value=!1,e})}}}let F=P(!1);F.withControlled=P(!0);function ie(e,t){let n=l.value.findIndex(n=>n.path===e&&(Array.isArray(n.id)?n.id.includes(t):n.id===t)),r=l.value[n];if(n!==-1&&r){if(jn(()=>{ve(e,{mode:`silent`,warn:!1})}),r.multiple&&r.fieldsCount&&r.fieldsCount--,Array.isArray(r.id)){let e=r.id.indexOf(t);e>=0&&r.id.splice(e,1),delete r.__flags.pendingUnmount[t]}(!r.multiple||r.fieldsCount<=0)&&(l.value.splice(n,1),ye(e),f(),delete d.value[e])}}function I(e){zC(d.value).forEach(t=>{t.startsWith(e)&&delete d.value[t]}),l.value=l.value.filter(t=>!t.path.startsWith(e)),jn(()=>{f()})}let ae={name:n,formId:t,values:c,controlledValues:E,errorBag:h,errors:g,schema:D,submitCount:o,meta:T,isSubmitting:i,isValidating:a,fieldArrays:s,keepValuesOnUnmount:x,validateSchema:B(D)?A:void 0,validate:_e,setFieldError:p,validateField:ve,setFieldValue:oe,setValues:ce,setErrors:m,setFieldTouched:ue,setTouched:me,resetForm:ge,resetField:he,handleSubmit:F,defineField:we,stageInitialValue:be,unsetInitialValue:ye,setFieldInitialValue:xe,createPathState:O,getPathState:M,unsetPathValue:re,removePathState:ie,initialValues:S,getAllPathStates:()=>l.value,destroyPath:I,isFieldTouched:de,isFieldDirty:fe,isFieldValid:pe};function oe(e,t,n=!0){let r=$(t),i=typeof e==`string`?e:e.path;M(i)||O(i),IC(c,i,r),n&&ve(i)}function se(e,t=!0){zC(c).forEach(e=>{delete c[e]}),zC(e).forEach(t=>{oe(t,e[t],!1)}),t&&_e()}function ce(e,t=!0){sC(c,e),s.forEach(e=>e&&e.reset()),t&&_e()}function le(e,t){let n=M(V(e))||O(e);return G({get(){return n.value},set(n){oe(V(e),n,V(t)??!1)}})}function ue(e,t){let n=M(e);n&&(n.touched=t)}function de(e){let t=M(e);return t?t.touched:l.value.filter(t=>t.path.startsWith(e)).some(e=>e.touched)}function fe(e){let t=M(e);return t?t.dirty:l.value.filter(t=>t.path.startsWith(e)).some(e=>e.dirty)}function pe(e){let t=M(e);return t?t.valid:l.value.filter(t=>t.path.startsWith(e)).every(e=>e.valid)}function me(e){if(typeof e==`boolean`){j(t=>{t.touched=e});return}zC(e).forEach(t=>{ue(t,!!e[t])})}function he(e,t){let n=t&&`value`in t?t.value:FC(S.value,e),r=M(e);r&&(r.__flags.pendingReset=!0),xe(e,$(n),!0),oe(e,n,!1),ue(e,t?.touched??!1),p(e,t?.errors||[]),jn(()=>{r&&(r.__flags.pendingReset=!1)})}function ge(e,t){let n=$(e?.values?e.values:C.value);n=t?.force?n:sC(C.value,n),w(n,{force:t?.force}),j(t=>{t.__flags.pendingReset=!0,t.validated=!1,t.touched=e?.touched?.[V(t.path)]||!1,oe(V(t.path),FC(n,V(t.path)),!1),p(V(t.path),void 0)}),t?.force?se(n,!1):ce(n,!1),m(e?.errors||{}),o.value=e?.submitCount||0,jn(()=>{_e({mode:`silent`}),j(e=>{e.__flags.pendingReset=!1})})}async function _e(e){let t=e?.mode||`force`;if(t===`force`&&j(e=>e.validated=!0),ae.validateSchema)return ae.validateSchema(t);a.value=!0;let n=await Promise.all(l.value.map(t=>t.validate?t.validate(e).then(e=>({key:V(t.path),valid:e.valid,errors:e.errors,value:e.value})):Promise.resolve({key:V(t.path),valid:!0,errors:[],value:void 0})));a.value=!1;let r={},i={},o={};for(let e of n)r[e.key]={valid:e.valid,errors:e.errors},e.value&&IC(o,e.key,e.value),e.errors.length&&(i[e.key]=e.errors[0]);return{valid:n.every(e=>e.valid),results:r,errors:i,values:o,source:`fields`}}async function ve(e,t){let n=M(e);if(n&&t?.mode!==`silent`&&(n.validated=!0),D){let{results:n}=await A(t?.mode||`validated-only`);return n[e]||{errors:[],valid:!0}}return n?.validate?n.validate(t):(!n&&t?.warn,Promise.resolve({errors:[],valid:!0}))}function ye(e){RC(S.value,e)}function be(t,n,r=!1){xe(t,n),IC(c,t,n),r&&!e?.initialValues&&IC(C.value,t,$(n))}function xe(e,t,n=!1){IC(S.value,e,$(t)),n&&IC(C.value,e,$(t))}async function Se(){let e=B(D);if(!e)return{valid:!0,results:{},errors:{},source:`none`};a.value=!0;let t=vC(e)?await hw(e,c):await gw(e,c,{names:v.value,bailsMap:y.value});return a.value=!1,t}let Ce=F((e,{evt:t})=>{DC(t)&&t.target.submit()});$r(()=>{if(e?.initialErrors&&m(e.initialErrors),e?.initialTouched&&me(e.initialTouched),e?.validateOnMount){_e();return}ae.validateSchema&&ae.validateSchema(`silent`)}),Qt(D)&&$n(D,()=>{var e;(e=ae.validateSchema)==null||e.call(ae,`validated-only`)}),Kn(fC,ae);function we(e,t){let n=$S(t)?void 0:t?.label,r=M(V(e))||O(e,{label:n}),i=()=>$S(t)?t(KC(r,Fw)):t||{};function a(){r.touched=!0,(i().validateOnBlur??cw().validateOnBlur)&&ve(V(r.path))}function o(){(i().validateOnInput??cw().validateOnInput)&&jn(()=>{ve(V(r.path))})}function s(){(i().validateOnChange??cw().validateOnChange)&&jn(()=>{ve(V(r.path))})}let c=G(()=>{let e={onChange:s,onInput:o,onBlur:a};return $S(t)?Object.assign(Object.assign({},e),t(KC(r,Fw)).props||{}):t?.props?Object.assign(Object.assign({},e),t.props(KC(r,Fw))):e});return[le(e,()=>i().validateOnModelUpdate??cw()?.validateOnModelUpdate??!0),c]}let Te=Object.assign(Object.assign({},ae),{values:Ht(c),handleReset:()=>ge(),submitForm:Ce});return Kn(pC,Te),Te}function Rw(e,t,n,r){let i={touched:`some`,pending:`some`,valid:`every`},a=G(()=>!AC(t,B(n)));function o(){let t=e.value;return zC(i).reduce((e,n)=>{let r=i[n];return e[n]=t[r](e=>e[n]),e},{})}let s=Bt(o());return Zn(()=>{let e=o();s.touched=e.touched,s.valid=e.valid,s.pending=e.pending}),G(()=>Object.assign(Object.assign({initialValues:B(n)},s),{valid:s.valid&&!zC(r.value).length,dirty:a.value}))}function zw(e,t,n){let r=Iw(n),i=z(r),a=z($(r));function o(n,r){r?.force?(i.value=$(n),a.value=$(n)):(i.value=sC($(i.value)||{},$(n)),a.value=sC($(a.value)||{},$(n))),r?.updateFields&&e.value.forEach(e=>{if(e.touched)return;let n=FC(i.value,V(e.path));IC(t,V(e.path),$(n))})}return{initialValues:i,originalInitialValues:a,setInitialValues:o}}function Bw(e,t){return t?{valid:e.valid&&t.valid,errors:[...e.errors,...t.errors]}:e}var Vw=Mr({name:`Form`,inheritAttrs:!1,props:{as:{type:null,default:`form`},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1},name:{type:String,default:`Form`}},setup(e,t){let n=un(e,`validationSchema`),r=un(e,`keepValues`),{errors:i,errorBag:a,values:o,meta:s,isSubmitting:c,isValidating:l,submitCount:u,controlledValues:d,validate:f,validateField:p,handleReset:m,resetForm:h,handleSubmit:g,setErrors:v,setFieldError:y,setFieldValue:b,setValues:x,setFieldTouched:S,setTouched:C,resetField:w}=Lw({validationSchema:n.value?n:void 0,initialValues:e.initialValues,initialErrors:e.initialErrors,initialTouched:e.initialTouched,validateOnMount:e.validateOnMount,keepValuesOnUnmount:r,name:e.name}),T=g((e,{evt:t})=>{DC(t)&&t.target.submit()},e.onInvalidSubmit),E=e.onSubmit?g(e.onSubmit,e.onInvalidSubmit):T;function D(e){OC(e)&&e.preventDefault(),m(),typeof t.attrs.onReset==`function`&&t.attrs.onReset()}function O(t,n){return g(typeof t==`function`&&!n?t:n,e.onInvalidSubmit)(t)}function k(){return $(o)}function ee(){return $(s.value)}function A(){return $(i.value)}function j(){return{meta:s.value,errors:i.value,errorBag:a.value,values:o,isSubmitting:c.value,isValidating:l.value,submitCount:u.value,controlledValues:d.value,validate:f,validateField:p,handleSubmit:O,handleReset:m,submitForm:T,setErrors:v,setFieldError:y,setFieldValue:b,setValues:x,setFieldTouched:S,setTouched:C,resetForm:h,resetField:w,getValues:k,getMeta:ee,getErrors:A}}return t.expose({setFieldError:y,setErrors:v,setFieldValue:b,setValues:x,setFieldTouched:S,setTouched:C,resetForm:h,validate:f,validateField:p,resetField:w,getValues:k,getMeta:ee,getErrors:A,values:o,meta:s,errors:i}),function(){let n=e.as===`form`?e.as:e.as?fi(e.as):null,r=XC(n,t,j);return n?Jo(n,Object.assign(Object.assign(Object.assign({},n===`form`?{novalidate:!0}:{}),t.attrs),{onSubmit:E,onReset:D}),r):r}}}),Hw=Mr({name:`ErrorMessage`,props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(e,t){let n=qn(fC,void 0),r=G(()=>n?.errors.value[e.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;let n=e.as?fi(e.as):e.as,a=XC(n,t,i),o=Object.assign({role:`alert`},t.attrs);return!n&&(Array.isArray(a)||!a)&&a?.length?a:(Array.isArray(a)||!a)&&!a?.length?Jo(n||`span`,o,r.value):Jo(n,o,a)}}}),Uw={accept:`Ja`,addRule:`Regel hinzufügen`,am:`am`,apply:`Übernehmen`,cancel:`Abbrechen`,choose:`Auswählen`,chooseDate:`Datum wählen`,chooseMonth:`Monat wählen`,chooseYear:`Jahr wählen`,clear:`Löschen`,completed:`Abgeschlossen`,contains:`Enthält`,custom:`Benutzerdefiniert`,dateAfter:`Datum ist nach`,dateBefore:`Datum ist vor`,dateFormat:`dd.mm.yy`,dateIs:`Datum ist`,dateIsNot:`Datum ist nicht`,dayNames:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`],dayNamesMin:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],dayNamesShort:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],emptyFilterMessage:`Keine Ergebnisse gefunden`,emptyMessage:`Keine Einträge gefunden`,emptySearchMessage:`Keine Ergebnisse gefunden`,emptySelectionMessage:`Kein ausgewähltes Element`,endsWith:`Endet mit`,equals:`Ist gleich`,fileChosenMessage:`{0} Dateien`,fileSizeTypes:[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],filter:`Filtern`,firstDayOfWeek:1,gt:`Größer als`,gte:`Größer oder gleich`,lt:`Kleiner als`,lte:`Kleiner oder gleich`,matchAll:`Trifft auf alle zu`,matchAny:`Trifft auf einige zu`,medium:`Mittel`,monthNames:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`],monthNamesShort:[`Jan`,`Feb`,`Mär`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Dez`],nextDecade:`Nächstes Jahrzehnt`,nextHour:`Nächste Stunde`,nextMinute:`Nächste Minute`,nextMonth:`Nächster Monat`,nextSecond:`Nächste Sekunde`,nextYear:`Nächstes Jahr`,noFileChosenMessage:`Keine Datei ausgewählt`,noFilter:`Kein Filter`,notContains:`Enthält nicht`,notEquals:`Ist ungleich`,now:`Jetzt`,passwordPrompt:`Passwort eingeben`,pending:`Ausstehend`,pm:`pm`,prevDecade:`Vorheriges Jahrzehnt`,prevHour:`Vorherige Stunde`,prevMinute:`Vorherige Minute`,prevMonth:`Vorheriger Monat`,prevSecond:`Vorherige Sekunde`,prevYear:`Vorheriges Jahr`,reject:`Nein`,removeRule:`Regel entfernen`,searchMessage:`{0} Ergebnisse verfügbar`,selectionMessage:`{0} Elemente ausgewählt`,showMonthAfterYear:!1,startsWith:`Beginnt mit`,strong:`Stark`,today:`Heute`,upload:`Hochladen`,weak:`Schwach`,weekHeader:`KW`,aria:{cancelEdit:`Änderungen abbrechen`,close:`Schließen`,collapseLabel:`Einklappen`,collapseRow:`Zeile reduziert`,editRow:`Zeile bearbeiten`,expandLabel:`Ausklappen`,expandRow:`Zeile erweitert`,falseLabel:`Falsch`,filterConstraint:`Filterbeschränkung`,filterOperator:`Filteroperator`,firstPageLabel:`Erste Seite`,gridView:`Rasteransicht`,hideFilterMenu:`Filtermenü ausblenden`,jumpToPageDropdownLabel:`Zum Dropdown-Menü springen`,jumpToPageInputLabel:`Zum Eingabefeld springen`,lastPageLabel:`Letzte Seite`,listLabel:`Optionsliste`,listView:`Listenansicht`,maximizeLabel:`Maximieren`,minimizeLabel:`Minimieren`,moveAllToSource:`Alle zur Quelle bewegen`,moveAllToTarget:`Alle zum Ziel bewegen`,moveBottom:`Zum Ende bewegen`,moveDown:`Nach unten bewegen`,moveTop:`Zum Anfang bewegen`,moveToSource:`Zur Quelle bewegen`,moveToTarget:`Zum Ziel bewegen`,moveUp:`Nach oben bewegen`,navigation:`Navigation`,next:`Nächste`,nextPageLabel:`Nächste Seite`,nullLabel:`Nicht ausgewählt`,otpLabel:`Bitte geben Sie das Einmalkennwortzeichen {0} ein.`,pageLabel:`Seite {page}`,passwordHide:`Passwort verbergen`,passwordShow:`Passwort anzeigen`,previous:`Vorherige`,prevPageLabel:`Vorherige Seite`,removeLabel:`Entfernen`,rotateLeft:`Nach links drehen`,rotateRight:`Nach rechts drehen`,rowsPerPageLabel:`Zeilen pro Seite`,saveEdit:`Änderungen speichern`,scrollTop:`Nach oben scrollen`,selectAll:`Alle Elemente ausgewählt`,selectColor:`Wählen Sie eine Farbe`,selectLabel:`Auswählen`,selectRow:`Zeile ausgewählt`,showFilterMenu:`Filtermenü anzeigen`,slide:`Folie`,slideNumber:`{slideNumber}`,star:`1 Stern`,stars:`{star} Sterne`,trueLabel:`Wahr`,unselectAll:`Alle Elemente abgewählt`,unselectLabel:`Auswahl aufheben`,unselectRow:`Zeile abgewählt`,zoomImage:`Bild vergrößern`,zoomIn:`Vergrößern`,zoomOut:`Verkleinern`}},Ww={accept:`Yes`,addRule:`Add Rule`,am:`AM`,apply:`Apply`,cancel:`Cancel`,choose:`Choose`,chooseDate:`Choose Date`,chooseMonth:`Choose Month`,chooseYear:`Choose Year`,clear:`Clear`,completed:`Completed`,contains:`Contains`,custom:`Custom`,dateAfter:`Date is after`,dateBefore:`Date is before`,dateFormat:`mm/dd/yy`,dateIs:`Date is`,dateIsNot:`Date is not`,dayNames:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],dayNamesMin:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],dayNamesShort:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],emptyFilterMessage:`No results found`,emptyMessage:`No available options`,emptySearchMessage:`No results found`,emptySelectionMessage:`No selected item`,endsWith:`Ends with`,equals:`Equals`,fileChosenMessage:`{0} files`,fileSizeTypes:[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],filter:`Filter`,firstDayOfWeek:0,gt:`Greater than`,gte:`Greater than or equal to`,lt:`Less than`,lte:`Less than or equal to`,matchAll:`Match All`,matchAny:`Match Any`,medium:`Medium`,monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthNamesShort:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],nextDecade:`Next Decade`,nextHour:`Next Hour`,nextMinute:`Next Minute`,nextMonth:`Next Month`,nextSecond:`Next Second`,nextYear:`Next Year`,noFileChosenMessage:`No file chosen`,noFilter:`No Filter`,notContains:`Not contains`,notEquals:`Not equals`,now:`Now`,passwordPrompt:`Enter a password`,pending:`Pending`,pm:`PM`,prevDecade:`Previous Decade`,prevHour:`Previous Hour`,prevMinute:`Previous Minute`,prevMonth:`Previous Month`,prevSecond:`Previous Second`,prevYear:`Previous Year`,reject:`No`,removeRule:`Remove Rule`,searchMessage:`{0} results are available`,selectionMessage:`{0} items selected`,showMonthAfterYear:!1,startsWith:`Starts with`,strong:`Strong`,today:`Today`,upload:`Upload`,weak:`Weak`,weekHeader:`Wk`,aria:{cancelEdit:`Cancel Edit`,close:`Close`,collapseLabel:`Collapse`,collapseRow:`Row Collapsed`,editRow:`Edit Row`,expandLabel:`Expand`,expandRow:`Row Expanded`,falseLabel:`False`,filterConstraint:`Filter Constraint`,filterOperator:`Filter Operator`,firstPageLabel:`First Page`,gridView:`Grid View`,hideFilterMenu:`Hide Filter Menu`,jumpToPageDropdownLabel:`Jump to Page Dropdown`,jumpToPageInputLabel:`Jump to Page Input`,lastPageLabel:`Last Page`,listLabel:`Option List`,listView:`List View`,maximizeLabel:`Maximize`,minimizeLabel:`Minimize`,moveAllToSource:`Move All to Source`,moveAllToTarget:`Move All to Target`,moveBottom:`Move Bottom`,moveDown:`Move Down`,moveToSource:`Move to Source`,moveToTarget:`Move to Target`,moveTop:`Move Top`,moveUp:`Move Up`,navigation:`Navigation`,next:`Next`,nextPageLabel:`Next Page`,nullLabel:`Not Selected`,otpLabel:`Please enter one time password character {0}`,pageLabel:`Page {page}`,passwordHide:`Hide Password`,passwordShow:`Show Password`,prevPageLabel:`Previous Page`,previous:`Previous`,removeLabel:`Remove`,rotateLeft:`Rotate Left`,rotateRight:`Rotate Right`,rowsPerPageLabel:`Rows per page`,saveEdit:`Save Edit`,scrollTop:`Scroll Top`,selectAll:`All items selected`,selectColor:`Select a color`,selectLabel:`Select`,selectRow:`Row Selected`,showFilterMenu:`Show Filter Menu`,slide:`Slide`,slideNumber:`{slideNumber}`,star:`1 star`,stars:`{star} stars`,trueLabel:`True`,unselectAll:`All items unselected`,unselectLabel:`Unselect`,unselectRow:`Row Unselected`,zoomImage:`Zoom Image`,zoomIn:`Zoom In`,zoomOut:`Zoom Out`}},Gw={};function Kw(e){let t=Gw[e];if(t)return t;t=Gw[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function qw(e,t){typeof t!=`string`&&(t=qw.defaultChars);let n=Kw(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;t+=e<128?`��`:String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;t+=e<2048||e>=55296&&e<=57343?`���`:String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}qw.defaultChars=`;/?:@&=+$,#`,qw.componentChars=``;var Jw={};function Yw(e){let t=Jw[e];if(t)return t;t=Jw[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Xw(e,t,n){typeof t!=`string`&&(n=t,t=Xw.defaultChars),n===void 0&&(n=!0);let r=Yw(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}Xw.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Xw.componentChars=`-_.!~*'()`;function Zw(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function Qw(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var $w=/^([a-z0-9.+-]+:)/i,eT=/:[0-9]*$/,tT=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,nT=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
12
- `,` `],rT=[`/`,`?`,`#`],iT=255,aT=/^[+a-z0-9A-Z_-]{0,63}$/,oT=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,sT={javascript:!0,"javascript:":!0},cT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function lT(e,t){if(e&&e instanceof Qw)return e;let n=new Qw;return n.parse(e,t),n}Qw.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=tT.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=$w.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&sT[o])&&(a=a.substr(2),this.slashes=!0)),!sT[o]&&(i||o&&!cT[o])){let e=-1;for(let t=0;t<rT.length;t++)r=a.indexOf(rT[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<nT.length;t++)r=a.indexOf(nT[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(aT)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(aT)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(oT);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>iT&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),cT[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},Qw.prototype.parseHost=function(e){let t=eT.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var uT=e({decode:()=>qw,encode:()=>Xw,format:()=>Zw,parse:()=>lT}),dT=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function fT(e){return e>=55296&&e<=57343||e>1114111?65533:dT.get(e)??e}function pT(e){let t=atob(e),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return r}var mT=pT(`QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdG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AoA0gagAAoAwg`),hT;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(hT||={});var gT;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(gT||={});var _T=32;function vT(e){return e>=gT.ZERO&&e<=gT.NINE}function yT(e){return e>=gT.UPPER_A&&e<=gT.UPPER_F||e>=gT.LOWER_A&&e<=gT.LOWER_F}function bT(e){return e>=gT.UPPER_A&&e<=gT.UPPER_Z||e>=gT.LOWER_A&&e<=gT.LOWER_Z||vT(e)}function xT(e){return e===gT.EQUALS||bT(e)}var ST;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(ST||={});var CT;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(CT||={});var wT=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=ST.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=CT.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=ST.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case ST.EntityStart:return e.charCodeAt(t)===gT.NUM?(this.state=ST.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ST.NamedEntity,this.stateNamedEntity(e,t));case ST.NumericStart:return this.stateNumericStart(e,t);case ST.NumericDecimal:return this.stateNumericDecimal(e,t);case ST.NumericHex:return this.stateNumericHex(e,t);case ST.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|_T)===gT.LOWER_X?(this.state=ST.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ST.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(vT(n)||yT(n)){let e=n<=gT.NINE?n-gT.ZERO:(n|_T)-gT.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(vT(n))this.result=this.result*10+(n-gT.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){if(this.consumed<=t)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===gT.SEMI)this.consumed+=1;else if(this.decodeMode===CT.Strict)return 0;return this.emitCodePoint(fT(this.result),this.consumed),this.errors&&(e!==gT.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&hT.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&hT.FLAG13)!==0){let a=(r&hT.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&hT.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],i=(r&hT.VALUE_LENGTH)>>14}if(t>=e.length)break;let a=e.charCodeAt(t);if(a===gT.SEMI&&i!==0&&(r&hT.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=ET(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===CT.Attribute&&(i===0||xT(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&hT.VALUE_LENGTH)>>14,i!==0){if(a===gT.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==CT.Strict&&(r&hT.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){let{result:e,decodeTree:t}=this,n=(t[e]&hT.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(hT.VALUE_LENGTH|hT.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){switch(this.state){case ST.NamedEntity:return this.result!==0&&(this.decodeMode!==CT.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ST.NumericDecimal:return this.emitNumericEntity(0,2);case ST.NumericHex:return this.emitNumericEntity(0,3);case ST.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ST.EntityStart:return 0}}};function TT(e){let t=``,n=new wT(e,e=>t+=String.fromCodePoint(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function ET(e,t,n,r){let i=(t&hT.BRANCH_LENGTH)>>7,a=t&hT.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=i+1>>1,s=0,c=i-1;for(;s<=c;){let t=s+c>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)s=t+1;else if(i>r)c=t-1;else return e[n+o+t]}return-1}var DT=TT(mT);function OT(e){return DT(e,CT.Strict)}var kT=2147483647,AT=36,jT=1,MT=26,NT=38,PT=700,FT=72,IT=128,LT=`-`,RT=/^xn--/,zT=/[^\0-\x7F]/,BT=/[\x2E\u3002\uFF0E\uFF61]/g,VT={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},HT=35,UT=Math.floor,WT=String.fromCharCode;function GT(e){throw RangeError(VT[e])}function KT(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function qT(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(BT,`.`);let i=KT(e.split(`.`),t).join(`.`);return r+i}function JT(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var YT=e=>String.fromCodePoint(...e),XT=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:AT},ZT=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},QT=function(e,t,n){let r=0;for(e=n?UT(e/PT):e>>1,e+=UT(e/t);e>455;r+=AT)e=UT(e/HT);return UT(r+36*e/(e+NT))},$T=function(e){let t=[],n=e.length,r=0,i=IT,a=FT,o=e.lastIndexOf(LT);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&GT(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=AT;;i+=AT){s>=n&&GT(`invalid-input`);let o=XT(e.charCodeAt(s++));o>=AT&&GT(`invalid-input`),o>UT((kT-r)/t)&&GT(`overflow`),r+=o*t;let c=i<=a?jT:i>=a+MT?MT:i-a;if(o<c)break;let l=AT-c;t>UT(kT/l)&&GT(`overflow`),t*=l}let c=t.length+1;a=QT(r-o,c,o==0),UT(r/c)>kT-i&&GT(`overflow`),i+=UT(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},eE=function(e){let t=[];e=JT(e);let n=e.length,r=IT,i=0,a=FT;for(let n of e)n<128&&t.push(WT(n));let o=t.length,s=o;for(o&&t.push(LT);s<n;){let n=kT;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>UT((kT-i)/c)&&GT(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>kT&&GT(`overflow`),n===r){let e=i;for(let n=AT;;n+=AT){let r=n<=a?jT:n>=a+MT?MT:n-a;if(e<r)break;let i=e-r,o=AT-r;t.push(WT(ZT(r+i%o,0))),e=UT(i/o)}t.push(WT(ZT(e,0))),a=QT(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},tE={version:`2.3.1`,ucs2:{decode:JT,encode:YT},decode:$T,encode:eE,toASCII:function(e){return qT(e,function(e){return zT.test(e)?`xn--`+eE(e):e})},toUnicode:function(e){return qT(e,function(e){return RT.test(e)?$T(e.slice(4).toLowerCase()):e})}},nE=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.THINKING_START=`THINKING_START`,e.THINKING_END=`THINKING_END`,e.THINKING_TEXT_MESSAGE_START=`THINKING_TEXT_MESSAGE_START`,e.THINKING_TEXT_MESSAGE_CONTENT=`THINKING_TEXT_MESSAGE_CONTENT`,e.THINKING_TEXT_MESSAGE_END=`THINKING_TEXT_MESSAGE_END`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e}({});function rE(e){return Object.keys(e).length>0?e:void 0}function iE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`promptTokens`in e}function aE(e,t){return iE(e)?e:oE(Array.isArray(e)?e:void 0,t)}function oE(e,t){let n=e?.[0];if(n==null&&t==null)return;let{promptTokensDetails:r,completionTokensDetails:i,...a}=t??{},o=rE({...n?.cachedInputTokens===void 0?{}:{cachedTokens:n.cachedInputTokens},...r}),s=rE({...n?.reasoningTokens===void 0?{}:{reasoningTokens:n.reasoningTokens},...i});return{promptTokens:n?.inputTokens??0,completionTokens:n?.outputTokens??0,totalTokens:n?.totalTokens??0,...a,...o===void 0?{}:{promptTokensDetails:o},...s===void 0?{}:{completionTokensDetails:s}}}function sE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cE(e,t){if(t==null)return e;if(e==null)return{...t};let n={...e,...t};return sE(e.tanstack)&&sE(t.tanstack)&&(n.tanstack={...e.tanstack,...t.tanstack}),n}function lE(e){if(e==null)return;let t=`metadata`in e?e.metadata:void 0,n=(typeof t==`object`&&t&&!Array.isArray(t)?t:e).tanstack;if(typeof n==`object`&&n&&!Array.isArray(n))return n}function uE(e,t){let n=e.metadata,r=lE(e)??{};return{...e,metadata:{...n??{},tanstack:{...r,...t}}}}function dE(e){let t=Error(e.message||e.error?.message||`An error occurred`),n=e.code??e.error?.code;return n!==void 0&&Object.assign(t,{code:n}),e.rawEvent!==void 0&&Object.assign(t,{rawEvent:e.rawEvent}),t}var fE=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function pE(e,t){return e>>>t|e<<32-t}function mE(e){let t=new TextEncoder().encode(e),n=t.length*8,r=t.length+1,i=r+(56-r%64+64)%64+8,a=new Uint8Array(i);a.set(t),a[t.length]=128;let o=new DataView(a.buffer);o.setUint32(i-8,Math.floor(n/4294967296)),o.setUint32(i-4,n>>>0);let s=1779033703,c=3144134277,l=1013904242,u=2773480762,d=1359893119,f=2600822924,p=528734635,m=1541459225,h=new Uint32Array(64);for(let e=0;e<i;e+=64){for(let t=0;t<16;t++)h[t]=o.getUint32(e+t*4);for(let e=16;e<64;e++){let t=h[e-15]??0,n=h[e-2]??0,r=pE(t,7)^pE(t,18)^t>>>3,i=pE(n,17)^pE(n,19)^n>>>10;h[e]=(h[e-16]??0)+r+(h[e-7]??0)+i>>>0}let t=s,n=c,r=l,i=u,a=d,g=f,v=p,y=m;for(let e=0;e<64;e++){let o=pE(a,6)^pE(a,11)^pE(a,25),s=a&g^~a&v,c=y+o+s+(fE[e]??0)+(h[e]??0)>>>0,l=(pE(t,2)^pE(t,13)^pE(t,22))+(t&n^t&r^n&r)>>>0;y=v,v=g,g=a,a=i+c>>>0,i=r,r=n,n=t,t=c+l>>>0}s=s+t>>>0,c=c+n>>>0,l=l+r>>>0,u=u+i>>>0,d=d+a>>>0,f=f+g>>>0,p=p+v>>>0,m=m+y>>>0}let g=e=>(e>>>0).toString(16).padStart(8,`0`);return g(s)+g(c)+g(l)+g(u)+g(d)+g(f)+g(p)+g(m)}function hE(e){return`sha256:${mE(e)}`}function gE(e,t){if(e===null)return`null`;if(typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e))return JSON.stringify(e);if(typeof e!=`object`)throw TypeError(`Interrupt values must be JSON-compatible.`);if(t.has(e))throw TypeError(`Interrupt values must not cycle.`);if(!Array.isArray(e)&&Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Interrupt values must use plain JSON objects.`);t.add(e);let n;if(Array.isArray(e)){let r=[];for(let n=0;n<e.length;n++)r.push(gE(e[n],t));n=`[${r.join(`,`)}]`}else{let r=e;n=`{${Object.keys(r).sort().map(e=>`${JSON.stringify(e)}:${gE(r[e],t)}`).join(`,`)}}`}return t.delete(e),n}function _E(e){return gE(e,new WeakSet)}function vE(e,t=hE){if(typeof e!=`string`)throw TypeError(`Interrupt digests require canonical JSON text.`);return t(e)}function yE(e){typeof e==`object`&&e&&!Object.isFrozen(e)&&(Object.values(e).forEach(yE),Object.freeze(e))}function bE(e){let t=JSON.parse(_E(e));return yE(t),t}function xE(e){let t=bE([...e].sort((e,t)=>e.interruptId.localeCompare(t.interruptId))),n=_E(t);return Object.freeze({resolutions:t,canonicalResolutions:n,fingerprint:vE(n)})}function SE(e){let t={};for(let[n,r]of Object.entries(e))n!==`$schema`&&(t[n]=r);return t}function CE(e){return(typeof e==`object`||typeof e==`function`)&&e!==null}function wE(e){if(!CE(e)||!(`~standard`in e))return!1;let t=e[`~standard`];return typeof t!=`object`||!t||!(`version`in t)||t.version!==1||!(`jsonSchema`in t)||typeof t.jsonSchema!=`object`||t.jsonSchema===null||!(`input`in t.jsonSchema)?!1:typeof t.jsonSchema.input==`function`}function TE(e){return CE(e)&&`~standard`in e&&typeof e[`~standard`]==`object`&&e[`~standard`]!==null&&`version`in e[`~standard`]&&e[`~standard`].version===1&&`validate`in e[`~standard`]&&typeof e[`~standard`].validate==`function`}function EE(e){return Object.keys(e).length>0?e:void 0}function DE(e){if(Array.isArray(e)){let t=e.map(e=>OE(e,e.required||[])),n=t.map(e=>e.nullWidening??{});return{schema:t.map(e=>e.schema),itemMap:n.some(e=>Object.keys(e).length>0)?n:void 0}}let t=OE(e,e.required||[]);return{schema:t.schema,itemMap:t.nullWidening}}function OE(e,t=[]){let n={...e},r={};if(n.type===`object`&&n.properties){let e={...n.properties},i=Object.keys(e),a={};for(let n of i){let r=e[n];if(!r)continue;let i=!t.includes(n),o=!1,s;if(r.type===`object`&&r.properties){let t=OE(r,r.required||[]);e[n]=i?{...t.schema,type:[`object`,`null`]}:t.schema,o=i,s=t.nullWidening}else if(r.type===`array`&&r.items){let t=DE(r.items);e[n]={...r,items:t.schema,...i?{type:[`array`,`null`]}:{}},o=i,s=t.itemMap?{items:t.itemMap}:void 0}else i&&(r.type&&!Array.isArray(r.type)?(e[n]={...r,type:[r.type,`null`]},o=!0):Array.isArray(r.type)&&!r.type.includes(`null`)&&(e[n]={...r,type:[...r.type,`null`]},o=!0));(o||s)&&(a[n]={...s??{},...o?{widened:!0}:{}})}n.properties=e,n.required=i,n.additionalProperties=!1,Object.keys(a).length>0&&(r.properties=a)}if(n.type===`array`&&n.items){let e=DE(n.items);n.items=e.schema,e.itemMap&&(r.items=e.itemMap)}return{schema:n,nullWidening:EE(r)}}function kE(e){if(wE(e)){let t=SE(e[`~standard`].jsonSchema.input({target:`draft-07`}));return`properties`in t&&!t.type&&(t.type=`object`),t.type===`object`&&!(`properties`in t)&&(t.properties={}),t.type===`object`&&!(`required`in t)&&(t.required=[]),t}if(TE(e))throw Error("Schema is a Standard Schema validator but does not expose a JSON Schema converter on `~standard.jsonSchema`. Use Zod v4.2+, ArkType v2.1.28+, or wrap a Valibot schema with `toStandardJsonSchema()` from `@valibot/to-json-schema` before passing it as `outputSchema`.");return typeof e==`object`?SE(e):e}function AE(e,t={}){if(!e)return;let{forStructuredOutput:n=!1}=t;if(!n&&!wE(e)&&!TE(e))return e;let r=kE(e);return!r||typeof r!=`object`||!n?r:OE(r,r.required||[]).schema}var jE=class extends Error{name=`StandardSchemaValidationError`;issues;constructor(e){super(`Validation failed: ${e.map(e=>e.message||`Validation failed`).join(`, `)}`),this.issues=e}};function ME(e,t){if(!TE(e))return t;let n=e[`~standard`].validate(t);if(n instanceof Promise)throw Error(`Schema validation returned a Promise. Use validateWithStandardSchema for async validation.`);if(!n.issues)return n.value;throw new jE(n.issues)}var NE=new Set([`$schema`,`$id`,`$ref`,`$defs`,`type`,`properties`,`required`,`additionalProperties`,`items`,`oneOf`,`anyOf`,`allOf`,`enum`,`const`,`format`,`minimum`,`maximum`,`minLength`,`maxLength`,`pattern`]);function PE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function FE(e){return PE(e)&&Object.keys(e).some(e=>NE.has(e))}function IE(e){return TE(e)||wE(e)||FE(e)}function LE(e){if(!PE(e))return!1;let t=Object.keys(e);return t.length>0&&t.every(e=>e===`approve`||e===`reject`)&&t.every(t=>IE(e[t]))}function RE(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}function zE(e){if(TE(e)){let t=wE(e)?RE(e[`~standard`].jsonSchema.input({target:`draft-2020-12`})):void 0;return{source:e,validator:e,...t!==void 0&&{jsonSchema:t}}}if(FE(e))return{source:e,jsonSchema:e};throw TypeError(`Expected a supported SchemaInput.`)}function BE(e){let t={approved:{const:e.approved}},n=[`approved`];return e.approved&&e.inputSchema&&(t.editedArgs=e.inputSchema.jsonSchema??{}),e.payload&&(t.payload=e.payload.jsonSchema??{},n.push(`payload`)),{type:`object`,properties:t,required:n,additionalProperties:!1}}function VE(e,t){let n=t===void 0?null:zE(t),r=null,i=null;if(e!==void 0){if(TE(e)||FE(e))r=zE(e),i=r;else if(LE(e))r=e.approve===void 0?null:zE(e.approve),i=e.reject===void 0?null:zE(e.reject);else throw TypeError(`approvalSchema must be a SchemaInput or a nonempty map containing approve or reject.`)}let a={oneOf:[BE({approved:!0,payload:r,inputSchema:n}),BE({approved:!1,payload:i,inputSchema:null})]},o=_E(a),s=_E({approve:r?.jsonSchema??null,reject:i?.jsonSchema??null});return{branches:{approve:r,reject:i},responseSchema:a,responseSchemaHash:vE(o),approvalSchemaHash:vE(s)}}function HE(e){return vE(e===void 0?`undefined`:_E(zE(e).jsonSchema??{standardValidator:`unserialized`}))}var UE=`tanstack:interruptBinding`,WE=UE;function GE(e){return e&&typeof e==`object`?e:null}function KE(e,t){return typeof e[t]==`string`?e[t]:void 0}function qE(e){let t=e.v;return t===void 0||t===1}function JE(e){let t=GE(e.metadata),n=t?GE(t[WE]):null;if(!n||KE(n,`interruptId`)!==e.id||!qE(n))return;let r=KE(n,`kind`),i=KE(n,`interruptId`),a=KE(n,`responseSchemaHash`),o=KE(n,`expiresAt`);if(!i||a===``||o!==void 0&&!Number.isFinite(Date.parse(o)))return;if(r===`generic`){let e=KE(n,`definitionId`),t=KE(n,`key`),s=n.batchIndex,c=KE(n,`payloadSchemaHash`);return(e!==void 0||t!==void 0||s!==void 0||c!==void 0)&&(!e||!t||typeof s!=`number`||!Number.isInteger(s)||s<0)?void 0:{v:1,kind:r,interruptId:i,...a?{responseSchemaHash:a}:{},...o?{expiresAt:o}:{},...e?{definitionId:e}:{},...t?{key:t}:{},...typeof s==`number`?{batchIndex:s}:{},...c?{payloadSchemaHash:c}:{}}}if(!a)return;let s=KE(n,`toolName`),c=KE(n,`toolCallId`);if(s&&c){if(r===`client-tool-execution`){let e=KE(n,`outputSchemaHash`);return e?{v:1,kind:r,interruptId:i,toolName:s,toolCallId:c,outputSchemaHash:e,responseSchemaHash:a,...o?{expiresAt:o}:{}}:void 0}if(r===`tool-approval`){let e=KE(n,`inputSchemaHash`),t=KE(n,`approvalSchemaHash`);return!e||!t?void 0:{v:1,kind:r,interruptId:i,toolName:s,toolCallId:c,originalArgs:n.originalArgs,inputSchemaHash:e,approvalSchemaHash:t,responseSchemaHash:a,...o?{expiresAt:o}:{}}}}}function YE(e){let t=JE(e);if(!t)return;let n=GE(e.metadata),r=n?GE(n[WE]):null;if(!r)return;let i=KE(r,`interruptedRunId`),a=r.generation;if(!(!i||typeof a!=`number`||!Number.isInteger(a)||a<0))return{...t,interruptedRunId:i,generation:a}}var XE=`tanstack:interruptPayload`;function ZE(e,t){if(!wE(e))throw TypeError(`${t} must be a Standard Schema with a JSON Schema converter.`);try{let t=e[`~standard`].jsonSchema.input({target:`draft-07`});if(t===void 0)throw TypeError(`The exported schema is undefined.`);if(typeof t==`function`)throw TypeError(`The exported schema must not be a function.`);if(Array.isArray(t)||!t||typeof t!=`object`||![Object.prototype,null].includes(Object.getPrototypeOf(t)))throw TypeError(`The exported schema must be a plain JSON object.`);let n={};for(let[e,r]of Object.entries(t))e!==`$schema`&&(n[e]=r);return{json:n,canonicalJson:_E(n)}}catch(e){throw TypeError(`${t} could not export compatible JSON Schema: ${e instanceof Error?e.message:String(e)}`)}}function QE(e){return vE(ZE(e,`Interrupt schema`).canonicalJson)}var $E=`tanstack:interruptContinuation`;function eD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function tD(e){return{[$E]:e}}function nD(e){let t=JE(e);if(t?.kind!==`generic`||t.definitionId===void 0||t.key===void 0||t.batchIndex===void 0)return;let n=eD(e.metadata)?e.metadata:void 0,r=n!==void 0&&Object.prototype.hasOwnProperty.call(n,`tanstack:interruptPayload`);return{v:1,definitionId:t.definitionId,key:t.key,batchIndex:t.batchIndex,reason:e.reason,message:e.message??``,...e.expiresAt===void 0?{}:{expiresAt:e.expiresAt},...t.responseSchemaHash===void 0?{}:{responseSchemaHash:t.responseSchemaHash},...t.payloadSchemaHash===void 0?{}:{payloadSchemaHash:t.payloadSchemaHash},...r?{payload:n[XE]}:{}}}var rD=new Set([`text`,`image`,`audio`,`video`,`document`]);function iD(e){if(typeof e!=`object`||!e)return!1;let t=e;if(typeof t.type!=`string`||!rD.has(t.type))return!1;if(t.type===`text`)return typeof t.content==`string`;let n=t.source;if(typeof n!=`object`||!n)return!1;let r=n;return typeof r.value==`string`?r.type===`data`?typeof r.mimeType==`string`:r.type===`url`:!1}function aD(e){return Array.isArray(e)&&e.length>0&&e.every(iD)}function oD(e){return typeof e==`string`||aD(e)?e:JSON.stringify(e)}function sD(e){let t=e?.metadata;return typeof t==`object`&&t&&t.providerExecuted===!0?t:null}function cD(e){return sD(e)!==null}function lD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function uD(e){return e.type===`text`||e.type===`image`||e.type===`audio`||e.type===`video`||e.type===`document`}function dD(e){try{return JSON.stringify(e)??``}catch{return``}}function fD(e){return typeof e==`string`&&e!==``?e:void 0}function pD(e){if(`encryptedValue`in e){let t=fD(e.encryptedValue);if(t!==void 0)return t}return fD(lE(e)?.signature)}function mD(e){return e.length===0?null:e.every(e=>e.type===`text`)?e.map(e=>e.content).join(``)||null:e}function hD(e){return e==null?``:typeof e==`string`?e:e.filter(e=>e.type===`text`).map(e=>e.content).join(``)}function gD(e){return Array.isArray(e)?e:hD(e)}function _D(e){if(!(`role`in e)||e.role!==`tool`)return e;let t=e,n=lE(t)?.toolResult;if(!lD(n)||`content`in n&&!aD(n.content))return e;let r={...e};if(`id`in n||Reflect.deleteProperty(r,`id`),`createdAt`in n||Reflect.deleteProperty(r,`createdAt`),typeof n.id==`string`&&Reflect.set(r,`id`,n.id),typeof n.createdAt==`string`){let e=vD(n.createdAt);e&&Reflect.set(r,`createdAt`,e)}aD(n.content)&&Reflect.set(r,`content`,n.content);let i=Reflect.get(t,`metadata`);if(lD(i)){let e=i.tanstack;if(lD(e)){let{toolResult:t,...n}=e,a={...i};Object.keys(n).length?a.tanstack=n:delete a.tanstack,Object.keys(a).length?Reflect.set(r,`metadata`,a):Reflect.deleteProperty(r,`metadata`)}}return r}function vD(e){if(e instanceof Date)return Number.isNaN(e.getTime())?void 0:e;if(typeof e!=`string`)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function yD(e){if(e.type!==`tool-result`)return e;let t=vD(e.createdAt),{createdAt:n,...r}=e;return t===void 0?r:{...r,createdAt:t}}function bD(e){return vD(lE(e)?.createdAt)}function xD(e){let t=vD(e.createdAt);return t===void 0?{}:{createdAt:t}}function SD(e){return e.name===void 0?{}:{name:e.name}}function CD(e){if(typeof e!=`object`||!e||Array.isArray(e)||!(`type`in e)||e.type!==`ui-resource`||!(`toolCallId`in e)||typeof e.toolCallId!=`string`||!(`toolName`in e)||typeof e.toolName!=`string`||!(`resource`in e)||e.resource==null||typeof e.resource!=`object`||Array.isArray(e.resource))return!1;let t=e.resource;return`uri`in t&&typeof t.uri==`string`&&`mimeType`in t&&typeof t.mimeType==`string`}function wD(e){return`${e.toolCallId}\0${e.toolName}\0${e.resource.uri}`}function TD(e,t){if(t.length===0)return e;let n=new Set(e.parts.filter(CD).map(e=>wD(e))),r=t.filter(e=>!n.has(wD(e)));return r.length===0?e:{...e,parts:[...e.parts,...r]}}function ED(e){let t=e.parts.filter(CD),n=e.metadata??{},r=lE(e),i={};r?.model!==void 0&&(i.model=r.model),r?.signature!==void 0&&(i.signature=r.signature),t.length>0&&(i.uiResources=t);let a={...n};return Object.keys(i).length>0?a.tanstack=i:delete a.tanstack,Object.keys(a).length>0?a:void 0}function DD(e){return e.role===`system`?[]:e.role===`assistant`?jD(e):[OD(e)]}function OD(e){let t=[];for(let n of e.parts)uD(n)&&t.push(n);return{id:e.id,role:e.role,content:mD(t),...SD(e),...xD(e),...e.metadata!==void 0&&{metadata:e.metadata}}}function kD(){return{contentParts:[],toolCalls:[]}}function AD(e){return e.state===`input-complete`||e.state===`complete`||e.state===`approval-requested`||e.state===`approval-responded`||e.state===`error`||e.output!==void 0}function jD(e){let t=[],n=kD(),r=[],i=new Set,a={id:e.id,...SD(e),...xD(e)},o=ED(e),s={...a,...o!==void 0&&{metadata:o}};function c(e=!1){let i=mD(n.contentParts),a=i!==null,o=n.toolCalls.length>0,c=r.length>0;(e||a||o||c)&&(t.push({...s,role:`assistant`,content:i,...o&&{toolCalls:n.toolCalls},...c&&{thinking:r},...n.structuredOutput&&{structuredOutput:n.structuredOutput}}),r=[]),n=kD()}for(let a of e.parts)switch(a.type){case`text`:case`image`:case`audio`:case`video`:case`document`:n.contentParts.push(a);break;case`tool-call`:AD(a)&&n.toolCalls.push({id:a.id,type:`function`,function:{name:a.name,arguments:a.arguments},...a.metadata!==void 0&&{metadata:a.metadata}});break;case`tool-result`:c(t.length===0),(a.state===`complete`||a.state===`error`)&&!i.has(a.toolCallId)&&(t.push({...a.id!==void 0&&{id:a.id},...xD(a),role:`tool`,content:a.content,toolCallId:a.toolCallId,...a.name!==void 0&&{name:a.name},...a.metadata!==void 0&&{metadata:a.metadata},...a.error!==void 0&&{error:a.error}}),i.add(a.toolCallId));break;case`thinking`:(a.content||a.signature)&&(n.toolCalls.some(cD)&&c(),r.push({content:a.content,...a.signature&&{signature:a.signature}}));break;case`structured-output`:if(a.status===`complete`){let e=a.raw===``?a.data===void 0?``:dD(a.data):a.raw;e!==``&&(n.contentParts.push({type:`text`,content:e}),n.structuredOutput=a)}}c();for(let n of e.parts)if(n.type===`tool-call`&&(n.output!==void 0&&!i.has(n.id)&&(t.push({role:`tool`,content:oD(n.output),toolCallId:n.id}),i.add(n.id)),n.output===void 0&&n.state===`approval-responded`&&n.approval?.approved!==void 0&&!i.has(n.id))){let e=n.approval.approved;t.push({role:`tool`,content:JSON.stringify({approved:e,...e&&{pendingExecution:!0},message:e?`User approved this action`:`User denied this action`}),toolCallId:n.id}),i.add(n.id)}return t.length===0&&t.push({...s,role:`assistant`,content:null}),t}function MD(e,t){let n=[],r=vD(e.createdAt);if(e.role===`assistant`&&e.thinking?.length)for(let t of e.thinking)(t.content||t.signature)&&n.push({type:`thinking`,content:t.content,...t.signature&&{signature:t.signature}});let i=e.structuredOutput??FD(lE(e)?.structuredOutput);if(e.role===`assistant`&&i){if(typeof e.content==`string`&&e.content&&e.content!==i.raw){let t=i.raw,r=t!==``&&e.content.endsWith(t)?e.content.slice(0,-t.length):e.content;r&&n.push({type:`text`,content:r})}n.push(i)}else if(e.role===`tool`&&e.toolCallId)n.push({type:`tool-result`,toolCallId:e.toolCallId,content:gD(e.content),state:e.error===void 0?`complete`:`error`,...e.id!==void 0&&{id:e.id},...e.name!==void 0&&{name:e.name},...e.metadata!==void 0&&{metadata:e.metadata},...r!==void 0&&{createdAt:r},...e.error!==void 0&&{error:e.error}});else if(Array.isArray(e.content))for(let t of e.content)n.push(t);else{let t=hD(e.content);t&&n.push({type:`text`,content:t})}if(e.toolCalls&&e.toolCalls.length>0)for(let t of e.toolCalls){let e;try{e=JSON.parse(t.function.arguments)}catch{e=void 0}n.push({type:`tool-call`,id:t.id,name:t.function.name,arguments:t.function.arguments,state:`input-complete`,...e!==void 0&&{input:e},...t.metadata!==void 0&&{metadata:t.metadata}})}let a={id:t||RD(),role:e.role===`tool`?`assistant`:e.role,parts:n,...SD(e),...r!==void 0&&{createdAt:r},...e.metadata!==void 0&&{metadata:e.metadata}},o=lE(e)?.uiResources;return TD(a,Array.isArray(o)?o.filter(CD):[])}function ND(e){if(`parts`in e)return PD(e,{...e,id:e.id||RD()});let t=e.id||RD();switch(e.role){case`user`:return PD(e,{id:t,role:`user`,parts:ID(e.content)});case`assistant`:{let n=lE(e),r=n?.toolCallMetadata,i=FD(n?.structuredOutput),a=e.toolCalls?.map(e=>{let t=typeof r==`object`&&r?r[e.id]:void 0;return t===void 0?e:{...e,metadata:t}});return PD(e,MD({role:`assistant`,content:e.content??null,...SD(e),...a&&{toolCalls:a},...i&&{structuredOutput:i}},t))}case`tool`:{e=_D(e);let n=vD(`createdAt`in e?e.createdAt:void 0)??bD(e);return PD(e,MD({role:`tool`,content:e.content,toolCallId:e.toolCallId,...`name`in e&&typeof e.name==`string`?{name:e.name}:{},...`id`in e&&typeof e.id==`string`?{id:e.id}:{},...`metadata`in e&&e.metadata!=null?{metadata:e.metadata}:{},...n===void 0?{}:{createdAt:n},...e.error!==void 0&&{error:e.error}},t))}case`system`:case`developer`:return PD(e,{id:t,role:`system`,parts:e.content?[{type:`text`,content:e.content}]:[]});case`reasoning`:{let n=pD(e),r=typeof e.content==`string`?e.content:``;return PD(e,{id:t,role:`assistant`,parts:r||n!==void 0?[{type:`thinking`,content:r,...n===void 0?{}:{signature:n}}]:[]})}default:return PD(e,{id:t,role:`assistant`,parts:[]})}}function PD(e,t){let n=t.parts.map(e=>yD(e));n!==t.parts&&(t={...t,parts:n});let r=`name`in e&&typeof e.name==`string`?e.name:void 0,i=r===void 0?t:{...t,name:r},a;if(`metadata`in e){let t=e.metadata;typeof t==`object`&&t&&!Array.isArray(t)&&(a=t,i={...i,metadata:a})}let o=vD(i.createdAt)??(a===void 0?void 0:bD(a));if(o!==void 0&&!Object.is(o,i.createdAt))i={...i,createdAt:o};else if(o===void 0&&i.createdAt!==void 0){let{createdAt:e,...t}=i;i=t}let s=lE(a)?.uiResources,c=Array.isArray(s)?s.filter(CD):[];return TD(i,c)}function FD(e){if(!(e==null||e.status!==`streaming`&&e.status!==`complete`&&e.status!==`error`||typeof e.raw!=`string`))return{type:`structured-output`,status:e.status,raw:e.raw,...e.partial===void 0?{}:{partial:e.partial},...e.data===void 0?{}:{data:e.data},...e.reasoning?{reasoning:e.reasoning}:{},...e.errorMessage===void 0?{}:{errorMessage:e.errorMessage}}}function ID(e){if(typeof e==`string`)return e?[{type:`text`,content:e}]:[];let t=[];for(let n of e)n.type===`text`?t.push({type:`text`,content:n.text}):n.type!==`binary`&&t.push(n);return t}function LD(e,t){if(`parts`in e){let n=e.parts.map(e=>yD(e));return{...e,parts:n,id:e.id||t(),createdAt:vD(e.createdAt)??new Date}}return{...MD(e,t()),createdAt:vD(e.createdAt)??new Date}}function RD(){return`msg-${Date.now()}-${Math.random().toString(36).substring(7)}`}function zD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function BD(e,t,n,r,i=!1){let a=zD(e)?e:{},o=zD(a.tanstack)?{...a.tanstack}:{};i&&delete o.uiResources;let s=vD(t),c={...n===void 0?{}:{id:n},...s&&{createdAt:s.toISOString()},...Array.isArray(r)&&{content:r}},l={...a,tanstack:{...o,toolResult:c}};return Object.keys(l).length?l:void 0}function VD(e,t){let n=[],r=new Set(e.flatMap(e=>`id`in e&&e.id&&e.role!==`tool`?[e.id]:[])),i=t?.includeSnapshotStructuredOutput??!1,a=new Set;for(let t of e)t.role===`assistant`&&t.id!==void 0&&a.add(t.id);for(let t of e){if(!(`parts`in t)&&t.role===`tool`&&t.toolCallId){let e=QD(eO(t.id,t.toolCallId,a),r),i=BD(t.metadata,t.createdAt,t.id,t.content);n.push({role:`tool`,id:e,...t.name!==void 0&&{name:t.name},toolCallId:t.toolCallId,content:typeof t.content==`string`?t.content:JSON.stringify(t.content),...t.error!==void 0&&{error:t.error},...i!==void 0&&{metadata:i}});continue}let e=`parts`in t?t:MD(t,t.id),o=e.parts;if(r.add(e.id),t.role===`system`){n.push(HD(e,`system`,{content:o.length>0?KD(o):t.content??``},o,i));continue}if(t.role===`user`){n.push(HD(e,`user`,{content:o.length>0?qD(o):t.content??``},o,i));continue}for(let t of o)if(t.type===`thinking`){let i={role:`reasoning`,id:$D(XD(e.id,t),r),content:t.content};t.signature&&(i.encryptedValue=t.signature),n.push(i)}let s=KD(o),c=YD(o);n.push(HD(e,`assistant`,{...s!==``&&{content:s},...c&&{toolCalls:c}},o,i));let l=new Set(o.flatMap(e=>e.type===`tool-result`?[e.toolCallId]:[]));for(let e of o)if(e.type===`tool-result`){let t=QD(e.id??ZD(e.toolCallId),r),i=BD(e.metadata,e.createdAt,e.id,e.content,!0);n.push({role:`tool`,id:t,toolCallId:e.toolCallId,...e.name!==void 0&&{name:e.name},content:typeof e.content==`string`?e.content:JSON.stringify(e.content),...e.error!==void 0&&{error:e.error},...i!==void 0&&{metadata:i}})}else if(e.type===`tool-call`){let t=e.approval?.approved;if(l.has(e.id)||e.output===void 0&&(e.state!==`approval-responded`||t===void 0))continue;let i=e.output===void 0?JSON.stringify({approved:t,...t&&{pendingExecution:!0},message:t?`User approved this action`:`User denied this action`}):oD(e.output),a=typeof i==`string`?i:JSON.stringify(i);n.push({role:`tool`,id:QD(ZD(e.id),r),toolCallId:e.id,content:a,metadata:BD(void 0,void 0,void 0,i)})}}return n}function HD(e,t,n,r,i){let a=UD(e,r,i),o={id:e.id,...e.name!==void 0&&{name:e.name},...a!==void 0&&{metadata:a}};return t===`system`?{...o,role:t,content:String(n.content??``)}:t===`user`?{...o,role:t,content:n.content??``}:{...o,role:t,...typeof n.content==`string`&&{content:n.content},...n.toolCalls!==void 0&&{toolCalls:n.toolCalls}}}function UD(e,t,n){let r={...e.metadata??{}},i=lE(e),a={};i?.model!==void 0&&(a.model=i.model),i?.signature!==void 0&&(a.signature=i.signature);let o=vD(e.createdAt);o!==void 0&&(a.createdAt=o.toISOString());let s=WD(t,n);s&&(a.structuredOutput=s);let c={};for(let e of t)e.type===`tool-call`&&e.metadata!==void 0&&(c[e.id]=e.metadata);Object.keys(c).length>0&&(a.toolCallMetadata=c);let l=t.filter(e=>e.type===`ui-resource`);return l.length>0&&(a.uiResources=l),Object.keys(a).length>0?r.tanstack=a:delete r.tanstack,Object.keys(r).length>0?r:void 0}function WD(e,t){for(let n of e)if(n.type===`structured-output`&&(t||n.status!==`complete`))return GD(n,t)}function GD(e,t){return{status:e.status,raw:e.raw,...t&&e.partial!==void 0?{partial:e.partial}:{},...t&&e.data!==void 0?{data:e.data}:{},...t&&e.reasoning?{reasoning:e.reasoning}:{},...e.errorMessage!==void 0&&{errorMessage:e.errorMessage}}}function KD(e){let t=[];for(let n of e)n.type===`text`?t.push(n.content):n.type===`structured-output`&&n.status===`complete`&&n.raw!==``&&t.push(n.raw);return t.join(``)}function qD(e){if(!e.some(e=>e.type===`image`||e.type===`audio`||e.type===`video`||e.type===`document`))return KD(e);let t=[];for(let n of e)n.type===`text`?t.push({type:`text`,text:n.content}):(n.type===`image`||n.type===`audio`||n.type===`video`||n.type===`document`)&&t.push(n);return t}function JD(e){if(typeof e!=`object`||!e||Array.isArray(e)||!(`thoughtSignature`in e))return;let t=e.thoughtSignature;return typeof t==`string`&&t!==``?t:void 0}function YD(e){let t=[];for(let n of e)if(n.type===`tool-call`){let e=JD(n.metadata);t.push({id:n.id,type:`function`,function:{name:n.name,arguments:n.arguments},...e===void 0?{}:{encryptedValue:e}})}return t.length>0?t:void 0}function XD(e,t){return`${e}-reasoning-${t.id??tO(t.content)}`}function ZD(e){return`tool-${e}`}function QD(e,t){return $D(e,t)}function $D(e,t){if(!t.has(e))return t.add(e),e;let n=2;for(;t.has(`${e}-${n}`);)n++;let r=`${e}-${n}`;return t.add(r),r}function eO(e,t,n){let r=ZD(t);return e===void 0||n.has(e)?r:e}function tO(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t).toString(36)}function nO(e){if((e.type===nE.RUN_FINISHED||e.type===nE.RUN_ERROR)&&(Array.isArray(e.usage)||iE(e.usage))){let t=aE(e.usage,lE(e)?.usage);t!==void 0&&(e.usage=t)}if(e.type===nE.TOOL_CALL_START&&e.toolName===void 0&&e.toolCallName&&(e.toolName=e.toolCallName),e.type===nE.TOOL_CALL_END&&e.input===void 0){let t=lE(e)?.input;t!==void 0&&(e.input=t)}return e}function rO(e){nO(e);let t=lE(e),n=e;if(t==null)return n;for(let[e,r]of Object.entries(t))e!==`usage`&&e!==`interruptErrors`&&n[e]===void 0&&r!==void 0&&(n[e]=r);return t.interruptErrors!==void 0&&(n[`tanstack:interruptErrors`]=t.interruptErrors),n}function iO(){let e=globalThis.crypto;return e?.randomUUID?e.randomUUID():Math.random().toString(36).slice(2)}var aO;function oO(){return aO===void 0?(globalThis.__TANSTACK_AI_DEVTOOLS_RUNTIME_ID__||(globalThis.__TANSTACK_AI_DEVTOOLS_RUNTIME_ID__=iO()),aO=globalThis.__TANSTACK_AI_DEVTOOLS_RUNTIME_ID__,aO):aO}var sO=0;function cO(e){return e==null||e===``?`missing`:`value-${encodeURIComponent(String(e))}`}function lO(e){let t=e.runtimeId??oO(),n=e.eventId&&e.eventId.length>0?e.eventId:[e.source,e.eventType,cO(t),cO(e.clientId),cO(e.requestId),cO(e.streamId),cO(e.hookId),cO(e.threadId),cO(e.runId),cO(e.messageId),cO(e.toolCallId),cO(e.sequence),e.timestamp,oO(),sO++].join(`:`);return{...e,runtimeId:t,eventId:n}}var uO=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},dO=class extends uO{constructor(){super({pluginId:`tanstack-ai-devtools`})}},fO=Symbol.for(`tanstack.ai.devtools.eventClient`);function pO(){let e=globalThis,t=e[fO];if(t)return t;let n=new dO;return e[fO]=n,n}var mO=pO();function hO(e,t){mO.emit(e,t)}function gO(e){if(e.approvalSchema!==void 0&&e.needsApproval!==!0)throw TypeError(`approvalSchema requires needsApproval: true.`);let t=e.inputSchema,n=e.outputSchema,r=e.approvalSchema,i=e.needsApproval;return{__toolSide:`definition`,...e,inputSchema:t,outputSchema:n,approvalSchema:r,needsApproval:i,server(a){return{__toolSide:`server`,...e,inputSchema:t,outputSchema:n,approvalSchema:r,needsApproval:i,execute:a}},client(a){return{__toolSide:`client`,...e,inputSchema:t,outputSchema:n,approvalSchema:r,needsApproval:i,...a!==void 0&&{execute:a}}}}}function _O(e){return typeof e==`string`&&e!==``?e:void 0}function vO(e){if(`runId`in e){let t=_O(e.runId);if(t!==void 0)return t}return _O(lE(e)?.runId)}var yO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Allow=e.ALL=e.COLLECTION=e.ATOM=e.SPECIAL=e.INF=e._INFINITY=e.INFINITY=e.NAN=e.BOOL=e.NULL=e.OBJ=e.ARR=e.NUM=e.STR=void 0,e.STR=1,e.NUM=2,e.ARR=4,e.OBJ=8,e.NULL=16,e.BOOL=32,e.NAN=64,e.INFINITY=128,e._INFINITY=256,e.INF=e.INFINITY|e._INFINITY,e.SPECIAL=e.NULL|e.BOOL|e.INF|e.NAN,e.ATOM=e.STR|e.NUM|e.SPECIAL,e.COLLECTION=e.ARR|e.OBJ,e.ALL=e.ATOM|e.COLLECTION,e.Allow={STR:e.STR,NUM:e.NUM,ARR:e.ARR,OBJ:e.OBJ,NULL:e.NULL,BOOL:e.BOOL,NAN:e.NAN,INFINITY:e.INFINITY,_INFINITY:e._INFINITY,INF:e.INF,SPECIAL:e.SPECIAL,ATOM:e.ATOM,COLLECTION:e.COLLECTION,ALL:e.ALL},e.default=e.Allow})),bO=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.Allow=e.MalformedJSON=e.PartialJSON=e.parseJSON=e.parse=void 0;var r=yO();Object.defineProperty(e,"Allow",{enumerable:!0,get:function(){return r.Allow}}),n(yO(),e);var i=class extends Error{};e.PartialJSON=i;var a=class extends Error{};e.MalformedJSON=a;function o(e,t=r.Allow.ALL){if(typeof e!=`string`)throw TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw Error(`${e} is empty`);return s(e.trim(),t)}e.parseJSON=o;var s=(e,t)=>{let n=e.length,o=0,s=e=>{throw new i(`${e} at position ${o}`)},c=e=>{throw new a(`${e} at position ${o}`)},l=()=>(m(),o>=n&&s(`Unexpected end of input`),e[o]===`"`?u():e[o]===`{`?d():e[o]===`[`?f():e.substring(o,o+4)===`null`||r.Allow.NULL&t&&n-o<4&&`null`.startsWith(e.substring(o))?(o+=4,null):e.substring(o,o+4)===`true`||r.Allow.BOOL&t&&n-o<4&&`true`.startsWith(e.substring(o))?(o+=4,!0):e.substring(o,o+5)===`false`||r.Allow.BOOL&t&&n-o<5&&`false`.startsWith(e.substring(o))?(o+=5,!1):e.substring(o,o+8)===`Infinity`||r.Allow.INFINITY&t&&n-o<8&&`Infinity`.startsWith(e.substring(o))?(o+=8,1/0):e.substring(o,o+9)===`-Infinity`||r.Allow._INFINITY&t&&1<n-o&&n-o<9&&`-Infinity`.startsWith(e.substring(o))?(o+=9,-1/0):e.substring(o,o+3)===`NaN`||r.Allow.NAN&t&&n-o<3&&`NaN`.startsWith(e.substring(o))?(o+=3,NaN):p()),u=()=>{let i=o,a=!1;for(o++;o<n&&(e[o]!==`"`||a&&e[o-1]===`\\`);)a=e[o]===`\\`&&!a,o++;if(e.charAt(o)==`"`)try{return JSON.parse(e.substring(i,++o-Number(a)))}catch(e){c(String(e))}else if(r.Allow.STR&t)try{return JSON.parse(e.substring(i,o-Number(a))+`"`)}catch{return JSON.parse(e.substring(i,e.lastIndexOf(`\\`))+`"`)}s(`Unterminated string literal`)},d=()=>{o++,m();let i={};try{for(;e[o]!==`}`;){if(m(),o>=n&&r.Allow.OBJ&t)return i;let a=u();m(),o++;try{i[a]=l()}catch(e){if(r.Allow.OBJ&t)return i;throw e}m(),e[o]===`,`&&o++}}catch{if(r.Allow.OBJ&t)return i;s(`Expected '}' at end of object`)}return o++,i},f=()=>{o++;let n=[];try{for(;e[o]!==`]`;)n.push(l()),m(),e[o]===`,`&&o++}catch{if(r.Allow.ARR&t)return n;s(`Expected ']' at end of array`)}return o++,n},p=()=>{if(o===0){e===`-`&&c(`Not sure what '-' is`);try{return JSON.parse(e)}catch(n){if(r.Allow.NUM&t)try{return JSON.parse(e.substring(0,e.lastIndexOf(`e`)))}catch{}c(String(n))}}let i=o;for(e[o]===`-`&&o++;e[o]&&`,]}`.indexOf(e[o])===-1;)o++;o==n&&!(r.Allow.NUM&t)&&s(`Unterminated number literal`);try{return JSON.parse(e.substring(i,o))}catch{e.substring(i,o)===`-`&&s(`Not sure what '-' is`);try{return JSON.parse(e.substring(i,e.lastIndexOf(`e`)))}catch(e){c(String(e))}}},m=()=>{for(;o<n&&`
13
- \r `.includes(e[o]);)o++};return l()};e.parse=o}))(),xO=new class{parse(e){if(e&&e.trim()!==``)try{return(0,bO.parse)(e)}catch{return}}};function SO(e){return xO.parse(e)}var CO=class{shouldEmit(e,t){return!0}};function wO(e,t,n){return e.map(e=>{if(e.id!==t)return e;let r=[...e.parts],i=r.length>0?r[r.length-1]:null;return i&&i.type===`text`?r[r.length-1]={type:`text`,content:n}:r.push({type:`text`,content:n}),{...e,parts:r}})}function TO(e,t,n){return e.map(e=>{if(e.id!==t)return e;let r=[...e.parts],i=r.find(e=>e.type===`tool-call`&&e.id===n.id),a=n.metadata??i?.metadata,o=n.input??i?.input,s={type:`tool-call`,id:n.id,name:n.name,arguments:n.arguments,state:n.state,...i?.approval&&{approval:{...i.approval}},...i?.output!==void 0&&{output:i.output},...o!==void 0&&{input:o},...a!==void 0&&{metadata:a}};return i?r[r.indexOf(i)]=s:r.push(s),{...e,parts:r}})}function EO(e,t,n,r,i,a){return e.map(e=>{if(e.id!==t)return e;let o=[...e.parts],s=o.findIndex(e=>e.type===`tool-result`&&e.toolCallId===n),c={type:`tool-result`,toolCallId:n,content:r,state:i,...a&&{error:a}};return s>=0?o[s]=c:o.push(c),{...e,parts:o}})}function DO(e,t,n,r){return e.map(e=>{if(e.id!==t)return e;let i=[...e.parts],a=i.find(e=>e.type===`tool-call`&&e.id===n);if(a){let e=i.indexOf(a);i[e]={...a,state:`approval-requested`,approval:{id:r,needsApproval:!0}}}return{...e,parts:i}})}function OO(e,t,n,r,i){return e.map(e=>{let a=[...e.parts],o=a.find(e=>e.type===`tool-call`&&e.id===t);if(o){let e=a.indexOf(o);a[e]={...o,output:i?{error:i}:n,state:r??(i?`error`:`complete`)}}return{...e,parts:a}})}function kO(e,t,n){return e.map(e=>{let r=[...e.parts],i=r.find(e=>e.type===`tool-call`&&e.approval?.id===t);if(i&&i.approval){let e=r.indexOf(i);r[e]={...i,approval:{...i.approval,approved:n},state:`approval-responded`}}return{...e,parts:r}})}function AO(e,t,n){return e.map(e=>{if(e.id!==t)return e;let r=[...e.parts],i=r.findIndex(e=>e.type===`structured-output`),a=i>=0?r[i]:null,o=(a?.raw??``)+n,s=SO(o)??a?.partial,c={type:`structured-output`,status:`streaming`,raw:o,...s===void 0?{}:{partial:s},...a?.reasoning===void 0?{}:{reasoning:a.reasoning}};return i>=0?r[i]=c:r.push(c),{...e,parts:r}})}function jO(e,t,n,r,i){return e.map(e=>{if(e.id!==t)return e;let a=[...e.parts],o=a.findIndex(e=>e.type===`structured-output`),s=o>=0?a[o].raw:``,c=r||s;if(c===``&&n!==void 0)try{c=JSON.stringify(n)}catch{}let l={type:`structured-output`,status:`complete`,data:n,partial:n,raw:c,...i===void 0?{}:{reasoning:i}};return o>=0?a[o]=l:a.push(l),{...e,parts:a}})}function MO(e,t,n){return e.map(e=>{if(e.id!==t)return e;let r=[...e.parts],i=r.findIndex(e=>e.type===`structured-output`);if(i<0)return r.push({type:`structured-output`,status:`error`,raw:``,errorMessage:n}),{...e,parts:r};let a=r[i];return a.status===`complete`?e:(r[i]={...a,status:`error`,errorMessage:n},{...e,parts:r})})}function NO(e,t,n,r,i){return e.map(e=>{if(e.id!==t)return e;let a=[...e.parts],o=a.findIndex(e=>e.type===`thinking`&&e.stepId===n),s={type:`thinking`,content:r,stepId:n,...i&&{signature:i}};return o>=0?a[o]=s:a.push(s),{...e,parts:a}})}var PO=12;function FO(e){return e.some(e=>{let t=e.metadata;if(!t||typeof t!=`object`||Array.isArray(t))return!1;let n=t[UE];return typeof n==`object`&&!!n&&!Array.isArray(n)&&n.kind===`generic`})}var IO=class e{chunkStrategy;events;jsonParser;recordingEnabled;messages=[];messageStates=new Map;activeMessageIds=new Set;toolCallToMessage=new Map;pendingManualMessageId=null;pendingThinkingStepId=null;structuredMessageIds=new Set;structuredOutputUpdateBatches=new Map;activeRuns=new Set;finishReason=null;hasError=!1;isDone=!1;streamEndEmitted=!1;recording=null;recordingStartTime=0;constructor(e={}){this.chunkStrategy=e.chunkStrategy||new CO,this.events=e.events||{},this.jsonParser=e.jsonParser||xO,this.recordingEnabled=e.recording??!1,e.initialMessages&&(this.messages=[...e.initialMessages])}setMessages(e){this.messages=[...e],this.emitMessagesChange()}addUserMessage(e,t,n){let r=typeof e==`string`?[{type:`text`,content:e}]:e.map(e=>e),i={id:t??RD(),role:`user`,parts:r,createdAt:new Date,...n==null?{}:{metadata:n}};return this.messages=[...this.messages,i],this.emitMessagesChange(),i}prepareAssistantMessage(){this.resetStreamState()}startAssistantMessage(e){this.prepareAssistantMessage();let{messageId:t}=this.ensureAssistantMessage(e);return this.pendingManualMessageId=t,t}getCurrentAssistantMessageId(){let e=null;for(let[t,n]of this.messageStates)n.role===`assistant`&&(e=t);return e}addToolResult(e,t,n){let r=this.messages.find(t=>t.parts.some(t=>t.type===`tool-call`&&t.id===e));if(!r){console.warn(`[StreamProcessor] Could not find message with tool call ${e}`);return}let i=OO(this.messages,e,t,n?`error`:void 0,n),a=oD(t),o=n?`error`:`complete`;i=EO(i,r.id,e,a,o,n),this.messages=i,this.emitMessagesChange()}addToolApprovalResponse(e,t){this.messages=kO(this.messages,e,t),this.emitMessagesChange()}toModelMessages(){let e=[];for(let t of this.messages)e.push(...DD(t));return e}getMessages(){return this.messages}areAllToolsComplete(){let e=this.messages.findLast(e=>e.role===`assistant`);if(!e)return!0;let t=e.parts.filter(e=>e.type===`tool-call`);if(t.length===0)return!0;let n=new Set(e.parts.filter(e=>e.type===`tool-result`).map(e=>e.toolCallId));return t.every(e=>e.state===`complete`||e.state===`approval-responded`||e.output!==void 0&&!e.approval||n.has(e.id)||cD(e))}removeMessagesAfter(e){let t=new Set(this.messages.slice(0,e+1).map(e=>e.id));for(let e of this.structuredMessageIds)t.has(e)||this.structuredMessageIds.delete(e);for(let e of this.structuredOutputUpdateBatches.keys())t.has(e)||this.structuredOutputUpdateBatches.delete(e);for(let e of this.messageStates.keys())t.has(e)||this.messageStates.delete(e);for(let[e,n]of this.toolCallToMessage)t.has(n)||this.toolCallToMessage.delete(e);for(let e of this.activeMessageIds)t.has(e)||this.activeMessageIds.delete(e);this.messages=this.messages.slice(0,e+1),this.emitMessagesChange()}clearMessages(){this.messages=[],this.messageStates.clear(),this.activeMessageIds.clear(),this.toolCallToMessage.clear(),this.structuredMessageIds.clear(),this.structuredOutputUpdateBatches.clear(),this.pendingManualMessageId=null,this.emitMessagesChange()}async process(e){this.resetStreamState(),this.recordingEnabled&&this.startRecording();for await(let t of e)this.processChunk(t);return this.finalizeStream(),this.recording&&(this.recording.result=this.getResult()),this.getResult()}processChunk(e){switch(this.recording&&this.recording.chunks.push({chunk:e,timestamp:Date.now(),index:this.recording.chunks.length}),e.type){case`TEXT_MESSAGE_START`:this.handleTextMessageStartEvent(e);break;case`TEXT_MESSAGE_CONTENT`:this.handleTextMessageContentEvent(e);break;case`TEXT_MESSAGE_END`:this.handleTextMessageEndEvent(e);break;case`TOOL_CALL_START`:this.handleToolCallStartEvent(e);break;case`TOOL_CALL_ARGS`:this.handleToolCallArgsEvent(e);break;case`TOOL_CALL_END`:this.handleToolCallEndEvent(e);break;case`RUN_FINISHED`:this.handleRunFinishedEvent(e);break;case`RUN_ERROR`:this.handleRunErrorEvent(e);break;case`STEP_FINISHED`:this.handleStepFinishedEvent(e);break;case`MESSAGES_SNAPSHOT`:this.handleMessagesSnapshotEvent(e);break;case`CUSTOM`:this.handleCustomEvent(e);break;case`RUN_STARTED`:this.handleRunStartedEvent(e);break;case`REASONING_START`:case`REASONING_MESSAGE_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:break;case`REASONING_MESSAGE_CONTENT`:this.handleReasoningMessageContentEvent(e);break;case`REASONING_ENCRYPTED_VALUE`:this.handleReasoningEncryptedValueEvent(e);break;case`TOOL_CALL_RESULT`:this.handleToolCallResultEvent(e);break;case`STEP_STARTED`:this.handleStepStartedEvent(e)}}createMessageState(e,t){let n={id:e,role:t,totalTextContent:``,currentSegmentText:``,lastEmittedText:``,hasSeenReasoningEvents:!1,thinkingSteps:new Map,thinkingStepSignatures:new Map,thinkingStepOrder:[],currentThinkingStepId:null,toolCalls:new Map,toolCallOrder:[],hasToolCallsSinceTextStart:!1,isComplete:!1};return this.messageStates.set(e,n),n}getMessageState(e){return this.messageStates.get(e)}consumePendingThinkingStep(e){if(!this.pendingThinkingStepId)return;let t=this.pendingThinkingStepId;e.currentThinkingStepId=t,e.thinkingSteps.has(t)||(e.thinkingSteps.set(t,``),e.thinkingStepOrder.push(t)),this.pendingThinkingStepId=null}getActiveAssistantMessageId(){let e=Array.from(this.activeMessageIds).reverse();for(let t of e){let e=this.messageStates.get(t);if(e&&e.role===`assistant`)return t}for(let[e,t]of[...this.messageStates].reverse())if(t.role===`assistant`)return e;return null}resumeAssistantState(e,t){this.activeMessageIds.add(e),(t.isComplete||this.isDone)&&(t.isComplete=!1,this.isDone=!1)}ensureAssistantMessage(e){if(e){let t=this.getMessageState(e);if(t)return this.resumeAssistantState(e,t),{messageId:e,state:t}}let t=this.getActiveAssistantMessageId();if(t){let e=this.getMessageState(t);if(e)return this.resumeAssistantState(t,e),{messageId:t,state:e}}if(e){let t=this.messages.find(t=>t.id===e);if(t){let n=this.createMessageState(e,t.role);this.activeMessageIds.add(e);let r=t.parts.length>0?t.parts[t.parts.length-1]:null;return r&&r.type===`text`&&(n.currentSegmentText=r.content,n.lastEmittedText=r.content,n.totalTextContent=r.content),{messageId:e,state:n}}}let n=e||RD(),r={id:n,role:`assistant`,parts:[],createdAt:new Date};this.messages=[...this.messages,r];let i=this.createMessageState(n,`assistant`);return this.activeMessageIds.add(n),this.pendingManualMessageId=n,this.events.onStreamStart?.(),this.emitMessagesChange(),{messageId:n,state:i}}mergeMessageMetadata(e,t){if(typeof t!=`object`||!t||Array.isArray(t))return;let n=this.messages.find(t=>t.id===e);if(!n)return;let r=t,i=lE(r),a=i!=null&&(`content`in i||`args`in i)?{...r,tanstack:Object.fromEntries(Object.entries(i).filter(([e])=>e!==`content`&&e!==`args`))}:r,o=cE(n.metadata,a),s=vD(lE(r)?.createdAt),c=s!==void 0;this.messages=this.messages.map(t=>t.id===e?{...t,...o===void 0?{}:{metadata:o},...c?{createdAt:s}:{}}:t),this.emitMessagesChange()}handleTextMessageStartEvent(e){let{messageId:t,role:n}=e,r=n===`user`||n===`system`?n:`assistant`;if(this.pendingManualMessageId){let n=this.pendingManualMessageId;if(this.pendingManualMessageId=null,n!==t){this.messages=this.messages.map(e=>e.id===n?{...e,id:t}:e);let e=this.messageStates.get(n);e&&(e.id=t,this.messageStates.delete(n),this.messageStates.set(t,e)),this.activeMessageIds.delete(n),this.activeMessageIds.add(t);for(let[e,r]of this.toolCallToMessage)r===n&&this.toolCallToMessage.set(e,t)}let i=this.messageStates.get(t);i?i.hasToolCallsSinceTextStart&&(i.currentSegmentText!==i.lastEmittedText&&this.emitTextUpdateForMessage(t),i.currentSegmentText=``,i.lastEmittedText=``,i.hasToolCallsSinceTextStart=!1):(i=this.createMessageState(t,r),this.activeMessageIds.add(t)),this.mergeMessageMetadata(t,e.metadata),this.emitMessagesChange();return}if(this.messages.find(e=>e.id===t)){this.activeMessageIds.add(t);let n=this.messageStates.get(t);n?n.hasToolCallsSinceTextStart&&=(n.currentSegmentText!==n.lastEmittedText&&this.emitTextUpdateForMessage(t),n.currentSegmentText=``,n.lastEmittedText=``,!1):this.createMessageState(t,r),this.mergeMessageMetadata(t,e.metadata);return}let i={id:t,role:r,parts:[],createdAt:new Date};this.messages=[...this.messages,i],this.createMessageState(t,r),this.activeMessageIds.add(t),this.mergeMessageMetadata(t,e.metadata),this.events.onStreamStart?.(),this.emitMessagesChange()}handleTextMessageEndEvent(e){let{messageId:t}=e;this.mergeMessageMetadata(t,e.metadata);let n=this.getMessageState(t);n&&(n.isComplete||n.currentSegmentText!==n.lastEmittedText&&this.emitTextUpdateForMessage(t))}handleMessagesSnapshotEvent(e){this.resetStreamState();let t=this.messages,n=new Map(t.map(e=>[e.id,e])),r=this.mergeReasoningFanOut(e.messages.map(ND));this.messages=this.reconcileSnapshotToolCalls(r,t).map(e=>{if(e.metadata!=null)return e;let t=n.get(e.id);return t?.metadata==null?e:{...e,metadata:t.metadata}}),this.emitMessagesChange()}mergeReasoningFanOut(e){let t=[],n=[],r=e=>e.parts.filter(e=>e.type===`thinking`),i=e=>e.role===`assistant`&&e.parts.length>0&&e.parts.every(e=>e.type===`thinking`),a=e=>e.role===`assistant`&&e.parts.some(e=>e.type===`tool-result`)&&e.parts.every(e=>e.type===`tool-result`||e.type===`ui-resource`),o=()=>{t.push(...n),n=[]};for(let s of e){if(i(s)){n.push(s);continue}if(s.role===`assistant`&&n.length>0&&!a(s)){t.push({...s,parts:[...n.flatMap(r),...s.parts]}),n=[];continue}o(),t.push(s)}return o(),t}reconcileSnapshotToolCalls(e,t){let n=new Map;for(let e of t)for(let t of e.parts)t.type===`tool-call`&&n.set(t.id,t);let r=new Set;for(let t of e)for(let e of t.parts)e.type===`tool-call`&&r.add(e.id);let i=[];for(let t of e){let e=t.parts.filter(e=>e.type===`tool-result`),a=t.role===`assistant`&&e.length===1&&t.parts.every(e=>e.type===`tool-result`||e.type===`ui-resource`)?e[0]:void 0;if(!a){i.push(t);continue}let o=i.findLast(e=>e.parts.some(e=>e.type===`tool-call`&&e.id===a.toolCallId))??i.findLast(e=>e.role===`assistant`&&(e.parts.length!==1||e.parts[0]?.type!==`tool-result`));if(!o){r.has(a.toolCallId)||console.warn(`[StreamProcessor] MESSAGES_SNAPSHOT contains a tool-result for "${a.toolCallId}" but no matching tool-call exists in the snapshot, and there is no assistant message to anchor into; addToolResult("${a.toolCallId}") will not be able to locate this call`),i.push(t);continue}let s=[...o.parts];if(!r.has(a.toolCallId)&&!s.some(e=>e.type===`tool-call`&&e.id===a.toolCallId)){let e=n.get(a.toolCallId);e?(s.push({...e}),r.add(e.id)):console.warn(`[StreamProcessor] MESSAGES_SNAPSHOT contains a tool-result for "${a.toolCallId}" but no matching tool-call exists in the snapshot or the pre-snapshot state; addToolResult("${a.toolCallId}") will not be able to locate this call`)}s.push(...t.parts),o.parts=s}return this.enrichSnapshotToolCallsFromResults(i,n)}enrichSnapshotToolCallsFromResults(e,t){let n=new Map;for(let t of e)for(let e of t.parts)e.type===`tool-result`&&n.set(e.toolCallId,e);return e.map(e=>{let r=e.parts.map(e=>{if(e.type!==`tool-call`)return e;let r=t.get(e.id),i=n.get(e.id),a=e;if(r&&(r.output!==void 0||r.state===`complete`||r.state===`error`)&&(e.output===void 0||e.state===`input-complete`||e.state===`input-streaming`||e.state===`awaiting-input`)&&(a={...e,...r.output===void 0?{}:{output:r.output},state:r.state,...r.approval===void 0?{}:{approval:r.approval},...r.metadata===void 0?{}:{metadata:r.metadata}}),i&&a.output===void 0){let e;if(Array.isArray(i.content))e=i.content;else try{e=JSON.parse(i.content)}catch{e=i.content}let t=i.state===`error`?this.extractToolResultError(e):void 0;a={...a,output:t?{error:t}:e,state:i.state===`error`?`error`:`complete`}}return a});return r.some((t,n)=>t!==e.parts[n])?{...e,parts:r}:e})}handleTextMessageContentEvent(e){let{messageId:t,state:n}=this.ensureAssistantMessage(e.messageId);if(this.mergeMessageMetadata(t,e.metadata),this.structuredMessageIds.has(t)){let r=e.delta||``;r!==``&&(this.messages=AO(this.messages,t,r),n.totalTextContent+=r,this.queueStructuredOutputUpdate(t,r),this.emitMessagesChange());return}let r=n.currentSegmentText;n.hasToolCallsSinceTextStart&&r.length>0&&this.isNewTextSegment(e,r)&&(r!==n.lastEmittedText&&this.emitTextUpdateForMessage(t),n.currentSegmentText=``,n.lastEmittedText=``,n.hasToolCallsSinceTextStart=!1),n.hasToolCallsSinceTextStart=!1;let i=n.currentSegmentText,a=e.delta||``,o=a===``?i:i+a,s=o.slice(i.length);n.currentSegmentText=o,n.totalTextContent+=s;let c=e.delta||``;this.chunkStrategy.shouldEmit(c,n.currentSegmentText)&&n.currentSegmentText!==n.lastEmittedText&&this.emitTextUpdateForMessage(t)}handleToolCallStartEvent(e){let t=e.parentMessageId??this.getActiveAssistantMessageId(),{messageId:n,state:r}=this.ensureAssistantMessage(t??void 0);r.hasToolCallsSinceTextStart=!0;let i=e.toolCallId;if(!r.toolCalls.get(i)){let t=`awaiting-input`,a=e.toolCallName,o=e.metadata,s={id:e.toolCallId,name:a,arguments:``,state:t,parsedArguments:void 0,index:r.toolCalls.size,...o!==void 0&&{metadata:o}};r.toolCalls.set(i,s),r.toolCallOrder.push(i),this.toolCallToMessage.set(i,n),this.messages=TO(this.messages,n,{id:e.toolCallId,name:a,arguments:``,state:t,...o!==void 0&&{metadata:o}}),this.emitMessagesChange(),this.events.onToolCallStateChange?.(n,e.toolCallId,t,``)}}handleToolCallArgsEvent(e){let t=e.toolCallId,n=this.toolCallToMessage.get(t);if(!n)return;let r=this.getMessageState(n);if(!r)return;let i=r.toolCalls.get(t);if(!i)return;let a=i.state===`awaiting-input`;i.arguments+=e.delta||``,a&&e.delta&&(i.state=`input-streaming`),i.parsedArguments=this.jsonParser.parse(i.arguments),this.messages=TO(this.messages,n,{id:i.id,name:i.name,arguments:i.arguments,state:i.state}),this.emitMessagesChange(),this.events.onToolCallStateChange?.(n,i.id,i.state,i.arguments)}handleToolCallEndEvent(e){let t=this.toolCallToMessage.get(e.toolCallId);if(!t)return;let n=this.getMessageState(t);if(!n)return;let r=e.input===void 0?lE(e)?.input:e.input,i=n.toolCalls.get(e.toolCallId);if(i&&i.state!==`input-complete`){if(r!==void 0&&!i.arguments)try{i.arguments=JSON.stringify(r)}catch{}let a=n.toolCallOrder.indexOf(e.toolCallId);this.completeToolCall(t,a,i),r!==void 0&&(i.parsedArguments=r,this.messages=TO(this.messages,t,{id:i.id,name:i.name,arguments:i.arguments,state:`input-complete`,input:r,...i.metadata!==void 0&&{metadata:i.metadata}}),this.emitMessagesChange())}}extractToolResultError(e){return e&&typeof e==`object`&&`error`in e&&typeof e.error==`string`?e.error:typeof e==`string`?e:`Tool execution failed`}handleToolCallResultEvent(e){let t=this.toolCallToMessage.get(e.toolCallId)??this.messages.find(t=>t.parts.some(t=>t.type===`tool-call`&&t.id===e.toolCallId))?.id;if(!t)return;let n=e.state===`output-error`||lE(e)?.state===`output-error`,r;try{r=JSON.parse(e.content)}catch{r=e.content}this.messages=OO(this.messages,e.toolCallId,r,n?`error`:void 0);let i=n?`error`:`complete`;this.messages=EO(this.messages,t,e.toolCallId,e.content,i,i===`error`?this.extractToolResultError(r):void 0),this.emitMessagesChange()}handleRunStartedEvent(e){this.activeRuns.add(e.runId)}handleRunFinishedEvent(e){let t=e;if(this.finishReason=t.finishReason===void 0?lE(e)?.finishReason??null:t.finishReason,this.activeRuns.delete(e.runId),e.outcome?.type===`interrupt`&&this.handleInterrupts(e.outcome.interrupts),this.activeRuns.size===0){if(this.completeAllToolCalls(),this.finishReason===`tool_calls`&&e.outcome?.type!==`interrupt`)return;this.isDone=!0,this.finalizeStream()}}handleInterrupts(e){let t=FO(e);for(let n of e){let e=n.metadata&&typeof n.metadata==`object`?n.metadata:{},r=typeof e.kind==`string`?e.kind:void 0,i=n.toolCallId;if(!i)continue;let a=typeof e.toolName==`string`?e.toolName:this.findToolCallName(i),o=Object.hasOwn(e,`input`)?e.input:{};if(r===`approval`||n.reason===`approval_required`){let e=this.getActiveAssistantMessageId()??this.toolCallToMessage.get(i)??this.messages.find(e=>e.role===`assistant`&&e.parts.some(e=>e.type===`tool-call`&&e.id===i))?.id;e&&(this.messages=DO(this.messages,e,i,n.id),this.emitMessagesChange()),this.events.onApprovalRequest?.({toolCallId:i,toolName:a,input:o,approvalId:n.id});continue}if(r===`client_tool`||n.reason===`client_tool_input`){if(t)continue;this.events.onToolCall?.({toolCallId:i,toolName:a,input:o})}}}findToolCallName(e){for(let t of this.messageStates.values()){let n=t.toolCalls.get(e);if(n)return n.name}return``}handleRunErrorEvent(e){this.hasError=!0;let t=vO(e);t?this.activeRuns.delete(t):this.activeRuns.clear();let{messageId:n}=this.ensureAssistantMessage(),r=e.message||`An error occurred`;e.message||console.error(`[StreamProcessor] RUN_ERROR with no message; original chunk:`,e),this.structuredMessageIds.has(n)&&(this.flushStructuredOutputUpdate(n),this.messages=MO(this.messages,n,r),this.structuredMessageIds.delete(n),this.emitStructuredOutputChange(n,`error`),this.emitMessagesChange()),this.events.onError?.(dE(e))}handleStepStartedEvent(e){let t=e.stepName||RD(),n=this.getActiveAssistantMessageId();if(n){let e=this.getMessageState(n);if(e){e.currentThinkingStepId=t,e.thinkingSteps.has(t)||(e.thinkingSteps.set(t,``),e.thinkingStepOrder.push(t)),this.pendingThinkingStepId=null;return}}this.pendingThinkingStepId=t}handleStepFinishedEvent(e){let t=e,n=t.signature;if(!n)return;let{messageId:r,state:i}=this.ensureAssistantMessage(this.getActiveAssistantMessageId()??void 0),a=i.currentThinkingStepId??t.stepId;if(!a)return;let o=i.thinkingSteps.get(a);o!==void 0&&(i.thinkingStepSignatures.set(a,n),this.messages=NO(this.messages,r,a,o,n),this.emitMessagesChange())}handleReasoningMessageContentEvent(e){let{messageId:t,state:n}=this.ensureAssistantMessage(this.getActiveAssistantMessageId()??void 0);n.hasSeenReasoningEvents=!0;let r=e.delta||``;this.consumePendingThinkingStep(n);let i=n.currentThinkingStepId??e.messageId;n.thinkingSteps.has(i)||(n.thinkingSteps.set(i,``),n.thinkingStepOrder.push(i),n.currentThinkingStepId=i);let a=(n.thinkingSteps.get(i)??``)+r;n.thinkingSteps.set(i,a),this.messages=NO(this.messages,t,i,a,n.thinkingStepSignatures.get(i)),this.emitMessagesChange(),this.events.onThinkingUpdate?.(t,i,a)}handleReasoningEncryptedValueEvent(e){let t=e.encryptedValue;if(typeof t!=`string`||t===``)return;if(e.subtype===`tool-call`){this.attachToolCallSignature(e.entityId,t);return}let{messageId:n,state:r}=this.ensureAssistantMessage(this.getActiveAssistantMessageId()??void 0),i=r.currentThinkingStepId??e.entityId;r.thinkingStepSignatures.set(i,t);let a=r.thinkingSteps.get(i)??``;r.thinkingSteps.has(i)||(r.thinkingSteps.set(i,a),r.thinkingStepOrder.push(i)),this.messages=NO(this.messages,n,i,a,t),this.emitMessagesChange()}attachToolCallSignature(e,t){this.messages=this.messages.map(n=>{let r=!1,i=n.parts.map(n=>n.type!==`tool-call`||n.id!==e?n:(r=!0,{...n,metadata:{...n.metadata!=null&&typeof n.metadata==`object`?n.metadata:{},thoughtSignature:t}}));return r?{...n,parts:i}:n});for(let n of this.messageStates.values()){let r=n.toolCalls.get(e);r&&(r.metadata={...r.metadata??{},thoughtSignature:t})}this.emitMessagesChange()}handleCustomEvent(e){let t=this.getActiveAssistantMessageId();if(e.name===`structured-output.start`&&e.value){let n=e.value,{messageId:r}=this.ensureAssistantMessage(n.messageId??t??void 0);r&&(this.structuredMessageIds.add(r),this.structuredOutputUpdateBatches.delete(r),this.events.onStructuredOutputChange?.({phase:`start`,messageId:r,status:`streaming`,raw:``}));return}if(e.name===`structured-output.complete`&&e.value){let n=e.value,{messageId:r}=this.ensureAssistantMessage(n.messageId??t??void 0);r&&(this.flushStructuredOutputUpdate(r),this.messages=jO(this.messages,r,n.object,n.raw??``,n.reasoning),this.structuredMessageIds.delete(r),this.emitStructuredOutputChange(r,`complete`),this.emitMessagesChange())}if(e.name===`tool-input-available`&&e.value){let{toolCallId:t,toolName:n,input:r}=e.value;this.events.onToolCall?.({toolCallId:t,toolName:n,input:r});return}if(e.name===`approval-requested`&&e.value){let{toolCallId:n,toolName:r,input:i,approval:a}=e.value,o=t??this.toolCallToMessage.get(n);o&&(this.messages=DO(this.messages,o,n,a.id),this.emitMessagesChange()),this.events.onApprovalRequest?.({toolCallId:n,toolName:r,input:i,approvalId:a.id});return}if(e.name===`ui-resource`&&e.value){let n=e.value,r=this.toolCallToMessage.get(n.toolCallId)??t;if(r){let e={type:`ui-resource`,resource:n.resource,toolCallId:n.toolCallId,toolName:n.toolName,...n.serverId!==void 0&&{serverId:n.serverId},...n.meta!==void 0&&{meta:n.meta}};this.messages=this.messages.map(t=>t.id===r?{...t,parts:[...t.parts,e]}:t),this.emitMessagesChange()}else console.warn(`[mcp-apps] dropped ui-resource: no target message for toolCallId "${n.toolCallId}" (toolName "${n.toolName}")`);return}if(this.events.onCustomEvent){let t=e.value&&typeof e.value==`object`?e.value.toolCallId:void 0;this.events.onCustomEvent(e.name,e.value,{toolCallId:t})}}isNewTextSegment(e,t){return!0}completeAllToolCalls(){for(let e of this.activeMessageIds)this.completeAllToolCallsForMessage(e)}completeAllToolCallsForMessage(e){let t=this.getMessageState(e);t&&t.toolCalls.forEach((n,r)=>{if(n.state!==`input-complete`){let i=t.toolCallOrder.indexOf(r);this.completeToolCall(e,i,n)}})}completeToolCall(e,t,n){n.state=`input-complete`;let r=!1;try{n.parsedArguments=JSON.parse(n.arguments),r=!0}catch{n.parsedArguments=void 0}this.isToolCallPartErrored(n.id)||this.isToolCallPartAwaitingUserAction(n.id)||(this.messages=TO(this.messages,e,{id:n.id,name:n.name,arguments:n.arguments,state:`input-complete`,...r&&{input:n.parsedArguments},...n.metadata!==void 0&&{metadata:n.metadata}}),this.emitMessagesChange(),this.events.onToolCallStateChange?.(e,n.id,`input-complete`,n.arguments))}isToolCallPartAwaitingUserAction(e){return this.messages.some(t=>t.parts?.some(t=>t.type===`tool-call`&&t.id===e&&(t.state===`approval-requested`||t.state===`approval-responded`)))}isToolCallPartErrored(e){return this.messages.some(t=>t.parts?.some(t=>t.type===`tool-call`&&t.id===e&&t.state===`error`))}emitTextUpdateForMessage(e){let t=this.getMessageState(e);t&&(t.lastEmittedText=t.currentSegmentText,this.messages=wO(this.messages,e,t.currentSegmentText),this.emitMessagesChange(),this.events.onTextUpdate?.(e,t.currentSegmentText))}queueStructuredOutputUpdate(e,t){let n=this.structuredOutputUpdateBatches.get(e),r={delta:`${n?.delta??``}${t}`,chunkCount:(n?.chunkCount??0)+1};this.structuredOutputUpdateBatches.set(e,r),r.chunkCount>=PO&&this.flushStructuredOutputUpdate(e)}flushStructuredOutputUpdate(e){let t=this.structuredOutputUpdateBatches.get(e);t&&t.chunkCount!==0&&(this.structuredOutputUpdateBatches.delete(e),this.emitStructuredOutputChange(e,`update`,t.delta))}emitStructuredOutputChange(e,t,n){let r=this.messages.find(t=>t.id===e)?.parts.find(e=>e.type===`structured-output`);r&&this.events.onStructuredOutputChange?.({phase:t,messageId:e,status:r.status,raw:r.raw,...r.partial===void 0?{}:{partial:r.partial},...r.data===void 0?{}:{data:r.data},...r.reasoning===void 0?{}:{reasoning:r.reasoning},...r.errorMessage===void 0?{}:{errorMessage:r.errorMessage},...n===void 0?{}:{delta:n}})}emitMessagesChange(){this.events.onMessagesChange?.([...this.messages])}finalizeStream(){this.isDone=!0;let e;for(let t of this.activeMessageIds){let n=this.getMessageState(t);if(!n)continue;this.completeAllToolCallsForMessage(t),n.currentSegmentText!==n.lastEmittedText&&this.emitTextUpdateForMessage(t),n.isComplete=!0;let r=this.messages.find(e=>e.id===t);r&&r.role===`assistant`&&(e=r)}for(let e of this.structuredMessageIds)this.flushStructuredOutputUpdate(e),this.messages=MO(this.messages,e,`Stream ended without structured-output.complete`),this.emitStructuredOutputChange(e,`error`);if(this.structuredMessageIds.clear(),this.structuredOutputUpdateBatches.clear(),this.activeMessageIds.clear(),e&&!this.hasError&&this.isWhitespaceOnlyMessage(e)){this.messages=this.messages.filter(t=>t.id!==e.id),this.emitMessagesChange();return}e&&!this.streamEndEmitted&&(this.streamEndEmitted=!0,this.events.onStreamEnd?.(e))}getCompletedToolCalls(){let e=[];for(let t of this.messageStates.values())for(let n of t.toolCalls.values())n.state===`input-complete`&&e.push({id:n.id,type:`function`,function:{name:n.name,arguments:n.arguments},...n.metadata!==void 0&&{metadata:n.metadata}});return e}getResult(){let e=this.getCompletedToolCalls(),t=``,n=``;for(let e of this.messageStates.values()){t+=e.totalTextContent;for(let t of e.thinkingStepOrder)n+=e.thinkingSteps.get(t)??``}return{content:t,thinking:n||void 0,toolCalls:e.length>0?e:void 0,finishReason:this.finishReason}}getState(){let e=``,t=``,n=new Map,r=[];for(let i of this.messageStates.values()){e+=i.totalTextContent;for(let e of i.thinkingStepOrder)t+=i.thinkingSteps.get(e)??``;for(let[e,t]of i.toolCalls)n.set(e,t);r.push(...i.toolCallOrder)}return{content:e,thinking:t,toolCalls:n,toolCallOrder:r,finishReason:this.finishReason,done:this.isDone}}startRecording(){this.recordingEnabled=!0,this.recordingStartTime=Date.now(),this.recording={version:`1.0`,timestamp:this.recordingStartTime,chunks:[]}}getRecording(){return this.recording}resetStreamState(){this.messageStates.clear(),this.activeMessageIds.clear(),this.activeRuns.clear(),this.toolCallToMessage.clear(),this.structuredMessageIds.clear(),this.structuredOutputUpdateBatches.clear(),this.pendingManualMessageId=null,this.pendingThinkingStepId=null,this.finishReason=null,this.hasError=!1,this.isDone=!1,this.streamEndEmitted=!1,this.chunkStrategy.reset?.()}reset(){this.resetStreamState(),this.messages=[]}isWhitespaceOnlyMessage(e){return e.parts.length!==0&&e.parts.every(e=>e.type===`text`&&e.content.trim()===``)}static async replay(t,n){return new e(n).process(LO(t))}};function LO(e){return{async*[Symbol.asyncIterator](){for(let{chunk:t}of e.chunks)yield t}}}var RO=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.THINKING_START=`THINKING_START`,e.THINKING_END=`THINKING_END`,e.THINKING_TEXT_MESSAGE_START=`THINKING_TEXT_MESSAGE_START`,e.THINKING_TEXT_MESSAGE_CONTENT=`THINKING_TEXT_MESSAGE_CONTENT`,e.THINKING_TEXT_MESSAGE_END=`THINKING_TEXT_MESSAGE_END`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e}({}),zO=class extends Error{missingFeature;constructor(e){super(BO(e)),this.name=`UnsupportedResponseStreamError`,this.missingFeature=e}};function BO(e){return`Streaming fetch responses are not supported in this runtime because ${e} is unavailable. React Native users need a compatible fetch/stream/TextDecoder polyfill, or should use a fetch, XHR, or custom transport that can deliver streaming chunks.`}function VO(e){if(!e.body)throw new zO(`Response.body`);if(typeof e.body.getReader!=`function`)throw new zO(`Response.body.getReader`);return e.body.getReader()}function HO(){if(typeof globalThis.TextDecoder!=`function`)throw new zO(`TextDecoder`);return new globalThis.TextDecoder}function UO(e){if(!e.startsWith(`data:`))return e;let t=e.slice(5);return t.startsWith(` `)?t.slice(1):t}function WO(e){if(e instanceof Date)return Number.isNaN(e.getTime())?void 0:e;if(typeof e!=`string`)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function GO(e){let t=WO(e.createdAt),n=e.parts.map(e=>{if(e.type!==`tool-result`)return e;let t=WO(e.createdAt),{createdAt:n,...r}=e;return t?{...r,createdAt:t}:r}),{createdAt:r,...i}=e;return t?{...i,parts:n,createdAt:t}:{...i,parts:n}}function KO(e){return e.map(GO)}var qO=/^[a-z][a-z0-9-]{0,63}$/;function JO(e){return typeof e==`string`&&qO.test(e)}function YO(e){if(typeof e!=`object`||!e||!(`error`in e))return!1;let t=e.error;return!(typeof t!=`object`||!t||!(`type`in t)||t.type!==`byok_missing`||!(`provider`in t)||typeof t.provider!=`string`||!JO(t.provider)||!(`message`in t)||typeof t.message!=`string`)}var XO=class extends Error{provider;constructor(e){super(`Missing ${e} API key`),this.name=`ByokMissingError`,this.provider=e}},ZO=class extends Error{provider;reason;constructor(e,t){super(t===`locked`?`${e} key is locked`:`Missing ${e} API key`),this.name=`ByokBlockedError`,this.provider=e,this.reason=t}},QO=class extends Error{constructor(){super(`BYOK is enabled but no provider slug was resolved. Pass byokProvider or forwardedProps.provider.`),this.name=`ByokUnresolvedProviderError`}},$O=new WeakMap;function ek(e){return $O.get(e)??vO(e)}var tk=class extends Error{constructor(){super(`Stream ended with unterminated trailing data — connection was likely cut short.`),this.name=`StreamTruncatedError`}},nk=class extends Error{constructor(e){super(`Stream response body read failed`,{cause:e}),this.name=`StreamReadError`}},rk=class extends Error{constructor(){super(`Durable run ended without a terminal event and could not resume — the run did not complete.`),this.name=`DurableStreamIncompleteError`}},ik=class extends Error{constructor(e){super(`Durable run exceeded its reconnect ceiling of ${e} attempts — giving up.`),this.name=`StreamReconnectLimitError`}};function ak(e){let t=e?.maxAttempts??5,n=e?.delayMs??250;if(!Number.isInteger(t)||t<0)throw Error(`Invalid reconnect.maxAttempts: ${t}. Must be a non-negative integer.`);if(!Number.isFinite(n)||n<0)throw Error(`Invalid reconnect.delayMs: ${n}. Must be a non-negative finite number.`);return{maxAttempts:t,delayMs:n}}function ok(e){let t=ak(e),n=new Set,r,i=0;return{get lastEventId(){return r},note(e){return e===void 0?`new`:e===``?(r=void 0,n.clear(),`reset`):n.has(e)?`duplicate`:(n.add(e),r=e,`new`)},async waitBeforeReconnect(e,n){if(e)i=0;else if(i+=1,i>t.maxAttempts)throw new ik(t.maxAttempts);await sk(t.delayMs,n)}}}function sk(e,t){return e<=0||t?.aborted?Promise.resolve():new Promise(n=>{let r=()=>{clearTimeout(i),n()},i=setTimeout(()=>{t?.removeEventListener(`abort`,r),n()},e);t?.addEventListener(`abort`,r,{once:!0})})}function ck(e){return`${e}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function lk(e,t){if(!e)throw Error(`Cannot synthesize terminal event: ${t} not supplied via runContext and not observed in the upstream stream.`);return e}function uk(e){if(!e)return{};if(e instanceof Headers){let t={};return e.forEach((e,n)=>{t[n]=e}),t}return e}var dk=`X-Run-Id`;function fk(e){return e===void 0?{}:{[dk]:e}}function pk(e,t){let n=e.indexOf(`#`),r=n===-1?``:e.slice(n),i=n===-1?e:e.slice(0,n),a=i.indexOf(`?`),o=a===-1?i:i.slice(0,a),s=new URLSearchParams(a===-1?``:i.slice(a+1));for(let[e,n]of Object.entries(t))s.set(e,n);let c=s.toString();return`${o}${c.length===0?``:`?${c}`}${r}`}async function*mk(e,t){try{let n=HO(),r=``;for(;!t?.aborted;){let i;try{i=await e.read()}catch(e){if(t?.aborted)return;throw new nk(e)}let{done:a,value:o}=i;if(a)break;r+=n.decode(o,{stream:!0});let s=r.split(`
14
- `);r=s.pop()||``;for(let e of s){let t=e.endsWith(`\r`)?e.slice(0,-1):e;t.trim()&&(yield t)}}if(r+=n.decode(),r.trim()&&!t?.aborted)throw new tk}finally{e.releaseLock()}}function hk(e){return rO(e)}function gk(e){let t=lE(e)?.model;if(typeof t==`string`)return t;let n=`usage`in e?e.usage:void 0;if(Array.isArray(n)){let e=n[0]?.model;if(typeof e==`string`)return e}}async function*_k(e,t){let n,r,i,a;for await(let o of e){if(o===`id`||o.startsWith(`id:`)){let e=o===`id`?``:o.slice(3);a=e.startsWith(` `)?e.slice(1):e;continue}if(o.startsWith(`:`)||o.startsWith(`event:`)||o.startsWith(`retry:`))continue;let e=UO(o);if(e===`[DONE]`){yield{chunk:uE({type:RO.RUN_FINISHED,threadId:n??t?.threadId??``,runId:r??t?.runId??``,timestamp:Date.now()},{finishReason:`stop`,...i===void 0?{}:{model:i}})};return}let s=hk(JSON.parse(e));`threadId`in s&&typeof s.threadId==`string`&&(n=s.threadId),`runId`in s&&typeof s.runId==`string`&&(r=s.runId);let c=gk(s);c!==void 0&&(i=c);let l=a;a=void 0,yield{chunk:s,...l===void 0?{}:{id:l}}}}async function vk(e){if(!e.ok){if(e.status===401){let t=await e.clone().json().catch(()=>null);if(YO(t))throw new XO(t.error.provider)}throw Error(`HTTP error! status: ${e.status} ${e.statusText}`)}}async function yk(e,t,n,r,i){let a=await e(pk(t,{threadId:i}),{method:`GET`,headers:{Accept:`application/json`,...n},credentials:r});await vk(a);let o=await a.json(),s=o.activeRun&&typeof o.activeRun.runId==`string`?{runId:o.activeRun.runId}:null,c=o.interrupts&&typeof o.interrupts.runId==`string`&&Array.isArray(o.interrupts.pending)&&o.interrupts.pending.length>0?{runId:o.interrupts.runId,pending:o.interrupts.pending}:null;return{messages:Array.isArray(o.messages)?KO(o.messages):[],activeRun:s,interrupts:c}}async function bk(e,t,n,r,i){let a=await e(pk(t,{threadId:i}),{method:`GET`,headers:{Accept:`application/json`,...n},credentials:r});await vk(a);let o=await a.json();if(o===null)return{resumeSnapshot:null,activeRun:null};if(typeof o!=`object`||Array.isArray(o))throw Error(`Generation hydration expected a JSON object from ${t}, received ${Array.isArray(o)?`an array`:typeof o}.`);let s=o,c=s.activeRun&&typeof s.activeRun.runId==`string`?{runId:s.activeRun.runId}:null;return{resumeSnapshot:s.resumeSnapshot??null,activeRun:c}}async function*xk(e,t,n){await vk(e),yield*_k(mk(VO(e),t),n)}async function*Sk(e,t){for await(let{chunk:n}of xk(e,t))yield n}function Ck(e,t,n,r){return async function*(i,a){let o;try{o=await e(t,{...n,headers:{...n.headers,...i},...a?{signal:a}:{}})}catch(e){throw new nk(e)}yield*r(o,a)}}async function*wk(e,t,n){let r=ok(n);for(;;){if(t?.aborted)return;let n=r.lastEventId===void 0?{}:{"Last-Event-ID":r.lastEventId},i=!1,a=!1;try{for await(let{chunk:o,id:s}of e(n,t))r.note(s)!==`duplicate`&&(a=!0,(o.type===`RUN_FINISHED`||o.type===`RUN_ERROR`)&&(i=!0),yield o)}catch(e){if(t?.aborted)return;if((e instanceof tk||e instanceof nk)&&r.lastEventId!==void 0){await r.waitBeforeReconnect(a,t);continue}throw e}if(t?.aborted||i)return;if(r.lastEventId!==void 0){if(a){await r.waitBeforeReconnect(!0,t);continue}throw new rk}return}}function Tk(e){if(!e)throw Error(`Connection adapter is required`);let t=`connect`in e,n=`subscribe`in e,r=`send`in e;if(t&&(n||r))throw Error(`Connection adapter must provide either connect or both subscribe and send, not both modes`);if(n&&r){let t=e.joinRun?.bind(e),n=e.hydrate?.bind(e);return{subscribe:e.subscribe.bind(e),send:e.send.bind(e),...t?{joinRun:t}:{},...n?{hydrate:n}:{}}}if(!t)throw Error(`Connection adapter must provide either connect or both subscribe and send`);let i=[],a=[],o;function s(e,t){t&&$O.set(e,t);let n=a.shift();n?n(e):i.push(e)}async function c(e){let t=()=>o!==a||i.length===0&&(a.length>0||e?.aborted);for(let n=0;n<16&&!e?.aborted;n++){if(t())return;await Promise.resolve()}for(;!e?.aborted;){if(t())return;await new Promise(e=>setTimeout(e,0))}}return{subscribe(e){let t=i.splice(0),n=[];return i=t,a=n,(async function*(){o=n;try{for(;!e?.aborted;){let r,i=t.shift();r=i===void 0?await new Promise(t=>{let r=()=>t(null);n.push(n=>{e?.removeEventListener(`abort`,r),t(n)}),e?.addEventListener(`abort`,r,{once:!0})}):i,r!==null&&(yield r)}}finally{o===n&&(o=void 0)}})()},async send(t,n,r,i){let a=!1,o,l;try{let c=e.connect(t,n,r,i);for await(let e of c)`threadId`in e&&typeof e.threadId==`string`&&(o=e.threadId),`runId`in e&&typeof e.runId==`string`&&(l=e.runId),(e.type===`RUN_FINISHED`||e.type===`RUN_ERROR`)&&(a=!0),s(e,i?.runId);!r?.aborted&&!a&&s(uE({type:RO.RUN_FINISHED,threadId:lk(o??i?.threadId,`threadId`),runId:lk(l??i?.runId,`runId`),timestamp:Date.now()},{finishReason:`stop`,model:`connect-wrapper`}),i?.runId)}catch(e){if(!r?.aborted&&!a)try{let t=e instanceof Error?e.message:`Unknown error in connect()`;s({type:RO.RUN_ERROR,threadId:lk(o??i?.threadId,`threadId`),runId:lk(l??i?.runId,`runId`),timestamp:Date.now(),message:t},i?.runId)}catch{}throw e}await c(r)},...typeof e.joinRun==`function`?{joinRun:(t,n)=>e.joinRun(t,n)}:{},...(()=>{let t=e.hydrate;return typeof t==`function`?{hydrate:e=>t(e)}:{}})()}}function Ek(e,t,n,r){let i=VD(e),a={...r.body,...n?.forwardedProps??{},...t};return{threadId:n?.threadId??ck(`thread`),runId:n?.runId??ck(`run`),...n?.parentRunId!==void 0&&{parentRunId:n.parentRunId},...n?.resume!==void 0&&{resume:n.resume},state:{},messages:i,tools:n?.clientTools??[],context:[],forwardedProps:a,data:{...a}}}function Dk(e,t={}){return{async*connect(n,r,i,a){let o=typeof e==`function`?e():e,s=typeof t==`function`?await t():t,c={"Content-Type":`application/json`,...uk(s.headers),...uk(a?.headers),...fk(a?.runId)},l=Ek(n,r,a,s),u=s.fetchClient??fetch,d=i||s.signal;yield*wk(Ck(u,o,{method:`POST`,headers:c,body:JSON.stringify(l),credentials:s.credentials||`same-origin`},(e,t)=>xk(e,t,{...a?.threadId===void 0?{}:{threadId:a.threadId},...a?.runId===void 0?{}:{runId:a.runId}})),d,s.reconnect)},async*joinRun(n,r){let i=typeof e==`function`?e():e,a=typeof t==`function`?await t():t,o=pk(i,{offset:`-1`,runId:n}),s={...uk(a.headers)},c=a.fetchClient??fetch,l=r||a.signal;yield*wk(Ck(c,o,{method:`GET`,headers:s,credentials:a.credentials||`same-origin`},(e,t)=>xk(e,t,{runId:n})),l,a.reconnect)},async hydrate(n){let r=typeof e==`function`?e():e,i=typeof t==`function`?await t():t;return yk(i.fetchClient??fetch,r,uk(i.headers),i.credentials||`same-origin`,n)},async hydrateGeneration(n){let r=typeof e==`function`?e():e,i=typeof t==`function`?await t():t;return bk(i.fetchClient??fetch,r,uk(i.headers),i.credentials||`same-origin`,n)}}}function Ok(e){return{async*connect(t,n,r,i){if(!r)throw Error(`fetcherToConnectionAdapter requires an AbortSignal — the chat client always supplies one.`);if(!i)throw Error(`fetcherToConnectionAdapter requires a RunAgentInputContext — the chat client always supplies one.`);let a=await e({messages:t,data:n,threadId:i.threadId,runId:i.runId,...i.parentRunId===void 0?{}:{parentRunId:i.parentRunId},...i.resume===void 0?{}:{resume:i.resume}},{signal:r,headers:i.headers});a instanceof Response?yield*Sk(a,r):yield*kk(a,r)}}}async function*kk(e,t){if(t.aborted)return;let n=e[Symbol.asyncIterator](),r=new Promise(e=>{t.addEventListener(`abort`,()=>e({done:!0,value:void 0}),{once:!0})});try{for(;;){let e=await Promise.race([n.next(),r]);if(e.done)return;yield e.value}}finally{await n.return?.()}}function Ak(e){return e.resumable}function jk(e,t){let n=nD(e.descriptor);return n?{...t,metadata:tD(n)}:t}function Mk(e){return`cancel`in e&&`clearResolution`in e}var Nk=new Set([`invalid-payload`,`invalid-edited-args`,`invalid-tool-output`,`invalid-response-schema`,`unknown-interrupt`,`expired`,`stale`,`conflict`,`legacy-unsupported`]),Pk=new Set([`incomplete-batch`,`item-validation-failed`,`unsupported-bulk-operation`,`async-resolver`,`inactive-transaction`,`mixed-provenance`,`transport`,`server`,`protocol`,`invalid-response-schema`,`expired`,`stale`,`conflict`,`legacy-submit-failed`]);function Fk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ik(e){return Fk(e)&&e.kind===`approval`&&typeof e.toolName==`string`&&`input`in e}function Lk(e){return Fk(e)&&e.kind===`client_tool`&&typeof e.toolName==`string`&&`input`in e}function Rk(e){return Ik(e.metadata)||Lk(e.metadata)}function zk(e){return YE(e)}function Bk(e){if(!Fk(e.metadata))return!1;let t=e.metadata[UE];return!Fk(t)||t.v!==void 0&&t.v!==1?!1:t.kind===`generic`||t.kind===`tool-approval`||t.kind===`client-tool-execution`||`definitionId`in t||`key`in t||`batchIndex`in t||`payloadSchemaHash`in t}function Vk(e){if(!Fk(e.metadata))return!1;let t=e.metadata[UE];return!Fk(t)||t.kind!==`generic`?!1:`definitionId`in t||`key`in t||`batchIndex`in t||`payloadSchemaHash`in t}function Hk(e){return e.metadata?.[`tanstack:interruptPayload`]}function Uk(e){return e===`tanstack:client_tool_execution`||e===`client_tool_input`}function Wk(e){if(e.responseSchema!==void 0)try{return vE(_E(e.responseSchema))}catch{return}}function Gk(e){if(e!==void 0)try{return QE(e)}catch{return}}function Kk(e){return e!==null&&(typeof e==`object`||typeof e==`function`)&&`then`in e&&typeof e.then==`function`}function qk(e,t,n){if(e===void 0)return{valid:!0,payload:t};if(TE(e)){let r=e[`~standard`].validate(t),i=e=>e.issues?{code:n,message:e.issues[0]?.message??`Schema validation failed.`}:{valid:!0,payload:e.value};return Kk(r)?Promise.resolve(r).then(i):i(r)}return{valid:!0,payload:t}}function Jk(e){for(let t of Nk)if(t===e)return!0;return!1}function Yk(e){for(let t of Pk)if(t===e)return!0;return!1}function Xk(e){if(!Fk(e))return!1;let t=e.scope,n=e.code;return typeof n!=`string`||typeof e.message!=`string`||typeof e.retryable!=`boolean`||typeof e.threadId!=`string`||typeof e.interruptedRunId!=`string`||typeof e.generation!=`number`?!1:t===`item`?Jk(n)&&typeof e.interruptId==`string`&&(e.source===`client`||e.source===`server`):t===`batch`&&Yk(n)&&Array.isArray(e.interruptIds)&&e.interruptIds.every(e=>typeof e==`string`)&&(e.source===`client`||e.source===`server`||e.source===`transport`)}function Zk(e){return Xk(e)?[e]:!Fk(e)||!Array.isArray(e.errors)?[]:e.errors.every(Xk)?e.errors:[]}function Qk(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])}function $k(e,t){return e.threadId===t.threadId&&e.interruptedRunId===t.interruptedRunId&&e.generation===t.generation&&Qk(e.interruptIds,t.interruptIds)}function eA(e,t,n){let r=n.filter(e=>e.source!==`transport`),i=e=>t.includes(e)&&r.some(t=>$k(e,t)),a=e.filter(e=>!i(e)),o=t.filter(e=>!r.some(t=>$k(e,t)));return Object.freeze({rootErrors:Object.freeze([...a,...n]),submissionRootErrors:Object.freeze([...o,...r])})}function tA(e,t){if(e.threadId!==t.threadId||e.interruptedRunId!==t.interruptedRunId||e.generation!==t.generation)return!1;let n=t.resolutions.map(e=>e.interruptId);return e.scope===`item`?n.includes(e.interruptId):Qk(e.interruptIds,n)}function nA(e,t,n){let r=Wk(e)??n?.responseSchemaHash;return bE({v:1,kind:`generic`,interruptId:e.id,interruptedRunId:t.interruptedRunId,generation:t.generation,...r===void 0?{}:{responseSchemaHash:r},...e.expiresAt===void 0?{}:{expiresAt:e.expiresAt}})}function rA(e,t){let n=bE(e.descriptor),r=e.error===void 0?Object.freeze([]):Object.freeze([bE(e.error)]),i=r[0];return{id:n.id,interruptId:n.id,reason:n.reason,...n.message===void 0?{}:{message:n.message},...n.responseSchema===void 0?{}:{responseSchema:n.responseSchema},...n.expiresAt===void 0?{}:{expiresAt:n.expiresAt},...n.metadata===void 0?{}:{metadata:n.metadata},threadId:t.threadId,interruptedRunId:t.interruptedRunId,generation:t.generation,status:e.status,errors:r,...i===void 0?{}:{error:i},canResolve:e.canResolve}}var iA=class{options;hydration;items=[];snapshot=Object.freeze([]);rootErrors=Object.freeze([]);submissionRootErrors=Object.freeze([]);state=Object.freeze({interrupts:this.snapshot,pendingInterrupts:this.snapshot,interruptErrors:this.rootErrors,resuming:!1});activeTransaction;activeSubmissionOperation;retrySubmission;resuming=!1;tools;interruptDefinitions;constructor(e){this.options=e,this.tools=e.tools;let t=new Map;for(let n of e.interrupts??[]){if(t.has(n.id))throw Error(`Duplicate interrupt definition id: ${n.id}`);t.set(n.id,n)}this.interruptDefinitions=t}updateTools(e){this.tools=e}hydrate(e,t=`live`){this.activeSubmissionOperation=void 0,this.hydration={threadId:e.threadId,interruptedRunId:e.interruptedRunId,generation:e.generation,interrupts:bE(e.interrupts)};let n=new Map;for(let t of e.interrupts){let e=zk(t);e?.kind===`generic`&&e.definitionId!==void 0&&e.key!==void 0&&e.batchIndex!==void 0&&n.set(e.batchIndex,(n.get(e.batchIndex)??0)+1)}this.items=e.interrupts.map(t=>this.hydrateInterrupt(t,e,n)),this.rootErrors=Object.freeze([]),this.submissionRootErrors=Object.freeze([]),this.retrySubmission=void 0,this.resuming=!1,this.publish(t)}getInterrupts(){return this.snapshot}getState(){return this.state}getDescriptors(){return this.hydration?.interrupts??Object.freeze([])}hasValidatedFirstPartyGenericBatch(){return this.items.some(e=>e.kind===`generic`&&e.definition!==void 0)}reset(e){this.activeSubmissionOperation=void 0,this.hydration=void 0,this.items=[],this.snapshot=Object.freeze([]),e?.preserveRootErrors!==!0&&(this.rootErrors=Object.freeze([]),this.submissionRootErrors=Object.freeze([])),this.retrySubmission=void 0,this.resuming=!1,this.state=Object.freeze({interrupts:this.snapshot,pendingInterrupts:this.snapshot,interruptErrors:this.rootErrors,resuming:!1}),this.options.onChange?.(e?.source??`live`)}getInterruptErrors(){return this.rootErrors}getResuming(){return this.resuming}resolve(e){if(this.assertRootMutable(),typeof e==`boolean`){this.resolveBooleanBulk(e);return}this.resolveTransaction(e)}cancel(){this.assertRootMutable(),this.invalidateRetry();for(let e of this.items)Ak(e)&&(e.validationGeneration++,e.resolution=Object.freeze(jk(e,{interruptId:e.descriptor.id,status:`cancelled`})),e.status=`staged`,e.error=void 0);this.publish(),this.maybeSubmit()}retry(){if(this.resuming)throw Error(`Interrupt submission is already active.`);let e=this.retrySubmission;if(!e){this.addRootError(`transport`,`There is no retryable interrupt submission.`,!1);return}this.submitBatch(e)}resolveClientToolOutput(e,t){let n=this.items.find(t=>t.kind===`client-tool-execution`&&t.binding?.kind===`client-tool-execution`&&t.binding.toolCallId===e||t.kind===`generic`&&Uk(t.descriptor.reason)&&t.descriptor.toolCallId===e&&Lk(t.descriptor.metadata));return n?(this.resolveItem(n.descriptor.id,t),!0):!1}resolveToolApprovalDecision(e,t){let n=this.items.find(t=>t.descriptor.id===e&&(t.kind===`tool-approval`||t.kind===`generic`&&t.descriptor.reason===`approval_required`&&Ik(t.descriptor.metadata)));return n?(this.resolveItem(n.descriptor.id,{approved:t}),!0):!1}hydrateInterrupt(e,t,n){let r=bE(e),i=zk(r),a=i===void 0&&Rk(r);if(i===void 0&&!a)return Bk(r)?{descriptor:r,binding:nA(r,t,void 0),kind:`generic`,status:`error`,canResolve:!1,resumable:!1,error:this.itemError(r.id,`stale`,`The interrupt binding is invalid or incomplete.`),validationGeneration:0}:{descriptor:r,binding:void 0,kind:`unbound`,status:`pending`,canResolve:!1,resumable:!1,validationGeneration:0};let o=i!==void 0&&i.interruptId===r.id&&i.interruptedRunId===t.interruptedRunId&&i.generation===t.generation&&Wk(r)===i.responseSchemaHash,s=i!==void 0&&i.interruptId===r.id&&i.interruptedRunId===t.interruptedRunId&&i.generation===t.generation&&i.responseSchemaHash===(Wk(r)??i.responseSchemaHash);if(i!==void 0&&Vk(r)&&(!s||i.kind!==`generic`||i.definitionId===void 0||i.key===void 0||i.batchIndex===void 0))return{descriptor:r,binding:nA(r,t,i),kind:`generic`,status:`error`,canResolve:!1,resumable:!1,error:this.itemError(r.id,`stale`,`The interrupt binding does not match this interrupted run.`),validationGeneration:0};if(s&&i.kind===`tool-approval`){let e=this.tools?.find(e=>e.name===i.toolName);if(e?.needsApproval===!0&&r.toolCallId===i.toolCallId)try{let t=VE(e.approvalSchema,e.inputSchema);if(HE(e.inputSchema)===i.inputSchemaHash&&t.approvalSchemaHash===i.approvalSchemaHash&&t.responseSchemaHash===i.responseSchemaHash)return{descriptor:r,binding:bE(i),kind:`tool-approval`,status:`pending`,canResolve:!0,resumable:!0,tool:e,validationGeneration:0}}catch{}}if(s&&i.kind===`client-tool-execution`){let e=this.tools?.find(e=>e.name===i.toolName);if(e!==void 0&&r.toolCallId===i.toolCallId&&HE(e.outputSchema)===i.outputSchemaHash)return{descriptor:r,binding:bE(i),kind:`client-tool-execution`,status:`pending`,canResolve:!0,resumable:!0,tool:e,validationGeneration:0}}if(i!==void 0&&i.kind===`generic`&&i.definitionId!==void 0&&i.key!==void 0&&i.batchIndex!==void 0&&i.key.length>0&&n.get(i.batchIndex)!==1)return{descriptor:r,binding:bE(i),kind:`generic`,status:`error`,canResolve:!1,resumable:!1,error:this.itemError(r.id,`stale`,`Generic interrupt batch contains a duplicate batchIndex.`),validationGeneration:0};if(o&&i.kind===`generic`&&i.definitionId!==void 0&&i.key!==void 0&&i.batchIndex!==void 0&&i.key.length>0&&n.get(i.batchIndex)===1){let e=this.interruptDefinitions.get(i.definitionId);if(e!==void 0&&Gk(e.responseSchema)===i.responseSchemaHash&&(e.payloadSchema===void 0?i.payloadSchemaHash===void 0:i.payloadSchemaHash===Gk(e.payloadSchema))){let t=Hk(r);return{descriptor:r,binding:bE(i),definition:e,kind:`generic`,status:`pending`,canResolve:!0,resumable:!0,...t===void 0?{}:{payload:bE(t)},validationGeneration:0}}}let c=a||i!==void 0&&i.interruptId===r.id&&i.interruptedRunId===t.interruptedRunId&&i.generation===t.generation&&(i.kind!==`generic`||Wk(r)===void 0||i.responseSchemaHash===Wk(r));return{descriptor:r,binding:nA(r,t,i),kind:`generic`,status:`pending`,canResolve:c,resumable:c,validationGeneration:0}}buildSnapshot(e){let t=this.requireHydration(),n=this.items.filter(e=>e.kind!==`client-tool-execution`&&e.status!==`submitting`).map(n=>{let r=rA(n,t);if(n.kind===`unbound`||n.binding===void 0){let e={...r,kind:`unbound`,canResolve:!1};return Object.freeze(e)}if(n.kind===`tool-approval`&&n.binding.kind===`tool-approval`){let t=bE(n.binding),i={...r,kind:`tool-approval`,binding:t,toolName:n.binding.toolName,toolCallId:n.binding.toolCallId,originalArgs:bE(n.binding.originalArgs),cancel:()=>this.cancelItem(n.descriptor.id,e),clearResolution:()=>this.clearItem(n.descriptor.id,e),resolveInterrupt:(t,r)=>{let i=Fk(r)?r:void 0;this.resolveItem(n.descriptor.id,{approved:t,...t&&i?.editedArgs!==void 0?{editedArgs:i.editedArgs}:{},...i?.payload===void 0?{}:{payload:i.payload}},e)}};return Object.freeze(i)}let i=n.binding.kind===`generic`?bE(n.binding):bE({v:1,kind:`generic`,interruptId:n.descriptor.id,interruptedRunId:t.interruptedRunId,generation:t.generation,...typeof n.binding.responseSchemaHash==`string`?{responseSchemaHash:n.binding.responseSchemaHash}:{}});if(n.definition!==void 0&&n.binding.kind===`generic`){let t={...r,kind:`generic`,definitionId:n.definition.id,key:n.binding.key??``,payload:n.payload,binding:i,cancel:()=>this.cancelItem(n.descriptor.id,e),clearResolution:()=>this.clearItem(n.descriptor.id,e),resolveInterrupt:t=>this.resolveItem(n.descriptor.id,t,e)};return Object.freeze(t)}let a={...r,kind:`generic`,binding:i,cancel:()=>this.cancelItem(n.descriptor.id,e),clearResolution:()=>this.clearItem(n.descriptor.id,e),resolveInterrupt:t=>this.resolveItem(n.descriptor.id,t,e)};return Object.freeze(a)});return Object.freeze(n)}publish(e=`live`){if(!this.hydration){this.snapshot=Object.freeze([]),this.state=Object.freeze({interrupts:this.snapshot,pendingInterrupts:this.snapshot,interruptErrors:this.rootErrors,resuming:this.resuming}),this.options.onChange?.(e);return}this.snapshot=this.buildSnapshot(),this.state=Object.freeze({interrupts:this.snapshot,pendingInterrupts:this.snapshot,interruptErrors:this.rootErrors,resuming:this.resuming}),this.options.onChange?.(e)}resolveItem(e,t,n){this.assertItemMutable(n);let r=this.findItem(e);if(this.invalidateRetry(),!r.canResolve){r.status=`error`,r.error=this.itemError(e,`invalid-response-schema`,`The interrupt response schema is invalid and cannot be resolved.`),n||this.publish();return}let i=++r.validationGeneration,a=this.validateCandidate(r,t);if(Kk(a)){r.status=`validating`,r.error=void 0,n||this.publish(),Promise.resolve(a).then(e=>{i===r.validationGeneration&&this.applyValidation(r,e,n)}).catch(e=>{i===r.validationGeneration&&this.applyValidation(r,{code:this.validationCode(r),message:e instanceof Error?e.message:String(e)},n)});return}this.applyValidation(r,a,n)}cancelItem(e,t){this.assertItemMutable(t);let n=this.findItem(e);this.invalidateRetry(),n.validationGeneration++,n.resolution=Object.freeze(jk(n,{interruptId:e,status:`cancelled`})),n.status=`staged`,n.error=void 0,t||(this.publish(),this.maybeSubmit())}clearItem(e,t){this.assertItemMutable(t);let n=this.findItem(e);this.invalidateRetry(),n.validationGeneration++,n.resolution=void 0,n.error=void 0,n.status=`pending`,t||this.publish()}maybeSubmit(){let e=this.items.some(e=>e.kind===`generic`),t=this.items.filter(t=>Ak(t)&&!(e&&t.kind===`client-tool-execution`));if(t.length===0||t.some(e=>e.resolution===void 0||e.status!==`staged`))return;let n=this.requireHydration(),r=xE(t.map(e=>e.resolution).filter(e=>e!==void 0)),i=Object.freeze({threadId:n.threadId,interruptedRunId:n.interruptedRunId,generation:n.generation,resolutions:r.resolutions,canonicalResolutions:r.canonicalResolutions,fingerprint:r.fingerprint});this.submitBatch(i)}applyValidation(e,t,n){if(!(`valid`in t)){e.status=`error`;let r=this.itemError(e.descriptor.id,t.code,t.message,t.path);e.error=r,e.kind===`client-tool-execution`&&(this.rootErrors=Object.freeze([...this.rootErrors.filter(t=>!(t.code===`item-validation-failed`&&t.interruptIds.includes(e.descriptor.id))),Object.freeze({scope:`batch`,code:`item-validation-failed`,message:r.message,source:`client`,retryable:!1,interruptIds:Object.freeze([e.descriptor.id]),threadId:r.threadId,interruptedRunId:r.interruptedRunId,generation:r.generation})])),n||this.publish();return}e.resolution=bE(jk(e,{interruptId:e.descriptor.id,status:`resolved`,payload:t.payload})),e.status=`staged`,e.error=void 0,n||(this.publish(),this.maybeSubmit())}validateCandidate(e,t){if(e.kind===`generic`){let n=qk(e.definition?.responseSchema??e.descriptor.responseSchema,t,`invalid-payload`);if(e.definition===void 0)return n;let r=e=>`valid`in e?{valid:!0,payload:t}:e;return Kk(n)?Promise.resolve(n).then(r):r(n)}return e.kind===`client-tool-execution`?qk(e.tool?.outputSchema,t,`invalid-tool-output`):this.validateApprovalCandidate(e,t)}validateApprovalCandidate(e,t){if(!Fk(t)||typeof t.approved!=`boolean`)return{code:`invalid-payload`,message:`Tool approval resolutions require an approved boolean.`};let n=t.approved,r=t.editedArgs;if(!n&&r!==void 0)return{code:`invalid-edited-args`,message:`Rejected tool approvals cannot edit tool arguments.`};if(n&&r!==void 0){let n=qk(e.tool?.inputSchema,r,`invalid-edited-args`);return Kk(n)?Promise.resolve(n).then(n=>`valid`in n?this.validateApprovalPayload(e,t,n.payload):n):`valid`in n?this.validateApprovalPayload(e,t,n.payload):n}return this.validateApprovalPayload(e,t,void 0)}validateApprovalPayload(e,t,n){let r=t.approved===!0,i=this.approvalBranchSchema(e.tool,r),a=t.payload;if(i===void 0&&a!==void 0)return{code:`invalid-payload`,message:`This approval branch does not accept a payload.`};if(i!==void 0&&a===void 0)return{code:`invalid-payload`,message:`This approval branch requires a payload.`};let o=qk(i,a,`invalid-payload`),s=e=>`valid`in e?{valid:!0,payload:{approved:r,...n===void 0?{}:{editedArgs:n},...i===void 0?{}:{payload:e.payload}}}:e;return Kk(o)?Promise.resolve(o).then(s):s(o)}approvalBranchSchema(e,t){let n=e?.approvalSchema;return!Fk(n)||!(`approve`in n||`reject`in n)?n:t?n.approve:n.reject}validationCode(e){return e.kind===`client-tool-execution`?`invalid-tool-output`:`invalid-payload`}resolveBooleanBulk(e){let t=this.items.filter(e=>Ak(e)&&e.kind!==`client-tool-execution`);if(!t.every(t=>t.kind===`tool-approval`&&this.approvalBranchSchema(t.tool,e)===void 0)||t.length===0){this.addRootError(`unsupported-bulk-operation`,`Boolean bulk resolution requires payloadless tool approvals.`,!1);return}this.invalidateRetry();for(let n of t)n.validationGeneration++,n.resolution=bE({interruptId:n.descriptor.id,status:`resolved`,payload:{approved:e}}),n.status=`staged`,n.error=void 0;this.publish(),this.maybeSubmit()}resolveTransaction(e){let t=this.items.map(e=>({status:e.status,...e.resolution===void 0?{}:{resolution:e.resolution},...e.error===void 0?{}:{error:e.error},validationGeneration:e.validationGeneration})),n={active:!0};this.activeTransaction=n;let r=this.buildSnapshot(n).filter(Mk),i;try{for(let t of r){let n=e(t);if(n!==void 0){i={code:Kk(n)?`async-resolver`:`inactive-transaction`,message:Kk(n)?`Interrupt transaction resolvers must be synchronous.`:`Interrupt transaction resolvers must return literal undefined.`};break}}i===void 0&&this.items.some(e=>Ak(e)&&e.kind!==`client-tool-execution`&&(e.resolution===void 0||e.status!==`staged`))&&(i={code:`incomplete-batch`,message:`Interrupt transaction did not resolve every item.`})}catch(e){i={code:`item-validation-failed`,message:e instanceof Error?e.message:String(e)}}finally{n.active=!1,this.activeTransaction=void 0}if(i){this.restoreCheckpoints(t),this.addRootError(i.code,i.message,!1);return}this.publish(),this.maybeSubmit()}restoreCheckpoints(e){this.items.forEach((t,n)=>{let r=e[n];r&&(t.status=r.status,t.resolution=r.resolution,t.error=r.error,t.validationGeneration=r.validationGeneration+1)}),this.publish()}assertItemMutable(e){if(e&&!e.active||this.activeTransaction&&e!==this.activeTransaction)throw Error(`Interrupt transaction is inactive.`);if(this.resuming)throw Error(`Interrupts cannot be mutated while submitting.`)}assertRootMutable(){if(this.activeTransaction)throw Error(`Interrupt transaction is already active.`);if(this.resuming)throw Error(`Interrupts cannot be mutated while submitting.`)}invalidateRetry(){this.retrySubmission=void 0}submitBatch(e){let t={submission:e};this.activeSubmissionOperation=t,this.resuming=!0,this.retrySubmission=void 0;for(let e of this.items)Ak(e)&&(e.status=`submitting`);this.publish(),this.performSubmission(t)}async performSubmission(e){try{await this.options.submit(e.submission)}catch(t){if(this.activeSubmissionOperation!==e)return;this.handleSubmissionFailure(t,e.submission)}finally{this.activeSubmissionOperation===e&&(this.activeSubmissionOperation=void 0,this.resuming=!1,this.publish())}}handleSubmissionFailure(e,t){let n=Zk(e);if(n.length===0){let n=e instanceof Error?e.message:String(e);this.addRootError(`transport`,n,!0,`transport`),this.retrySubmission=t;for(let e of this.items)Ak(e)&&(e.status=`error`);return}let r=n.filter(e=>tA(e,t));r.length!==n.length&&this.addRootError(`protocol`,`Interrupt submission errors did not match the active batch.`,!1);let i=!1,a=!1,o=[];for(let e of r)if((e.code===`stale`||e.code===`expired`||e.code===`conflict`)&&(i=!0),a||=e.retryable,e.scope===`item`){let t=this.items.find(t=>Ak(t)&&t.descriptor.id===e.interruptId);t&&(t.status=`error`,t.error=bE(e))}else o.push(bE(e));let s=eA(this.rootErrors,this.submissionRootErrors,o);this.rootErrors=s.rootErrors,this.submissionRootErrors=s.submissionRootErrors;for(let e of this.items)Ak(e)&&e.status===`submitting`&&(e.status=`error`);this.retrySubmission=a&&!i?t:void 0}addRootError(e,t,n,r=`client`){let i=this.requireHydration();this.rootErrors=Object.freeze([...this.rootErrors,Object.freeze({scope:`batch`,code:e,message:t,source:r,retryable:n,interruptIds:Object.freeze(this.items.filter(Ak).map(e=>e.descriptor.id)),threadId:i.threadId,interruptedRunId:i.interruptedRunId,generation:i.generation})]),this.publish()}findItem(e){let t=this.items.find(t=>t.descriptor.id===e);if(!t)throw Error(`Unknown interrupt: ${e}`);return t}requireHydration(){if(!this.hydration)throw Error(`InterruptManager is not hydrated.`);return this.hydration}itemError(e,t,n,r){let i=this.requireHydration();return Object.freeze({scope:`item`,interruptId:e,code:t,message:n,...r===void 0?{}:{path:Object.freeze([...r])},source:`client`,retryable:!1,threadId:i.threadId,interruptedRunId:i.interruptedRunId,generation:i.generation})}};function aA(e,...t){let n=e?.();if(JO(n))return n;for(let e of t)if(JO(e))return e}async function oA(e,t){if(!t)throw new QO;return await e.prepare(t),e.headers(t)}var sA=class{clientId;constructor(e){this.clientId=e}clientCreated(e){this.emitEvent(`client:created`,{initialMessageCount:e})}loadingChanged(e){this.emitEvent(`client:loading:changed`,{isLoading:e})}errorChanged(e){this.emitEvent(`client:error:changed`,{error:e})}textUpdated(e,t,n,r){this.emitEvent(`text:chunk:content`,{streamId:e,messageId:t,content:n,...r})}toolCallStateChanged(e,t,n,r,i,a,o){this.emitEvent(`tools:call:updated`,{streamId:e,messageId:t,toolCallId:n,toolName:r,state:i,arguments:a,...o})}thinkingUpdated(e,t,n,r,i){this.emitEvent(`text:chunk:thinking`,{streamId:e,messageId:t,content:n,delta:r,...i})}structuredOutputChanged(e,t,n,r,i){this.emitEvent(e,{streamId:t,messageId:n,...r,...i})}approvalRequested(e,t,n,r,i,a,o){this.emitEvent(`tools:approval:requested`,{streamId:e,messageId:t,toolCallId:n,toolName:r,input:i,approvalId:a,...o})}messageAppended(e,t,n){let r=e.parts.filter(e=>e.type===`text`).map(e=>e.content).join(` `);this.emitEvent(`text:message:created`,{streamId:t,messageId:e.id,role:e.role,content:r,parts:e.parts,...n})}messageSent(e,t){let n=typeof t==`string`?t:t.filter(e=>e.type===`text`).map(e=>e.content).join(``);this.emitEvent(`text:message:created`,{messageId:e,role:`user`,content:n,...Array.isArray(t)&&{parts:t}}),this.emitEvent(`text:message:user`,{messageId:e,role:`user`,content:n,...Array.isArray(t)&&{parts:t}})}reloaded(e){this.emitEvent(`client:reloaded`,{fromMessageIndex:e})}stopped(){this.emitEvent(`client:stopped`)}messagesCleared(){this.emitEvent(`client:messages:cleared`)}toolResultAdded(e,t,n,r,i){this.emitEvent(`tools:result:added`,{toolCallId:e,toolName:t,output:n,state:r,...i})}toolApprovalResponded(e,t,n,r){this.emitEvent(`tools:approval:responded`,{approvalId:e,toolCallId:t,approved:n,...r})}toolFixtureApplied(e){this.emitEvent(`devtools:tool-fixture:applied`,{...e})}},cA=class extends sA{emitEvent(e,t){let n=Date.now(),r=e.startsWith(`text:`)||e.startsWith(`tools:`)||e.startsWith(`structured-output:`)||e===`devtools:tool-fixture:applied`,i=e.startsWith(`client:`)||e.startsWith(`tools:`)||e.startsWith(`text:`)||e.startsWith(`structured-output:`)||e===`devtools:tool-fixture:applied`,a=r?`user-visible`:`client-state`,o={hookId:this.clientId,...typeof t?.threadId==`string`?{threadId:t.threadId}:{},...typeof t?.runId==`string`?{runId:t.runId}:{},...typeof t?.streamId==`string`?{streamId:t.streamId}:{},...typeof t?.messageId==`string`?{messageId:t.messageId}:{},...typeof t?.toolCallId==`string`?{toolCallId:t.toolCallId}:{}};if(i){let r=lO({eventType:e,clientId:this.clientId,...o,source:`client`,visibility:a,timestamp:n});mO.emit(e,{...t,...r})}else{let r=lO({eventType:e,source:`client`,visibility:`client-state`,timestamp:n});mO.emit(e,{...t,...r})}}},lA=class extends sA{emitEvent(){}},uA=class{events;constructor(e){this.events=new lA(e.clientId)}emitRegistered(){}emitUpdated(){}emitSnapshot(){}emitToolsRegistered(){}emitRunLifecycle(e,t,n,r){}deactivate(){}supersede(){}dispose(){}mountWithTools(e){}notifyToolsChanged(){}setCurrentStreamId(e){}recordStreamId(e){}getCurrentStreamId(){return null}getLastStreamId(){return null}resolveStreamId(){return``}observeChunk(e){}recordMemoryState(e){}recordCompactionEvent(e,t){}recordCompactionState(e){}recordSkillsState(e){}beginRun(e,t){}getCurrentRunEventContext(){}getCurrentOrLastRunEventContext(){}findToolCallContext(e){return{toolCallId:e}}async applyFixture(e){}},dA=e=>new uA(e);function fA(e){if(Array.isArray(e))return{messages:e};if(e&&Array.isArray(e.messages))return e}function pA(e){return`toolCallId`in e&&typeof e.toolCallId==`string`?e.toolCallId:void 0}function mA(e){return`messageId`in e&&typeof e.messageId==`string`?e.messageId:void 0}function hA(e){return`parentMessageId`in e&&typeof e.parentMessageId==`string`?e.parentMessageId:void 0}var gA=class{adapter;id;applyMessages;applyResume;skipNextPersist=!1;generation=0;queue=Promise.resolve();queuePending=!1;messagesGeneration=0;lastMessages=[];lastResume=null;clearedMessageIds=new Set;clearedRunIds=new Set;ignoredActiveRunIds=new Set;clearedToolCallIds=new Set;currentRunlessRunId=null;constructor(e,t,n,r){this.adapter=e,this.id=t,this.applyMessages=n,this.applyResume=r}writeState(){let e=[...this.lastMessages];if(e.length===0&&!this.lastResume){let e=this.generation;this.runOperation(()=>{if(e===this.generation)return this.adapter.removeItem(this.id)});return}let t=this.generation,n={messages:e,...this.lastResume?{resume:this.lastResume}:{}};this.runOperation(()=>{if(t===this.generation)return this.adapter.setItem(this.id,n)})}readInitial(){try{let e=this.adapter.getItem(this.id);if(e instanceof Promise)return e.then(fA).catch(()=>void 0);let t=fA(e);return t&&(this.lastMessages=t.messages,this.lastResume=t.resume??null),t}catch{return}}hydrateAsync(e){if(!(e instanceof Promise))return;let t=this.messagesGeneration;e.then(e=>{e&&this.messagesGeneration===t&&(this.lastResume=e.resume??null,this.lastMessages=e.messages,this.applyMessages(e.messages),e.resume&&this.applyResume&&this.applyResume(e.resume))}).catch(()=>{})}notifyMessagesChanged(e){if(this.messagesGeneration++,this.lastMessages=[...e],this.skipNextPersist){this.skipNextPersist=!1;return}this.writeState()}persistResumeSnapshot(e){this.lastResume=e,!this.skipNextPersist&&this.writeState()}remove(){this.lastMessages=[],this.lastResume=null;let e=++this.generation;this.runOperation(()=>{if(e===this.generation)return this.adapter.removeItem(this.id)})}runOperation(e){if(this.queuePending){let t=this.queue.then(e).catch(()=>{});this.queue=t,t.finally(()=>{this.queue===t&&(this.queuePending=!1)});return}try{let t=e();if(t instanceof Promise){this.queuePending=!0;let e=t.catch(()=>{});this.queue=e,e.finally(()=>{this.queue===e&&(this.queuePending=!1)})}}catch{}}snapshotClear(e){for(let t of e.messages)this.clearedMessageIds.add(t.id);for(let t of e.activeRunIds)this.clearedRunIds.add(t),this.ignoredActiveRunIds.add(t);e.currentRunId&&(this.clearedRunIds.add(e.currentRunId),this.ignoredActiveRunIds.add(e.currentRunId))}beginClear(){this.skipNextPersist=!0}shouldIgnoreChunk(e){let t=ek(e);if(t&&this.clearedRunIds.has(t))return e.type===`RUN_STARTED`&&(this.ignoredActiveRunIds.add(t),this.currentRunlessRunId=t),this.markIgnoredChunkIds(e),!0;if(t&&this.ignoredActiveRunIds.has(t)||this.isRunlessChunkFromIgnoredRun(e))return this.markIgnoredChunkIds(e),!0;let n=pA(e);if(n&&this.clearedToolCallIds.has(n))return!0;let r=hA(e);if(r&&this.clearedMessageIds.has(r))return n&&this.clearedToolCallIds.add(n),!0;let i=mA(e);return i?!!this.clearedMessageIds.has(i):!1}onRunStarted(e){this.currentRunlessRunId=e}onRunSettled(e){this.ignoredActiveRunIds.delete(e),this.clearedRunIds.delete(e),this.currentRunlessRunId===e&&(this.currentRunlessRunId=this.ignoredActiveRunIds.values().next().value??null)}onSessionRunError(){this.ignoredActiveRunIds.clear(),this.currentRunlessRunId=null}resetIgnored(){this.ignoredActiveRunIds.clear()}takeRunlessRunId(){let e=this.currentRunlessRunId;return e?(this.ignoredActiveRunIds.delete(e),this.clearedRunIds.delete(e),this.currentRunlessRunId=this.ignoredActiveRunIds.values().next().value??null,e):null}markIgnoredChunkIds(e){let t=mA(e);t&&this.clearedMessageIds.add(t);let n=pA(e);n&&this.clearedToolCallIds.add(n)}isRunlessChunkFromIgnoredRun(e){return ek(e)||!this.currentRunlessRunId||!this.ignoredActiveRunIds.has(this.currentRunlessRunId)&&!this.clearedRunIds.has(this.currentRunlessRunId)?!1:e.type===`TEXT_MESSAGE_START`||e.type===`TEXT_MESSAGE_CONTENT`||e.type===`TOOL_CALL_START`||e.type===`TOOL_CALL_ARGS`||e.type===`TOOL_CALL_END`||e.type===`TOOL_CALL_RESULT`||e.type===`MESSAGES_SNAPSHOT`||e.type===`RUN_ERROR`}};function _A(e){return`toolCallId`in e&&typeof e.toolCallId==`string`?e.toolCallId:void 0}function vA(e){return`messageId`in e&&typeof e.messageId==`string`?e.messageId:void 0}function yA(e){return`parentMessageId`in e&&typeof e.parentMessageId==`string`?e.parentMessageId:void 0}var bA=class{clearedMessageIds=new Set;clearedRunIds=new Set;ignoredActiveRunIds=new Set;clearedToolCallIds=new Set;currentRunlessRunId=null;snapshotClear(e){for(let t of e.messages)this.clearedMessageIds.add(t.id);for(let t of e.activeRunIds)this.clearedRunIds.add(t),this.ignoredActiveRunIds.add(t);e.currentRunId&&(this.clearedRunIds.add(e.currentRunId),this.ignoredActiveRunIds.add(e.currentRunId))}shouldIgnoreChunk(e){let t=ek(e);if(t&&this.clearedRunIds.has(t))return e.type===`RUN_STARTED`&&(this.ignoredActiveRunIds.add(t),this.currentRunlessRunId=t),this.markIgnoredChunkIds(e),!0;if(t&&this.ignoredActiveRunIds.has(t)||this.isRunlessChunkFromIgnoredRun(e))return this.markIgnoredChunkIds(e),!0;let n=_A(e);if(n&&this.clearedToolCallIds.has(n))return!0;let r=yA(e);if(r&&this.clearedMessageIds.has(r))return n&&this.clearedToolCallIds.add(n),!0;let i=vA(e);return!!(i&&this.clearedMessageIds.has(i))}onRunStarted(e){this.currentRunlessRunId=e}onRunSettled(e){this.ignoredActiveRunIds.delete(e),this.clearedRunIds.delete(e),this.currentRunlessRunId===e&&(this.currentRunlessRunId=this.ignoredActiveRunIds.values().next().value??null)}onSessionRunError(){this.ignoredActiveRunIds.clear(),this.currentRunlessRunId=null}resetActiveRuns(){this.ignoredActiveRunIds.clear(),this.currentRunlessRunId=null}takeRunlessRunId(){let e=this.currentRunlessRunId;return e?(this.ignoredActiveRunIds.delete(e),this.clearedRunIds.delete(e),this.currentRunlessRunId=this.ignoredActiveRunIds.values().next().value??null,e):null}markIgnoredChunkIds(e){let t=vA(e);t&&this.clearedMessageIds.add(t);let n=_A(e);n&&this.clearedToolCallIds.add(n)}isRunlessChunkFromIgnoredRun(e){return ek(e)||!this.currentRunlessRunId||!this.ignoredActiveRunIds.has(this.currentRunlessRunId)&&!this.clearedRunIds.has(this.currentRunlessRunId)?!1:e.type===`TEXT_MESSAGE_START`||e.type===`TEXT_MESSAGE_CONTENT`||e.type===`TOOL_CALL_START`||e.type===`TOOL_CALL_ARGS`||e.type===`TOOL_CALL_END`||e.type===`TOOL_CALL_RESULT`||e.type===`MESSAGES_SNAPSHOT`||e.type===`RUN_ERROR`}};function xA(e){let t=new Set;for(let n of e??[]){if(t.has(n.id))throw Error(`Duplicate interrupt definition id: ${n.id}`);t.add(n.id)}}function SA(e){let{connection:t,fetcher:n}=e;if(t&&n)throw Error("ChatClient: pass either `connection` or `fetcher`, not both.");if(t)return t;if(n)return Ok(n);throw Error("ChatClient: either `connection` or `fetcher` is required.")}function CA(e){return`connect`in e}function wA(e){if(e.type!==`RUN_FINISHED`||e.outcome?.type===`interrupt`)return!1;let t=e;return t.finishReason===void 0?lE(e)?.finishReason===`tool_calls`:t.finishReason===`tool_calls`}function TA(e){let t={whenBusy:`queue`,drain:`fifo`,onOverflow:`reject`};if(!e)return t;if(typeof e==`string`)return{...t,whenBusy:e};if(typeof e==`function`)return{...t,strategy:e};let n=e.maxSize;if(n!==void 0&&(!Number.isInteger(n)||n<0))throw Error(`ChatClient: queue.maxSize must be a non-negative integer`);return{whenBusy:e.whenBusy??`queue`,drain:e.drain??`fifo`,onOverflow:e.onOverflow??`reject`,...n===void 0?{}:{maxSize:n}}}function EA(e){let t=e.at(-1)?.body,n=[];for(let t of e){if(typeof t.content!=`string`)break;n.push(t.content)}if(n.length===e.length)return{content:n.join(`
15
- `),...t===void 0?{}:{body:t}};let r=[],i;for(let t of e){if(typeof t.content==`string`){r.push({type:`text`,content:t.content});continue}typeof t.content.content==`string`?r.push({type:`text`,content:t.content.content}):r.push(...t.content.content),i=cE(i,t.content.metadata)}return{content:{content:r,...i===void 0?{}:{metadata:i}},...t===void 0?{}:{body:t}}}function DA(e){if(typeof e==`object`&&e&&!Array.isArray(e)&&`approved`in e&&typeof e.approved==`boolean`)return e.approved}function OA(e){let t=e;if(typeof t!=`object`||!t||!(`resumeState`in t))return;let n=t.resumeState;if(typeof n==`object`&&n&&`threadId`in n&&typeof n.threadId==`string`&&n.threadId.length!==0&&`runId`in n&&typeof n.runId==`string`&&n.runId.length!==0)return{threadId:n.threadId,runId:n.runId}}var kA=2e3,AA=new Set([`TEXT_MESSAGE_START`,`TEXT_MESSAGE_CONTENT`,`TOOL_CALL_START`,`MESSAGES_SNAPSHOT`]),jA=class{processor;connection;uniqueId;threadId;persistor;clearedStreamTracker=new bA;currentRunId=null;lastResume=null;rejoinedRunId=null;interruptManager;activeInterruptSubmission;interruptSubmissionFailure;joinedRunWaiters=new Map;pendingResumeParentRunId=null;pendingResumeThreadId=null;pendingResumeItems=null;activeResumeThreadId=null;activeResumeRunId=null;bodyOption={};forwardedPropsOption={};byok;byokProvider;context=void 0;pendingMessageBody=void 0;queueConfig;messageQueue=[];sendInFlight=!1;messageQueueDraining=!1;stopMessageQueueDrain=!1;deliverClaim=!1;isLoading=!1;isSubscribed=!1;error=void 0;status=`ready`;connectionStatus=`disconnected`;abortController=null;clientToolsRef;devtoolsBridge;events;currentStreamId=null;currentMessageId=null;postStreamActions=[];pendingToolExecutions=new Map;activeClientTools=null;activeContext=void 0;continuationPending=!1;subscriptionAbortController=null;processingResolve=null;connectionDrainsOnSend=!1;errorReportedGeneration=null;streamGeneration=0;continuationGeneration=0;streamContinuationGeneration=0;continuationSkipped=!1;draining=!1;sessionGenerating=!1;activeRunIds=new Set;disposed=!1;tailing=!1;rejoinRunId;cachesMessages;devtoolsMounted=!1;callbacksRef;constructor(e){xA(e.interrupts),this.threadId=e.threadId||``,this.uniqueId=this.threadId;let t=!0;if(e.persistence===!0){if(!e.threadId)throw Error("[TanStack AI] persistence needs a stable `threadId` to key on. Pass a threadId from your app (for example support-42).");t=!1}else if(e.persistence){if(!e.threadId)throw Error("[TanStack AI] persistence needs a stable `threadId` to key on. Pass a threadId from your app (for example support-42).");this.persistor=new gA(e.persistence,e.threadId,e=>this.processor.setMessages(e),e=>this.applyPersistedResume(e))}this.bodyOption=e.body||{},this.forwardedPropsOption=e.forwardedProps||{},this.byok=e.byok,this.byokProvider=e.byokProvider,this.context=e.context,this.queueConfig=TA(e.queue);let n=SA(e);if(this.connectionDrainsOnSend=CA(n),this.connection=Tk(n),this.clientToolsRef={current:new Map},e.tools)for(let t of e.tools)this.clientToolsRef.current.set(t.name,t);this.devtoolsBridge=(e.devtoolsBridgeFactory??dA)(this.buildDevtoolsBridgeOptions(e.devtools)),this.events=this.devtoolsBridge.events,this.callbacksRef={current:{onResponse:e.onResponse||(()=>{}),onChunk:e.onChunk||(()=>{}),onFinish:e.onFinish||(()=>{}),onError:e.onError||(()=>{}),onMessagesChange:e.onMessagesChange||(()=>{}),onLoadingChange:e.onLoadingChange||(()=>{}),onErrorChange:e.onErrorChange||(()=>{}),onStatusChange:e.onStatusChange||(()=>{}),onSubscriptionChange:e.onSubscriptionChange||(()=>{}),onConnectionStatusChange:e.onConnectionStatusChange||(()=>{}),onSessionGeneratingChange:e.onSessionGeneratingChange||(()=>{}),onQueueChange:e.onQueueChange||(()=>{}),onResumeStateChange:e.onResumeStateChange||(()=>{}),onRunIdChange:e.onRunIdChange||(()=>{}),onInterruptStateChange:e.onInterruptStateChange||(()=>{}),onCustomEvent:e.onCustomEvent||(()=>{})}},this.interruptManager=new iA({...e.tools===void 0?{}:{tools:e.tools},...e.interrupts===void 0?{}:{interrupts:e.interrupts},submit:e=>this.submitInterruptBatch(e),onChange:e=>this.notifyResumeStateChange(e)}),e.initialResumeSnapshot&&this.applyResumeSnapshot(e.initialResumeSnapshot);let r=this.persistor?.readInitial(),i=r instanceof Promise?void 0:r,a=i?i.messages:e.initialMessages,o=null;if(i?.resume){let e=i.resume;Array.isArray(e.pendingInterrupts)&&e.pendingInterrupts.length>0?this.applyResumeSnapshot(e):e.resumeState.runId&&(o=e.resumeState.runId)}if(!o&&e.initialResumeSnapshot){let t=e.initialResumeSnapshot;!(Array.isArray(t.pendingInterrupts)&&t.pendingInterrupts.length>0)&&t.resumeState.runId&&(o=t.resumeState.runId)}this.processor=new IO({...e.streamProcessor?.chunkStrategy?{chunkStrategy:e.streamProcessor.chunkStrategy}:{},...a?{initialMessages:a}:{},events:{onMessagesChange:e=>{this.persistor?.notifyMessagesChanged(e),this.callbacksRef.current.onMessagesChange(e)},onStreamStart:()=>{this.setStatus(`streaming`);let e=this.processor.getCurrentAssistantMessageId();if(!e)return;let t=this.processor.getMessages().find(t=>t.id===e);t&&(this.currentMessageId=t.id,this.events.messageAppended(t,this.currentStreamId||void 0))},onStreamEnd:e=>{this.callbacksRef.current.onFinish(e),this.setStatus(`ready`),this.resolveProcessing()},onError:e=>{this.reportStreamError(e)},onTextUpdate:(e,t)=>{this.currentStreamId&&this.events.textUpdated(this.currentStreamId,e,t)},onThinkingUpdate:(e,t)=>{this.currentStreamId&&this.events.thinkingUpdated(this.currentStreamId,e,t,void 0)},onStructuredOutputChange:e=>{let t=this.devtoolsBridge.resolveStreamId(),n=e.phase===`start`?`structured-output:started`:e.phase===`complete`?`structured-output:completed`:e.phase===`error`?`structured-output:errored`:`structured-output:updated`;this.currentMessageId=e.messageId,this.events.structuredOutputChanged(n,t,e.messageId,{status:e.status,raw:e.raw,...e.partial===void 0?{}:{partial:e.partial},...e.data===void 0?{}:{data:e.data},...e.reasoning===void 0?{}:{reasoning:e.reasoning},...e.errorMessage===void 0?{}:{errorMessage:e.errorMessage},...e.delta===void 0?{}:{delta:e.delta}})},onToolCallStateChange:(e,t,n,r)=>{let i=this.processor.getMessages().find(t=>t.id===e)?.parts.find(e=>e.type===`tool-call`&&e.id===t)?.name||`unknown`;this.currentStreamId&&this.events.toolCallStateChanged(this.currentStreamId,e,t,i,n,r)},onToolCall:e=>{let t=(this.activeClientTools??this.clientToolsRef.current).get(e.toolName),n=t?.execute;if(n){let r=this.continuationGeneration,i=this.devtoolsBridge.getCurrentRunEventContext(),a=(async()=>{try{let a=this.activeClientTools===null?this.context:this.activeContext,o=await n(e.input,{toolCallId:e.toolCallId,context:a,emitCustomEvent:()=>{}});await this.addToolResultForClientTool({toolCallId:e.toolCallId,tool:e.toolName,output:o,state:`output-available`},t,r,i)}catch(n){await this.addToolResultForClientTool({toolCallId:e.toolCallId,tool:e.toolName,output:null,state:`output-error`,errorText:n.message},t,r,i)}finally{this.pendingToolExecutions.delete(e.toolCallId)}})();this.pendingToolExecutions.set(e.toolCallId,a)}},onApprovalRequest:e=>{let t=this.devtoolsBridge.resolveStreamId(),n=this.findMessageIdForToolCall(e.toolCallId)??this.currentMessageId??``;this.events.approvalRequested(t,n,e.toolCallId,e.toolName,e.input,e.approvalId)},onCustomEvent:(e,t,n)=>{e===`memory:state`&&this.devtoolsBridge.recordMemoryState(t),(e===`compaction:started`||e===`compaction:state`||e===`compaction:ended`)&&this.devtoolsBridge.recordCompactionEvent(e,t),e===`skills:state`&&this.devtoolsBridge.recordSkillsState(t),this.callbacksRef.current.onCustomEvent(e,t,n)}}}),this.persistor?.hydrateAsync(r),this.rejoinRunId=o,this.cachesMessages=t}attach(){this.disposed||this.tailing||(this.ensureThreadId(),this.tailing=!0,this.rejoinRunId&&this.maybeRejoinInFlight(this.rejoinRunId),!this.cachesMessages&&this.connection.hydrate&&this.hydrateFromServer())}detach(){this.tailing&&(this.tailing=!1,this.cancelInFlightStream({setReadyStatus:!0}),this.rejoinedRunId=null)}applyResumeSnapshot(e){let t=OA(e);if(t===void 0){this.interruptManager.reset({source:`hydrate`});return}this.lastResume=t;let n=Array.isArray(e.pendingInterrupts)?e.pendingInterrupts:[];if(n.length===0){this.interruptManager.reset({source:`hydrate`});return}let r=this.interruptGeneration(n);this.interruptManager.hydrate({threadId:t.threadId,interruptedRunId:t.runId,generation:r,interrupts:n},`hydrate`)}applyPersistedResume(e){this.applyResumeSnapshot(e);let t=Array.isArray(e.pendingInterrupts)&&e.pendingInterrupts.length>0,n=e.resumeState?.runId;!t&&n&&this.maybeRejoinInFlight(n)}maybeRejoinInFlight(e){this.connection.joinRun&&!this.disposed&&this.tailing&&this.rejoinedRunId!==e&&(this.isLoading||this.abortController||(this.rejoinedRunId=e,this.resumeInFlightRun(e)))}hydrateFromServer(){let e=this.connection.hydrate;e&&(this.isLoading||this.abortController||this.disposed||(async()=>{let t;try{t=await e(this.threadId)}catch{return}!this.disposed&&this.tailing&&(this.isLoading||this.abortController||(t.messages.length>0&&this.processor.setMessages(KO(t.messages)),t.interrupts&&t.interrupts.pending.length>0?this.applyResumeSnapshot({resumeState:{threadId:this.threadId,runId:t.interrupts.runId},pendingInterrupts:t.interrupts.pending}):t.activeRun?.runId&&this.maybeRejoinInFlight(t.activeRun.runId)))})())}mountDevtools(){this.ensureThreadId(),!this.devtoolsMounted&&(this.devtoolsMounted=!0,this.devtoolsBridge.mountWithTools(this.processor.getMessages().length))}ensureThreadId(){return this.threadId||=this.generateUniqueId(`thread`),this.uniqueId=this.threadId,this.threadId}drainIgnoredRunlessChunk(e){if(e.type!==`RUN_ERROR`)return;let t=this.clearedStreamTracker.takeRunlessRunId();t&&(this.activeRunIds.delete(t),this.setSessionGenerating(this.activeRunIds.size>0),this.resolveProcessing())}retireIgnoredClearedTerminalChunk(e){if(e.type!==`RUN_FINISHED`&&e.type!==`RUN_ERROR`)return;let t=ek(e)??this.clearedStreamTracker.takeRunlessRunId();t&&(this.activeRunIds.delete(t),this.setSessionGenerating(this.activeRunIds.size>0),ek(e)||this.resolveProcessing())}updateRunLifecycle(e,t){if(e.type===`RUN_STARTED`){let t=ek(e)??e.runId;this.activeResumeThreadId=`threadId`in e&&typeof e.threadId==`string`?e.threadId:this.activeResumeThreadId,this.activeResumeRunId=t,this.activeRunIds.add(t),this.clearedStreamTracker.onRunStarted(t),this.setSessionGenerating(!0),this.persistor&&this.connection.joinRun&&!this.lastResume&&this.persistResumeSnapshot({threadId:this.activeResumeThreadId??this.threadId,runId:t});return}if(e.type!==`RUN_FINISHED`&&e.type!==`RUN_ERROR`)return;let n=ek(e);n?(this.activeRunIds.delete(n),this.clearedStreamTracker.onRunSettled(n)):e.type===`RUN_ERROR`&&(this.activeRunIds.clear(),this.clearedStreamTracker.onSessionRunError()),this.setSessionGenerating(this.activeRunIds.size>0);let r=e.type===`RUN_FINISHED`&&wA(e);t?.resolveProcessing!==!1&&!r&&this.resolveProcessing()}observeInterruptState(e){if(e.type!==`RUN_FINISHED`&&e.type!==`RUN_ERROR`||this.activeInterruptSubmission&&e.type===`RUN_ERROR`)return;let t=ek(e),n=`threadId`in e&&typeof e.threadId==`string`?e.threadId:this.activeResumeThreadId;if(e.type===`RUN_FINISHED`&&e.outcome?.type===`interrupt`){let r=this.currentRunId??t??this.activeResumeRunId??``;this.lastResume={threadId:n??this.threadId,runId:r},this.interruptManager.hydrate({threadId:this.lastResume.threadId,interruptedRunId:r,generation:this.interruptGeneration(e.outcome.interrupts),interrupts:e.outcome.interrupts},`live`);return}let r=e.type===`RUN_ERROR`&&!t,i=!!(t&&this.lastResume?.runId===t),a=!!(t&&this.currentRunId===t||this.currentRunId&&this.lastResume?.runId===this.currentRunId),o=!(!this.isLoading||!t||t!==this.activeResumeRunId&&t!==this.currentRunId),s=this.isLoading&&e.type===`RUN_FINISHED`&&!t,c=!!(this.activeInterruptSubmission&&this.isLoading&&e.type===`RUN_FINISHED`&&e.outcome?.type!==`interrupt`);if(r||i||a||o||s||c){this.lastResume=null,this.persistor?.persistResumeSnapshot(null),this.interruptManager.reset();return}this.notifyResumeStateChange(`live`)}getResumeState(){return this.lastResume?{...this.lastResume}:null}getCurrentRunId(){return this.currentRunId}setCurrentRunId(e){this.currentRunId!==e&&(this.currentRunId=e,this.callbacksRef.current.onRunIdChange(e))}getInterruptState(){return this.interruptManager.getState()}getInterrupts(){return this.interruptManager.getInterrupts()}getPendingInterrupts(){return this.interruptManager.getInterrupts()}resolveInterrupts(e){if(typeof e==`boolean`){this.interruptManager.resolve(e);return}this.interruptManager.resolve(e)}cancelInterrupts(){this.interruptManager.cancel()}retryInterrupts(){this.interruptManager.retry()}resumeInterruptsUnsafe(e,t){let n=t??this.lastResume;return n?this.resumeInterruptsUnsafeForGeneration(e,n,this.continuationGeneration):Promise.resolve(!1)}resumeInterruptsUnsafeForGeneration(e,t,n){return n===this.continuationGeneration?this.isLoading?new Promise((r,i)=>{this.queuePostStreamAction(async()=>{try{r(await this.resumeInterruptsUnsafeForGeneration(e,t,n))}catch(e){i(e)}})}):(this.pendingResumeThreadId=t.threadId,this.pendingResumeParentRunId=t.runId,this.pendingResumeItems=[...e],this.streamResponse()):Promise.resolve(!1)}resumeInterrupts(e,t){return this.resumeInterruptsUnsafe(e,t)}async submitInterruptBatch(e){let t=this.continuationGeneration;this.activeInterruptSubmission=e,this.interruptSubmissionFailure=void 0;for(let t of e.resolutions){let e=DA(t.payload);if(e===void 0)continue;let n=t.interruptId;this.processor.addToolApprovalResponse(n,e)}let n=await this.resumeInterruptsUnsafeForGeneration([...e.resolutions],{threadId:e.threadId,runId:e.interruptedRunId},t).finally(()=>{this.activeInterruptSubmission===e&&(this.activeInterruptSubmission=void 0)});if(t!==this.continuationGeneration)return;let r=this.takeInterruptSubmissionFailure();if(r!==void 0)throw{errors:r.errors};if(!n)throw Error(`Interrupt continuation could not be started.`);this.lastResume?.runId===e.interruptedRunId&&(this.lastResume=null,this.interruptManager.reset())}takeInterruptSubmissionFailure(){let e=this.interruptSubmissionFailure;return this.interruptSubmissionFailure=void 0,e}interruptGeneration(e){let t;for(let n of e){let e=n.metadata?.[`tanstack:interruptBinding`];if(typeof e!=`object`||!e||!(`generation`in e)||typeof e.generation!=`number`||!Number.isInteger(e.generation)||e.generation<0||t!==void 0&&t!==e.generation)return 0;t=e.generation}return t??0}generateUniqueId(e){return`${e}-${Date.now()}-${Math.random().toString(36).substring(7)}`}setIsLoading(e){this.isLoading=e,this.callbacksRef.current.onLoadingChange(e),this.events.loadingChanged(e)}setStatus(e){this.status=e,this.callbacksRef.current.onStatusChange(e),this.devtoolsBridge.emitSnapshot()}setIsSubscribed(e){this.isSubscribed=e,this.callbacksRef.current.onSubscriptionChange(e),this.devtoolsBridge.emitSnapshot()}setConnectionStatus(e){this.connectionStatus=e,this.callbacksRef.current.onConnectionStatusChange(e),this.devtoolsBridge.emitSnapshot()}setSessionGenerating(e){this.sessionGenerating!==e&&(this.sessionGenerating=e,this.callbacksRef.current.onSessionGeneratingChange(e),this.devtoolsBridge.emitSnapshot())}notifyResumeStateChange(e){let t=this.getResumeState(),n=this.interruptManager.getState();this.persistResumeSnapshot(t),this.callbacksRef.current.onResumeStateChange(t,n.interrupts),this.callbacksRef.current.onInterruptStateChange(n,{source:e})}persistResumeSnapshot(e){if(!this.persistor)return;if(!e){this.persistor.persistResumeSnapshot(null);return}let t=this.interruptManager.getDescriptors();this.persistor.persistResumeSnapshot({resumeState:e,...t.length>0?{pendingInterrupts:[...t]}:{}})}resetSessionGenerating(e){this.activeRunIds.clear(),e?.preserveClearedStreamTracking||this.clearedStreamTracker.resetActiveRuns(),this.setSessionGenerating(!1)}setError(e){this.error=e,this.callbacksRef.current.onErrorChange(e),this.events.errorChanged(e?.message||null)}buildDevtoolsBridgeOptions(e){let t=this;return{get hookId(){return t.uniqueId},get clientId(){return t.uniqueId},get threadId(){return t.threadId},metadata:{hookName:e?.hookName??`useChat`,outputKind:e?.outputKind??`chat`,...e?.framework?{framework:e.framework}:{},...e?.name?{name:e.name}:{}},getSnapshot:()=>this.getDevtoolsSnapshot(),getTools:()=>this.clientToolsRef.current.values(),getMessages:()=>this.processor.getMessages(),setMessages:e=>{this.processor.setMessages(e)},addToolResult:(e,t,n)=>{this.processor.addToolResult(e,t,n)},generateId:e=>this.generateUniqueId(e)}}getDevtoolsSnapshot(){return{messages:this.processor.getMessages(),status:this.status,isLoading:this.isLoading,isSubscribed:this.isSubscribed,connectionStatus:this.connectionStatus,sessionGenerating:this.sessionGenerating,activeRunIds:Array.from(this.activeRunIds),queue:this.getQueue(),...this.error?{error:this.error.message}:{}}}findMessageIdForToolCall(e){let t=this.processor.getMessages();for(let n of t)if(n.parts.find(t=>t.type===`tool-call`&&t.id===e))return n.id}abortSubscriptionLoop(){this.subscriptionAbortController?.abort(),this.subscriptionAbortController=null}resolveProcessing(){this.processingResolve?.(),this.processingResolve=null}cancelInFlightStream(e){this.abortController?.abort(),this.abortController=null,e?.abortSubscription&&this.abortSubscriptionLoop(),this.resolveProcessing(),this.setIsLoading(!1),this.deliverClaim=!1,e?.setReadyStatus&&this.setStatus(`ready`)}reportStreamError(e){let t=this.errorReportedGeneration===this.streamGeneration;this.setError(e),(this.isLoading||this.status===`submitted`||this.status===`streaming`)&&this.setStatus(`error`),t||(this.errorReportedGeneration=this.streamGeneration,this.callbacksRef.current.onError(e))}startSubscription(){this.subscriptionAbortController=new AbortController;let e=this.subscriptionAbortController.signal;this.consumeSubscription(e).catch(e=>{e instanceof Error&&e.name!==`AbortError`&&(this.setConnectionStatus(`error`),this.resetSessionGenerating(),this.setIsSubscribed(!1),this.reportStreamError(e)),this.resolveProcessing()}).finally(()=>{this.subscriptionAbortController?.signal===e&&(this.subscriptionAbortController=null,!e.aborted&&this.isSubscribed&&(this.setIsSubscribed(!1),this.connectionStatus!==`error`&&this.setConnectionStatus(`disconnected`)))})}async consumeSubscription(e){let t=this.connection.subscribe(e);for await(let n of t){if(e.aborted)break;await this.processIncomingChunk(n)}}resumeInFlightRun(e){let t=this.connection.joinRun;if(!t)return;let n=new AbortController;this.abortController=n,this.setCurrentRunId(e),this.lastResume={threadId:this.threadId,runId:e},this.streamContinuationGeneration=this.continuationGeneration,this.setIsLoading(!0),this.setStatus(`streaming`),(async()=>{let r=!1,i=!1,a=!1,o=setTimeout(()=>{i||n.abort()},kA);try{for await(let a of t(e,n.signal)){if(n.signal.aborted)break;i||(i=!0,clearTimeout(o)),!r&&AA.has(a.type)&&(r=!0,this.dropTrailingInFlightAssistant()),await this.processIncomingChunk(a,{defer:!1})}this.pendingToolExecutions.size>0&&await Promise.all(this.pendingToolExecutions.values())}catch(e){let t=e instanceof Error&&(e.name===`AbortError`||e.name===`TimeoutError`);!i&&!t&&(a=!0),i&&!t&&this.reportStreamError(e instanceof Error?e:Error(String(e)))}finally{clearTimeout(o),!i&&a&&this.tailing&&!this.disposed&&(this.lastResume=null,this.persistor?.persistResumeSnapshot(null)),this.abortController===n&&(this.abortController=null,this.setIsLoading(!1),this.status===`streaming`&&this.setStatus(`ready`),await this.drainPostStreamActions())}})()}dropTrailingInFlightAssistant(){let e=this.processor.getMessages(),t=e[e.length-1];t&&t.role===`assistant`&&this.processor.setMessages(e.slice(0,-1))}async processIncomingChunk(e,t){if(e=rO(e),e.type===`RUN_ERROR`&&this.isActiveInterruptSubmissionFailure(e)){let t=lE(e)?.interruptErrors;this.interruptSubmissionFailure={errors:Array.isArray(t)?t:[]}}if(this.connectionStatus===`connecting`&&this.setConnectionStatus(`connected`),this.clearedStreamTracker.shouldIgnoreChunk(e)){(e.type===`RUN_FINISHED`||e.type===`RUN_ERROR`)&&(ek(e)?this.updateRunLifecycle(e,{resolveProcessing:!1}):this.drainIgnoredRunlessChunk(e),this.retireIgnoredClearedTerminalChunk(e),this.resolveJoinedRun(e));return}this.callbacksRef.current.onChunk(e),this.devtoolsBridge.observeChunk(e),this.processor.processChunk(e),this.updateRunLifecycle(e),this.observeInterruptState(e),t?.defer!==!1&&(typeof document>`u`||!document.hidden)&&await new Promise(e=>setTimeout(e,0)),this.resolveJoinedRun(e)}isActiveInterruptSubmissionFailure(e){let t=this.activeInterruptSubmission,n=lE(e)?.interruptErrors;if(!t||!Array.isArray(n)||n.length===0)return!1;let r=ek(e);return r!==void 0&&r!==this.currentRunId||typeof e.threadId==`string`&&e.threadId!==t.threadId?!1:n.every(e=>typeof e!=`object`||!e||typeof e.threadId!=`string`||typeof e.interruptedRunId!=`string`||typeof e.generation!=`number`?!1:e.threadId===t.threadId&&e.interruptedRunId===t.interruptedRunId&&e.generation===t.generation)}resolveJoinedRun(e){if(e.type!==`RUN_FINISHED`&&e.type!==`RUN_ERROR`)return;let t=ek(e);if(t===void 0)return;let n=this.joinedRunWaiters.get(t);n!==void 0&&(this.joinedRunWaiters.delete(t),n())}ensureSubscription(){if(!this.isSubscribed){this.subscribe();return}(!this.subscriptionAbortController||this.subscriptionAbortController.signal.aborted)&&this.subscribe({restart:!0})}waitForProcessing(){return this.resolveProcessing(),new Promise(e=>{this.processingResolve=e})}async sendMessage(e,t,n){if(this.mountDevtools(),typeof e==`string`&&!e.trim())return;if(this.hasPendingInterrupts())throw Error(`ChatClient: cannot send normal input while pending interrupts exist. Use resumeInterrupts() instead.`);let r={...t,...n?.body};if(this.isSendBusy()){let{action:t,id:i}=this.decideWhenBusy(e,n);if(t===`drop`)return;if(t===`queue`){this.enqueueMessage(e,r,i);return}this.stopMessageQueueDrain=!0,this.sendInFlight=!0,this.cancelInFlightStream({setReadyStatus:!0}),this.resetSessionGenerating()}else this.sendInFlight=!0;try{await this.deliverMessage(e,r)}finally{this.sendInFlight=!1}}hasPendingInterrupts(){return this.interruptManager.getDescriptors().length>0}isSendBusy(){return this.isLoading||this.sendInFlight||this.messageQueueDraining}resolveBusyReason(){return this.isLoading?`streaming`:this.messageQueueDraining?`draining`:`sendInFlight`}async deliverMessage(e,t){if(this.isLoading||this.deliverClaim)return!1;this.deliverClaim=!0;try{let n=this.normalizeMessageInput(e);this.pendingMessageBody=t;let r=this.processor.addUserMessage(n.content,n.id,n.metadata);return this.events.messageSent(r.id,n.content),await this.streamResponse()}finally{this.deliverClaim=!1}}decideWhenBusy(e,t){let n=this.generateUniqueId(`queued`);if(t?.whenBusy)return{action:t.whenBusy,id:n};let{strategy:r,whenBusy:i}=this.queueConfig;if(r){let{action:t}=r({pending:{id:n,content:e,createdAt:Date.now()},busyReason:this.resolveBusyReason(),queued:this.getQueue()});return{action:t,id:n}}return{action:i,id:n}}enqueueMessage(e,t,n){let{maxSize:r,onOverflow:i}=this.queueConfig;if(r!==void 0&&this.messageQueue.length>=r){if(i===`reject`||r===0)return;this.messageQueue.shift()}this.messageQueue.push({id:n??this.generateUniqueId(`queued`),content:e,createdAt:Date.now(),...t===void 0?{}:{body:t}}),this.emitQueueChange()}normalizeMessageInput(e){return typeof e==`string`?{content:e.trim()}:{content:e.content,id:e.id,...e.metadata===void 0?{}:{metadata:e.metadata}}}async append(e){if(this.mountDevtools(),this.hasPendingInterrupts())throw Error(`ChatClient: cannot append normal input while pending interrupts exist. Use resumeInterrupts() instead.`);let t=LD(e,RD);if(t.role===`system`)return;let n=t;this.events.messageAppended(n);let r=this.processor.getMessages();if(this.processor.setMessages([...r,n]),this.devtoolsBridge.emitSnapshot(),this.isLoading){this.queuePostStreamAction(async()=>{await this.streamResponse()});return}await this.streamResponse()}async streamResponse(){if(this.isLoading)return!1;let e=++this.streamGeneration;this.streamContinuationGeneration=this.continuationGeneration;let t=this.pendingResumeThreadId,n=this.pendingResumeParentRunId,r=this.pendingResumeItems;this.pendingResumeThreadId=null,this.pendingResumeParentRunId=null,this.pendingResumeItems=null;let i=`run-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;this.setCurrentRunId(i),this.activeResumeThreadId=t??this.threadId,this.activeResumeRunId=i,this.setIsLoading(!0),this.deliverClaim=!1,this.setStatus(`submitted`),this.setError(void 0),this.errorReportedGeneration=null,this.abortController=new AbortController;let a=this.abortController.signal;this.pendingToolExecutions.clear();let o=!1,s=null,c=!1;try{let l=this.processor.getMessages(),u=new Map(this.clientToolsRef.current),d=this.context;if(await this.callbacksRef.current.onResponse(),a.aborted)return!1;let f={...this.bodyOption,...this.forwardedPropsOption,...this.pendingMessageBody};this.pendingMessageBody=void 0,this.currentStreamId=this.generateUniqueId(`stream`),this.devtoolsBridge.setCurrentStreamId(this.currentStreamId),this.currentMessageId=null,this.activeClientTools=u,this.activeContext=d,this.processor.prepareAssistantMessage(),this.ensureSubscription();let p=this.waitForProcessing(),m;if(this.byok){let e=aA(this.byokProvider,f.provider);m=await oA(this.byok,e)}let h={threadId:t??this.threadId,runId:i,...n===null?{}:{parentRunId:n},clientTools:Array.from(u.values()).map(e=>({name:e.name,description:e.description,parameters:e.inputSchema?AE(e.inputSchema):{type:`object`}})),forwardedProps:{...f},...r?{resume:r}:{},...m?{headers:m}:{}};if(this.devtoolsBridge.beginRun(h.runId,h.threadId),s=h.runId,this.devtoolsBridge.emitRunLifecycle(`run:created`,h.runId,`created`),this.devtoolsBridge.emitRunLifecycle(`run:started`,h.runId,`started`),this.devtoolsBridge.emitSnapshot(),await this.connection.send(l,f,a,h),e!==this.streamGeneration||a.aborted||(this.connectionDrainsOnSend&&this.resolveProcessing(),await p,e!==this.streamGeneration))return!1;if(this.status===`error`)return s&&(this.devtoolsBridge.emitRunLifecycle(`run:errored`,s,`errored`,this.error?{error:this.error.message}:{}),c=!0),!1;this.pendingToolExecutions.size>0&&await Promise.all(this.pendingToolExecutions.values()),this.processor.finalizeStream(),o=!0}catch(t){let n=t instanceof Error?t:Error(String(t));if(n.name===`AbortError`)return s&&(this.devtoolsBridge.emitRunLifecycle(`run:cancelled`,s,`cancelled`),c=!0),!1;if(n instanceof XO&&this.byok?.request(n.provider,`missing`),n instanceof ZO&&n.reason===`locked`&&this.byok?.request(n.provider,`locked`),e===this.streamGeneration&&(this.reportStreamError(n),s&&(this.devtoolsBridge.emitRunLifecycle(`run:errored`,s,`errored`,{error:n.message}),c=!0)),e===this.streamGeneration&&(n instanceof XO||n instanceof ZO||n instanceof QO))throw n}finally{e===this.streamGeneration&&(this.currentStreamId=null,this.devtoolsBridge.setCurrentStreamId(null),this.currentMessageId=null,this.setCurrentRunId(null),this.activeClientTools=null,this.activeContext=void 0,this.abortController=null,this.setIsLoading(!1),this.pendingMessageBody=void 0,s&&!c&&(o?this.devtoolsBridge.emitRunLifecycle(`run:completed`,s,`completed`):a.aborted&&this.devtoolsBridge.emitRunLifecycle(`run:cancelled`,s,`cancelled`)),await this.drainPostStreamActions(),o?(this.status!==`ready`&&this.setStatus(`ready`),this.messageQueueDraining||await this.drainQueue()):this.flushQueue())}return o}subscribe(e){let t=e?.restart===!0;(!this.isSubscribed||t)&&(this.isSubscribed&&t&&this.abortSubscriptionLoop(),this.setIsSubscribed(!0),this.setConnectionStatus(`connecting`),this.startSubscription())}unsubscribe(){this.cancelInFlightStream({setReadyStatus:!0,abortSubscription:!0}),this.discardPendingSends(),this.resetSessionGenerating(),this.setIsSubscribed(!1),this.setConnectionStatus(`disconnected`)}async reload(){let e=this.processor.getMessages();if(e.length===0)return;let t=e.findLastIndex(e=>e.role===`user`);t!==-1&&(this.isLoading&&this.cancelInFlightStream(),this.discardPendingSends(),this.events.reloaded(t),this.processor.removeMessagesAfter(t),this.devtoolsBridge.emitSnapshot(),await this.streamResponse())}stop(){this.continuationGeneration++;let e=this.abortController!==null;this.cancelInFlightStream({setReadyStatus:!0}),this.discardPendingSends(),this.lastResume=null,this.activeInterruptSubmission=void 0,this.interruptManager.reset(),e&&this.resetSessionGenerating(),this.events.stopped()}clear(){let e=this.abortController!==null;this.clearedStreamTracker.snapshotClear({messages:this.processor.getMessages(),activeRunIds:this.activeRunIds,currentRunId:this.currentRunId}),this.isLoading||e?(this.cancelInFlightStream({setReadyStatus:!0}),this.resetSessionGenerating({preserveClearedStreamTracking:!0})):this.activeRunIds.size>0&&this.resetSessionGenerating({preserveClearedStreamTracking:!0}),this.persistor?.beginClear(),this.processor.clearMessages(),this.discardPendingSends(),this.persistor?.remove(),this.lastResume=null,this.interruptManager.reset(),this.pendingResumeThreadId=null,this.pendingResumeParentRunId=null,this.pendingResumeItems=null,this.setError(void 0),this.events.messagesCleared()}async addToolResult(e){let t=this.clientToolsRef.current.get(e.tool);await this.addToolResultForClientTool(e,t,this.streamContinuationGeneration)}async addToolResultForClientTool(e,t,n,r){if(t&&e.state!==`output-error`)try{e={...e,output:this.validateClientToolOutput(t,e.output)}}catch(t){e={...e,output:null,state:`output-error`,errorText:t.message}}if(this.events.toolResultAdded(e.toolCallId,e.tool,e.output,e.state||`output-available`,r),n===this.continuationGeneration&&(this.processor.addToolResult(e.toolCallId,e.output,e.state===`output-error`?e.errorText||`Tool execution failed`:void 0),this.devtoolsBridge.emitSnapshot(),!this.interruptManager.resolveClientToolOutput(e.toolCallId,e.state===`output-error`?{error:e.errorText||`Tool execution failed`}:e.output))){if(this.isLoading){this.queuePostStreamAction(()=>n===this.continuationGeneration?this.checkForContinuation():Promise.resolve());return}await this.checkForContinuation()}}validateClientToolOutput(e,t){return e.outputSchema&&TE(e.outputSchema)?ME(e.outputSchema,t):t}async addToolApprovalResponse(e){if(this.processor.addToolApprovalResponse(e.id,e.approved),this.devtoolsBridge.emitSnapshot(),this.interruptManager.resolveToolApprovalDecision(e.id,e.approved))return;let t=this.processor.getMessages(),n;for(let r of t){let t=r.parts.find(t=>t.type===`tool-call`&&t.approval?.id===e.id);if(t){n=t.id;break}}if(n&&this.events.toolApprovalResponded(e.id,n,e.approved),this.processor.addToolApprovalResponse(e.id,e.approved),this.devtoolsBridge.emitSnapshot(),this.isLoading){this.queuePostStreamAction(()=>this.checkForContinuation());return}await this.checkForContinuation()}queuePostStreamAction(e){let t=this.continuationGeneration;this.postStreamActions.push(async()=>{t===this.continuationGeneration&&await e()})}async drainPostStreamActions(){if(!this.draining){this.draining=!0;try{let e;for(;(e=this.postStreamActions.shift())!==void 0;)await e()}finally{this.draining=!1}}}async checkForContinuation(){if(this.streamContinuationGeneration===this.continuationGeneration&&!this.hasPendingInterrupts()){if(this.continuationPending||this.isLoading){this.continuationSkipped=!0;return}if(this.shouldAutoSend()){this.continuationPending=!0,this.continuationSkipped=!1;let e=!1;try{e=await this.streamResponse()}finally{this.continuationPending=!1}this.continuationSkipped&&e&&(this.continuationSkipped=!1,await this.checkForContinuation())}}}shouldAutoSend(){if(this.lastResume||this.activeInterruptSubmission&&this.hasPendingInterrupts()||this.interruptManager.getInterrupts().length>0)return!1;let e=this.processor.getMessages().findLast(e=>e.role===`assistant`);return!e||!e.parts.some(e=>e.type===`tool-call`)?!1:this.processor.areAllToolsComplete()}getMessages(){return this.processor.getMessages()}shouldAbortMessageQueueDrain(){return this.isLoading||this.stopMessageQueueDrain}async drainQueue(){if(!(this.messageQueueDraining||this.isLoading||this.messageQueue.length===0)){this.messageQueueDraining=!0,this.stopMessageQueueDrain=!1;try{if(this.queueConfig.drain===`batch`){for(;this.messageQueue.length>0;){if(this.shouldAbortMessageQueueDrain())return;let e=this.messageQueue.splice(0);this.emitQueueChange();let t=EA(e);if(!await this.deliverMessage(t.content,t.body)||this.shouldAbortMessageQueueDrain())return}return}for(;this.messageQueue.length>0;){if(this.shouldAbortMessageQueueDrain())return;let e=this.messageQueue.shift();if(e===void 0||(this.emitQueueChange(),!await this.deliverMessage(e.content,e.body)||this.shouldAbortMessageQueueDrain()))return}}finally{this.messageQueueDraining=!1,this.stopMessageQueueDrain=!1}}}discardPendingSends(){this.sendInFlight=!1,this.flushQueue()}getQueue(){return this.messageQueue.map(({id:e,content:t,createdAt:n})=>({id:e,content:t,createdAt:n}))}emitQueueChange(){this.callbacksRef.current.onQueueChange(this.getQueue()),this.devtoolsBridge.emitSnapshot()}cancelQueued(e){let t=this.messageQueue.findIndex(t=>t.id===e);t!==-1&&(this.messageQueue.splice(t,1),this.emitQueueChange())}flushQueue(){this.messageQueue.length!==0&&(this.messageQueue=[],this.emitQueueChange())}getIsLoading(){return this.isLoading}getStatus(){return this.status}getIsSubscribed(){return this.isSubscribed}getConnectionStatus(){return this.connectionStatus}getSessionGenerating(){return this.sessionGenerating}getError(){return this.error}setMessagesManually(e){this.processor.setMessages(e),this.devtoolsBridge.emitSnapshot()}updateOptions(e){if(e.connection!==void 0||e.fetcher!==void 0){let t=this.isSubscribed;this.isLoading?this.cancelInFlightStream({setReadyStatus:!0,abortSubscription:!0}):t&&this.abortSubscriptionLoop(),this.resetSessionGenerating(),this.setIsSubscribed(!1),this.setConnectionStatus(`disconnected`);let n=SA({connection:e.connection,fetcher:e.fetcher});this.connectionDrainsOnSend=CA(n),this.connection=Tk(n),t&&this.subscribe()}if(e.body!==void 0&&(this.bodyOption=e.body),e.forwardedProps!==void 0&&(this.forwardedPropsOption=e.forwardedProps),e.byok!==void 0&&(this.byok=e.byok),e.byokProvider!==void 0&&(this.byokProvider=e.byokProvider),`context`in e&&(this.context=e.context),e.tools!==void 0){this.interruptManager.updateTools(e.tools),this.clientToolsRef.current=new Map;for(let t of e.tools)this.clientToolsRef.current.set(t.name,t);this.devtoolsBridge.notifyToolsChanged()}e.queue!==void 0&&(this.queueConfig=TA(e.queue)),e.onResponse!==void 0&&(this.callbacksRef.current.onResponse=e.onResponse),e.onChunk!==void 0&&(this.callbacksRef.current.onChunk=e.onChunk),e.onFinish!==void 0&&(this.callbacksRef.current.onFinish=e.onFinish),e.onError!==void 0&&(this.callbacksRef.current.onError=e.onError),e.onSubscriptionChange!==void 0&&(this.callbacksRef.current.onSubscriptionChange=e.onSubscriptionChange),e.onConnectionStatusChange!==void 0&&(this.callbacksRef.current.onConnectionStatusChange=e.onConnectionStatusChange),e.onSessionGeneratingChange!==void 0&&(this.callbacksRef.current.onSessionGeneratingChange=e.onSessionGeneratingChange),e.onQueueChange!==void 0&&(this.callbacksRef.current.onQueueChange=e.onQueueChange),e.onResumeStateChange!==void 0&&(this.callbacksRef.current.onResumeStateChange=e.onResumeStateChange),e.onRunIdChange!==void 0&&(this.callbacksRef.current.onRunIdChange=e.onRunIdChange),e.onInterruptStateChange!==void 0&&(this.callbacksRef.current.onInterruptStateChange=e.onInterruptStateChange),e.onCustomEvent!==void 0&&(this.callbacksRef.current.onCustomEvent=e.onCustomEvent)}dispose(){this.disposed=!0,this.unsubscribe(),this.devtoolsBridge.dispose(),this.devtoolsMounted=!1}};function MA(e){return!e||typeof e!=`object`?{}:{...`before`in e&&typeof e.before==`number`?{before:e.before}:{},...`after`in e&&typeof e.after==`number`?{after:e.after}:{},...`messagesBefore`in e&&typeof e.messagesBefore==`number`?{messagesBefore:e.messagesBefore}:{},...`messagesAfter`in e&&typeof e.messagesAfter==`number`?{messagesAfter:e.messagesAfter}:{},...`reusedCheckpoint`in e&&typeof e.reusedCheckpoint==`boolean`?{reusedCheckpoint:e.reusedCheckpoint}:{},...`maxTokens`in e&&typeof e.maxTokens==`number`?{maxTokens:e.maxTokens}:{},...`strategyKey`in e&&typeof e.strategyKey==`string`?{strategyKey:e.strategyKey}:{},...`durationMs`in e&&typeof e.durationMs==`number`?{durationMs:e.durationMs}:{}}}function NA(e){if(!Array.isArray(e))return;let t=[];for(let n of e)n&&typeof n==`object`&&`role`in n&&`tokens`in n&&`text`in n&&typeof n.role==`string`&&typeof n.tokens==`number`&&typeof n.text==`string`&&t.push({role:n.role,tokens:n.tokens,text:n.text});return t}function PA(e){if(!e||typeof e!=`object`||!(`before`in e)||!(`after`in e)||!(`messagesBefore`in e)||!(`messagesAfter`in e)||typeof e.before!=`number`||typeof e.after!=`number`||typeof e.messagesBefore!=`number`||typeof e.messagesAfter!=`number`)return null;let t=`reusedCheckpoint`in e&&e.reusedCheckpoint===!0,n=`maxTokens`in e&&typeof e.maxTokens==`number`?e.maxTokens:void 0,r=`strategyKey`in e&&typeof e.strategyKey==`string`?e.strategyKey:void 0,i=`dropped`in e?NA(e.dropped):void 0,a=`result`in e?NA(e.result):void 0;return{before:e.before,after:e.after,messagesBefore:e.messagesBefore,messagesAfter:e.messagesAfter,reusedCheckpoint:t,...n===void 0?{}:{maxTokens:n},...r?{strategyKey:r}:{},...i?{dropped:i}:{},...a?{result:a}:{}}}var FA=Symbol.for(`tanstack.ai.devtools.activeBridgeByHookId`);function IA(){let e=globalThis,t=e[FA];if(t)return t;let n=new Map;return e[FA]=n,n}function LA(e,t){return{get hookId(){return e.hookId},get clientId(){return e.clientId},get threadId(){return e.threadId},metadata:e.metadata,getSnapshot:t.getSnapshot,...t.getTools||e.getTools?{getTools:t.getTools??e.getTools}:{},...t.applyToolFixture||e.applyToolFixture?{applyToolFixture:t.applyToolFixture??e.applyToolFixture}:{}}}var RA=class{options;unsubscribers=[];disposed=!1;superseded=!1;registered=!1;constructor(e){this.options=e}emitRegistered(){this.prepareForMountEmit()&&(this.registered=!0,hO(`hook:registered`,{...this.createEnvelope(`hook:registered`),...this.createMetadataPayload(),lifecycle:`mounted`}))}emitUpdated(){this.prepareForEmit()&&hO(`hook:updated`,{...this.createEnvelope(`hook:updated`),...this.createMetadataPayload(),lifecycle:`active`})}emitSnapshot(){this.prepareForEmit()&&hO(`hook:state-snapshot`,{...this.createEnvelope(`hook:state-snapshot`),...this.createMetadataPayload(),state:this.options.getSnapshot()})}emitToolsRegistered(){if(!this.prepareForEmit())return;let e=this.options.getTools?Array.from(this.options.getTools()).map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema?AE(e.inputSchema):{type:`object`},outputSchema:e.outputSchema?AE(e.outputSchema):void 0,needsApproval:e.needsApproval,metadata:e.metadata})):[];hO(`tools:registered`,{...this.createEnvelope(`tools:registered`),...this.createMetadataPayload(),tools:e})}emitRunLifecycle(e,t,n,r={}){this.prepareForEmit()&&hO(e,{...this.createEnvelope(e,`client-state`,{runId:t}),runId:t,status:n,...r.error?{error:r.error}:{}})}deactivate(){let e=IA();e.get(this.options.hookId)===this&&e.delete(this.options.hookId);for(let e of this.unsubscribers.splice(0))e()}supersede(){this.disposed||(this.superseded=!0,this.disposed=!0,this.deactivate())}dispose(){if(!this.disposed){if(this.disposed=!0,!this.registered){this.deactivate();return}if(IA().get(this.options.hookId)!==this){this.deactivate();return}hO(`hook:unregistered`,{...this.createEnvelope(`hook:unregistered`),...this.createMetadataPayload(),reason:`disposed`}),this.deactivate()}}prepareForEmit(){return this.disposed||this.superseded?!1:(this.activate(),!0)}prepareForMountEmit(){return!this.superseded&&(this.disposed&&(this.disposed=!1,this.registered=!1),this.activate(),!0)}activate(){if(this.disposed)return;let e=IA(),t=e.get(this.options.hookId);t&&t!==this&&(typeof t.supersede==`function`?t.supersede():t.deactivate()),e.set(this.options.hookId,this),!(this.unsubscribers.length>0)&&(this.unsubscribers.push(mO.on(`devtools:request-state`,e=>{this.handleRequestState(e)})),this.options.applyToolFixture&&this.unsubscribers.push(mO.on(`devtools:tool-fixture:apply`,e=>{this.handleToolFixtureApply(e)})))}handleRequestState(e){if(this.disposed||this.superseded)return;let t=e.payload.targetHookId;t&&t!==this.options.hookId||(this.emitRegistered(),this.emitToolsRegistered(),this.emitSnapshot(),this.onReplayState())}onReplayState(){}async handleToolFixtureApply(e){let t=e.payload;this.matchesFixtureTarget(t)&&await this.options.applyToolFixture?.(t)}matchesFixtureTarget(e){return!e.hookId&&!e.threadId?!1:e.hookId?e.hookId===this.options.hookId:!e.threadId||!!this.options.threadId&&e.threadId===this.options.threadId}createEnvelope(e,t=`client-state`,n={}){return lO({eventType:e,source:`client`,visibility:t,clientId:this.options.clientId,hookId:this.options.hookId,...this.options.threadId?{threadId:this.options.threadId}:{},...n.runId?{runId:n.runId}:{},timestamp:Date.now()})}createMetadataPayload(){return{hookId:this.options.hookId,hookName:this.options.metadata.hookName,...this.options.metadata.name?{displayName:this.options.metadata.name}:{},...this.options.metadata.outputKind?{outputKind:this.options.metadata.outputKind}:{},...this.options.metadata.framework?{framework:this.options.metadata.framework}:{}}}},zA=class extends RA{events;chatOptions;currentRunId=null;currentRunThreadId=null;currentStreamId=null;lastStreamId=null;lastRunEventContext;lastMemoryStateValue=null;lastCompactionEvents=[];lastSkillsStateValue=null;constructor(e){super(LA(e,{getSnapshot:e.getSnapshot,applyToolFixture:e=>this.applyFixture(e)})),this.chatOptions=e,this.events=new qA(()=>e.clientId,this)}setCurrentStreamId(e){this.currentStreamId=e,e&&(this.lastStreamId=e)}recordStreamId(e){e&&(this.lastStreamId=e)}mountWithTools(e){this.events.clientCreated(e),this.emitRegistered(),this.emitToolsRegistered(),this.emitSnapshot()}notifyToolsChanged(){this.emitToolsRegistered(),this.emitSnapshot()}getCurrentStreamId(){return this.currentStreamId}getLastStreamId(){return this.lastStreamId}resolveStreamId(){return this.currentStreamId??this.lastStreamId??this.chatOptions.generateId(`stream`)}beginRun(e,t){this.currentRunId=e,this.currentRunThreadId=t,this.lastRunEventContext={runId:e,threadId:t}}observeChunk(e){if(e.type===`RUN_STARTED`){this.beginRun(e.runId,e.threadId);return}if(e.type===`RUN_FINISHED`||e.type===`RUN_ERROR`){let t=(e.type,e.runId);if(!t||t===this.currentRunId){let e=this.getCurrentRunEventContext();e&&(this.lastRunEventContext=e),this.currentRunId=null,this.currentRunThreadId=null}}}recordMemoryState(e){this.lastMemoryStateValue=e,this.emitMemoryState(e)}recordSkillsState(e){this.lastSkillsStateValue=e,this.emitSkillsState(e)}emitMemoryState(e){if(!e||typeof e!=`object`)return;let t=e,n=t.scope,r=t.adapter;if(!n||typeof r!=`string`)return;let i=this.currentRunId?{runId:this.currentRunId}:{};hO(`memory:retrieve:started`,{...this.createEnvelope(`memory:retrieve:started`,`client-state`,i),scope:n,adapter:r,query:t.query??``}),t.recall&&hO(`memory:retrieve:completed`,{...this.createEnvelope(`memory:retrieve:completed`,`client-state`,i),scope:n,adapter:r,fragmentCount:t.recall.fragmentCount??0,hasTools:!!t.recall.hasTools,systemPromptChars:t.recall.systemPromptChars??0,durationMs:t.recall.durationMs??0}),t.snapshot&&hO(`memory:snapshot`,{...this.createEnvelope(`memory:snapshot`,`client-state`,i),scope:n,adapter:r,takenAt:t.snapshot.takenAt,data:t.snapshot.data,facts:t.snapshot.facts??[]})}recordCompactionEvent(e,t){this.lastCompactionEvents.push({eventType:e,value:t}),this.lastCompactionEvents.length>60&&this.lastCompactionEvents.splice(0,this.lastCompactionEvents.length-60),this.emitCompactionEvent(e,t)}recordCompactionState(e){this.recordCompactionEvent(`compaction:state`,e)}emitCompactionEvent(e,t){let n=this.currentRunId?{runId:this.currentRunId}:{};if(e===`compaction:started`){let e=MA(t);hO(`compaction:started`,{...this.createEnvelope(`compaction:started`,`client-state`,n),...e});return}if(e===`compaction:ended`){let e=MA(t);hO(`compaction:ended`,{...this.createEnvelope(`compaction:ended`,`client-state`,n),...e});return}if(e===`compaction:state`){let e=PA(t);if(!e)return;hO(`compaction:state`,{...this.createEnvelope(`compaction:state`,`client-state`,n),...e})}}emitSkillsState(e){if(!e||typeof e!=`object`)return;let t=e,n=Array.isArray(t.catalog)?t.catalog:[],r=Array.isArray(t.activated)?t.activated:[],i=this.currentRunId?{runId:this.currentRunId}:{};hO(`skills:snapshot`,{...this.createEnvelope(`skills:snapshot`,`client-state`,i),catalog:n,activated:r})}onReplayState(){this.lastMemoryStateValue!=null&&this.emitMemoryState(this.lastMemoryStateValue);for(let e of this.lastCompactionEvents)this.emitCompactionEvent(e.eventType,e.value);this.lastSkillsStateValue!=null&&this.emitSkillsState(this.lastSkillsStateValue)}getCurrentRunEventContext(){if(this.currentRunId)return{threadId:this.currentRunThreadId??this.chatOptions.threadId??``,runId:this.currentRunId}}getCurrentOrLastRunEventContext(){return this.getCurrentRunEventContext()??this.lastRunEventContext}findToolCallContext(e){let t={toolCallId:e},n=this.getCurrentRunEventContext();return n?{threadId:n.threadId,runId:n.runId,toolCallId:e}:this.chatOptions.threadId?{threadId:this.chatOptions.threadId,toolCallId:e}:t}async applyFixture(e){let t=this.chatOptions.getMessages(),n=e.threadId??this.chatOptions.threadId??``;if(e.execute){await this.executeFixture(e,t,n);return}let{message:r,toolCallId:i}=this.createReplayMessageFromFixture(e,t),a=r.id;this.events.messageAppended(r,void 0,{threadId:n,toolCallId:i,...e.runId?{runId:e.runId}:{}}),this.chatOptions.setMessages([...t,r]),this.events.toolFixtureApplied({hookId:this.chatOptions.hookId,threadId:n,...e.runId?{runId:e.runId}:{},toolName:e.toolName,input:e.input,output:e.output,messageId:a,toolCallId:i,...e.execute===void 0?{}:{execute:e.execute},...e.message?{message:e.message}:{},...e.errorText?{errorText:e.errorText}:{}}),this.emitSnapshot()}async executeFixture(e,t,n){let r=this.resolveFixtureToolCallId(e.toolCallId,t),i=this.resolveFixtureMessageId(e.messageId,t),a={id:i,role:`assistant`,parts:[{type:`tool-call`,id:r,name:e.toolName,arguments:VA(e.input),input:e.input,state:`input-complete`}],createdAt:new Date};this.events.messageAppended(a,void 0,{threadId:n,toolCallId:r,...e.runId?{runId:e.runId}:{}}),this.chatOptions.setMessages([...t,a]),this.emitSnapshot();let o=this.findClientTool(e.toolName)?.execute;if(!o){console.warn(`[ai-devtools] tool fixture "${e.toolName}" requested execute=true but no client tool implementation is registered; replaying saved output instead.`),this.addToolResultForFixture({fixture:e,messageId:i,toolCallId:r,threadId:n,output:e.output,errorText:e.errorText});return}let s;try{s=await o(e.input)}catch(t){console.error(`[ai-devtools] tool fixture "${e.toolName}" execute threw`,t),this.addToolResultForFixture({fixture:e,messageId:i,toolCallId:r,threadId:n,output:null,errorText:t instanceof Error?`${t.name}: ${t.message}`:`Tool execution failed: ${String(t)}`});return}this.addToolResultForFixture({fixture:e,messageId:i,toolCallId:r,threadId:n,output:s})}addToolResultForFixture(e){let t=e.errorText?`output-error`:`output-available`;this.events.toolResultAdded(e.toolCallId,e.fixture.toolName,e.output,t,{threadId:e.threadId,...e.fixture.runId?{runId:e.fixture.runId}:{},toolCallId:e.toolCallId}),this.chatOptions.addToolResult(e.toolCallId,e.output,e.errorText),this.events.toolFixtureApplied({hookId:this.chatOptions.hookId,threadId:e.threadId,...e.fixture.runId?{runId:e.fixture.runId}:{},toolName:e.fixture.toolName,input:e.fixture.input,output:e.output,execute:!0,messageId:e.messageId,toolCallId:e.toolCallId,...e.errorText?{errorText:e.errorText}:{}}),this.emitSnapshot()}createReplayMessageFromFixture(e,t){let n=this.cloneFixtureSourceMessage(e,t);if(n)return n;let r=this.resolveFixtureToolCallId(e.toolCallId,t),i=this.resolveFixtureMessageId(e.messageId,t),a=e.errorText?`error`:`complete`;return{toolCallId:r,message:{id:i,role:`assistant`,parts:[{type:`tool-call`,id:r,name:e.toolName,arguments:VA(e.input),input:e.input,state:`input-complete`,output:e.output},{type:`tool-result`,toolCallId:r,content:VA(e.output),state:a,...e.errorText?{error:e.errorText}:{}}],createdAt:new Date}}}cloneFixtureSourceMessage(e,t){let n=e.message;if(!n||!Array.isArray(n.parts))return;let r=this.createFixtureToolCallIdMap(n.parts,t),i=n.parts.map(e=>UA(e,r)).filter(e=>!!e),a=e.toolCallId?r.get(e.toolCallId):void 0;if(GA(i,{...a?{mappedToolCallId:a}:{},output:e.output}),i.length===0)return;let o=(e.toolCallId?r.get(e.toolCallId):void 0)??WA(i);if(o)return{toolCallId:o,message:{id:this.resolveFixtureMessageId(n.id,t),role:n.role,parts:i,createdAt:new Date}}}createFixtureToolCallIdMap(e,t){let n=new Map;for(let r of e)BA(r)&&r.type===`tool-call`&&typeof r.id==`string`&&n.set(r.id,this.resolveFixtureToolCallId(r.id,t));return n}resolveFixtureMessageId(e,t){return e&&!t.some(t=>t.id===e)?e:this.chatOptions.generateId(`fixture-msg`)}resolveFixtureToolCallId(e,t){return e&&!KA(t,e)?e:this.chatOptions.generateId(`fixture-tool-call`)}findClientTool(e){let t=this.chatOptions.getTools?.();if(t){for(let n of t)if(n.name===e)return n}}};function BA(e){return typeof e==`object`&&!!e}function VA(e){if(typeof e==`string`)return e;if(e===void 0||typeof e==`function`||typeof e==`symbol`)return String(e);try{return JSON.stringify(e)}catch(t){return console.error(`[ai-devtools] failed to JSON.stringify fixture value; falling back to String(). Tool call arguments may be malformed.`,{error:t,value:e}),String(e)}}function HA(e){try{return JSON.parse(e)}catch(t){return console.error(`[ai-devtools] failed to JSON.parse fixture result content; replaying as raw string. Fixture payload may be corrupted.`,{error:t,content:e}),e}}function UA(e,t){if(!BA(e)||typeof e.type!=`string`)return;let n={...e};return e.type===`tool-call`&&typeof e.id==`string`&&(n.id=t.get(e.id)??e.id),e.type===`tool-result`&&typeof e.toolCallId==`string`&&(n.toolCallId=t.get(e.toolCallId)??e.toolCallId),n}function WA(e){let t=e.find(e=>e.type===`tool-call`);return t?.type===`tool-call`?t.id:void 0}function GA(e,t){for(let t of e){if(t.type!==`tool-result`)continue;let n=e.find(e=>e.type===`tool-call`&&e.id===t.toolCallId&&e.output===void 0);n&&(n.output=Array.isArray(t.content)?t.content:HA(t.content))}if(t.mappedToolCallId&&t.output!==void 0){let n=e.find(e=>e.type===`tool-call`&&e.id===t.mappedToolCallId&&e.output===void 0);n&&(n.output=t.output)}}function KA(e,t){return e.some(e=>e.parts.some(e=>e.type===`tool-call`?e.id===t:e.type===`tool-result`&&e.toolCallId===t))}var qA=class extends cA{getClientId;helper;constructor(e,t){super(e()),this.getClientId=e,this.helper=t}emitEvent(e,t){this.clientId=this.getClientId(),super.emitEvent(e,t)}afterEmit(e){e&&this.helper.recordStreamId(e),this.helper.emitSnapshot()}textUpdated(e,t,n,r){super.textUpdated(e,t,n,r??this.helper.getCurrentRunEventContext()),this.afterEmit(e)}thinkingUpdated(e,t,n,r,i){super.thinkingUpdated(e,t,n,r,i??this.helper.getCurrentRunEventContext()),this.afterEmit(e)}messageAppended(e,t,n){super.messageAppended(e,t,n??this.helper.getCurrentRunEventContext()),this.afterEmit(t)}toolCallStateChanged(e,t,n,r,i,a,o){super.toolCallStateChanged(e,t,n,r,i,a,o??this.helper.getCurrentRunEventContext()),this.afterEmit(e)}structuredOutputChanged(e,t,n,r,i){super.structuredOutputChanged(e,t,n,r,i??this.helper.getCurrentOrLastRunEventContext()),this.afterEmit(t)}approvalRequested(e,t,n,r,i,a,o){super.approvalRequested(e,t,n,r,i,a,o??this.helper.getCurrentOrLastRunEventContext()),this.afterEmit(e)}toolResultAdded(e,t,n,r,i){super.toolResultAdded(e,t,n,r,i??this.helper.getCurrentRunEventContext()),this.afterEmit()}toolApprovalResponded(e,t,n,r){super.toolApprovalResponded(e,t,n,r??this.helper.getCurrentRunEventContext()),this.afterEmit()}clientCreated(e){super.clientCreated(e),this.afterEmit()}loadingChanged(e){super.loadingChanged(e),this.afterEmit()}errorChanged(e){super.errorChanged(e),this.afterEmit()}reloaded(e){super.reloaded(e),this.afterEmit()}stopped(){super.stopped(),this.afterEmit()}messagesCleared(){super.messagesCleared(),this.afterEmit()}messageSent(e,t){super.messageSent(e,t),this.afterEmit()}toolFixtureApplied(e){super.toolFixtureApplied(e),this.afterEmit()}};function JA(e){return new zA(e)}var YA=Object.freeze([]),XA=Object.freeze([]);function ZA(e={}){let t=$t(e.initialMessages||[]),n=$t(!1),r=$t(void 0),i=$t(`ready`),a=$t(!1),o=$t(`disconnected`),s=$t(!1),c=$t([]),l=$t(null),u=$t({interrupts:YA,pendingInterrupts:YA,interruptErrors:XA,resuming:!1}),d=new jA({devtoolsBridgeFactory:JA,...e.connection?{connection:e.connection}:{fetcher:e.fetcher},...e.initialMessages!==void 0&&{initialMessages:e.initialMessages},...typeof e.threadId==`string`&&e.persistence?{persistence:e.persistence,threadId:e.threadId}:{...e.threadId!==void 0&&{threadId:e.threadId}},...e.initialResumeSnapshot!==void 0&&{initialResumeSnapshot:e.initialResumeSnapshot},...e.body!==void 0&&{body:e.body},...e.forwardedProps!==void 0&&{forwardedProps:e.forwardedProps},...e.byok!==void 0&&{byok:e.byok},byokProvider:()=>e.byokProvider?.(),...e.context!==void 0&&{context:e.context},devtools:{...e.devtools,framework:`vue`,hookName:`useChat`,outputKind:e.outputSchema?`structured`:`chat`},onResponse:t=>e.onResponse?.(t),onChunk:t=>{e.onChunk?.(t)},onFinish:t=>{e.onFinish?.(t)},onError:t=>{e.onError?.(t)},tools:e.tools,...e.interrupts!==void 0&&{interrupts:e.interrupts},onCustomEvent:(t,n,r)=>e.onCustomEvent?.(t,n,r),...e.streamProcessor!==void 0&&{streamProcessor:e.streamProcessor},onMessagesChange:e=>{t.value=e},onLoadingChange:e=>{n.value=e,f()},onStatusChange:e=>{i.value=e},onErrorChange:e=>{r.value=e},onSubscriptionChange:e=>{a.value=e},onConnectionStatusChange:e=>{o.value=e},onSessionGeneratingChange:e=>{s.value=e},...e.queue!==void 0&&{queue:e.queue},onQueueChange:e=>{c.value=e},onRunIdChange:e=>{l.value=e},onInterruptStateChange:(t,n)=>{u.value=t,e.onInterruptStateChange?.(t,n)}});function f(){l.value=d.getCurrentRunId(),u.value=d.getInterruptState()}t.value=d.getMessages(),u.value=d.getInterruptState(),$n(()=>[e.body,e.forwardedProps,e.context,e.queue],([e,t,n,r])=>{d.updateOptions({body:e,...t!==void 0&&{forwardedProps:t},context:n,...r!==void 0&&{queue:r}})}),$n(()=>e.live,e=>{e?d.subscribe():d.unsubscribe()},{immediate:!0}),$r(()=>{d.attach(),d.mountDevtools(),f()}),Oe(()=>{d.detach(),e.live?d.unsubscribe():d.stop(),d.dispose()});let p=async(e,t)=>{try{await d.sendMessage(e,void 0,t)}finally{f()}},m=e=>d.cancelQueued(e),h=async e=>{try{await d.append(e)}finally{f()}},g=async()=>{try{await d.reload()}finally{f()}},v=()=>{d.stop()},y=()=>{d.clear(),f()},b=e=>{d.setMessagesManually(e)},x=async e=>{await d.addToolResult(e)},S=async e=>{await d.addToolApprovalResponse(e),f()},C=async(e,t)=>{let n=await d.resumeInterrupts(e,t);return f(),n},w=G(()=>u.value.interrupts),T=G(()=>u.value.interrupts),E=G(()=>u.value.interruptErrors),D=G(()=>u.value.resuming),O=e=>{d.resolveInterrupts(e)},k=()=>{d.cancelInterrupts()},ee=()=>{d.retryInterrupts()},A=(e,t)=>d.resumeInterruptsUnsafe(e,t),j=G(()=>{let e=t.value,n=-1;for(let t=e.length-1;t>=0;t--)if(e[t]?.role===`user`){n=t;break}if(n===-1)return null;for(let t=e.length-1;t>n;t--){let n=e[t];if(n?.role!==`assistant`)continue;let r=n.parts.find(e=>e.type===`structured-output`);if(r)return r}return null}),M=G(()=>{let e=j.value;return e?e.partial??e.data??{}:{}}),te=G(()=>{let e=j.value;return!e||e.status!==`complete`?null:e.data});return{messages:Ht(t),sendMessage:p,queue:Ht(c),cancelQueued:m,append:h,reload:g,stop:v,isLoading:Ht(n),error:Ht(r),status:Ht(i),isSubscribed:Ht(a),connectionStatus:Ht(o),sessionGenerating:Ht(s),setMessages:b,clear:y,addToolResult:x,addToolApprovalResponse:S,runId:Ht(l),interrupts:Ht(w),pendingInterrupts:Ht(T),interruptErrors:Ht(E),resuming:Ht(D),resolveInterrupts:O,cancelInterrupts:k,retryInterrupts:ee,resumeInterruptsUnsafe:A,resumeInterrupts:C,partial:Ht(M),final:Ht(te)}}var QA=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),$A=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),ej=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),tj=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),nj=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),rj=t((e=>{var t=$A().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),ij=t((e=>{var t=$A().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),aj=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),oj=t((e=>{var t=ej(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),sj=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),cj=t((e=>{var t=sj();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),lj=t(((e,t)=>{var n=cj();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),uj=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),dj=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
16
- ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^[0-9]+$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),fj=t((e=>{var t=uj(),n=dj();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),pj=t((e=>{var t=$A(),n=oj(),r=ej(),i=fj(),a=uj(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),mj=t((e=>{var t=$A(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),hj=t(((e,t)=>{var n=fj();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),gj=t(((e,t)=>{var n=fj(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),_j=t(((e,t)=>{var n=fj();function r(e){this.mode=n.BYTE,this.data=typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),vj=t(((e,t)=>{var n=fj(),r=$A();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
17
- Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),yj=t(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),bj=t((e=>{var t=fj(),n=hj(),r=gj(),i=_j(),a=vj(),o=dj(),s=$A(),c=yj();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
18
- Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),xj=t((e=>{var t=$A(),n=ej(),r=tj(),i=nj(),a=rj(),o=ij(),s=aj(),c=oj(),l=lj(),u=pj(),d=mj(),f=fj(),p=bj();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function v(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function y(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function b(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function x(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return S(a,e,n)}function S(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),v=Array(o),y=0,b=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=b.slice(h,h+t),v[e]=m.encode(g[e]),h+=t,y=Math.max(y,t)}let x=new Uint8Array(i),S=0,C,w;for(C=0;C<y;C++)for(w=0;w<o;w++)C<g[w].length&&(x[S++]=g[w][C]);for(C=0;C<p;C++)for(w=0;w<o;w++)x[S++]=v[w][C];return x}function C(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
11
+ `:t.breakLineCode,a=t.needIndent?t.needIndent:n!==`arrow`,o=e.helpers||[],s=bg(e,{filename:r,breakLineCode:i,needIndent:a});s.push(n===`normal`?`function __msg__ (ctx) {`:`(ctx) => {`),s.indent(a),o.length>0&&(s.push(`const { ${Eh(o.map(e=>`${e}: _${e}`),`, `)} } = ctx`),s.newline()),s.push(`return `),Tg(s,e),s.deindent(a),s.push(`}`),delete e.helpers;let{code:c,map:l}=s.context();return{ast:e,code:c,map:l?l.toJSON():void 0}};function Dg(e,t={}){let n=uh({},t),r=!!n.jit,i=!!n.minify,a=n.optimize==null||n.optimize,o=dg(n).parse(e);return r?(a&&_g(o),i&&yg(o),{ast:o,code:``}):(gg(o,n),Eg(o,n))}function Og(){typeof __INTLIFY_PROD_DEVTOOLS__!=`boolean`&&(mh().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!=`boolean`&&(mh().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function kg(e){return bh(e)&&zg(e)===0&&(gh(e,`b`)||gh(e,`body`))}var Ag=[`b`,`body`];function jg(e){return Kg(e,Ag)}var Mg=[`c`,`cases`];function Ng(e){return Kg(e,Mg,[])}var Pg=[`s`,`static`];function Fg(e){return Kg(e,Pg)}var Ig=[`i`,`items`];function Lg(e){return Kg(e,Ig,[])}var Rg=[`t`,`type`];function zg(e){return Kg(e,Rg)}var Bg=[`v`,`value`];function Vg(e,t){let n=Kg(e,Bg);if(n!=null)return n;throw Jg(t)}var Hg=[`m`,`modifier`];function Ug(e){return Kg(e,Hg)}var Wg=[`k`,`key`];function Gg(e){let t=Kg(e,Wg);if(t)return t;throw Jg(6)}function Kg(e,t,n){for(let n=0;n<t.length;n++){let r=t[n];if(gh(e,r)&&e[r]!=null)return e[r]}return n}var qg=[...Ag,...Mg,...Pg,...Ig,...Wg,...Hg,...Bg,...Rg];function Jg(e){return Error(`unhandled node type: ${e}`)}function Yg(e){return t=>Xg(t,e)}function Xg(e,t){let n=jg(t);if(n==null)throw Jg(0);if(zg(n)===1){let t=Ng(n);return e.plural(t.reduce((t,n)=>[...t,Zg(e,n)],[]))}return Zg(e,n)}function Zg(e,t){let n=Fg(t);if(n!=null)return e.type===`text`?n:e.normalize([n]);{let n=Lg(t).reduce((t,n)=>[...t,Qg(e,n)],[]);return e.normalize(n)}}function Qg(e,t){let n=zg(t);switch(n){case 3:return Vg(t,n);case 9:return Vg(t,n);case 4:{let r=t;if(gh(r,`k`)&&r.k)return e.interpolate(e.named(r.k));if(gh(r,`key`)&&r.key)return e.interpolate(e.named(r.key));throw Jg(n)}case 5:{let r=t;if(gh(r,`i`)&&oh(r.i))return e.interpolate(e.list(r.i));if(gh(r,`index`)&&oh(r.index))return e.interpolate(e.list(r.index));throw Jg(n)}case 6:{let n=t,r=Ug(n),i=Gg(n);return e.linked(Qg(e,i),r?Qg(e,r):void 0,e.type)}case 7:return Vg(t,n);case 8:return Vg(t,n);default:throw Error(`unhandled node on format message part: ${n}`)}}var $g=e=>e,e_=fh();function t_(e,t={}){let n=!1,r=t.onError||Yh;return t.onError=e=>{n=!0,r(e)},{...Dg(e,t),detectError:n}}function n_(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Y(e)){yh(t.warnHtmlMessage)&&t.warnHtmlMessage;let n=(t.onCacheKey||$g)(e),r=e_[n];if(r)return r;let{ast:i,detectError:a}=t_(e,{...t,location:!1,jit:!0}),o=Yg(i);return a?o:e_[n]=o}{let t=e.cacheKey;return t?e_[t]||(e_[t]=Yg(e)):Yg(e)}}var r_=null;function i_(e){r_=e}function a_(e,t,n){r_&&r_.emit(`i18n:init`,{timestamp:Date.now(),i18n:e,version:t,meta:n})}var o_=s_(`function:translate`);function s_(e){return t=>r_&&r_.emit(e,t)}var c_={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_NON_STRING_MESSAGE:20,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23};function l_(e){return Jh(e,null,void 0)}c_.INVALID_ARGUMENT,c_.INVALID_DATE_ARGUMENT,c_.INVALID_ISO_DATE_ARGUMENT,c_.NOT_SUPPORT_NON_STRING_MESSAGE,c_.NOT_SUPPORT_LOCALE_PROMISE_VALUE,c_.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION,c_.NOT_SUPPORT_LOCALE_TYPE;function u_(e,t){return t.locale==null?f_(e.locale):f_(t.locale)}var d_;function f_(e){if(Y(e))return e;if(vh(e)){if(e.resolvedOnce&&d_!=null)return d_;if(e.constructor.name===`Function`){let t=e();if(xh(t))throw l_(c_.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return d_=t}throw l_(c_.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw l_(c_.NOT_SUPPORT_LOCALE_TYPE)}function p_(e,t,n){return[...new Set([n,..._h(t)?t:bh(t)?Object.keys(t).filter(e=>e!=="default"):Y(t)?[t]:[n]])]}function m_(e,t,n){let r=Y(n)?n:A_,i=e,a;bh(t)?(i.__localeChainObjectCache||=new WeakMap,a=i.__localeChainObjectCache.get(t),a||(a=new Map,i.__localeChainObjectCache.set(t,a))):(i.__localeChainCache||=new Map,a=i.__localeChainCache.get(t),a||(a=new Map,i.__localeChainCache.set(t,a)));let o=a.get(r);if(o)return o;let s=[],c=[n];for(;_h(c);)c=h_(s,c,t);let l=_h(t)||!wh(t)?t:t.default?t.default:null;return c=Y(l)?[l]:l,_h(c)&&h_(s,c,!1),a.set(r,s),s}function h_(e,t,n){let r=!0;for(let i=0;i<t.length&&yh(r);i++){let a=t[i];Y(a)&&(r=g_(e,t[i],n))}return r}function g_(e,t,n){let r,i=t.split(`-`);do r=__(e,i.join(`-`),n),i.splice(-1,1);while(i.length&&r===!0);return r}function __(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r=t[t.length-1]!==`!`;let i=t.replace(/!/g,``);e.push(i),(_h(n)||wh(n))&&n[i]&&(r=n[i])}return r}var v_=[];v_[0]={w:[0],i:[3,0],"[":[4],o:[7]},v_[1]={w:[1],".":[2],"[":[4],o:[7]},v_[2]={w:[2],i:[3,0],0:[3,0]},v_[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},v_[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},v_[5]={"'":[4,0],o:8,l:[5,0]},v_[6]={'"':[4,0],o:8,l:[6,0]};var y_=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function b_(e){return y_.test(e)}function x_(e){let t=e.charCodeAt(0);return t===e.charCodeAt(e.length-1)&&(t===34||t===39)?e.slice(1,-1):e}function S_(e){if(e==null)return`o`;switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return`i`;case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return`w`}return`i`}function C_(e){let t=e.trim();return e.charAt(0)===`0`&&isNaN(parseInt(e))?!1:b_(t)?x_(t):`*`+t}function w_(e){let t=[],n=-1,r=0,i=0,a,o,s,c,l,u,d,f=[];f[0]=()=>{o===void 0?o=s:o+=s},f[1]=()=>{o!==void 0&&(t.push(o),o=void 0)},f[2]=()=>{f[0](),i++},f[3]=()=>{if(i>0)i--,r=4,f[0]();else{if(i=0,o===void 0||(o=C_(o),o===!1))return!1;f[1]()}};function p(){let t=e[n+1];if(r===5&&t===`'`||r===6&&t===`"`)return n++,s=`\\`+t,f[0](),!0}for(;r!==null;)if(n++,a=e[n],!(a===`\\`&&p())){if(c=S_(a),d=v_[r],l=d[c]||d.l||8,l===8||(r=l[0],l[1]!==void 0&&(u=f[l[1]],u&&(s=a,u()===!1))))return;if(r===7)return t}}var T_=new Map;function E_(e,t){return bh(e)?e[t]:null}function D_(e,t){if(!bh(e))return null;let n=T_.get(t);if(n||(n=w_(t),n&&T_.set(t,n)),!n)return null;let r=n.length,i=e,a=0;for(;a<r;){let e=n[a];if(qg.includes(e)&&kg(i)||!bh(i)||!gh(i,e))return null;let t=i[e];if(t===void 0||vh(i))return null;i=t,a++}return i}var O_={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,INVALID_NUMBER_ARGUMENT:8,INVALID_DATE_ARGUMENT:9};O_.NOT_FOUND_KEY,O_.FALLBACK_TO_TRANSLATE,O_.CANNOT_FORMAT_NUMBER,O_.FALLBACK_TO_NUMBER_FORMAT,O_.CANNOT_FORMAT_DATE,O_.FALLBACK_TO_DATE_FORMAT,O_.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER,O_.INVALID_NUMBER_ARGUMENT,O_.INVALID_DATE_ARGUMENT;var k_=`11.4.12`,A_=`en-US`,j_=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function M_(){return{upper:(e,t)=>t===`text`&&Y(e)?e.toUpperCase():t===`vnode`&&bh(e)&&`__v_isVNode`in e?e.children.toUpperCase():e,lower:(e,t)=>t===`text`&&Y(e)?e.toLowerCase():t===`vnode`&&bh(e)&&`__v_isVNode`in e?e.children.toLowerCase():e,capitalize:(e,t)=>t===`text`&&Y(e)?j_(e):t===`vnode`&&bh(e)&&`__v_isVNode`in e?j_(e.children):e}}var N_;function P_(e){N_=e}var F_;function I_(e){F_=e}var L_;function R_(e){L_=e}var z_=null,B_=e=>{z_=e},V_=()=>z_,H_=null,U_=e=>{H_=e},W_=()=>H_,G_=0;function K_(e={}){let t=vh(e.onWarn)?e.onWarn:Dh,n=Y(e.version)?e.version:k_,r=Y(e.locale)||vh(e.locale)?e.locale:A_,i=vh(r)?A_:r,a=_h(e.fallbackLocale)||wh(e.fallbackLocale)||Y(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:i,o=wh(e.messages)?e.messages:q_(i),s=wh(e.datetimeFormats)?e.datetimeFormats:q_(i),c=wh(e.numberFormats)?e.numberFormats:q_(i),l=uh(fh(),e.modifiers,M_()),u=e.pluralRules||fh(),d=vh(e.missing)?e.missing:null,f=yh(e.missingWarn)||ch(e.missingWarn)?e.missingWarn:!0,p=yh(e.fallbackWarn)||ch(e.fallbackWarn)?e.fallbackWarn:!0,m=!!e.fallbackFormat,h=!!e.unresolving,g=vh(e.postTranslation)?e.postTranslation:null,v=wh(e.processor)?e.processor:null,y=!yh(e.warnHtmlMessage)||e.warnHtmlMessage,b=!!e.escapeParameter,x=vh(e.messageCompiler)?e.messageCompiler:N_,S=vh(e.messageResolver)?e.messageResolver:F_||E_,C=vh(e.localeFallbacker)?e.localeFallbacker:L_||p_,w=bh(e.fallbackContext)?e.fallbackContext:void 0,T=e,E=bh(T.__datetimeFormatters)?T.__datetimeFormatters:new Map,D=bh(T.__numberFormatters)?T.__numberFormatters:new Map,O=bh(T.__meta)?T.__meta:{};G_++;let k={version:n,cid:G_,locale:r,fallbackLocale:a,messages:o,modifiers:l,pluralRules:u,missing:d,missingWarn:f,fallbackWarn:p,fallbackFormat:m,unresolving:h,postTranslation:g,processor:v,warnHtmlMessage:y,escapeParameter:b,messageCompiler:x,messageResolver:S,localeFallbacker:C,fallbackContext:w,onWarn:t,__meta:O};return k.datetimeFormats=s,k.numberFormats=c,k.__datetimeFormatters=E,k.__numberFormatters=D,__INTLIFY_PROD_DEVTOOLS__&&a_(k,n,O),k}var q_=e=>({[e]:fh()});function J_(e,t,n,r,i){let{missing:a,onWarn:o}=e;if(a!==null){let r=a(e,n,t,i);return Y(r)?r:t}return t}function Y_(e,t){let n=e;bh(t)?n.__localeChainObjectCache?.delete(t):n.__localeChainCache?.delete(t)}function X_(e,t,n){Y_(e,n),e.fallbackContext&&Y_(e.fallbackContext,n),e.localeFallbacker(e,n,t)}function Z_(e,t){return e!==t&&e.split(`-`)[0]===t.split(`-`)[0]}function Q_(e,t){let n=t.indexOf(e);if(n===-1)return!1;for(let r=n+1;r<t.length;r++)if(Z_(e,t[r]))return!0;return!1}function $_(e,t,n,r,i,a,o){let{fallbackLocale:s,localeFallbacker:c,onWarn:l}=e,u=c(e,s,n);for(let n=0;n<u.length;n++){let a=u[n],s=(r[a]||{})[t];if(wh(s)&&Y(a))return a;J_(e,t,a,i,o)}return null}function ev(e,t,n){let r=`${e}__${t}`;return wh(n)&&!lh(n)&&(r=`${r}__${JSON.stringify(n)}`),r}function tv(e,t,n){for(let r in n){let n=`${t}__${r}`;for(let t of e.keys())(t===n||t.startsWith(`${n}__`))&&e.delete(t)}}function nv(e,t,n,r){let[,i,a,o]=e,s=n;return Y(i)?t.key=i:wh(i)&&Object.keys(i).forEach(e=>{r.includes(e)?s[e]=i[e]:t[e]=i[e]}),Y(a)?t.locale=a:wh(a)&&(s=a),wh(o)&&(s=o),s}var rv=typeof Intl<`u`;rv&&Intl.DateTimeFormat,rv&&Intl.NumberFormat;function iv(e,...t){let{datetimeFormats:n,unresolving:r,onWarn:i}=e,{__datetimeFormatters:a}=e;if(!Y(t[0])&&!sh(t[0])&&!oh(t[0]))return``;let[o,s,c,l]=ov(...t),u=yh(c.missingWarn)?c.missingWarn:e.missingWarn,d=yh(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=!!c.part,p=u_(e,c);if(!Y(o)||o===``){let e=new Intl.DateTimeFormat(p.replace(/!/g,``),l);return f?e.formatToParts(s):e.format(s)}let m=$_(e,o,p,n,u,d,`datetime format`);if(!Y(m))return r?-1:o;let h=n[m][o],g=ev(m,o,l),v=a.get(g);return v||(v=new Intl.DateTimeFormat(m,uh({},h,l)),a.set(g,v)),f?v.formatToParts(s):v.format(s)}var av=[`localeMatcher`,`weekday`,`era`,`year`,`month`,`day`,`hour`,`minute`,`second`,`timeZoneName`,`formatMatcher`,`hour12`,`timeZone`,`dateStyle`,`timeStyle`,`calendar`,`dayPeriod`,`numberingSystem`,`hourCycle`,`fractionalSecondDigits`];function ov(...e){let[t]=e,n=fh(),r=fh(),i;if(Y(t)){let e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw l_(c_.INVALID_ISO_DATE_ARGUMENT);let n=e[3]?e[3].trim().startsWith(`T`)?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();i=new Date(n);try{i.toISOString()}catch{throw l_(c_.INVALID_ISO_DATE_ARGUMENT)}}else if(sh(t)){if(isNaN(t.getTime()))throw l_(c_.INVALID_DATE_ARGUMENT);i=t}else if(oh(t))i=t;else throw l_(c_.INVALID_ARGUMENT);let a=nv(e,n,r,av);return[n.key||``,i,n,a]}function sv(e,t,n){tv(e.__datetimeFormatters,t,n)}function cv(e,...t){let{numberFormats:n,unresolving:r,onWarn:i}=e,{__numberFormatters:a}=e;if(!oh(t[0]))return``;let[o,s,c,l]=uv(...t),u=yh(c.missingWarn)?c.missingWarn:e.missingWarn,d=yh(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,f=!!c.part,p=u_(e,c);if(!Y(o)||o===``){let e=new Intl.NumberFormat(p.replace(/!/g,``),l);return f?e.formatToParts(s):e.format(s)}let m=$_(e,o,p,n,u,d,`number format`);if(!Y(m))return r?-1:o;let h=n[m][o],g=ev(m,o,l),v=a.get(g);return v||(v=new Intl.NumberFormat(m,uh({},h,l)),a.set(g,v)),f?v.formatToParts(s):v.format(s)}var lv=[`localeMatcher`,`style`,`currency`,`currencyDisplay`,`currencySign`,`useGrouping`,`minimumIntegerDigits`,`minimumFractionDigits`,`maximumFractionDigits`,`minimumSignificantDigits`,`maximumSignificantDigits`,`compactDisplay`,`notation`,`signDisplay`,`unit`,`unitDisplay`,`roundingMode`,`roundingPriority`,`roundingIncrement`,`trailingZeroDisplay`];function uv(...e){let[t]=e,n=fh(),r=fh();if(!oh(t))throw l_(c_.INVALID_ARGUMENT);let i=t,a=nv(e,n,r,lv);return[n.key||``,i,n,a]}function dv(e,t,n){tv(e.__numberFormatters,t,n)}var fv=e=>e,pv=e=>``,mv=`text`,hv=e=>e.length===0?``:Eh(e),gv=Th;function _v(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function vv(e){let t=oh(e.pluralIndex)?e.pluralIndex:-1;return oh(e.named?.count)?e.named.count:oh(e.named?.n)?e.named.n:t}function yv(e={}){let t=e.locale,n=vv(e),r=Y(t)&&vh(e.pluralRules?.[t])?e.pluralRules[t]:_v,i=r===_v?void 0:_v,a=e=>e[r(n,e.length,i)],o=e.list||[],s=e=>o[e],c=e.named||fh();oh(e.pluralIndex)&&(c.count||=e.pluralIndex,c.n||=e.pluralIndex);let l=e=>c[e];function u(t,n){return(vh(e.messages)?e.messages(t,!!n):bh(e.messages)?e.messages[t]:!1)||(e.parent?e.parent.message(t):pv)}let d=t=>e.modifiers?e.modifiers[t]:fv,f=vh(e.processor?.normalize)?e.processor.normalize:hv,p=vh(e.processor?.interpolate)?e.processor.interpolate:gv,m={list:s,named:l,plural:a,linked:(e,...t)=>{let[n,r]=t,i=`text`,a=``;t.length===1?bh(n)?(a=n.modifier||a,i=n.type||i):Y(n)&&(a=n||a):t.length===2&&(Y(n)&&(a=n||a),Y(r)&&(i=r||i));let o=u(e,!0)(m),s=o===``||o===void 0?e:o,c=i===`vnode`&&_h(s)&&a?s[0]:s;return a?d(a)(c,i):c},message:u,type:Y(e.processor?.type)?e.processor.type:mv,interpolate:p,normalize:f,values:uh(fh(),o,c)};return m}var bv=()=>``,xv=e=>vh(e);function Sv(e,...t){let{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:a,fallbackLocale:o,messages:s}=e,[c,l]=Dv(...t),u=yh(l.missingWarn)?l.missingWarn:e.missingWarn,d=yh(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=yh(l.escapeParameter)?l.escapeParameter:e.escapeParameter,p=!!l.resolvedMessage,m=Y(l.default)||yh(l.default)?yh(l.default)?a?c:()=>c:l.default:n?a?c:()=>c:null,h=n||m!=null&&(Y(m)||vh(m)),g=u_(e,l);f&&Cv(l);let[v,y,b]=p?[c,g,s[g]||fh()]:wv(e,c,g,o,d,u),x=v,S=c;if(!p&&!(Y(x)||kg(x)||xv(x))&&h&&(x=m,S=x),!p&&(!(Y(x)||kg(x)||xv(x))||!Y(y)))return i?-1:c;let C=!1,w=xv(x)?x:Tv(e,c,y,x,S,()=>{C=!0});if(C)return x;let T=Ev(e,w,yv(kv(e,y,b,l))),E=r?r(T,c):T;if(f&&Y(E)&&(E=Uh(E)),__INTLIFY_PROD_DEVTOOLS__){let t={timestamp:Date.now(),key:Y(c)?c:xv(x)?x.key:``,locale:y||(xv(x)?x.locale:``),format:Y(x)?x:xv(x)?x.source:``,message:E};t.meta=uh({},e.__meta,V_()||{}),o_(t)}return E}function Cv(e){_h(e.list)?e.list=e.list.map(e=>Y(e)?Oh(e):e):bh(e.named)&&Object.keys(e.named).forEach(t=>{Y(e.named[t])&&(e.named[t]=Oh(e.named[t]))})}function wv(e,t,n,r,i,a){let{messages:o,onWarn:s,messageResolver:c,localeFallbacker:l}=e,u=l(e,r,n),d=fh(),f,p=null;for(let n=0;n<u.length&&(f=u[n],d=o[f]||fh(),(p=c(d,t))===null&&(p=d[t]),!(Y(p)||kg(p)||xv(p)));n++)if(!Q_(f,u)){let n=J_(e,t,f,a,`translate`);n!==t&&(p=n)}return[p,f,d]}function Tv(e,t,n,r,i,a){let{messageCompiler:o,warnHtmlMessage:s}=e;if(xv(r)){let e=r;return e.locale=e.locale||n,e.key=e.key||t,e}if(o==null){let e=(()=>r);return e.locale=n,e.key=t,e}let c=o(r,Ov(e,n,i,r,s,a));return c.locale=n,c.key=t,c.source=r,c}function Ev(e,t,n){return t(n)}function Dv(...e){let[t,n,r]=e,i=fh();if(!Y(t)&&!oh(t)&&!xv(t)&&!kg(t))throw l_(c_.INVALID_ARGUMENT);let a=oh(t)?String(t):(xv(t),t);return oh(n)?i.plural=n:Y(n)?i.default=n:wh(n)&&!lh(n)?i.named=n:_h(n)&&(i.list=n),oh(r)?i.plural=r:Y(r)?i.default=r:wh(r)&&uh(i,r),[a,i]}function Ov(e,t,n,r,i,a){return{locale:t,key:n,warnHtmlMessage:i,onError:e=>{throw a&&a(e),e},onCacheKey:e=>ih(t,n,e)}}function kv(e,t,n,r){let{modifiers:i,pluralRules:a,messageResolver:o,fallbackLocale:s,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,d={locale:t,modifiers:i,pluralRules:a,messages:(r,i)=>{let a=o(n,r);if(a==null&&(u||i)){let[n,,i]=wv(u||e,r,t,s,c,l);a=n??o(i,r)}if(Y(a)||kg(a)){let n=!1,i=Tv(e,r,t,a,r,()=>{n=!0});return n?bv:i}return xv(a)?a:bv}};return e.processor&&(d.processor=e.processor),r.list&&(d.list=r.list),r.named&&(d.named=r.named),oh(r.plural)&&(d.pluralIndex=r.plural),d}Og();var Av=`VUE_QUERY_CLIENT`;function jv(e){return`${Av}${e?`:${e}`:``}`}function Mv(e,t){Object.keys(e).forEach(n=>{e[n]=t[n]})}function Nv(e,t,n=``,r=0){if(t){let i=t(e,n,r);if(i===void 0&&Qt(e)||i!==void 0)return i}if(Array.isArray(e))return e.map((e,n)=>Nv(e,t,String(n),r+1));if(typeof e==`object`&&Fv(e)){let n=Object.entries(e).map(([e,n])=>[e,Nv(n,t,e,r+1)]);return Object.fromEntries(n)}return e}function Pv(e,t){return Nv(e,t)}function Z(e,t=!1){return Pv(e,(e,n,r)=>{if(r===1&&n===`queryKey`)return Z(e,!0);if(t&&Iv(e))return Z(e(),t);if(Qt(e))return Z(B(e),t)})}function Fv(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Iv(e){return typeof e==`function`}function Lv(e=``){if(!Jn())throw Error(`vue-query hooks can only be used inside setup() function or functions that support injection context.`);let t=qn(jv(e));if(!t)throw Error(`No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.`);return t}var Rv={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},zv=new class{#e=Rv;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Bv(e){setTimeout(e,0)}var Vv=typeof window>`u`||`Deno`in globalThis;function Hv(){}function Uv(e,t){return typeof e==`function`?e(t):e}function Wv(e){return typeof e==`number`&&e>=0&&e!==1/0}function Gv(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Kv(e,t){return typeof e==`function`?e(t):e}function qv(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Yv(o,t.options))return!1}else if(!Zv(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Jv(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Xv(t.options.mutationKey)!==Xv(a))return!1}else if(!Zv(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Yv(e,t){return(t?.queryKeyHashFn||Xv)(e)}function Xv(e){return JSON.stringify(e,(e,t)=>ny(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Zv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!Zv(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Zv(e[r],t[r]))return!1;return!0}return!1}var Qv=Object.prototype.hasOwnProperty;function $v(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ty(e)&&ty(t);if(!r&&!(ny(e)&&ny(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Qv.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=$v(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ey(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ty(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ny(e){if(!ry(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!ry(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function ry(e){return Object.prototype.toString.call(e)===`[object Object]`}function iy(e){return new Promise(t=>{zv.setTimeout(t,e)})}function ay(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:$v(e,t)}function oy(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function sy(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cy=Symbol();function ly(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===cy?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function uy(e,t){return typeof e==`function`?e(...t):!!e}function dy(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var fy=()=>Vv,py=()=>fy(),my={isServer:py,setIsServer(e){fy=e}},hy=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},gy=new class extends hy{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},_y=Bv;function vy(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=_y,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var yy=vy(),by=new class extends hy{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function xy(e){return Math.min(1e3*2**e,3e4)}function Sy(e){return(e??`online`)!==`online`||by.isOnline()}var Cy=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function wy(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Hv);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Cy(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>gy.isFocused()&&(e.networkMode===`always`||by.isOnline())&&e.canRun(),p=()=>Sy(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),v=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(py()?0:3),a=e.retryDelay??xy,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),iy(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):v()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?v():g().then(v),s)}}var Ty=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wv(this.gcTime)&&(this.#e=zv.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(py()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(zv.clearTimeout(this.#e),this.#e=void 0)}};function Ey(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{dy(e,()=>t.signal,()=>n=!0)},u=ly(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?sy:oy;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Oy:Dy,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Dy(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Dy(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Oy(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ky=class extends Ty{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=My(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=My(this.options);e.data!==void 0&&(this.setState(jy(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ay(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Hv).catch(Hv):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Kv(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cy||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Kv(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Gv(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ly(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ey(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=wy({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Cy&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Cy){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ay(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...jy(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),yy.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Ay(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Sy(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function jy(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function My(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ny=class extends hy{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Fy(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Iy(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Iy(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Kv(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ey(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ly(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||Kv(this.options.enabled,this.#t)!==Kv(t.enabled,this.#t)||Kv(this.options.staleTime,this.#t)!==Kv(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Kv(this.options.enabled,this.#t)!==Kv(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ey(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Hv)),t}#h(e){return!py()&&Kv(this.options.enabled,this.#t)!==!1&&Wv(e)}#g(){this.#b();let e=Kv(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=Gv(this.#r.dataUpdatedAt,e)+1;this.#u=zv.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return Kv(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=zv.setInterval(()=>{(this.options.refetchIntervalInBackground||gy.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(zv.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(zv.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Fy(e,t),o=i&&Ly(e,n,t,r);(a||o)&&(l={...l,...Ay(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ay(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ay(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,b=v&&g,x=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:b,isLoading:b,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:y&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&x,isStale:Ry(e,t),refetch:this.refetch,isEnabled:Kv(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),ey(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();yy.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function Py(e,t){return Kv(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Kv(t.retryOnMount,e)!==!1)}function Fy(e,t){return Py(e,t)||e.state.data!==void 0&&Iy(e,t,t.refetchOnMount)}function Iy(e,t,n){if(Kv(t.enabled,e)!==!1&&Kv(t.staleTime,e)!==`static`){let r=Kv(n,e);return r===`always`||r!==!1&&Ry(e,t)}return!1}function Ly(e,t,n,r){return(e!==t||Kv(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Ry(e,n)}function Ry(e,t){return Kv(t.enabled,e)!==!1&&e.isStaleByTime(Kv(t.staleTime,e))}var zy=class extends Ty{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||By(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=wy({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),yy.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function By(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Vy=class extends hy{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new zy({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Hy(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Hy(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Hy(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Hy(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){yy.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Jv(t,e))}findAll(e={}){return this.getAll().filter(t=>Jv(e,t))}notify(e){yy.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return yy.batch(()=>Promise.all(e.map(e=>e.continue().catch(Hv))))}};function Hy(e){return e.options.scope?.id}var Uy=class extends hy{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ey(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Xv(t.mutationKey)!==Xv(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??By();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){yy.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function Wy(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var Gy=class extends hy{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,yy.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!ey(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Wy(e,n).forEach(e=>{e.destroy()}),Wy(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=$v(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Ny(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&yy.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Ky=class extends hy{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??Yv(r,t),a=this.get(i);return a||(a=new ky({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){yy.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>qv(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>qv(e,t)):t}notify(e){yy.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yy.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yy.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qy=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ky,this.#t=e.mutationCache||new Vy,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=gy.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=by.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Kv(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Uv(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return yy.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;yy.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return yy.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=yy.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Hv).catch(Hv)}invalidateQueries(e,t={}){return yy.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=yy.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Hv)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Hv)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Kv(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Kv(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Hv).catch(Hv)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Hv).catch(Hv)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return by.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Xv(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Zv(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Xv(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Zv(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Yv(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===cy&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Jy=class extends Ky{find(e){return super.find(Z(e))}findAll(e={}){return super.findAll(Z(e))}},Yy=class extends Vy{find(e){return super.find(Z(e))}findAll(e={}){return super.findAll(Z(e))}},Xy=class extends qy{constructor(e={}){let t={defaultOptions:e.defaultOptions,queryCache:e.queryCache||new Jy,mutationCache:e.mutationCache||new Yy};super(t),this.isRestoring=z(!1)}isFetching(e={}){return super.isFetching(Z(e))}isMutating(e={}){return super.isMutating(Z(e))}getQueryData(e){return super.getQueryData(Z(e))}ensureQueryData(e){return super.ensureQueryData(Z(e))}getQueriesData(e){return super.getQueriesData(Z(e))}setQueryData(e,t,n={}){return super.setQueryData(Z(e),t,Z(n))}setQueriesData(e,t,n={}){return super.setQueriesData(Z(e),t,Z(n))}getQueryState(e){return super.getQueryState(Z(e))}removeQueries(e={}){return super.removeQueries(Z(e))}resetQueries(e={},t={}){return super.resetQueries(Z(e),Z(t))}cancelQueries(e={},t={}){return super.cancelQueries(Z(e),Z(t))}invalidateQueries(e={},t={}){let n=Z(e),r=Z(t);if(super.invalidateQueries({...n,refetchType:`none`},r),n.refetchType===`none`)return Promise.resolve();let i={...n,type:n.refetchType??n.type??`active`};return jn().then(()=>super.refetchQueries(i,r))}refetchQueries(e={},t={}){return super.refetchQueries(Z(e),Z(t))}query(e){return super.query(Z(e))}fetchQuery(e){return super.fetchQuery(Z(e))}prefetchQuery(e){return super.prefetchQuery(Z(e))}infiniteQuery(e){return super.infiniteQuery(Z(e))}fetchInfiniteQuery(e){return super.fetchInfiniteQuery(Z(e))}prefetchInfiniteQuery(e){return super.prefetchInfiniteQuery(Z(e))}setDefaultOptions(e){super.setDefaultOptions(Z(e))}setQueryDefaults(e,t){super.setQueryDefaults(Z(e),Z(t))}getQueryDefaults(e){return super.getQueryDefaults(Z(e))}setMutationDefaults(e,t){super.setMutationDefaults(Z(e),Z(t))}getMutationDefaults(e){return super.getMutationDefaults(Z(e))}},Zy={install:(e,t={})=>{let n=jv(t.queryClientKey),r;r=`queryClient`in t&&t.queryClient?t.queryClient:new Xy(`queryClientConfig`in t?t.queryClientConfig:void 0),my.isServer()||r.mount();let i=()=>{};if(t.clientPersister){r.isRestoring&&(r.isRestoring.value=!0);let[e,n]=t.clientPersister(r);i=e,n.then(()=>{r.isRestoring&&(r.isRestoring.value=!1),t.clientPersisterOnSuccess?.(r)})}let a=()=>{r.unmount(),i()};if(e.onUnmount)e.onUnmount(a);else{let t=e.unmount;e.unmount=function(){a(),t()}}e.provide(n,r)}};function Qy(e,t,n){let r=n||Lv(),i=G(()=>{let e=t;typeof e==`function`&&(e=e());let n=Z(e);typeof n.enabled==`function`&&(n.enabled=n.enabled());let i=r.defaultQueryOptions(n);return i._optimisticResults=r.isRestoring?.value?`isRestoring`:`optimistic`,i}),a=new e(r,i.value),o=i.value.shallow?Vt(a.getCurrentResult()):Bt(a.getCurrentResult()),s=()=>{};r.isRestoring&&$n(r.isRestoring,e=>{e||(s(),s=a.subscribe(e=>{Mv(o,e)}))},{immediate:!0});let c=()=>{a.setOptions(i.value),Mv(o,a.getCurrentResult())};$n(i,c),Oe(()=>{s()});let l=(...e)=>(c(),o.refetch(...e)),u=()=>new Promise((e,t)=>{let n=()=>{},r=()=>{if(i.value.enabled!==!1){a.setOptions(i.value);let r=a.getOptimisticResult(i.value);r.isStale?(n(),a.fetchOptimistic(i.value).then(e,n=>{uy(i.value.throwOnError,[n,a.getCurrentQuery()])?t(n):e(a.getCurrentResult())})):(n(),e(r))}};r(),n=$n(i,r)});$n(()=>o.error,e=>{if(o.isError&&!o.isFetching&&uy(i.value.throwOnError,[e,a.getCurrentQuery()]))throw e});let d=sn(i.value.shallow?Ut(o):Ht(o));for(let e in o)typeof o[e]==`function`&&(d[e]=o[e]);return d.suspense=u,d.refetch=l,d}function $y(e,t){return Qy(Ny,e,t)}function eb({queries:e,...t},n){let r=n||Lv(),i=G(()=>B(typeof e==`function`?e():e).map(e=>{let t=Z(e);typeof t.enabled==`function`&&(t.enabled=e.enabled());let n=r.defaultQueryOptions(t);return n._optimisticResults=r.isRestoring?.value?`isRestoring`:`optimistic`,n})),a=new Gy(r,i.value,t),o=()=>{let[e,n]=a.getOptimisticResult(i.value,t.combine);return n(e.map((e,n)=>({...e,refetch:async(...e)=>{let[{[n]:r}]=a.getOptimisticResult(i.value,t.combine);return r.refetch(...e)}})))},s=$t(o()),c=()=>{};return r.isRestoring&&$n(r.isRestoring,e=>{e||(c(),c=a.subscribe(()=>{s.value=o()}),s.value=o())},{immediate:!0}),$n(i,e=>{a.setQueries(e,t),s.value=o()}),Oe(()=>{c()}),t.shallow?Ut(s):Ht(s)}function tb(e,t){let n=t||Lv(),r=G(()=>{let t=typeof e==`function`?e():e;return n.defaultMutationOptions(Z(t))}),i=new Uy(n,r.value),a=r.value.shallow?Vt(i.getCurrentResult()):Bt(i.getCurrentResult()),o=i.subscribe(e=>{Mv(a,e)}),s=(...e)=>{i.mutate(e[0],e[1]).catch(()=>{})};$n(r,()=>{i.setOptions(r.value)}),Oe(()=>{o()});let c=sn(r.value.shallow?Ut(a):Ht(a));return $n(()=>a.error,e=>{if(e&&uy(r.value.throwOnError,[e]))throw e}),{...c,mutate:s,mutateAsync:a.mutate,reset:a.reset}}function nb(e,t,n){if(typeof t==`string`)e.style.viewTransitionName=t;else if(t&&typeof t==`object`){let[n,r]=Object.entries(t)?.[0]||[];r?e.style.viewTransitionName=n:e.style.viewTransitionName=`none`}else throw Error(`[vue-view-transitions]: The value of \`v-${n}\` should be either "string" or "object" but got "${typeof t}"`)}function rb(){return{install(e){e.directive(`view-transition-name`,{beforeMount(e,t){nb(e,t.value,`view-transition-name`)},beforeUpdate(e,t){nb(e,t.value,`view-transition-name`)}}),e.directive(`trans`,{beforeMount(e,t){nb(e,t.value,`trans`)},beforeUpdate(e,t){nb(e,t.value,`trans`)}})}}}function ib(e){let t={};return document.startViewTransition?t.captured=new Promise(n=>{let r=document.startViewTransition(async()=>{n(),e&&await e()});t.updateCallbackDone=r.updateCallbackDone,t.ready=r.ready,t.finished=r.finished,t.skipTransition=r.skipTransition.bind(r)}):(t.captured=Promise.resolve(),t.updateCallbackDone=t.ready=t.finished=e?Promise.resolve(e()):Promise.resolve(),t.skipTransition=()=>{},console.error(`[vue-view-transitions]: This browser doesn't support View Transitions Api, please check: https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#browser_compatibility`)),t}function ab(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}var ob=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})(),sb=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},cb={INIT:`@@redux/INIT`+sb(),REPLACE:`@@redux/REPLACE`+sb(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+sb()}};function lb(e){if(typeof e!=`object`||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ub(e,t,n){var r;if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(ab(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(ab(1));return n(ub)(e,t)}if(typeof e!=`function`)throw Error(ab(2));var i=e,a=t,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){if(c)throw Error(ab(3));return a}function d(e){if(typeof e!=`function`)throw Error(ab(4));if(c)throw Error(ab(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw Error(ab(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),o=null}}}function f(e){if(!lb(e))throw Error(ab(7));if(e.type===void 0)throw Error(ab(8));if(c)throw Error(ab(9));try{c=!0,a=i(a,e)}finally{c=!1}for(var t=o=s,n=0;n<t.length;n++){var r=t[n];r()}return e}function p(e){if(typeof e!=`function`)throw Error(ab(10));i=e,f({type:cb.REPLACE})}function m(){var e,t=d;return e={subscribe:function(e){if(typeof e!=`object`||!e)throw Error(ab(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}},e[ob]=function(){return this},e}return f({type:cb.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:p},r[ob]=m,r}function Q(e,t,...n){if(db()&&t===void 0)throw Error(`invariant requires an error message argument`);if(!e){let e;if(t===void 0)e=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{let r=0;e=Error(t.replace(/%s/g,function(){return n[r++]})),e.name=`Invariant Violation`}throw e.framesToPop=1,e}}function db(){return typeof process<`u`&&!0}function fb(e,t,n){return t.split(`.`).reduce((e,t)=>e&&e[t]?e[t]:n||null,e)}function pb(e,t){return e.filter(e=>e!==t)}function mb(e){return typeof e==`object`}function hb(e,t){let n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);let i=[];return n.forEach((e,t)=>{e===1&&i.push(t)}),i}function gb(e,t){return e.filter(e=>t.indexOf(e)>-1)}var _b=`dnd-core/INIT_COORDS`,vb=`dnd-core/BEGIN_DRAG`,yb=`dnd-core/PUBLISH_DRAG_SOURCE`,bb=`dnd-core/HOVER`,xb=`dnd-core/DROP`,Sb=`dnd-core/END_DRAG`;function Cb(e,t){return{type:_b,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var wb={type:_b,payload:{clientOffset:null,sourceClientOffset:null}};function Tb(e){return function(t=[],n={publishSource:!0}){let{publishSource:r=!0,clientOffset:i,getSourceClientOffset:a}=n,o=e.getMonitor(),s=e.getRegistry();e.dispatch(Cb(i)),Eb(t,o,s);let c=kb(t,o);if(c==null){e.dispatch(wb);return}let l=null;if(i){if(!a)throw Error(`getSourceClientOffset must be defined`);Db(a),l=a(c)}e.dispatch(Cb(i,l));let u=s.getSource(c).beginDrag(o,c);return u==null?void 0:(Ob(u),s.pinSource(c),{type:vb,payload:{itemType:s.getSourceType(c),item:u,sourceId:c,clientOffset:i||null,sourceClientOffset:l||null,isSourcePublic:!!r}})}}function Eb(e,t,n){Q(!t.isDragging(),`Cannot call beginDrag while dragging.`),e.forEach(function(e){Q(n.getSource(e),`Expected sourceIds to be registered.`)})}function Db(e){Q(typeof e==`function`,`When clientOffset is provided, getSourceClientOffset must be a function.`)}function Ob(e){Q(mb(e),`Item must be an object.`)}function kb(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function Ab(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Ab(e,t,n[t])})}return e}function Mb(e){return function(t={}){let n=e.getMonitor(),r=e.getRegistry();Nb(n),Ib(n).forEach((i,a)=>{let o={type:xb,payload:{dropResult:jb({},t,Pb(i,a,r,n))}};e.dispatch(o)})}}function Nb(e){Q(e.isDragging(),`Cannot call drop while not dragging.`),Q(!e.didDrop(),`Cannot call drop twice during one drag operation.`)}function Pb(e,t,n,r){let i=n.getTarget(e),a=i?i.drop(r,e):void 0;return Fb(a),a===void 0&&(a=t===0?{}:r.getDropResult()),a}function Fb(e){Q(e===void 0||mb(e),`Drop result must either be an object or undefined.`)}function Ib(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Lb(e){return function(){let t=e.getMonitor(),n=e.getRegistry();Rb(t);let r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:Sb}}}function Rb(e){Q(e.isDragging(),`Cannot call endDrag while not dragging.`)}function zb(e,t){return t===null?e===null:Array.isArray(e)?e.some(e=>e===t):e===t}function Bb(e){return function(t,{clientOffset:n}={}){Vb(t);let r=t.slice(0),i=e.getMonitor(),a=e.getRegistry();return Ub(r,a,i.getItemType()),Hb(r,i,a),Wb(r,i,a),{type:bb,payload:{targetIds:r,clientOffset:n||null}}}}function Vb(e){Q(Array.isArray(e),`Expected targetIds to be an array.`)}function Hb(e,t,n){Q(t.isDragging(),`Cannot call hover while not dragging.`),Q(!t.didDrop(),`Cannot call hover after drop.`);for(let t=0;t<e.length;t++){let r=e[t];Q(e.lastIndexOf(r)===t,`Expected targetIds to be unique in the passed array.`),Q(n.getTarget(r),`Expected targetIds to be registered.`)}}function Ub(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];zb(t.getTargetType(i),n)||e.splice(r,1)}}function Wb(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}function Gb(e){return function(){if(e.getMonitor().isDragging())return{type:yb}}}function Kb(e){return{beginDrag:Tb(e),publishDragSource:Gb(e),hover:Bb(e),drop:Mb(e),endDrag:Lb(e)}}var qb=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function n(n){return(...r)=>{let i=n.apply(e,r);i!==void 0&&t(i)}}let r=Kb(this);return Object.keys(r).reduce((e,t)=>{let i=r[t];return e[t]=n(i),e},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function Jb(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Yb(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xb(e){let{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:Yb(Jb(t,r),n)}function Zb(e){let{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:Yb(t,n)}var Qb=[],$b=[];Qb.__IS_NONE__=!0,$b.__IS_ALL__=!0;function ex(e,t){return e===Qb?!1:e===$b||t===void 0||gb(t,e).length>0}var tx=class{subscribeToStateChange(e,t={}){let{handlerIds:n}=t;Q(typeof e==`function`,`listener must be a function.`),Q(n===void 0||Array.isArray(n),`handlerIds, when specified, must be an array of strings.`);let r=this.store.getState().stateId;return this.store.subscribe(()=>{let t=this.store.getState(),i=t.stateId;try{i===r||i===r+1&&!ex(t.dirtyHandlerIds,n)||e()}finally{r=i}})}subscribeToOffsetChange(e){Q(typeof e==`function`,`listener must be a function.`);let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return Q(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return Q(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:zb(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return Q(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:n}=t;if(!this.isDragging())return!1;let r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!zb(r,i))return!1;let a=this.getTargetIds();if(!a.length)return!1;let o=a.indexOf(e);return n?o===a.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Xb(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return Zb(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},nx=typeof global<`u`?global:self,rx=nx.MutationObserver||nx.WebKitMutationObserver;function ix(e){return function(){let t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}function ax(e){let t=1,n=new rx(e),r=document.createTextNode(``);return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}var ox=typeof rx==`function`?ax:ix,sx=class{enqueueTask(e){let{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=ox(this.flush),this.requestErrorThrow=ix(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},cx=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},lx=class{create(e){let t=this.freeTasks,n=t.length?t.pop():new cx(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}},ux=new sx,dx=new lx(ux.registerPendingError);function fx(e){ux.enqueueTask(dx.create(e))}var px=`dnd-core/ADD_SOURCE`,mx=`dnd-core/ADD_TARGET`,hx=`dnd-core/REMOVE_SOURCE`,gx=`dnd-core/REMOVE_TARGET`;function _x(e){return{type:px,payload:{sourceId:e}}}function vx(e){return{type:mx,payload:{targetId:e}}}function yx(e){return{type:hx,payload:{sourceId:e}}}function bx(e){return{type:gx,payload:{targetId:e}}}function xx(e){Q(typeof e.canDrag==`function`,`Expected canDrag to be a function.`),Q(typeof e.beginDrag==`function`,`Expected beginDrag to be a function.`),Q(typeof e.endDrag==`function`,`Expected endDrag to be a function.`)}function Sx(e){Q(typeof e.canDrop==`function`,`Expected canDrop to be a function.`),Q(typeof e.hover==`function`,`Expected hover to be a function.`),Q(typeof e.drop==`function`,`Expected beginDrag to be a function.`)}function Cx(e,t){if(t&&Array.isArray(e)){e.forEach(e=>Cx(e,!1));return}Q(typeof e==`string`||typeof e==`symbol`,t?`Type can only be a string, a symbol, or an array of either.`:`Type can only be a string or a symbol.`)}var wx;(function(e){e.SOURCE=`SOURCE`,e.TARGET=`TARGET`})(wx||={});var Tx=0;function Ex(){return Tx++}function Dx(e){let t=Ex().toString();switch(e){case wx.SOURCE:return`S${t}`;case wx.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function Ox(e){switch(e[0]){case`S`:return wx.SOURCE;case`T`:return wx.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function kx(e,t){let n=e.entries(),r=!1;do{let{done:e,value:[,i]}=n.next();if(i===t)return!0;r=!!e}while(!r);return!1}var Ax=class{addSource(e,t){Cx(e),xx(t);let n=this.addHandler(wx.SOURCE,e,t);return this.store.dispatch(_x(n)),n}addTarget(e,t){Cx(e,!0),Sx(t);let n=this.addHandler(wx.TARGET,e,t);return this.store.dispatch(vx(n)),n}containsHandler(e){return kx(this.dragSources,e)||kx(this.dropTargets,e)}getSource(e,t=!1){return Q(this.isSourceId(e),`Expected a valid source ID.`),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return Q(this.isTargetId(e),`Expected a valid target ID.`),this.dropTargets.get(e)}getSourceType(e){return Q(this.isSourceId(e),`Expected a valid source ID.`),this.types.get(e)}getTargetType(e){return Q(this.isTargetId(e),`Expected a valid target ID.`),this.types.get(e)}isSourceId(e){return Ox(e)===wx.SOURCE}isTargetId(e){return Ox(e)===wx.TARGET}removeSource(e){Q(this.getSource(e),`Expected an existing source.`),this.store.dispatch(yx(e)),fx(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){Q(this.getTarget(e),`Expected an existing target.`),this.store.dispatch(bx(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);Q(t,`Expected an existing source.`),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){Q(this.pinnedSource,`No source is pinned at the time.`),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){let r=Dx(e);return this.types.set(r,t),e===wx.SOURCE?this.dragSources.set(r,n):e===wx.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},jx=(e,t)=>e===t;function Mx(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Nx(e,t,n=jx){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function Px(e=Qb,t){switch(t.type){case bb:break;case px:case mx:case gx:case hx:return Qb;case vb:case yb:case Sb:case xb:default:return $b}let{targetIds:n=[],prevTargetIds:r=[]}=t.payload,i=hb(n,r);if(!(i.length>0||!Nx(n,r)))return Qb;let a=r[r.length-1],o=n[n.length-1];return a!==o&&(a&&i.push(a),o&&i.push(o)),i}function Fx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ix(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Fx(e,t,n[t])})}return e}var Lx={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Rx(e=Lx,t){let{payload:n}=t;switch(t.type){case _b:case vb:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case bb:return Mx(e.clientOffset,n.clientOffset)?e:Ix({},e,{clientOffset:n.clientOffset});case Sb:case xb:return Lx;default:return e}}function zx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){zx(e,t,n[t])})}return e}var Vx={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Hx(e=Vx,t){let{payload:n}=t;switch(t.type){case vb:return Bx({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case yb:return Bx({},e,{isSourcePublic:!0});case bb:return Bx({},e,{targetIds:n.targetIds});case gx:return e.targetIds.indexOf(n.targetId)===-1?e:Bx({},e,{targetIds:pb(e.targetIds,n.targetId)});case xb:return Bx({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Sb:return Bx({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Ux(e=0,t){switch(t.type){case px:case mx:return e+1;case hx:case gx:return e-1;default:return e}}function Wx(e=0){return e+1}function Gx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Gx(e,t,n[t])})}return e}function qx(e={},t){return{dirtyHandlerIds:Px(e.dirtyHandlerIds,{type:t.type,payload:Kx({},t.payload,{prevTargetIds:fb(e,`dragOperation.targetIds`,[])})}),dragOffset:Rx(e.dragOffset,t),refCount:Ux(e.refCount,t),dragOperation:Hx(e.dragOperation,t),stateId:Wx(e.stateId)}}function Jx(e,t=void 0,n={},r=!1){let i=Yx(r),a=new qb(i,new tx(i,new Ax(i))),o=e(a,t,n);return a.receiveBackend(o),a}function Yx(e){let t=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__;return ub(qx,e&&t&&t({name:`dnd-core`,instanceId:`dnd-core`}))}var Xx=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),Zx=t(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n():e.getSize=n()})(window,function(){function e(e){let t=parseFloat(e);return e.indexOf(`%`)==-1&&!isNaN(t)&&t}let t=[`paddingLeft`,`paddingRight`,`paddingTop`,`paddingBottom`,`marginLeft`,`marginRight`,`marginTop`,`marginBottom`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`borderBottomWidth`];t.length;function n(){let e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};return t.forEach(t=>{e[t]=0}),e}function r(r){if(typeof r==`string`&&(r=document.querySelector(r)),!(r&&typeof r==`object`&&r.nodeType))return;let i=getComputedStyle(r);if(i.display==`none`)return n();let a={};a.width=r.offsetWidth,a.height=r.offsetHeight;let o=a.isBorderBox=i.boxSizing==`border-box`;t.forEach(e=>{let t=i[e],n=parseFloat(t);a[e]=isNaN(n)?0:n});let s=a.paddingLeft+a.paddingRight,c=a.paddingTop+a.paddingBottom,l=a.marginLeft+a.marginRight,u=a.marginTop+a.marginBottom,d=a.borderLeftWidth+a.borderRightWidth,f=a.borderTopWidth+a.borderBottomWidth,p=e(i.width);p!==!1&&(a.width=p+(o?0:s+d));let m=e(i.height);return m!==!1&&(a.height=m+(o?0:c+f)),a.innerWidth=a.width-(s+d),a.innerHeight=a.height-(c+f),a.outerWidth=a.width+l,a.outerHeight=a.height+u,a}return r})})),Qx=t(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n():e.EvEmitter=n()})(typeof window<`u`?window:e,function(){function e(){}let t=e.prototype;return t.on=function(e,t){if(!e||!t)return this;let n=this._events=this._events||{},r=n[e]=n[e]||[];return r.includes(t)||r.push(t),this},t.once=function(e,t){if(!e||!t)return this;this.on(e,t);let n=this._onceEvents=this._onceEvents||{},r=n[e]=n[e]||{};return r[t]=!0,this},t.off=function(e,t){let n=this._events&&this._events[e];if(!n||!n.length)return this;let r=n.indexOf(t);return r!=-1&&n.splice(r,1),this},t.emitEvent=function(e,t){let n=this._events&&this._events[e];if(!n||!n.length)return this;n=n.slice(0),t||=[];let r=this._onceEvents&&this._onceEvents[e];for(let i of n)r&&r[i]&&(this.off(e,i),delete r[i]),i.apply(this,t);return this},t.allOff=function(){return delete this._events,delete this._onceEvents,this},e})})),$x=t(((e,t)=>{(function(e,n){typeof t==`object`&&t.exports?t.exports=n(e,Qx()):e.Unidragger=n(e,e.EvEmitter)})(typeof window<`u`?window:e,function(e,t){function n(){}let r=n.prototype=Object.create(t.prototype);r.handleEvent=function(e){let t=`on`+e.type;this[t]&&this[t](e)};let i,a;`ontouchstart`in e?(i=`touchstart`,a=[`touchmove`,`touchend`,`touchcancel`]):e.PointerEvent?(i=`pointerdown`,a=[`pointermove`,`pointerup`,`pointercancel`]):(i=`mousedown`,a=[`mousemove`,`mouseup`]),r.touchActionValue=`none`,r.bindHandles=function(){this._bindHandles(`addEventListener`,this.touchActionValue)},r.unbindHandles=function(){this._bindHandles(`removeEventListener`,``)},r._bindHandles=function(t,n){this.handles.forEach(r=>{r[t](i,this),r[t](`click`,this),e.PointerEvent&&(r.style.touchAction=n)})},r.bindActivePointerEvents=function(){a.forEach(t=>{e.addEventListener(t,this)})},r.unbindActivePointerEvents=function(){a.forEach(t=>{e.removeEventListener(t,this)})},r.withPointer=function(e,t){t.pointerId===this.pointerIdentifier&&this[e](t,t)},r.withTouch=function(e,t){let n;for(let e of t.changedTouches)e.identifier===this.pointerIdentifier&&(n=e);n&&this[e](t,n)},r.onmousedown=function(e){this.pointerDown(e,e)},r.ontouchstart=function(e){this.pointerDown(e,e.changedTouches[0])},r.onpointerdown=function(e){this.pointerDown(e,e)};let o=[`TEXTAREA`,`INPUT`,`SELECT`,`OPTION`],s=[`radio`,`checkbox`,`button`,`submit`,`image`,`file`];return r.pointerDown=function(e,t){let n=o.includes(e.target.nodeName),r=s.includes(e.target.type),i=!n||r;this.isPointerDown||e.button||!i||(this.isPointerDown=!0,this.pointerIdentifier=t.pointerId===void 0?t.identifier:t.pointerId,this.pointerDownPointer={pageX:t.pageX,pageY:t.pageY},this.bindActivePointerEvents(),this.emitEvent(`pointerDown`,[e,t]))},r.onmousemove=function(e){this.pointerMove(e,e)},r.onpointermove=function(e){this.withPointer(`pointerMove`,e)},r.ontouchmove=function(e){this.withTouch(`pointerMove`,e)},r.pointerMove=function(e,t){let n={x:t.pageX-this.pointerDownPointer.pageX,y:t.pageY-this.pointerDownPointer.pageY};this.emitEvent(`pointerMove`,[e,t,n]),!this.isDragging&&this.hasDragStarted(n)&&this.dragStart(e,t),this.isDragging&&this.dragMove(e,t,n)},r.hasDragStarted=function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3},r.dragStart=function(e,t){this.isDragging=!0,this.isPreventingClicks=!0,this.emitEvent(`dragStart`,[e,t])},r.dragMove=function(e,t,n){this.emitEvent(`dragMove`,[e,t,n])},r.onmouseup=function(e){this.pointerUp(e,e)},r.onpointerup=function(e){this.withPointer(`pointerUp`,e)},r.ontouchend=function(e){this.withTouch(`pointerUp`,e)},r.pointerUp=function(e,t){this.pointerDone(),this.emitEvent(`pointerUp`,[e,t]),this.isDragging?this.dragEnd(e,t):this.staticClick(e,t)},r.dragEnd=function(e,t){this.isDragging=!1,setTimeout(()=>delete this.isPreventingClicks),this.emitEvent(`dragEnd`,[e,t])},r.pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this.unbindActivePointerEvents(),this.emitEvent(`pointerDone`)},r.onpointercancel=function(e){this.withPointer(`pointerCancel`,e)},r.ontouchcancel=function(e){this.withTouch(`pointerCancel`,e)},r.pointerCancel=function(e,t){this.pointerDone(),this.emitEvent(`pointerCancel`,[e,t])},r.onclick=function(e){this.isPreventingClicks&&e.preventDefault()},r.staticClick=function(e,t){let n=e.type===`mouseup`;n&&this.isIgnoringMouseUp||(this.emitEvent(`staticClick`,[e,t]),n&&(this.isIgnoringMouseUp=!0,setTimeout(()=>{delete this.isIgnoringMouseUp},400)))},n})})),eS={class:`controll`},tS={class:`controll__item controll__item--circle`},nS={class:`controll__pan controll__item--circle__inner`},rS={class:`controll__pan__up controll__item--circle__inner__up`},iS={class:`controll__pan__right controll__item--circle__inner__right`},aS={class:`controll__pan__down controll__item--circle__inner__down`},oS={class:`controll__pan__left controll__item--circle__inner__left`},sS={class:`controll__home controll__item controll__item--list-item`},cS={class:`controll__zoom-in controll__item controll__item--list-item`},lS={class:`controll__zoom-in controll__item controll__item--list-item`},uS=Mr({__name:`ControlButtons`,emits:[`buttondown`,`buttonup`],setup(e,{emit:t}){let n=t;function r(e,t){n(`buttondown`,{key:t})}function i(e,t){n(`buttonup`,{key:t})}return(e,t)=>(H(),uo(`div`,{id:`v-zoomable-control-btns`,class:`controll__buttons`,onDblclick:t[31]||=vc(()=>{},[`stop`]),onMousedown:t[32]||=vc(()=>{},[`stop`])},[U(`ul`,eS,[U(`li`,tS,[U(`ul`,nS,[U(`li`,rS,[U(`a`,{onPointerdown:t[0]||=e=>r(e,`pan-up`),onPointerup:t[1]||=e=>i(e,`pan-up`),onPointercancel:t[2]||=e=>i(e,`pan-up`),onPointerleave:t[3]||=e=>i(e,`pan-up`),onContextmenu:t[4]||=vc(()=>{},[`prevent`])},t[33]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-chevron-up`},[U(`polyline`,{points:`18 15 12 9 6 15`})],-1)],32)]),U(`li`,iS,[U(`a`,{onPointerdown:t[5]||=e=>r(e,`pan-right`),onPointerup:t[6]||=e=>i(e,`pan-right`),onPointercancel:t[7]||=e=>i(e,`pan-right`),onPointerleave:t[8]||=e=>i(e,`pan-right`),onContextmenu:t[9]||=vc(()=>{},[`prevent`])},t[34]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-chevron-right`},[U(`polyline`,{points:`9 18 15 12 9 6`})],-1)],32)]),U(`li`,aS,[U(`a`,{onPointerdown:t[10]||=e=>r(e,`pan-down`),onPointerup:t[11]||=e=>i(e,`pan-down`),onPointercancel:t[12]||=e=>i(e,`pan-down`),onPointerleave:t[13]||=e=>i(e,`pan-down`),onContextmenu:t[14]||=vc(()=>{},[`prevent`])},t[35]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-chevron-down`},[U(`polyline`,{points:`6 9 12 15 18 9`})],-1)],32)]),U(`li`,oS,[U(`a`,{onPointerdown:t[15]||=e=>r(e,`pan-left`),onPointercancel:t[16]||=e=>i(e,`pan-left`),onPointerup:t[17]||=e=>i(e,`pan-left`),onPointerleave:t[18]||=e=>i(e,`pan-left`),onContextmenu:t[19]||=vc(()=>{},[`prevent`])},t[36]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-chevron-left`},[U(`polyline`,{points:`15 18 9 12 15 6`})],-1)],32)])])]),U(`li`,sS,[U(`a`,{onPointerdown:t[20]||=e=>r(e,`home`)},t[37]||=[xo(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-minimize-2" data-v-3ba139de><polyline points="4 14 10 14 10 20" data-v-3ba139de></polyline><polyline points="20 10 14 10 14 4" data-v-3ba139de></polyline><line x1="14" y1="10" x2="21" y2="3" data-v-3ba139de></line><line x1="3" y1="21" x2="10" y2="14" data-v-3ba139de></line></svg>`,1)],32)]),U(`li`,cS,[U(`a`,{onPointerdown:t[21]||=e=>r(e,`zoom-in`),onPointerup:t[22]||=e=>i(e,`zoom-in`),onPointercancel:t[23]||=e=>i(e,`zoom-in`),onPointerleave:t[24]||=e=>i(e,`zoom-in`),onContextmenu:t[25]||=vc(()=>{},[`prevent`])},t[38]||=[xo(`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-zoom-in" data-v-3ba139de><circle cx="11" cy="11" r="8" data-v-3ba139de></circle><line x1="21" y1="21" x2="16.65" y2="16.65" data-v-3ba139de></line><line x1="11" y1="8" x2="11" y2="14" data-v-3ba139de></line><line x1="8" y1="11" x2="14" y2="11" data-v-3ba139de></line></svg>`,1)],32)]),U(`li`,lS,[U(`a`,{onPointerdown:t[26]||=e=>r(e,`zoom-out`),onPointerup:t[27]||=e=>i(e,`zoom-out`),onPointercancel:t[28]||=e=>i(e,`zoom-out`),onPointerleave:t[29]||=e=>i(e,`zoom-out`),onContextmenu:t[30]||=vc(()=>{},[`prevent`])},t[39]||=[U(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`feather feather-zoom-out`},[U(`circle`,{cx:`11`,cy:`11`,r:`8`}),U(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`}),U(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`})],-1)],32)])])],32))}}),dS=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},fS=dS(uS,[[`__scopeId`,`data-v-3ba139de`]]);function pS(){let e=0;function t(t,n,r,i){t(),e=window.setTimeout(()=>{e=window.setInterval(()=>{n()},i)},r)}function n(){e&&=(window.clearInterval(e),0)}return{startHold:t,clearHold:n}}var mS=`control-btn`;function hS({props:e,transform:t}){let n=pS();function r(r){n.startHold(()=>{t.changeZoom(r*e.buttonZoomStep*.5,mS)},()=>{t.changeZoom(r*e.buttonZoomStep*.5,mS)},300,50)}function i(t){if(!e.disabled)switch(t.key){case`home`:s();break;case`zoom-in`:r(1);break;case`zoom-out`:r(-1);break;case`pan-left`:o({x:1,y:0});break;case`pan-right`:o({x:-1,y:0});break;case`pan-up`:o({x:0,y:1});break;case`pan-down`:o({x:0,y:-1})}}function a(e){n.clearHold()}function o(r){n.startHold(()=>{t.changePan(r.x*e.buttonPanStep,r.y*e.buttonPanStep,mS)},()=>{t.changePan(r.x*e.buttonPanStep,r.y*e.buttonPanStep,mS)},300,50)}function s(){t.goHome(mS)}return{onButtonDown:i,onButtonUp:a}}function gS({props:e,transform:t}){let n={x:0,y:0};function r(t){e.disabled||t.pointerType!==`mouse`||!e.mouseEnabled||(n={x:t.clientX,y:t.clientY},document.addEventListener(`pointermove`,a,{passive:!1}),document.addEventListener(`pointerup`,function(e){document.removeEventListener(`pointermove`,a)}),document.addEventListener(`pointerleave`,function(e){document.removeEventListener(`pointermove`,a)}),document.addEventListener(`pointercancel`,function(e){document.removeEventListener(`pointermove`,a)}))}function i(n){if(e.disabled||!e.dblClickEnabled||!e.zoomEnabled)return;let r={x:n.clientX,y:n.clientY};t.changeZoom(e.dblClickZoomStep,`dblClick`,r)}function a(r){if(e.disabled||!e.panEnabled||r.pointerType!==`mouse`||!e.mouseEnabled)return;let i={x:r.clientX-n.x,y:r.clientY-n.y};t.changePan(i.x,i.y,r.pointerType),n={x:r.clientX,y:r.clientY},r.preventDefault()}return{onPointerDown:r,onDblClick:i}}function _S({props:e,transform:t}){let n=z({}),r=z(0),i=null;function a(n){if(e.disabled||!e.touchEnabled||!e.panEnabled&&!e.zoomEnabled||(n.preventDefault(),n.touches.length<1))return;let a=n.touches.item(0);if(!a)return;let s=0,c={x:a.clientX,y:a.clientY};if(n.touches.length===2){let e=n.touches.item(1),i=o({x:a?a.clientX:0,y:a?a.clientY:0},{x:e?e.clientX:0,y:e?e.clientY:0});r.value<=0?(r.value=i.distance,s=0):(s=i.distance/r.value*t.zoom.value-t.zoom.value,r.value=i.distance),c=i.center}if(e.zoomEnabled&&t.changeZoom(s,`touch`,c),i===null){i={x:c.x,y:c.y};return}let l={x:c.x-i.x,y:c.y-i.y};e.panEnabled&&t.changePan(l.x,l.y,`touch`),i={x:c.x,y:c.y}}function o(e,t){return{distance:Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),center:{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}}function s(t){e.disabled||!e.touchEnabled||(i=null,document.addEventListener(`touchmove`,a,{passive:!1}),document.addEventListener(`touchend`,function(e){t.touches.length<2&&(r.value=-1),document.removeEventListener(`touchmove`,a)}))}return{onTouchStart:s,touchCount:G(()=>Object.keys(n.value).length)}}function vS({props:e,onChange:t,container:n,target:r}){let i=z({x:0,y:0}),a=z(0);$r(()=>{a.value=e.minZoom,i.value={x:e.pan==null?e.initialPanX:e.pan.x,y:e.pan==null?e.initialPanY:e.pan.y},e.zoom?a.value=e.zoom:e.initialZoom>=e.minZoom&&e.initialZoom<=e.maxZoom&&(a.value=e.initialZoom)}),$n(()=>e.zoom,()=>{isNaN(e.zoom)||(a.value=e.zoom)}),$n(()=>e.pan,()=>{e.pan&&(i.value.x=e.pan.x,i.value.y=e.pan.y)},{deep:!0});function o(r,o,c){if(isNaN(r)||r===0)return;let l=a.value,u=a.value+r;if(u>e.maxZoom?u=e.maxZoom:u<e.minZoom&&(u=e.minZoom),!(Math.abs(l-u)<1e-4)){if(a.value=u,e.zoomOrigin===`center`&&(c=yS(n.value)),e.zoomOrigin!==`content-center`){c||=yS(n.value);let e=bS(n.value,i.value),t={x:(u-l)*((e.x-c.x)/l),y:(u-l)*((e.y-c.y)/l)};s(t.x,t.y,`zoom`)}t(`zoom`,{zoom:u,delta:{zoom:r,pan:{x:0,y:0}},pan:{x:i.value.x,y:i.value.y,deltaX:0,deltaY:0},type:o})}}function s(e,n,r){isNaN(e)&&(e=0),isNaN(n)&&(n=0),i.value={x:i.value.x+e,y:i.value.y+n},t(`panned`,{zoom:a.value,delta:{zoom:0,pan:{x:e,y:n}},pan:{x:i.value.x,y:i.value.y,deltaX:e,deltaY:n},type:r})}function c(n){a.value=e.initialZoom,t(`zoom`,{zoom:a.value,pan:{x:i.value.x,y:i.value.y,deltaX:0,deltaY:0},type:n});let r={x:e.initialPanX-i.value.x,y:e.initialPanY-i.value.y};i.value={x:e.initialPanX,y:e.initialPanY},t(`panned`,{zoom:a.value,pan:{x:i.value.x,y:i.value.y,deltaX:r.x,deltaY:r.y},type:n})}return{zoom:G(()=>a.value),pan:G(()=>i.value),setZoom:e=>{a.value=e},setPan:e=>{i.value=e},changeZoom:o,changePan:s,goHome:c}}function yS(e){let t=e.getBoundingClientRect();return{x:t.left+t.width/2,y:t.top+t.height/2}}function bS(e,t){let n=yS(e);return{x:n.x+t.x,y:n.y+t.y}}function xS({props:e,transform:t}){function n(n){if(e.disabled||!e.wheelEnabled||!e.zoomEnabled)return;let r=Math.abs(n.deltaY)>0?n.deltaY:n.deltaX,i=e.wheelZoomStep*-1*r/Math.abs(r),a={x:n.clientX,y:n.clientY};t.changeZoom(i,`wheel`,a),n.preventDefault()}return{onWheel:n}}function SS({props:e,onChange:t,container:n,target:r}){let i=vS({props:e,onChange:t,container:n,target:r}),a=_S({props:e,transform:i}),o=xS({props:e,transform:i}),s=gS({props:e,transform:i}),c=hS({props:e,transform:i});return{zoom:i.zoom,pan:i.pan,setZoom:i.setZoom,setPan:i.setPan,onWheel:o.onWheel,onTouchStart:a.onTouchStart,onButtonUp:c.onButtonUp,onButtonDown:c.onButtonDown,onPointerDown:s.onPointerDown,onDblClick:s.onDblClick}}var CS=dS(Mr({__name:`VueZoomable`,props:{zoom:{type:Number,default:null},pan:{type:Object,default:null},selector:{type:String,default:`* > *`},maxZoom:{type:Number,default:3},minZoom:{type:Number,default:.5},initialPanX:{type:Number,default:0},initialPanY:{type:Number,default:0},initialZoom:{type:Number,default:.5},dblClickZoomStep:{type:Number,default:.4},wheelZoomStep:{type:Number,default:.4},panEnabled:{type:Boolean,default:!0},zoomEnabled:{type:Boolean,default:!0},mouseEnabled:{type:Boolean,default:!0},touchEnabled:{type:Boolean,default:!0},dblClickEnabled:{type:Boolean,default:!0},wheelEnabled:{type:Boolean,default:!0},enableControlButton:{type:Boolean,default:!0},buttonPanStep:{type:Number,default:15},buttonZoomStep:{type:Number,default:.1},disabled:{type:Boolean,default:!1},zoomOrigin:{type:String,default:`pointer`}},emits:[`panned`,`zoom`,`update:zoom`,`update:pan`],setup(e,{emit:t}){let n=t,r=e,i=z(),a=G(()=>i.value?.querySelector(r.selector)),o=SS({props:r,onChange:s,container:i,target:a});function s(e,t){e===`zoom`?n(`update:zoom`,t.zoom):e===`panned`&&n(`update:pan`,t.pan),n(e,t)}let c=G(()=>`translate(${o.pan.value.x}px, ${o.pan.value.y}px) scale(${o.zoom.value})`);function l(){a.value&&(a.value.style.transform=c.value,a.value.style.transformOrigin=`center center`,a.value.style.transition=`transform 0.07s ease-out`,a.value.style.transformBox=`fill-box`)}return $n(c,()=>{l()},{flush:`post`}),$r(()=>{l()}),(e,t)=>(H(),uo(`div`,{ref_key:`container`,ref:i,class:de(e.$style.container),onDblclick:t[0]||=(...e)=>B(o).onDblClick&&B(o).onDblClick(...e),onPointerdown:t[1]||=(...e)=>B(o).onPointerDown&&B(o).onPointerDown(...e),onWheel:t[2]||=(...e)=>B(o).onWheel&&B(o).onWheel(...e),onTouchstart:t[3]||=(...e)=>B(o).onTouchStart&&B(o).onTouchStart(...e)},[vi(e.$slots,`default`,{},void 0,!0),vi(e.$slots,`buttons`,{},()=>[B(r).enableControlButton?(H(),fo(fS,{key:0,onButtondown:B(o).onButtonDown,onButtonup:B(o).onButtonUp},null,8,[`onButtondown`,`onButtonup`])):So(``,!0)],!0)],34))}}),[[`__cssModules`,{$style:{container:`_container_irdvc_2`,buttons:`_buttons_irdvc_11`}}],[`__scopeId`,`data-v-fce7d501`]]),wS;(function(e){e.Unimplemented=`UNIMPLEMENTED`,e.Unavailable=`UNAVAILABLE`})(wS||={});var TS=class extends Error{constructor(e,t,n){super(e),this.message=e,this.code=t,this.data=n}},ES=e=>e?.androidBridge?`android`:e?.webkit?.messageHandlers?.bridge?`ios`:`web`,DS=e=>{let t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},r=n.Plugins=n.Plugins||{},i=()=>t===null?ES(e):t.name,a=()=>i()!==`web`,o=e=>!!(l.get(e)?.platforms.has(i())||s(e)),s=e=>n.PluginHeaders?.find(t=>t.name===e),c=t=>e.console.error(t),l=new Map;return n.convertFileSrc||=e=>e,n.getPlatform=i,n.handleError=c,n.isNativePlatform=a,n.isPluginAvailable=o,n.registerPlugin=(e,a={})=>{let o=l.get(e);if(o)return console.warn(`Capacitor plugin "${e}" already registered. Cannot register plugins twice.`),o.proxy;let c=i(),u=s(e),d,f=async()=>(!d&&c in a?d=d=typeof a[c]==`function`?await a[c]():a[c]:t!==null&&!d&&`web`in a&&(d=d=typeof a.web==`function`?await a.web():a.web),d),p=(t,r)=>{if(u){let i=u?.methods.find(e=>r===e.name);if(i)return i.rtype===`promise`?t=>n.nativePromise(e,r.toString(),t):(t,i)=>n.nativeCallback(e,r.toString(),t,i);if(t)return t[r]?.bind(t)}else if(t)return t[r]?.bind(t);else throw new TS(`"${e}" plugin is not implemented on ${c}`,wS.Unimplemented)},m=t=>{let n,r=(...r)=>{let i=f().then(i=>{let a=p(i,t);if(a){let e=a(...r);return n=e?.remove,e}throw new TS(`"${e}.${t}()" is not implemented on ${c}`,wS.Unimplemented)});return t===`addListener`&&(i.remove=async()=>n()),i};return r.toString=()=>`${t.toString()}() { [capacitor code] }`,Object.defineProperty(r,"name",{value:t,writable:!1,configurable:!1}),r},h=m(`addListener`),g=m(`removeListener`),v=(e,t)=>{let n=h({eventName:e},t),r=async()=>{let r=await n;g({eventName:e,callbackId:r},t)},i=new Promise(e=>n.then(()=>e({remove:r})));return i.remove=async()=>{console.warn(`Using addListener() without 'await' is deprecated.`),await r()},i},y=new Proxy({},{get(e,t){switch(t){case`$$typeof`:return;case`toJSON`:return()=>({});case`addListener`:return u?v:h;case`removeListener`:return g;default:return m(t)}}});return r[e]=y,l.set(e,{name:e,proxy:y,platforms:new Set([...Object.keys(a),...u?[c]:[]])}),y},n.Exception=TS,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},OS=(e=>e.Capacitor=DS(e))(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}),kS=OS.registerPlugin,AS=class{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,t){let n=!1;this.listeners[e]||(this.listeners[e]=[],n=!0),this.listeners[e].push(t);let r=this.windowListeners[e];return r&&!r.registered&&this.addWindowListener(r),n&&this.sendRetainedArgumentsForEvent(e),Promise.resolve({remove:async()=>this.removeListener(e,t)})}async removeAllListeners(){this.listeners={};for(let e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t,n){let r=this.listeners[e];if(!r){if(n){let n=this.retainedEventArguments[e];n||=[],n.push(t),this.retainedEventArguments[e]=n}return}r.forEach(e=>e(t))}hasListeners(e){return!!this.listeners[e]?.length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:e=>{this.notifyListeners(t,e)}}}unimplemented(e=`not implemented`){return new OS.Exception(e,wS.Unimplemented)}unavailable(e=`not available`){return new OS.Exception(e,wS.Unavailable)}async removeListener(e,t){let n=this.listeners[e];if(!n)return;let r=n.indexOf(t);r!==-1&&this.listeners[e].splice(r,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){let t=this.retainedEventArguments[e];t&&(delete this.retainedEventArguments[e],t.forEach(t=>{this.notifyListeners(e,t)}))}},jS=kS(`WebView`),MS=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),NS=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent),PS=class extends AS{async getCookies(){let e=document.cookie,t={};return e.split(`;`).forEach(e=>{if(e.length<=0)return;let[n,r]=e.replace(/=/,`CAP_COOKIE`).split(`CAP_COOKIE`);n=NS(n).trim(),r=NS(r).trim(),t[n]=r}),t}async setCookie(e){try{let t=MS(e.key),n=MS(e.value),r=e.expires?`; expires=${e.expires.replace(`expires=`,``)}`:``,i=(e.path||`/`).replace(`path=`,``),a=e.url!=null&&e.url.length>0?`domain=${e.url}`:``;document.cookie=`${t}=${n||``}${r}; path=${i}; ${a};`}catch(e){return Promise.reject(e)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(e){return Promise.reject(e)}}async clearCookies(){try{let e=document.cookie.split(`;`)||[];for(let t of e)document.cookie=t.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)}}},FS=kS(`CapacitorCookies`,{web:()=>new PS}),IS=async e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{let e=r.result;t(e.indexOf(`,`)>=0?e.split(`,`)[1]:e)},r.onerror=e=>n(e),r.readAsDataURL(e)}),LS=(e={})=>{let t=Object.keys(e);return Object.keys(e).map(e=>e.toLocaleLowerCase()).reduce((n,r,i)=>(n[r]=e[t[i]],n),{})},RS=(e,t=!0)=>e?Object.entries(e).reduce((e,n)=>{let[r,i]=n,a,o;return Array.isArray(i)?(o=``,i.forEach(e=>{a=t?encodeURIComponent(e):e,o+=`${r}=${a}&`}),o.slice(0,-1)):(a=t?encodeURIComponent(i):i,o=`${r}=${a}`),`${e}&${o}`},``).substr(1):null,zS=(e,t={})=>{let n=Object.assign({method:e.method||`GET`,headers:e.headers},t),r=LS(e.headers)[`content-type`]||``;if(typeof e.data==`string`)n.body=e.data;else if(r.includes(`application/x-www-form-urlencoded`)){let t=new URLSearchParams;for(let[n,r]of Object.entries(e.data||{}))t.set(n,r);n.body=t.toString()}else if(r.includes(`multipart/form-data`)||e.data instanceof FormData){let t=new FormData;if(e.data instanceof FormData)e.data.forEach((e,n)=>{t.append(n,e)});else for(let n of Object.keys(e.data))t.append(n,e.data[n]);n.body=t;let r=new Headers(n.headers);r.delete(`content-type`),n.headers=r}else(r.includes(`application/json`)||typeof e.data==`object`)&&(n.body=JSON.stringify(e.data));return n},BS=class extends AS{async request(e){let t=zS(e,e.webFetchExtra),n=RS(e.params,e.shouldEncodeUrlParams),r=n?`${e.url}?${n}`:e.url,i=await fetch(r,t),a=i.headers.get(`content-type`)||``,{responseType:o=`text`}=i.ok?e:{};a.includes(`application/json`)&&(o=`json`);let s,c;switch(o){case`arraybuffer`:case`blob`:c=await i.blob(),s=await IS(c);break;case`json`:s=await i.json();break;default:s=await i.text()}let l={};return i.headers.forEach((e,t)=>{l[t]=e}),{data:s,headers:l,status:i.status,url:i.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`}))}},VS=kS(`CapacitorHttp`,{web:()=>new BS}),HS;(function(e){e.Dark=`DARK`,e.Light=`LIGHT`,e.Default=`DEFAULT`})(HS||={});var US;(function(e){e.StatusBar=`StatusBar`,e.NavigationBar=`NavigationBar`})(US||={});var WS=class extends AS{async setStyle(){this.unavailable(`not available for web`)}async setAnimation(){this.unavailable(`not available for web`)}async show(){this.unavailable(`not available for web`)}async hide(){this.unavailable(`not available for web`)}},GS=kS(`SystemBars`,{web:()=>new WS}),KS=kS(`Badge`,{web:()=>Nm(()=>import(`./web-kt-Rh6Kp.js`).then(e=>new e.BadgeWeb),[],import.meta.url)}),qS={};function JS(e){return e.getIsPending!==void 0}function YS(e){if(JS(e))return e;let t=!0,n=e.then(e=>(t=!1,e),e=>{throw t=!1,e});return n.getIsPending=function(){return t},n}function XS(e){let t={},n=e.attributes;if(!n)return t;for(let e=n.length-1;e>=0;e--)t[n[e].name]=n[e].value;return t}function ZS(e){return Object.keys(e).reduce((t,n)=>(e[n]!==!1&&e[n]!==null&&e[n]!==void 0&&(t[n]=e[n]),t),{})}function QS(e,t){let{class:n,style:r,...i}=XS(e),{class:a,style:o,...s}=ZS(t);return{class:[n,a],style:[r,o],...i,...s}}var $S=Mr({inheritAttrs:!1,__name:`InlineSvg`,props:{src:{},title:{default:void 0},transformSource:{type:Function,default:e=>e},keepDuringLoading:{type:Boolean,default:!0},uniqueIds:{type:[Boolean,String],default:!1},uniqueIdsBase:{default:``}},emits:[`loaded`,`unloaded`,`error`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=Ei(),o=z(),s=z(),c=z(),l=Math.random().toString(36).substring(2);t({svgElSource:o,request:c}),$n(()=>r.src,e=>{d(e)}),d(r.src);function u(e){if(e=e.cloneNode(!0),r.uniqueIds){let t=typeof r.uniqueIds==`string`?r.uniqueIds:l;e=h(e,t,r.uniqueIdsBase)}return e=r.transformSource(e),r.title&&m(e,r.title),e.innerHTML}function d(e){qS[e]||(qS[e]=f(e)),o.value&&qS[e].getIsPending()&&!r.keepDuringLoading&&(o.value=null,i(`unloaded`)),qS[e].then(e=>{o.value=e,jn(()=>{i(`loaded`,s.value)})}).catch(t=>{o.value&&(o.value=void 0,i(`unloaded`)),delete qS[e],i(`error`,t)})}function f(e){return YS(new Promise((t,n)=>{let r=new XMLHttpRequest;r.open(`GET`,e,!0),c.value=r,r.onload=()=>{if(r.status>=200&&r.status<400)try{let e=new DOMParser().parseFromString(r.responseText,`text/xml`).getElementsByTagName(`svg`)[0];e?t(e):n(Error(`Loaded file is not valid SVG"`))}catch(e){n(e)}else n(Error(`Error loading SVG`))},r.onerror=n,r.send()}))}let p=()=>o.value?Jo(`svg`,{...QS(o.value,a),innerHTML:u(o.value),ref:s}):null;function m(e,t){let n=e.getElementsByTagName(`title`);if(n.length)n[0].textContent=t;else{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`title`);n.textContent=t,e.insertBefore(n,e.firstChild)}}function h(e,t,n=``){let r=[`id`,`href`,`xlink:href`,`xlink:role`,`xlink:arcrole`],i=[`href`,`xlink:href`],a=(e,t)=>i.includes(e)&&(t?!t.includes(`#`):!1);return[...e.children].forEach(e=>{var i;if((i=e.attributes)!=null&&i.length){let i=Object.values(e.attributes).map(e=>{let r=/url\((.*?)\)/.exec(e.value);return r!=null&&r[1]&&(e.value=e.value.replace(r[0],`url(${n}${r[1]}_${t})`)),e});r.forEach(e=>{let n=i.find(t=>t.name===e);n&&!a(e,n.value)&&(n.value=`${n.value}_${t}`)})}return e.children.length?h(e,t,n):e}),e}return(e,t)=>(H(),fo(p))}});function eC(e){return typeof e==`function`}function tC(e){return e==null}var nC=e=>e!==null&&!!e&&typeof e==`object`&&!Array.isArray(e);function rC(e){return Number(e)>=0}function iC(e){let t=parseFloat(e);return isNaN(t)?e:t}function aC(e){return typeof e==`object`&&!!e}function oC(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}function sC(e){if(!aC(e)||oC(e)!==`[object Object]`)return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function cC(e,t){return Object.keys(t).forEach(n=>{if(sC(t[n])&&sC(e[n])){e[n]||(e[n]={}),cC(e[n],t[n]);return}e[n]=t[n]}),e}function lC(e){let t=e.split(`.`);if(!t.length)return``;let n=String(t[0]);for(let e=1;e<t.length;e++){if(rC(t[e])){n+=`[${t[e]}]`;continue}n+=`.${t[e]}`}return n}var uC={};function dC(e){return uC[e]}function fC(e,t,n){typeof n.value==`object`&&(n.value=$(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t===`__proto__`?Object.defineProperty(e,t,n):e[t]=n.value}function $(e){if(typeof e!=`object`)return e;var t=0,n,r,i,a=Object.prototype.toString.call(e);if(a===`[object Object]`?i=Object.create(e.__proto__||null):a===`[object Array]`?i=Array(e.length):a===`[object Set]`?(i=new Set,e.forEach(function(e){i.add($(e))})):a===`[object Map]`?(i=new Map,e.forEach(function(e,t){i.set($(t),$(e))})):a===`[object Date]`?i=new Date(+e):a===`[object RegExp]`?i=new RegExp(e.source,e.flags):a===`[object DataView]`?i=new e.constructor($(e.buffer)):a===`[object ArrayBuffer]`?i=e.slice(0):a.slice(-6)===`Array]`&&(i=new e.constructor(e)),i){for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)fC(i,r[t],Object.getOwnPropertyDescriptor(e,r[t]));for(t=0,r=Object.getOwnPropertyNames(e);t<r.length;t++)Object.hasOwnProperty.call(i,n=r[t])&&i[n]===e[n]||fC(i,n,Object.getOwnPropertyDescriptor(e,n))}return i||e}var pC=Symbol(`vee-validate-form`),mC=Symbol(`vee-validate-form-context`),hC=Symbol(`vee-validate-field-instance`),gC=Symbol(`Default empty value`),_C=typeof window<`u`;function vC(e){return eC(e)&&!!e.__locatorRef}function yC(e){return nC(e)&&`~standard`in e}function bC(e){return e===`checkbox`||e===`radio`}function xC(e){return nC(e)||Array.isArray(e)}function SC(e){return Array.isArray(e)?e.length===0:nC(e)&&Object.keys(e).length===0}function CC(e){return/^\[.+\]$/i.test(e)}function wC(e){return TC(e)&&e.multiple}function TC(e){return e.tagName===`SELECT`}function EC(e,t){let n=![!1,null,void 0,0].includes(t.multiple)&&!Number.isNaN(t.multiple);return e===`select`&&`multiple`in t&&n}function DC(e,t){return!EC(e,t)&&t.type!==`file`&&!bC(t.type)}function OC(e){return kC(e)&&e.target&&`submit`in e.target}function kC(e){return e?!!(typeof Event<`u`&&eC(Event)&&e instanceof Event||e&&e.srcElement):!1}function AC(e,t){return t in e&&e[t]!==gC}function jC(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!jC(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!jC(r[1],t.get(r[0])))return!1;return!0}if(NC(e)&&NC(t))return e.size===t.size&&e.name===t.name&&e.lastModified===t.lastModified&&e.type===t.type;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(e=MC(e),t=MC(t),i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){var a=i[r];if(!jC(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function MC(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function NC(e){return _C?e instanceof File:!1}function PC(e){if(e.path?.length){let t=``;for(let n of e.path){let e=typeof n==`object`?n.key:n;if(typeof e==`string`||typeof e==`number`)t+=t?`.${e}`:e;else return null}return t}return null}function FC(e){return CC(e)?e.replace(/\[|\]/gi,``):e}function IC(e,t,n){return e?CC(t)?e[FC(t)]:(t||``).split(/\.|\[(\d+)\]/).filter(Boolean).reduce((e,t)=>xC(e)&&t in e?e[t]:n,e):n}function LC(e,t,n){if(CC(t)){e[FC(t)]=n;return}let r=t.split(/\.|\[(\d+)\]/).filter(Boolean),i=e;for(let e=0;e<r.length;e++){if(e===r.length-1){i[r[e]]=n;return}(!(r[e]in i)||tC(i[r[e]]))&&(i[r[e]]=rC(r[e+1])?[]:{}),i=i[r[e]]}}function RC(e,t){if(Array.isArray(e)&&rC(t)){e.splice(Number(t),1);return}nC(e)&&delete e[t]}function zC(e,t){if(CC(t)){delete e[FC(t)];return}let n=t.split(/\.|\[(\d+)\]/).filter(Boolean),r=e;for(let e=0;e<n.length;e++){if(e===n.length-1){RC(r,n[e]);break}if(!(n[e]in r)||tC(r[n[e]]))break;r=r[n[e]]}let i=n.map((t,r)=>IC(e,n.slice(0,r).join(`.`)));for(let t=i.length-1;t>=0;t--)if(SC(i[t])){if(t===0){RC(e,n[0]);continue}RC(i[t-1],n[t-1])}}function BC(e){return Object.keys(e)}function VC(e,t=void 0){return Mo()?.provides[e]||qn(e,t)}function HC(e,t,n){if(Array.isArray(e)){let n=[...e],r=n.findIndex(e=>jC(e,t));return r>=0?n.splice(r,1):n.push(t),n}return jC(e,t)?n:t}function UC(e,t=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{let t=e(...i);r.forEach(e=>e(t)),r=[]},t),new Promise(e=>r.push(e))}}function WC(e,t){return nC(t)&&t.number?iC(e):e}function GC(e,t){let n;return async function(...r){let i=e(...r);n=i;let a=await i;return i===n?(n=void 0,t(a,r)):a}}function KC(e){return Array.isArray(e)?e:e?[e]:[]}function qC(e,t){let n={};for(let r in e)t.includes(r)||(n[r]=e[r]);return n}function JC(e){let t=null,n=[];return function(...r){let i=jn(()=>{if(t!==i)return;let a=e(...r);n.forEach(e=>e(a)),n=[],t=null});return t=i,new Promise(e=>n.push(e))}}function YC(e,t){let n={};for(let r of e){let e=t(r);n[e]||(n[e]={path:e,messages:[]}),`messages`in r?n[e].messages.push(...r.messages):n[e].messages.push(r.message)}return Object.values(n)}function XC(e){return YC(e,e=>e.path?PC(e)??``:``)}function ZC(e,t,n){return t.slots.default?typeof e==`string`||!e?t.slots.default(n()):{default:()=>{var e;return(e=t.slots).default?.call(e,n())}}:t.slots.default}function QC(e){if($C(e))return e._value}function $C(e){return`_value`in e}function ew(e){return e.type===`range`?Number.isNaN(e.valueAsNumber)?e.value:e.valueAsNumber:e.value}function tw(e){if(!kC(e))return e;let t=e.target;if(bC(t.type)&&$C(t))return QC(t);if(t.type===`file`&&t.files){let e=Array.from(t.files);return t.multiple?e:e[0]}if(wC(t))return Array.from(t.options).filter(e=>e.selected&&!e.disabled).map(QC);if(TC(t)){let e=Array.from(t.options).find(e=>e.selected);return e?QC(e):t.value}return ew(t)}function nw(e){let t={};return Object.defineProperty(t,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),e?nC(e)&&e._$$isNormalized?e:nC(e)?Object.keys(e).reduce((t,n)=>{let r=rw(e[n]);return e[n]!==!1&&(t[n]=iw(r)),t},t):typeof e==`string`?e.split(`|`).reduce((e,t)=>{let n=aw(t);return n.name&&(e[n.name]=iw(n.params)),e},t):t:t}function rw(e){return e===!0?[]:Array.isArray(e)||nC(e)?e:[e]}function iw(e){let t=e=>typeof e==`string`&&e[0]===`@`?ow(e.slice(1)):e;return Array.isArray(e)?e.map(t):e instanceof RegExp?[e]:Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{})}var aw=e=>{let t=[],n=e.split(`:`)[0];return e.includes(`:`)&&(t=e.split(`:`).slice(1).join(`:`).split(`,`)),{name:n,params:t}};function ow(e){let t=t=>IC(t,e)??t[e];return t.__locatorRef=e,t}function sw(e){return Array.isArray(e)?e.filter(vC):BC(e).filter(t=>vC(e[t])).map(t=>e[t])}var cw=Object.assign({},{generateMessage:({field:e})=>`${e} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0}),lw=()=>cw;async function uw(e,t,n={}){let r=n?.bails,i=await dw({name:n?.name||`{field}`,rules:t,label:n?.label,bails:r??!0,formData:n?.values||{}},e);return Object.assign(Object.assign({},i),{valid:!i.errors.length})}async function dw(e,t){let n=e.rules;if(yC(n))return fw(t,Object.assign(Object.assign({},e),{rules:n}));if(eC(n)||Array.isArray(n)){let r={field:e.label||e.name,name:e.name,label:e.label,form:e.formData,value:t},i=Array.isArray(n)?n:[n],a=i.length,o=[];for(let n=0;n<a;n++){let a=i[n],s=await a(t,r);if(typeof s==`string`||Array.isArray(s)||!s){if(Array.isArray(s))o.push(...s);else{let e=typeof s==`string`?s:mw(r);o.push(e)}if(e.bails)return{errors:o}}}return{errors:o}}let r=Object.assign(Object.assign({},e),{rules:nw(n)}),i=[],a=Object.keys(r.rules),o=a.length;for(let n=0;n<o;n++){let o=a[n],s=await pw(r,t,{name:o,params:r.rules[o]});if(s.error&&(i.push(s.error),e.bails))return{errors:i}}return{errors:i}}async function fw(e,t){let n=await t.rules[`~standard`].validate(e);if(!n.issues)return{value:n.value,errors:[]};let r=[];for(let e of n.issues)e.message&&r.push(e.message);return{errors:r}}async function pw(e,t,n){let r=dC(n.name);if(!r)throw Error(`No such validator '${n.name}' exists.`);let i=hw(n.params,e.formData),a={field:e.label||e.name,name:e.name,label:e.label,value:t,form:e.formData,rule:Object.assign(Object.assign({},n),{params:i})},o=await r(t,i,a);return typeof o==`string`?{error:o}:{error:o?void 0:mw(a)}}function mw(e){let t=lw().generateMessage;return t?t(e):`Field is invalid`}function hw(e,t){let n=e=>vC(e)?e(t):e;return Array.isArray(e)?e.map(n):Object.keys(e).reduce((t,r)=>(t[r]=n(e[r]),t),{})}async function gw(e,t){let n=await e[`~standard`].validate($(t)),r={},i={};if(!n.issues)return{valid:!0,results:{},errors:{},values:n.value,source:`schema`};let a=XC(n.issues||[]);for(let e of a){let t=e.messages,n=e.path;r[n]={valid:!t.length,errors:t},t.length&&(i[n]=t[0])}return{valid:!a.length,results:r,errors:i,values:void 0,source:`schema`}}async function _w(e,t,n){let r=BC(e).map(async r=>{let i=n?.names?.[r],a=await uw(IC(t,r),e[r],{name:i?.name||r,label:i?.label,values:t,bails:n?.bailsMap?.[r]??!0});return Object.assign(Object.assign({},a),{path:r})}),i=!0,a=await Promise.all(r),o={},s={};for(let e of a)o[e.path]={valid:e.valid,errors:e.errors},e.valid||(i=!1,s[e.path]=e.errors[0]);return{valid:i,results:o,errors:s,source:`schema`}}var vw=0;function yw(e,t){let{value:n,initialValue:r,setInitialValue:i}=bw(e,t.modelValue,t.form);if(!t.form){let{errors:t,setErrors:a}=Cw(),o=vw>=2**53-1?0:++vw,s=Sw(n,r,t);function c(e){`value`in e&&(n.value=e.value),`errors`in e&&a(e.errors),`touched`in e&&(s.touched=e.touched??s.touched),`initialValue`in e&&i(e.initialValue)}return{id:o,path:e,value:n,initialValue:r,meta:s,flags:{pendingUnmount:{[o]:!1},pendingReset:!1},errors:t,setState:c}}let a=t.form.createPathState(e,{bails:t.bails,label:t.label,type:t.type,validate:t.validate}),o=G(()=>a.errors);function s(r){var a,o;`value`in r&&(n.value=r.value),`errors`in r&&((a=t.form)==null||a.setFieldError(B(e),r.errors)),`touched`in r&&((o=t.form)==null||o.setFieldTouched(B(e),r.touched??!1)),`initialValue`in r&&i(r.initialValue)}return{id:Array.isArray(a.id)?a.id[a.id.length-1]:a.id,path:e,value:n,errors:o,meta:a,initialValue:r,flags:a.__flags,setState:s}}function bw(e,t,n){let r=z(B(t));function i(){return n?IC(n.initialValues.value,B(e),B(r)):B(r)}function a(t){if(!n){r.value=t;return}n.setFieldInitialValue(B(e),t,!0)}let o=G(i);if(!n)return{value:z(i()),initialValue:o,setInitialValue:a};let s=xw(t,n,o,e);return n.stageInitialValue(B(e),s,!0),{value:G({get(){return IC(n.values,B(e))},set(t){n.setFieldValue(B(e),t,!1)}}),initialValue:o,setInitialValue:a}}function xw(e,t,n,r){return Qt(e)?B(e):e===void 0?IC(t.values,B(r),B(n)):e}function Sw(e,t,n){let r=Bt({touched:!1,pending:!1,valid:!0,validated:!!B(n).length,initialValue:G(()=>B(t)),dirty:G(()=>!jC(B(e),B(t)))});return $n(n,e=>{r.valid=!e.length},{immediate:!0,flush:`sync`}),r}function Cw(){let e=z([]);return{errors:e,setErrors:t=>{e.value=KC(t)}}}function ww(e,t,n){return bC(n?.type)?Dw(e,t,n):Tw(e,t,n)}function Tw(e,t,n){let{initialValue:r,validateOnMount:i,bails:a,type:o,checkedValue:s,label:c,validateOnValueUpdate:l,uncheckedValue:u,controlled:d,keepValueOnUnmount:f,syncVModel:p,form:m}=Ew(n),h=d?VC(pC):void 0,g=m||h,v=G(()=>lC(V(e))),y=G(()=>{if(V(g?.schema))return;let e=B(t);return yC(e)||eC(e)||Array.isArray(e)?e:nw(e)}),{id:b,value:x,initialValue:S,meta:C,setState:w,errors:T,flags:E}=yw(v,{modelValue:r,form:g,bails:a,label:c,type:o,validate:y.value?j:void 0}),D=G(()=>T.value[0]);p&&Ow({value:x,prop:p,handleChange:M,shouldValidate:()=>l&&!E.pendingReset});let O=(e,t=!1)=>{C.touched=!0,t&&ee()};async function k(e){if(g?.validateSchema){let{results:t}=await g.validateSchema(e);return t[V(v)]??{valid:!0,errors:[]}}return y.value?uw(x.value,y.value,{name:V(v),label:V(c),values:g?.values??{},bails:a}):{valid:!0,errors:[]}}let ee=GC(async()=>(C.pending=!0,C.validated=!0,k(`validated-only`)),e=>E.pendingUnmount[F.id]?e:(w({errors:e.errors}),C.pending=!1,C.valid=e.valid,e)),A=GC(async()=>k(`silent`),e=>(C.valid=e.valid,e));function j(e){return e?.mode===`silent`?A():ee()}function M(e,t=!0){re(tw(e),t)}$r(()=>{if(i)return ee();(!g||!g.validateSchema)&&A()});function te(e){C.touched=e}function ne(e){let t=e&&`value`in e?e.value:S.value;w({value:$(t),initialValue:$(t),touched:e?.touched??!1,errors:e?.errors||[]}),C.pending=!1,C.validated=!1,A()}let N=Mo();function re(e,t=!0){x.value=N&&p?WC(e,N.props.modelModifiers):e,(t?ee:A)()}function P(e){w({errors:Array.isArray(e)?e:[e]})}let F={id:b,name:v,label:c,value:G({get(){return x.value},set(e){re(e,l)}}),meta:C,errors:T,errorMessage:D,type:o,checkedValue:s,uncheckedValue:u,bails:a,keepValueOnUnmount:f,resetField:ne,handleReset:()=>ne(),validate:j,handleChange:M,handleBlur:O,setState:w,setTouched:te,setErrors:P,setValue:re};return Kn(hC,F),Qt(t)&&typeof B(t)!=`function`&&$n(t,(e,t)=>{jC(e,t)||(C.validated?ee():A())},{deep:!0}),g?($n(G(()=>{let e=y.value;return!e||eC(e)||yC(e)||Array.isArray(e)?{}:Object.keys(e).reduce((t,n)=>{let r=sw(e[n]).map(e=>e.__locatorRef).reduce((e,t)=>{let n=IC(g.values,t)||g.values[t];return n!==void 0&&(e[t]=n),e},{});return Object.assign(t,r),t},{})}),(e,t)=>{Object.keys(e).length&&(jC(e,t)||(C.validated?ee():A()))}),ni(()=>{let e=V(F.keepValueOnUnmount)??V(g.keepValuesOnUnmount),t=V(v);if(e||!g||E.pendingUnmount[F.id]){g?.removePathState(t,b);return}E.pendingUnmount[F.id]=!0;let n=g.getPathState(t);if(Array.isArray(n?.id)&&n?.multiple?n?.id.includes(F.id):n?.id===F.id){if(n?.multiple&&Array.isArray(n.value)){let e=n.value.findIndex(e=>jC(e,V(F.checkedValue)));if(e>-1){let r=[...n.value];r.splice(e,1),g.setFieldValue(t,r)}Array.isArray(n.id)&&n.id.splice(n.id.indexOf(F.id),1)}else g.unsetPathValue(V(v));g.removePathState(t,b)}}),F):F}function Ew(e){let t=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!e?.syncVModel,r=typeof e?.syncVModel==`string`?e.syncVModel:`modelValue`,i=n&&!(`initialValue`in(e||{}))?kw(Mo(),r):e?.initialValue;if(!e)return Object.assign(Object.assign({},t()),{initialValue:i});let a=e.controlled??!0,o=e?.syncVModel||!1;return Object.assign(Object.assign(Object.assign({},t()),e||{}),{initialValue:i,controlled:a??!0,checkedValue:e?.checkedValue,syncVModel:o})}function Dw(e,t,n){let r=n?.controlled?VC(pC):void 0,i=n?.checkedValue,a=n?.uncheckedValue;function o(t){let o=t.handleChange,s=G(()=>{let e=V(t.value),n=V(i);return Array.isArray(e)?e.findIndex(e=>jC(e,n))>=0:jC(n,e)});function c(c,l=!0){if(s.value===c?.target?.checked){l&&t.validate();return}let u=V(e),d=r?.getPathState(u),f=tw(c),p=V(i)??f;r&&d?.multiple&&d.type===`checkbox`?p=HC(IC(r.values,u)||[],p,void 0):n?.type===`checkbox`&&(p=HC(V(t.value),p,V(a))),o(p,l)}return Object.assign(Object.assign({},t),{checked:s,checkedValue:i,uncheckedValue:a,handleChange:c})}return o(Tw(e,t,n))}function Ow({prop:e,value:t,handleChange:n,shouldValidate:r}){let i=Mo();if(!i||!e)return;let a=typeof e==`string`?e:`modelValue`,o=`update:${a}`;a in i.props&&($n(t,e=>{jC(e,kw(i,a))||i.emit(o,e)}),$n(()=>kw(i,a),e=>{if(e===gC&&t.value===void 0)return;let i=e===gC?void 0:e;jC(i,t.value)||n(i,r())}))}function kw(e,t){if(e)return e.props[t]}var Aw=Mr({name:`Field`,inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>lw().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:gC},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},controlled:{type:Boolean,default:!0},keepValue:{type:Boolean,default:void 0}},setup(e,t){let n=un(e,`rules`),r=un(e,`name`),i=un(e,`label`),a=un(e,`uncheckedValue`),o=un(e,`keepValue`),{errors:s,value:c,errorMessage:l,validate:u,handleChange:d,handleBlur:f,setTouched:p,resetField:m,handleReset:h,meta:g,checked:v,setErrors:y,setValue:b}=ww(r,n,{validateOnMount:e.validateOnMount,bails:e.bails,controlled:e.controlled,type:t.attrs.type,initialValue:Nw(e,t),checkedValue:t.attrs.value,uncheckedValue:a,label:i,validateOnValueUpdate:e.validateOnModelUpdate,keepValueOnUnmount:o,syncVModel:!0}),x=function(e,t=!0){d(e,t)},S=G(()=>{let{validateOnInput:n,validateOnChange:r,validateOnBlur:i,validateOnModelUpdate:a}=Mw(e);function o(e){f(e,i),eC(t.attrs.onBlur)&&t.attrs.onBlur(e)}function s(e){x(e,n),eC(t.attrs.onInput)&&t.attrs.onInput(e)}function c(e){x(e,r),eC(t.attrs.onChange)&&t.attrs.onChange(e)}let l={name:e.name,onBlur:o,onInput:s,onChange:c};return l[`onUpdate:modelValue`]=e=>x(e,a),l}),C=G(()=>{let n=Object.assign({},S.value);return bC(t.attrs.type)&&v&&(n.checked=v.value),DC(jw(e,t),t.attrs)&&(n.value=c.value),n}),w=G(()=>Object.assign(Object.assign({},S.value),{modelValue:c.value}));function T(){return{field:C.value,componentField:w.value,value:c.value,meta:g,errors:s.value,errorMessage:l.value,validate:u,resetField:m,handleChange:x,handleInput:e=>x(e,!1),handleReset:h,handleBlur:S.value.onBlur,setTouched:p,setErrors:y,setValue:b}}return t.expose({value:c,meta:g,errors:s,errorMessage:l,setErrors:y,setTouched:p,setValue:b,reset:m,validate:u,handleChange:d}),()=>{let n=fi(jw(e,t)),r=ZC(n,t,T);return n?Jo(n,Object.assign(Object.assign({},t.attrs),C.value),r):r}}});function jw(e,t){let n=e.as||``;return!e.as&&!t.slots.default&&(n=`input`),n}function Mw(e){let{validateOnInput:t,validateOnChange:n,validateOnBlur:r,validateOnModelUpdate:i}=lw();return{validateOnInput:e.validateOnInput??t,validateOnChange:e.validateOnChange??n,validateOnBlur:e.validateOnBlur??r,validateOnModelUpdate:e.validateOnModelUpdate??i}}function Nw(e,t){return bC(t.attrs.type)?AC(e,`modelValue`)?e.modelValue:void 0:AC(e,`modelValue`)?e.modelValue:t.attrs.value}var Pw=Aw,Fw=0,Iw=[`bails`,`fieldsCount`,`id`,`multiple`,`type`,`validate`];function Lw(e){let t=e?.initialValues||{};return $(Object.assign({},V(t)))}function Rw(e){let t=Fw++,n=e?.name||`Form`,r=0,i=z(!1),a=z(!1),o=z(0),s=[],c=Bt(Lw(e)),l=z([]),u=z({}),d=z({}),f=JC(()=>{d.value=l.value.reduce((e,t)=>(e[lC(V(t.path))]=t,e),{})});function p(e,t){let n=M(e);if(!n){typeof e==`string`&&(u.value[lC(e)]=KC(t));return}if(typeof e==`string`){let t=lC(e);u.value[t]&&delete u.value[t]}n.errors=KC(t),n.valid=!n.errors.length}function m(e){BC(e).forEach(t=>{p(t,e[t])})}e?.initialErrors&&m(e.initialErrors);let h=G(()=>{let e=l.value.reduce((e,t)=>(t.errors.length&&(e[V(t.path)]=t.errors),e),{});return Object.assign(Object.assign({},u.value),e)}),g=G(()=>BC(h.value).reduce((e,t)=>{let n=h.value[t];return n?.length&&(e[t]=n[0]),e},{})),v=G(()=>l.value.reduce((e,t)=>(e[V(t.path)]={name:V(t.path)||``,label:t.label||``},e),{})),y=G(()=>l.value.reduce((e,t)=>(e[V(t.path)]=t.bails??!0,e),{})),b=Object.assign({},e?.initialErrors||{}),x=e?.keepValuesOnUnmount??!1,{initialValues:S,originalInitialValues:C,setInitialValues:w}=Bw(l,c,e),T=zw(l,c,C,g),E=G(()=>l.value.reduce((e,t)=>{let n=IC(c,V(t.path));return LC(e,V(t.path),n),e},{})),D=e?.validationSchema;function O(e,t){let n=G(()=>IC(S.value,V(e))),i=d.value[V(e)],a=t?.type===`checkbox`||t?.type===`radio`;if(i&&a){i.multiple=!0;let e=r++;return Array.isArray(i.id)?i.id.push(e):i.id=[i.id,e],i.fieldsCount++,i.__flags.pendingUnmount[e]=!1,i}let o=G(()=>IC(c,V(e))),s=V(e),u=ne.findIndex(e=>e===s);u!==-1&&ne.splice(u,1);let p=r++,m=Bt({id:p,path:e,touched:!1,pending:!1,valid:!0,validated:!!b[s]?.length,initialValue:n,errors:$t([]),bails:t?.bails??!1,label:t?.label,type:t?.type||`default`,value:o,multiple:!1,__flags:{pendingUnmount:{[p]:!1},pendingReset:!1},fieldsCount:1,validate:t?.validate,dirty:G(()=>!jC(B(o),B(n)))});return l.value.push(m),d.value[s]=m,f(),g.value[s]&&!b[s]&&jn(()=>{ve(s,{mode:`silent`})}),Qt(e)&&$n(e,e=>{f();let t=$(o.value);d.value[e]=m,jn(()=>{LC(c,e,t)})}),m}let k=UC(Se,5),ee=UC(Se,5),A=GC(async e=>await(e===`silent`?k():ee()),(e,[t])=>{let n=BC(ae.errorBag.value),r=[...new Set([...BC(e.results),...l.value.map(e=>e.path),...n])].sort().reduce((n,r)=>{let i=r,a=M(i)||te(i),o=e.results[i]?.errors||[],s=V(a?.path)||i,c=Vw({errors:o,valid:!o.length},n.results[s]);return n.results[s]=c,c.valid||(n.errors[s]=c.errors[0]),a&&u.value[s]&&delete u.value[s],a?(a.valid=c.valid,t===`silent`||t===`validated-only`&&!a.validated||p(a,c.errors),n):(p(s,o),n)},{valid:e.valid,results:{},errors:{},source:e.source});return e.values&&(r.values=e.values,r.source=e.source),BC(r.results).forEach(e=>{let n=M(e);n&&t!==`silent`&&(t!==`validated-only`||n.validated)&&p(n,r.results[e]?.errors)}),r});function j(e){l.value.forEach(e)}function M(e){let t=typeof e==`string`?lC(e):e;return typeof t==`string`?d.value[t]:t}function te(e){return l.value.filter(t=>e.startsWith(V(t.path))).reduce((e,t)=>e?t.path.length>e.path.length?t:e:t,void 0)}let ne=[],N;function re(e){return ne.push(e),N||=jn(()=>{[...ne].sort().reverse().forEach(e=>{zC(c,e)}),ne=[],N=null}),N}function P(e){return function(t,n){return function(r){return r instanceof Event&&(r.preventDefault(),r.stopPropagation()),j(e=>e.touched=!0),i.value=!0,o.value++,_e().then(i=>{let a=$(c);if(i.valid&&typeof t==`function`){let n=$(E.value),o=e?n:a;return i.values&&(o=i.source===`schema`?i.values:Object.assign({},o,i.values)),t(o,{evt:r,controlledValues:n,setErrors:m,setFieldError:p,setTouched:me,setFieldTouched:ue,setValues:ce,setFieldValue:oe,resetForm:ge,resetField:he})}!i.valid&&typeof n==`function`&&n({values:a,evt:r,errors:i.errors,results:i.results})}).then(e=>(i.value=!1,e),e=>{throw i.value=!1,e})}}}let F=P(!1);F.withControlled=P(!0);function ie(e,t){let n=l.value.findIndex(n=>n.path===e&&(Array.isArray(n.id)?n.id.includes(t):n.id===t)),r=l.value[n];if(n!==-1&&r){if(jn(()=>{ve(e,{mode:`silent`,warn:!1})}),r.multiple&&r.fieldsCount&&r.fieldsCount--,Array.isArray(r.id)){let e=r.id.indexOf(t);e>=0&&r.id.splice(e,1),delete r.__flags.pendingUnmount[t]}(!r.multiple||r.fieldsCount<=0)&&(l.value.splice(n,1),ye(e),f(),delete d.value[e])}}function I(e){BC(d.value).forEach(t=>{t.startsWith(e)&&delete d.value[t]}),l.value=l.value.filter(t=>!t.path.startsWith(e)),jn(()=>{f()})}let ae={name:n,formId:t,values:c,controlledValues:E,errorBag:h,errors:g,schema:D,submitCount:o,meta:T,isSubmitting:i,isValidating:a,fieldArrays:s,keepValuesOnUnmount:x,validateSchema:B(D)?A:void 0,validate:_e,setFieldError:p,validateField:ve,setFieldValue:oe,setValues:ce,setErrors:m,setFieldTouched:ue,setTouched:me,resetForm:ge,resetField:he,handleSubmit:F,defineField:we,stageInitialValue:be,unsetInitialValue:ye,setFieldInitialValue:xe,createPathState:O,getPathState:M,unsetPathValue:re,removePathState:ie,initialValues:S,getAllPathStates:()=>l.value,destroyPath:I,isFieldTouched:de,isFieldDirty:fe,isFieldValid:pe};function oe(e,t,n=!0){let r=$(t),i=typeof e==`string`?e:e.path;M(i)||O(i),LC(c,i,r),n&&ve(i)}function se(e,t=!0){BC(c).forEach(e=>{delete c[e]}),BC(e).forEach(t=>{oe(t,e[t],!1)}),t&&_e()}function ce(e,t=!0){cC(c,e),s.forEach(e=>e&&e.reset()),t&&_e()}function le(e,t){let n=M(V(e))||O(e);return G({get(){return n.value},set(n){oe(V(e),n,V(t)??!1)}})}function ue(e,t){let n=M(e);n&&(n.touched=t)}function de(e){let t=M(e);return t?t.touched:l.value.filter(t=>t.path.startsWith(e)).some(e=>e.touched)}function fe(e){let t=M(e);return t?t.dirty:l.value.filter(t=>t.path.startsWith(e)).some(e=>e.dirty)}function pe(e){let t=M(e);return t?t.valid:l.value.filter(t=>t.path.startsWith(e)).every(e=>e.valid)}function me(e){if(typeof e==`boolean`){j(t=>{t.touched=e});return}BC(e).forEach(t=>{ue(t,!!e[t])})}function he(e,t){let n=t&&`value`in t?t.value:IC(S.value,e),r=M(e);r&&(r.__flags.pendingReset=!0),xe(e,$(n),!0),oe(e,n,!1),ue(e,t?.touched??!1),p(e,t?.errors||[]),jn(()=>{r&&(r.__flags.pendingReset=!1)})}function ge(e,t){let n=$(e?.values?e.values:C.value);n=t?.force?n:cC(C.value,n),w(n,{force:t?.force}),j(t=>{t.__flags.pendingReset=!0,t.validated=!1,t.touched=e?.touched?.[V(t.path)]||!1,oe(V(t.path),IC(n,V(t.path)),!1),p(V(t.path),void 0)}),t?.force?se(n,!1):ce(n,!1),m(e?.errors||{}),o.value=e?.submitCount||0,jn(()=>{_e({mode:`silent`}),j(e=>{e.__flags.pendingReset=!1})})}async function _e(e){let t=e?.mode||`force`;if(t===`force`&&j(e=>e.validated=!0),ae.validateSchema)return ae.validateSchema(t);a.value=!0;let n=await Promise.all(l.value.map(t=>t.validate?t.validate(e).then(e=>({key:V(t.path),valid:e.valid,errors:e.errors,value:e.value})):Promise.resolve({key:V(t.path),valid:!0,errors:[],value:void 0})));a.value=!1;let r={},i={},o={};for(let e of n)r[e.key]={valid:e.valid,errors:e.errors},e.value&&LC(o,e.key,e.value),e.errors.length&&(i[e.key]=e.errors[0]);return{valid:n.every(e=>e.valid),results:r,errors:i,values:o,source:`fields`}}async function ve(e,t){let n=M(e);if(n&&t?.mode!==`silent`&&(n.validated=!0),D){let{results:n}=await A(t?.mode||`validated-only`);return n[e]||{errors:[],valid:!0}}return n?.validate?n.validate(t):(!n&&t?.warn,Promise.resolve({errors:[],valid:!0}))}function ye(e){zC(S.value,e)}function be(t,n,r=!1){xe(t,n),LC(c,t,n),r&&!e?.initialValues&&LC(C.value,t,$(n))}function xe(e,t,n=!1){LC(S.value,e,$(t)),n&&LC(C.value,e,$(t))}async function Se(){let e=B(D);if(!e)return{valid:!0,results:{},errors:{},source:`none`};a.value=!0;let t=yC(e)?await gw(e,c):await _w(e,c,{names:v.value,bailsMap:y.value});return a.value=!1,t}let Ce=F((e,{evt:t})=>{OC(t)&&t.target.submit()});$r(()=>{if(e?.initialErrors&&m(e.initialErrors),e?.initialTouched&&me(e.initialTouched),e?.validateOnMount){_e();return}ae.validateSchema&&ae.validateSchema(`silent`)}),Qt(D)&&$n(D,()=>{var e;(e=ae.validateSchema)==null||e.call(ae,`validated-only`)}),Kn(pC,ae);function we(e,t){let n=eC(t)?void 0:t?.label,r=M(V(e))||O(e,{label:n}),i=()=>eC(t)?t(qC(r,Iw)):t||{};function a(){r.touched=!0,(i().validateOnBlur??lw().validateOnBlur)&&ve(V(r.path))}function o(){(i().validateOnInput??lw().validateOnInput)&&jn(()=>{ve(V(r.path))})}function s(){(i().validateOnChange??lw().validateOnChange)&&jn(()=>{ve(V(r.path))})}let c=G(()=>{let e={onChange:s,onInput:o,onBlur:a};return eC(t)?Object.assign(Object.assign({},e),t(qC(r,Iw)).props||{}):t?.props?Object.assign(Object.assign({},e),t.props(qC(r,Iw))):e});return[le(e,()=>i().validateOnModelUpdate??lw()?.validateOnModelUpdate??!0),c]}let Te=Object.assign(Object.assign({},ae),{values:Ht(c),handleReset:()=>ge(),submitForm:Ce});return Kn(mC,Te),Te}function zw(e,t,n,r){let i={touched:`some`,pending:`some`,valid:`every`},a=G(()=>!jC(t,B(n)));function o(){let t=e.value;return BC(i).reduce((e,n)=>{let r=i[n];return e[n]=t[r](e=>e[n]),e},{})}let s=Bt(o());return Zn(()=>{let e=o();s.touched=e.touched,s.valid=e.valid,s.pending=e.pending}),G(()=>Object.assign(Object.assign({initialValues:B(n)},s),{valid:s.valid&&!BC(r.value).length,dirty:a.value}))}function Bw(e,t,n){let r=Lw(n),i=z(r),a=z($(r));function o(n,r){r?.force?(i.value=$(n),a.value=$(n)):(i.value=cC($(i.value)||{},$(n)),a.value=cC($(a.value)||{},$(n))),r?.updateFields&&e.value.forEach(e=>{if(e.touched)return;let n=IC(i.value,V(e.path));LC(t,V(e.path),$(n))})}return{initialValues:i,originalInitialValues:a,setInitialValues:o}}function Vw(e,t){return t?{valid:e.valid&&t.valid,errors:[...e.errors,...t.errors]}:e}var Hw=Mr({name:`Form`,inheritAttrs:!1,props:{as:{type:null,default:`form`},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1},name:{type:String,default:`Form`}},setup(e,t){let n=un(e,`validationSchema`),r=un(e,`keepValues`),{errors:i,errorBag:a,values:o,meta:s,isSubmitting:c,isValidating:l,submitCount:u,controlledValues:d,validate:f,validateField:p,handleReset:m,resetForm:h,handleSubmit:g,setErrors:v,setFieldError:y,setFieldValue:b,setValues:x,setFieldTouched:S,setTouched:C,resetField:w}=Rw({validationSchema:n.value?n:void 0,initialValues:e.initialValues,initialErrors:e.initialErrors,initialTouched:e.initialTouched,validateOnMount:e.validateOnMount,keepValuesOnUnmount:r,name:e.name}),T=g((e,{evt:t})=>{OC(t)&&t.target.submit()},e.onInvalidSubmit),E=e.onSubmit?g(e.onSubmit,e.onInvalidSubmit):T;function D(e){kC(e)&&e.preventDefault(),m(),typeof t.attrs.onReset==`function`&&t.attrs.onReset()}function O(t,n){return g(typeof t==`function`&&!n?t:n,e.onInvalidSubmit)(t)}function k(){return $(o)}function ee(){return $(s.value)}function A(){return $(i.value)}function j(){return{meta:s.value,errors:i.value,errorBag:a.value,values:o,isSubmitting:c.value,isValidating:l.value,submitCount:u.value,controlledValues:d.value,validate:f,validateField:p,handleSubmit:O,handleReset:m,submitForm:T,setErrors:v,setFieldError:y,setFieldValue:b,setValues:x,setFieldTouched:S,setTouched:C,resetForm:h,resetField:w,getValues:k,getMeta:ee,getErrors:A}}return t.expose({setFieldError:y,setErrors:v,setFieldValue:b,setValues:x,setFieldTouched:S,setTouched:C,resetForm:h,validate:f,validateField:p,resetField:w,getValues:k,getMeta:ee,getErrors:A,values:o,meta:s,errors:i}),function(){let n=e.as===`form`?e.as:e.as?fi(e.as):null,r=ZC(n,t,j);return n?Jo(n,Object.assign(Object.assign(Object.assign({},n===`form`?{novalidate:!0}:{}),t.attrs),{onSubmit:E,onReset:D}),r):r}}}),Uw=Mr({name:`ErrorMessage`,props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(e,t){let n=qn(pC,void 0),r=G(()=>n?.errors.value[e.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;let n=e.as?fi(e.as):e.as,a=ZC(n,t,i),o=Object.assign({role:`alert`},t.attrs);return!n&&(Array.isArray(a)||!a)&&a?.length?a:(Array.isArray(a)||!a)&&!a?.length?Jo(n||`span`,o,r.value):Jo(n,o,a)}}}),Ww={accept:`Ja`,addRule:`Regel hinzufügen`,am:`am`,apply:`Übernehmen`,cancel:`Abbrechen`,choose:`Auswählen`,chooseDate:`Datum wählen`,chooseMonth:`Monat wählen`,chooseYear:`Jahr wählen`,clear:`Löschen`,completed:`Abgeschlossen`,contains:`Enthält`,custom:`Benutzerdefiniert`,dateAfter:`Datum ist nach`,dateBefore:`Datum ist vor`,dateFormat:`dd.mm.yy`,dateIs:`Datum ist`,dateIsNot:`Datum ist nicht`,dayNames:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`],dayNamesMin:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],dayNamesShort:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],emptyFilterMessage:`Keine Ergebnisse gefunden`,emptyMessage:`Keine Einträge gefunden`,emptySearchMessage:`Keine Ergebnisse gefunden`,emptySelectionMessage:`Kein ausgewähltes Element`,endsWith:`Endet mit`,equals:`Ist gleich`,fileChosenMessage:`{0} Dateien`,fileSizeTypes:[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],filter:`Filtern`,firstDayOfWeek:1,gt:`Größer als`,gte:`Größer oder gleich`,lt:`Kleiner als`,lte:`Kleiner oder gleich`,matchAll:`Trifft auf alle zu`,matchAny:`Trifft auf einige zu`,medium:`Mittel`,monthNames:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`],monthNamesShort:[`Jan`,`Feb`,`Mär`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Dez`],nextDecade:`Nächstes Jahrzehnt`,nextHour:`Nächste Stunde`,nextMinute:`Nächste Minute`,nextMonth:`Nächster Monat`,nextSecond:`Nächste Sekunde`,nextYear:`Nächstes Jahr`,noFileChosenMessage:`Keine Datei ausgewählt`,noFilter:`Kein Filter`,notContains:`Enthält nicht`,notEquals:`Ist ungleich`,now:`Jetzt`,passwordPrompt:`Passwort eingeben`,pending:`Ausstehend`,pm:`pm`,prevDecade:`Vorheriges Jahrzehnt`,prevHour:`Vorherige Stunde`,prevMinute:`Vorherige Minute`,prevMonth:`Vorheriger Monat`,prevSecond:`Vorherige Sekunde`,prevYear:`Vorheriges Jahr`,reject:`Nein`,removeRule:`Regel entfernen`,searchMessage:`{0} Ergebnisse verfügbar`,selectionMessage:`{0} Elemente ausgewählt`,showMonthAfterYear:!1,startsWith:`Beginnt mit`,strong:`Stark`,today:`Heute`,upload:`Hochladen`,weak:`Schwach`,weekHeader:`KW`,aria:{cancelEdit:`Änderungen abbrechen`,close:`Schließen`,collapseLabel:`Einklappen`,collapseRow:`Zeile reduziert`,editRow:`Zeile bearbeiten`,expandLabel:`Ausklappen`,expandRow:`Zeile erweitert`,falseLabel:`Falsch`,filterConstraint:`Filterbeschränkung`,filterOperator:`Filteroperator`,firstPageLabel:`Erste Seite`,gridView:`Rasteransicht`,hideFilterMenu:`Filtermenü ausblenden`,jumpToPageDropdownLabel:`Zum Dropdown-Menü springen`,jumpToPageInputLabel:`Zum Eingabefeld springen`,lastPageLabel:`Letzte Seite`,listLabel:`Optionsliste`,listView:`Listenansicht`,maximizeLabel:`Maximieren`,minimizeLabel:`Minimieren`,moveAllToSource:`Alle zur Quelle bewegen`,moveAllToTarget:`Alle zum Ziel bewegen`,moveBottom:`Zum Ende bewegen`,moveDown:`Nach unten bewegen`,moveTop:`Zum Anfang bewegen`,moveToSource:`Zur Quelle bewegen`,moveToTarget:`Zum Ziel bewegen`,moveUp:`Nach oben bewegen`,navigation:`Navigation`,next:`Nächste`,nextPageLabel:`Nächste Seite`,nullLabel:`Nicht ausgewählt`,otpLabel:`Bitte geben Sie das Einmalkennwortzeichen {0} ein.`,pageLabel:`Seite {page}`,passwordHide:`Passwort verbergen`,passwordShow:`Passwort anzeigen`,previous:`Vorherige`,prevPageLabel:`Vorherige Seite`,removeLabel:`Entfernen`,rotateLeft:`Nach links drehen`,rotateRight:`Nach rechts drehen`,rowsPerPageLabel:`Zeilen pro Seite`,saveEdit:`Änderungen speichern`,scrollTop:`Nach oben scrollen`,selectAll:`Alle Elemente ausgewählt`,selectColor:`Wählen Sie eine Farbe`,selectLabel:`Auswählen`,selectRow:`Zeile ausgewählt`,showFilterMenu:`Filtermenü anzeigen`,slide:`Folie`,slideNumber:`{slideNumber}`,star:`1 Stern`,stars:`{star} Sterne`,trueLabel:`Wahr`,unselectAll:`Alle Elemente abgewählt`,unselectLabel:`Auswahl aufheben`,unselectRow:`Zeile abgewählt`,zoomImage:`Bild vergrößern`,zoomIn:`Vergrößern`,zoomOut:`Verkleinern`}},Gw={accept:`Yes`,addRule:`Add Rule`,am:`AM`,apply:`Apply`,cancel:`Cancel`,choose:`Choose`,chooseDate:`Choose Date`,chooseMonth:`Choose Month`,chooseYear:`Choose Year`,clear:`Clear`,completed:`Completed`,contains:`Contains`,custom:`Custom`,dateAfter:`Date is after`,dateBefore:`Date is before`,dateFormat:`mm/dd/yy`,dateIs:`Date is`,dateIsNot:`Date is not`,dayNames:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],dayNamesMin:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],dayNamesShort:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],emptyFilterMessage:`No results found`,emptyMessage:`No available options`,emptySearchMessage:`No results found`,emptySelectionMessage:`No selected item`,endsWith:`Ends with`,equals:`Equals`,fileChosenMessage:`{0} files`,fileSizeTypes:[`B`,`KB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],filter:`Filter`,firstDayOfWeek:0,gt:`Greater than`,gte:`Greater than or equal to`,lt:`Less than`,lte:`Less than or equal to`,matchAll:`Match All`,matchAny:`Match Any`,medium:`Medium`,monthNames:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthNamesShort:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],nextDecade:`Next Decade`,nextHour:`Next Hour`,nextMinute:`Next Minute`,nextMonth:`Next Month`,nextSecond:`Next Second`,nextYear:`Next Year`,noFileChosenMessage:`No file chosen`,noFilter:`No Filter`,notContains:`Not contains`,notEquals:`Not equals`,now:`Now`,passwordPrompt:`Enter a password`,pending:`Pending`,pm:`PM`,prevDecade:`Previous Decade`,prevHour:`Previous Hour`,prevMinute:`Previous Minute`,prevMonth:`Previous Month`,prevSecond:`Previous Second`,prevYear:`Previous Year`,reject:`No`,removeRule:`Remove Rule`,searchMessage:`{0} results are available`,selectionMessage:`{0} items selected`,showMonthAfterYear:!1,startsWith:`Starts with`,strong:`Strong`,today:`Today`,upload:`Upload`,weak:`Weak`,weekHeader:`Wk`,aria:{cancelEdit:`Cancel Edit`,close:`Close`,collapseLabel:`Collapse`,collapseRow:`Row Collapsed`,editRow:`Edit Row`,expandLabel:`Expand`,expandRow:`Row Expanded`,falseLabel:`False`,filterConstraint:`Filter Constraint`,filterOperator:`Filter Operator`,firstPageLabel:`First Page`,gridView:`Grid View`,hideFilterMenu:`Hide Filter Menu`,jumpToPageDropdownLabel:`Jump to Page Dropdown`,jumpToPageInputLabel:`Jump to Page Input`,lastPageLabel:`Last Page`,listLabel:`Option List`,listView:`List View`,maximizeLabel:`Maximize`,minimizeLabel:`Minimize`,moveAllToSource:`Move All to Source`,moveAllToTarget:`Move All to Target`,moveBottom:`Move Bottom`,moveDown:`Move Down`,moveToSource:`Move to Source`,moveToTarget:`Move to Target`,moveTop:`Move Top`,moveUp:`Move Up`,navigation:`Navigation`,next:`Next`,nextPageLabel:`Next Page`,nullLabel:`Not Selected`,otpLabel:`Please enter one time password character {0}`,pageLabel:`Page {page}`,passwordHide:`Hide Password`,passwordShow:`Show Password`,prevPageLabel:`Previous Page`,previous:`Previous`,removeLabel:`Remove`,rotateLeft:`Rotate Left`,rotateRight:`Rotate Right`,rowsPerPageLabel:`Rows per page`,saveEdit:`Save Edit`,scrollTop:`Scroll Top`,selectAll:`All items selected`,selectColor:`Select a color`,selectLabel:`Select`,selectRow:`Row Selected`,showFilterMenu:`Show Filter Menu`,slide:`Slide`,slideNumber:`{slideNumber}`,star:`1 star`,stars:`{star} stars`,trueLabel:`True`,unselectAll:`All items unselected`,unselectLabel:`Unselect`,unselectRow:`Row Unselected`,zoomImage:`Zoom Image`,zoomIn:`Zoom In`,zoomOut:`Zoom Out`}},Kw={};function qw(e){let t=Kw[e];if(t)return t;t=Kw[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function Jw(e,t){typeof t!=`string`&&(t=Jw.defaultChars);let n=qw(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;t+=e<128?`��`:String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;t+=e<2048||e>=55296&&e<=57343?`���`:String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}Jw.defaultChars=`;/?:@&=+$,#`,Jw.componentChars=``;var Yw={};function Xw(e){let t=Yw[e];if(t)return t;t=Yw[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Zw(e,t,n){typeof t!=`string`&&(n=t,t=Zw.defaultChars),n===void 0&&(n=!0);let r=Xw(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}Zw.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Zw.componentChars=`-_.!~*'()`;function Qw(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function $w(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var eT=/^([a-z0-9.+-]+:)/i,tT=/:[0-9]*$/,nT=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,rT=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
12
+ `,` `],iT=[`/`,`?`,`#`],aT=255,oT=/^[+a-z0-9A-Z_-]{0,63}$/,sT=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,cT={javascript:!0,"javascript:":!0},lT={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function uT(e,t){if(e&&e instanceof $w)return e;let n=new $w;return n.parse(e,t),n}$w.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=nT.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=eT.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&cT[o])&&(a=a.substr(2),this.slashes=!0)),!cT[o]&&(i||o&&!lT[o])){let e=-1;for(let t=0;t<iT.length;t++)r=a.indexOf(iT[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<rT.length;t++)r=a.indexOf(rT[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(oT)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(oT)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(sT);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>aT&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),lT[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},$w.prototype.parseHost=function(e){let t=tT.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var dT=e({decode:()=>Jw,encode:()=>Zw,format:()=>Qw,parse:()=>uT}),fT=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function pT(e){return e>=55296&&e<=57343||e>1114111?65533:fT.get(e)??e}function mT(e){let t=atob(e),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return r}var hT=mT(`QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2x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AABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg`),gT;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(gT||={});var _T;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(_T||={});var vT=32;function yT(e){return e>=_T.ZERO&&e<=_T.NINE}function bT(e){return e>=_T.UPPER_A&&e<=_T.UPPER_F||e>=_T.LOWER_A&&e<=_T.LOWER_F}function xT(e){return e>=_T.UPPER_A&&e<=_T.UPPER_Z||e>=_T.LOWER_A&&e<=_T.LOWER_Z||yT(e)}function ST(e){return e===_T.EQUALS||xT(e)}var CT;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(CT||={});var wT;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(wT||={});var TT=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=CT.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=wT.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=CT.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case CT.EntityStart:return e.charCodeAt(t)===_T.NUM?(this.state=CT.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=CT.NamedEntity,this.stateNamedEntity(e,t));case CT.NumericStart:return this.stateNumericStart(e,t);case CT.NumericDecimal:return this.stateNumericDecimal(e,t);case CT.NumericHex:return this.stateNumericHex(e,t);case CT.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|vT)===_T.LOWER_X?(this.state=CT.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=CT.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(yT(n)||bT(n)){let e=n<=_T.NINE?n-_T.ZERO:(n|vT)-_T.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(yT(n))this.result=this.result*10+(n-_T.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){if(this.consumed<=t)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===_T.SEMI)this.consumed+=1;else if(this.decodeMode===wT.Strict)return 0;return this.emitCodePoint(pT(this.result),this.consumed),this.errors&&(e!==_T.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&gT.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&gT.FLAG13)!==0){let a=(r&gT.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&gT.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],i=(r&gT.VALUE_LENGTH)>>14}if(t>=e.length)break;let a=e.charCodeAt(t);if(a===_T.SEMI&&i!==0&&(r&gT.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=DT(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===wT.Attribute&&(i===0||ST(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&gT.VALUE_LENGTH)>>14,i!==0){if(a===_T.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==wT.Strict&&(r&gT.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){let{result:e,decodeTree:t}=this,n=(t[e]&gT.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(gT.VALUE_LENGTH|gT.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){switch(this.state){case CT.NamedEntity:return this.result!==0&&(this.decodeMode!==wT.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case CT.NumericDecimal:return this.emitNumericEntity(0,2);case CT.NumericHex:return this.emitNumericEntity(0,3);case CT.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case CT.EntityStart:return 0}}};function ET(e){let t=``,n=new TT(e,e=>t+=String.fromCodePoint(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function DT(e,t,n,r){let i=(t&gT.BRANCH_LENGTH)>>7,a=t&gT.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=i+1>>1,s=0,c=i-1;for(;s<=c;){let t=s+c>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)s=t+1;else if(i>r)c=t-1;else return e[n+o+t]}return-1}var OT=ET(hT);function kT(e){return OT(e,wT.Strict)}var AT=2147483647,jT=36,MT=1,NT=26,PT=38,FT=700,IT=72,LT=128,RT=`-`,zT=/^xn--/,BT=/[^\0-\x7F]/,VT=/[\x2E\u3002\uFF0E\uFF61]/g,HT={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},UT=35,WT=Math.floor,GT=String.fromCharCode;function KT(e){throw RangeError(HT[e])}function qT(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function JT(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(VT,`.`);let i=qT(e.split(`.`),t).join(`.`);return r+i}function YT(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var XT=e=>String.fromCodePoint(...e),ZT=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:jT},QT=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},$T=function(e,t,n){let r=0;for(e=n?WT(e/FT):e>>1,e+=WT(e/t);e>455;r+=jT)e=WT(e/UT);return WT(r+36*e/(e+PT))},eE=function(e){let t=[],n=e.length,r=0,i=LT,a=IT,o=e.lastIndexOf(RT);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&KT(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=jT;;i+=jT){s>=n&&KT(`invalid-input`);let o=ZT(e.charCodeAt(s++));o>=jT&&KT(`invalid-input`),o>WT((AT-r)/t)&&KT(`overflow`),r+=o*t;let c=i<=a?MT:i>=a+NT?NT:i-a;if(o<c)break;let l=jT-c;t>WT(AT/l)&&KT(`overflow`),t*=l}let c=t.length+1;a=$T(r-o,c,o==0),WT(r/c)>AT-i&&KT(`overflow`),i+=WT(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},tE=function(e){let t=[];e=YT(e);let n=e.length,r=LT,i=0,a=IT;for(let n of e)n<128&&t.push(GT(n));let o=t.length,s=o;for(o&&t.push(RT);s<n;){let n=AT;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>WT((AT-i)/c)&&KT(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>AT&&KT(`overflow`),n===r){let e=i;for(let n=jT;;n+=jT){let r=n<=a?MT:n>=a+NT?NT:n-a;if(e<r)break;let i=e-r,o=jT-r;t.push(GT(QT(r+i%o,0))),e=WT(i/o)}t.push(GT(QT(e,0))),a=$T(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},nE={version:`2.3.1`,ucs2:{decode:YT,encode:XT},decode:eE,encode:tE,toASCII:function(e){return JT(e,function(e){return BT.test(e)?`xn--`+tE(e):e})},toUnicode:function(e){return JT(e,function(e){return zT.test(e)?eE(e.slice(4).toLowerCase()):e})}},rE=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.THINKING_START=`THINKING_START`,e.THINKING_END=`THINKING_END`,e.THINKING_TEXT_MESSAGE_START=`THINKING_TEXT_MESSAGE_START`,e.THINKING_TEXT_MESSAGE_CONTENT=`THINKING_TEXT_MESSAGE_CONTENT`,e.THINKING_TEXT_MESSAGE_END=`THINKING_TEXT_MESSAGE_END`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e}({});function iE(e){return Object.keys(e).length>0?e:void 0}function aE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&`promptTokens`in e}function oE(e,t){return aE(e)?e:sE(Array.isArray(e)?e:void 0,t)}function sE(e,t){let n=e?.[0];if(n==null&&t==null)return;let{promptTokensDetails:r,completionTokensDetails:i,...a}=t??{},o=iE({...n?.cachedInputTokens===void 0?{}:{cachedTokens:n.cachedInputTokens},...r}),s=iE({...n?.reasoningTokens===void 0?{}:{reasoningTokens:n.reasoningTokens},...i});return{promptTokens:n?.inputTokens??0,completionTokens:n?.outputTokens??0,totalTokens:n?.totalTokens??0,...a,...o===void 0?{}:{promptTokensDetails:o},...s===void 0?{}:{completionTokensDetails:s}}}function cE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function lE(e,t){if(t==null)return e;if(e==null)return{...t};let n={...e,...t};return cE(e.tanstack)&&cE(t.tanstack)&&(n.tanstack={...e.tanstack,...t.tanstack}),n}function uE(e){if(e==null)return;let t=`metadata`in e?e.metadata:void 0,n=(typeof t==`object`&&t&&!Array.isArray(t)?t:e).tanstack;if(typeof n==`object`&&n&&!Array.isArray(n))return n}function dE(e,t){let n=e.metadata,r=uE(e)??{};return{...e,metadata:{...n??{},tanstack:{...r,...t}}}}function fE(e){let t=Error(e.message||e.error?.message||`An error occurred`),n=e.code??e.error?.code;return n!==void 0&&Object.assign(t,{code:n}),e.rawEvent!==void 0&&Object.assign(t,{rawEvent:e.rawEvent}),t}var pE=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function mE(e,t){return e>>>t|e<<32-t}function hE(e){let t=new TextEncoder().encode(e),n=t.length*8,r=t.length+1,i=r+(56-r%64+64)%64+8,a=new Uint8Array(i);a.set(t),a[t.length]=128;let o=new DataView(a.buffer);o.setUint32(i-8,Math.floor(n/4294967296)),o.setUint32(i-4,n>>>0);let s=1779033703,c=3144134277,l=1013904242,u=2773480762,d=1359893119,f=2600822924,p=528734635,m=1541459225,h=new Uint32Array(64);for(let e=0;e<i;e+=64){for(let t=0;t<16;t++)h[t]=o.getUint32(e+t*4);for(let e=16;e<64;e++){let t=h[e-15]??0,n=h[e-2]??0,r=mE(t,7)^mE(t,18)^t>>>3,i=mE(n,17)^mE(n,19)^n>>>10;h[e]=(h[e-16]??0)+r+(h[e-7]??0)+i>>>0}let t=s,n=c,r=l,i=u,a=d,g=f,v=p,y=m;for(let e=0;e<64;e++){let o=mE(a,6)^mE(a,11)^mE(a,25),s=a&g^~a&v,c=y+o+s+(pE[e]??0)+(h[e]??0)>>>0,l=(mE(t,2)^mE(t,13)^mE(t,22))+(t&n^t&r^n&r)>>>0;y=v,v=g,g=a,a=i+c>>>0,i=r,r=n,n=t,t=c+l>>>0}s=s+t>>>0,c=c+n>>>0,l=l+r>>>0,u=u+i>>>0,d=d+a>>>0,f=f+g>>>0,p=p+v>>>0,m=m+y>>>0}let g=e=>(e>>>0).toString(16).padStart(8,`0`);return g(s)+g(c)+g(l)+g(u)+g(d)+g(f)+g(p)+g(m)}function gE(e){return`sha256:${hE(e)}`}function _E(e,t){if(e===null)return`null`;if(typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&Number.isFinite(e))return JSON.stringify(e);if(typeof e!=`object`)throw TypeError(`Interrupt values must be JSON-compatible.`);if(t.has(e))throw TypeError(`Interrupt values must not cycle.`);if(!Array.isArray(e)&&Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Interrupt values must use plain JSON objects.`);t.add(e);let n;if(Array.isArray(e)){let r=[];for(let n=0;n<e.length;n++)r.push(_E(e[n],t));n=`[${r.join(`,`)}]`}else{let r=e;n=`{${Object.keys(r).sort().map(e=>`${JSON.stringify(e)}:${_E(r[e],t)}`).join(`,`)}}`}return t.delete(e),n}function vE(e){return _E(e,new WeakSet)}function yE(e,t=gE){if(typeof e!=`string`)throw TypeError(`Interrupt digests require canonical JSON text.`);return t(e)}function bE(e){typeof e==`object`&&e&&!Object.isFrozen(e)&&(Object.values(e).forEach(bE),Object.freeze(e))}function xE(e){let t=JSON.parse(vE(e));return bE(t),t}function SE(e){let t=xE([...e].sort((e,t)=>e.interruptId.localeCompare(t.interruptId))),n=vE(t);return Object.freeze({resolutions:t,canonicalResolutions:n,fingerprint:yE(n)})}function CE(e){let t={};for(let[n,r]of Object.entries(e))n!==`$schema`&&(t[n]=r);return t}function wE(e){return(typeof e==`object`||typeof e==`function`)&&e!==null}function TE(e){if(!wE(e)||!(`~standard`in e))return!1;let t=e[`~standard`];return typeof t!=`object`||!t||!(`version`in t)||t.version!==1||!(`jsonSchema`in t)||typeof t.jsonSchema!=`object`||t.jsonSchema===null||!(`input`in t.jsonSchema)?!1:typeof t.jsonSchema.input==`function`}function EE(e){return wE(e)&&`~standard`in e&&typeof e[`~standard`]==`object`&&e[`~standard`]!==null&&`version`in e[`~standard`]&&e[`~standard`].version===1&&`validate`in e[`~standard`]&&typeof e[`~standard`].validate==`function`}function DE(e){return Object.keys(e).length>0?e:void 0}function OE(e){if(Array.isArray(e)){let t=e.map(e=>kE(e,e.required||[])),n=t.map(e=>e.nullWidening??{});return{schema:t.map(e=>e.schema),itemMap:n.some(e=>Object.keys(e).length>0)?n:void 0}}let t=kE(e,e.required||[]);return{schema:t.schema,itemMap:t.nullWidening}}function kE(e,t=[]){let n={...e},r={};if(n.type===`object`&&n.properties){let e={...n.properties},i=Object.keys(e),a={};for(let n of i){let r=e[n];if(!r)continue;let i=!t.includes(n),o=!1,s;if(r.type===`object`&&r.properties){let t=kE(r,r.required||[]);e[n]=i?{...t.schema,type:[`object`,`null`]}:t.schema,o=i,s=t.nullWidening}else if(r.type===`array`&&r.items){let t=OE(r.items);e[n]={...r,items:t.schema,...i?{type:[`array`,`null`]}:{}},o=i,s=t.itemMap?{items:t.itemMap}:void 0}else i&&(r.type&&!Array.isArray(r.type)?(e[n]={...r,type:[r.type,`null`]},o=!0):Array.isArray(r.type)&&!r.type.includes(`null`)&&(e[n]={...r,type:[...r.type,`null`]},o=!0));(o||s)&&(a[n]={...s??{},...o?{widened:!0}:{}})}n.properties=e,n.required=i,n.additionalProperties=!1,Object.keys(a).length>0&&(r.properties=a)}if(n.type===`array`&&n.items){let e=OE(n.items);n.items=e.schema,e.itemMap&&(r.items=e.itemMap)}return{schema:n,nullWidening:DE(r)}}function AE(e){if(TE(e)){let t=CE(e[`~standard`].jsonSchema.input({target:`draft-07`}));return`properties`in t&&!t.type&&(t.type=`object`),t.type===`object`&&!(`properties`in t)&&(t.properties={}),t.type===`object`&&!(`required`in t)&&(t.required=[]),t}if(EE(e))throw Error("Schema is a Standard Schema validator but does not expose a JSON Schema converter on `~standard.jsonSchema`. Use Zod v4.2+, ArkType v2.1.28+, or wrap a Valibot schema with `toStandardJsonSchema()` from `@valibot/to-json-schema` before passing it as `outputSchema`.");return typeof e==`object`?CE(e):e}function jE(e,t={}){if(!e)return;let{forStructuredOutput:n=!1}=t;if(!n&&!TE(e)&&!EE(e))return e;let r=AE(e);return!r||typeof r!=`object`||!n?r:kE(r,r.required||[]).schema}var ME=class extends Error{name=`StandardSchemaValidationError`;issues;constructor(e){super(`Validation failed: ${e.map(e=>e.message||`Validation failed`).join(`, `)}`),this.issues=e}};function NE(e,t){if(!EE(e))return t;let n=e[`~standard`].validate(t);if(n instanceof Promise)throw Error(`Schema validation returned a Promise. Use validateWithStandardSchema for async validation.`);if(!n.issues)return n.value;throw new ME(n.issues)}var PE=new Set([`$schema`,`$id`,`$ref`,`$defs`,`type`,`properties`,`required`,`additionalProperties`,`items`,`oneOf`,`anyOf`,`allOf`,`enum`,`const`,`format`,`minimum`,`maximum`,`minLength`,`maxLength`,`pattern`]);function FE(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function IE(e){return FE(e)&&Object.keys(e).some(e=>PE.has(e))}function LE(e){return EE(e)||TE(e)||IE(e)}function RE(e){if(!FE(e))return!1;let t=Object.keys(e);return t.length>0&&t.every(e=>e===`approve`||e===`reject`)&&t.every(t=>LE(e[t]))}function zE(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r;return t}function BE(e){if(EE(e)){let t=TE(e)?zE(e[`~standard`].jsonSchema.input({target:`draft-2020-12`})):void 0;return{source:e,validator:e,...t!==void 0&&{jsonSchema:t}}}if(IE(e))return{source:e,jsonSchema:e};throw TypeError(`Expected a supported SchemaInput.`)}function VE(e){let t={approved:{const:e.approved}},n=[`approved`];return e.approved&&e.inputSchema&&(t.editedArgs=e.inputSchema.jsonSchema??{}),e.payload&&(t.payload=e.payload.jsonSchema??{},n.push(`payload`)),{type:`object`,properties:t,required:n,additionalProperties:!1}}function HE(e,t){let n=t===void 0?null:BE(t),r=null,i=null;if(e!==void 0){if(EE(e)||IE(e))r=BE(e),i=r;else if(RE(e))r=e.approve===void 0?null:BE(e.approve),i=e.reject===void 0?null:BE(e.reject);else throw TypeError(`approvalSchema must be a SchemaInput or a nonempty map containing approve or reject.`)}let a={oneOf:[VE({approved:!0,payload:r,inputSchema:n}),VE({approved:!1,payload:i,inputSchema:null})]},o=vE(a),s=vE({approve:r?.jsonSchema??null,reject:i?.jsonSchema??null});return{branches:{approve:r,reject:i},responseSchema:a,responseSchemaHash:yE(o),approvalSchemaHash:yE(s)}}function UE(e){return yE(e===void 0?`undefined`:vE(BE(e).jsonSchema??{standardValidator:`unserialized`}))}var WE=`tanstack:interruptBinding`,GE=WE;function KE(e){return e&&typeof e==`object`?e:null}function qE(e,t){return typeof e[t]==`string`?e[t]:void 0}function JE(e){let t=e.v;return t===void 0||t===1}function YE(e){let t=KE(e.metadata),n=t?KE(t[GE]):null;if(!n||qE(n,`interruptId`)!==e.id||!JE(n))return;let r=qE(n,`kind`),i=qE(n,`interruptId`),a=qE(n,`responseSchemaHash`),o=qE(n,`expiresAt`);if(!i||a===``||o!==void 0&&!Number.isFinite(Date.parse(o)))return;if(r===`generic`){let e=qE(n,`definitionId`),t=qE(n,`key`),s=n.batchIndex,c=qE(n,`payloadSchemaHash`);return(e!==void 0||t!==void 0||s!==void 0||c!==void 0)&&(!e||!t||typeof s!=`number`||!Number.isInteger(s)||s<0)?void 0:{v:1,kind:r,interruptId:i,...a?{responseSchemaHash:a}:{},...o?{expiresAt:o}:{},...e?{definitionId:e}:{},...t?{key:t}:{},...typeof s==`number`?{batchIndex:s}:{},...c?{payloadSchemaHash:c}:{}}}if(!a)return;let s=qE(n,`toolName`),c=qE(n,`toolCallId`);if(s&&c){if(r===`client-tool-execution`){let e=qE(n,`outputSchemaHash`);return e?{v:1,kind:r,interruptId:i,toolName:s,toolCallId:c,outputSchemaHash:e,responseSchemaHash:a,...o?{expiresAt:o}:{}}:void 0}if(r===`tool-approval`){let e=qE(n,`inputSchemaHash`),t=qE(n,`approvalSchemaHash`);return!e||!t?void 0:{v:1,kind:r,interruptId:i,toolName:s,toolCallId:c,originalArgs:n.originalArgs,inputSchemaHash:e,approvalSchemaHash:t,responseSchemaHash:a,...o?{expiresAt:o}:{}}}}}function XE(e){let t=YE(e);if(!t)return;let n=KE(e.metadata),r=n?KE(n[GE]):null;if(!r)return;let i=qE(r,`interruptedRunId`),a=r.generation;if(!(!i||typeof a!=`number`||!Number.isInteger(a)||a<0))return{...t,interruptedRunId:i,generation:a}}var ZE=`tanstack:interruptPayload`;function QE(e,t){if(!TE(e))throw TypeError(`${t} must be a Standard Schema with a JSON Schema converter.`);try{let t=e[`~standard`].jsonSchema.input({target:`draft-07`});if(t===void 0)throw TypeError(`The exported schema is undefined.`);if(typeof t==`function`)throw TypeError(`The exported schema must not be a function.`);if(Array.isArray(t)||!t||typeof t!=`object`||![Object.prototype,null].includes(Object.getPrototypeOf(t)))throw TypeError(`The exported schema must be a plain JSON object.`);let n={};for(let[e,r]of Object.entries(t))e!==`$schema`&&(n[e]=r);return{json:n,canonicalJson:vE(n)}}catch(e){throw TypeError(`${t} could not export compatible JSON Schema: ${e instanceof Error?e.message:String(e)}`)}}function $E(e){return yE(QE(e,`Interrupt schema`).canonicalJson)}var eD=`tanstack:interruptContinuation`;function tD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function nD(e){return{[eD]:e}}function rD(e){let t=YE(e);if(t?.kind!==`generic`||t.definitionId===void 0||t.key===void 0||t.batchIndex===void 0)return;let n=tD(e.metadata)?e.metadata:void 0,r=n!==void 0&&Object.prototype.hasOwnProperty.call(n,`tanstack:interruptPayload`);return{v:1,definitionId:t.definitionId,key:t.key,batchIndex:t.batchIndex,reason:e.reason,message:e.message??``,...e.expiresAt===void 0?{}:{expiresAt:e.expiresAt},...t.responseSchemaHash===void 0?{}:{responseSchemaHash:t.responseSchemaHash},...t.payloadSchemaHash===void 0?{}:{payloadSchemaHash:t.payloadSchemaHash},...r?{payload:n[ZE]}:{}}}var iD=new Set([`text`,`image`,`audio`,`video`,`document`]);function aD(e){if(typeof e!=`object`||!e)return!1;let t=e;if(typeof t.type!=`string`||!iD.has(t.type))return!1;if(t.type===`text`)return typeof t.content==`string`;let n=t.source;if(typeof n!=`object`||!n)return!1;let r=n;return typeof r.value==`string`?r.type===`data`?typeof r.mimeType==`string`:r.type===`url`:!1}function oD(e){return Array.isArray(e)&&e.length>0&&e.every(aD)}function sD(e){return typeof e==`string`||oD(e)?e:JSON.stringify(e)}function cD(e){let t=e?.metadata;return typeof t==`object`&&t&&t.providerExecuted===!0?t:null}function lD(e){return cD(e)!==null}function uD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function dD(e){return e.type===`text`||e.type===`image`||e.type===`audio`||e.type===`video`||e.type===`document`}function fD(e){try{return JSON.stringify(e)??``}catch{return``}}function pD(e){return typeof e==`string`&&e!==``?e:void 0}function mD(e){if(`encryptedValue`in e){let t=pD(e.encryptedValue);if(t!==void 0)return t}return pD(uE(e)?.signature)}function hD(e){return e.length===0?null:e.every(e=>e.type===`text`)?e.map(e=>e.content).join(``)||null:e}function gD(e){return e==null?``:typeof e==`string`?e:e.filter(e=>e.type===`text`).map(e=>e.content).join(``)}function _D(e){return Array.isArray(e)?e:gD(e)}function vD(e){if(!(`role`in e)||e.role!==`tool`)return e;let t=e,n=uE(t)?.toolResult;if(!uD(n)||`content`in n&&!oD(n.content))return e;let r={...e};if(`id`in n||Reflect.deleteProperty(r,`id`),`createdAt`in n||Reflect.deleteProperty(r,`createdAt`),typeof n.id==`string`&&Reflect.set(r,`id`,n.id),typeof n.createdAt==`string`){let e=yD(n.createdAt);e&&Reflect.set(r,`createdAt`,e)}oD(n.content)&&Reflect.set(r,`content`,n.content);let i=Reflect.get(t,`metadata`);if(uD(i)){let e=i.tanstack;if(uD(e)){let{toolResult:t,...n}=e,a={...i};Object.keys(n).length?a.tanstack=n:delete a.tanstack,Object.keys(a).length?Reflect.set(r,`metadata`,a):Reflect.deleteProperty(r,`metadata`)}}return r}function yD(e){if(e instanceof Date)return Number.isNaN(e.getTime())?void 0:e;if(typeof e!=`string`)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function bD(e){if(e.type!==`tool-result`)return e;let t=yD(e.createdAt),{createdAt:n,...r}=e;return t===void 0?r:{...r,createdAt:t}}function xD(e){return yD(uE(e)?.createdAt)}function SD(e){let t=yD(e.createdAt);return t===void 0?{}:{createdAt:t}}function CD(e){return e.name===void 0?{}:{name:e.name}}function wD(e){if(typeof e!=`object`||!e||Array.isArray(e)||!(`type`in e)||e.type!==`ui-resource`||!(`toolCallId`in e)||typeof e.toolCallId!=`string`||!(`toolName`in e)||typeof e.toolName!=`string`||!(`resource`in e)||e.resource==null||typeof e.resource!=`object`||Array.isArray(e.resource))return!1;let t=e.resource;return`uri`in t&&typeof t.uri==`string`&&`mimeType`in t&&typeof t.mimeType==`string`}function TD(e){return`${e.toolCallId}\0${e.toolName}\0${e.resource.uri}`}function ED(e,t){if(t.length===0)return e;let n=new Set(e.parts.filter(wD).map(e=>TD(e))),r=t.filter(e=>!n.has(TD(e)));return r.length===0?e:{...e,parts:[...e.parts,...r]}}function DD(e){let t=e.parts.filter(wD),n=e.metadata??{},r=uE(e),i={};r?.model!==void 0&&(i.model=r.model),r?.signature!==void 0&&(i.signature=r.signature),t.length>0&&(i.uiResources=t);let a={...n};return Object.keys(i).length>0?a.tanstack=i:delete a.tanstack,Object.keys(a).length>0?a:void 0}function OD(e){return e.role===`system`?[]:e.role===`assistant`?MD(e):[kD(e)]}function kD(e){let t=[];for(let n of e.parts)dD(n)&&t.push(n);return{id:e.id,role:e.role,content:hD(t),...CD(e),...SD(e),...e.metadata!==void 0&&{metadata:e.metadata}}}function AD(){return{contentParts:[],toolCalls:[]}}function jD(e){return e.state===`input-complete`||e.state===`complete`||e.state===`approval-requested`||e.state===`approval-responded`||e.state===`error`||e.output!==void 0}function MD(e){let t=[],n=AD(),r=[],i=new Set,a={id:e.id,...CD(e),...SD(e)},o=DD(e),s={...a,...o!==void 0&&{metadata:o}};function c(e=!1){let i=hD(n.contentParts),a=i!==null,o=n.toolCalls.length>0,c=r.length>0;(e||a||o||c)&&(t.push({...s,role:`assistant`,content:i,...o&&{toolCalls:n.toolCalls},...c&&{thinking:r},...n.structuredOutput&&{structuredOutput:n.structuredOutput}}),r=[]),n=AD()}for(let a of e.parts)switch(a.type){case`text`:case`image`:case`audio`:case`video`:case`document`:n.contentParts.push(a);break;case`tool-call`:jD(a)&&n.toolCalls.push({id:a.id,type:`function`,function:{name:a.name,arguments:a.arguments},...a.metadata!==void 0&&{metadata:a.metadata}});break;case`tool-result`:c(t.length===0),(a.state===`complete`||a.state===`error`)&&!i.has(a.toolCallId)&&(t.push({...a.id!==void 0&&{id:a.id},...SD(a),role:`tool`,content:a.content,toolCallId:a.toolCallId,...a.name!==void 0&&{name:a.name},...a.metadata!==void 0&&{metadata:a.metadata},...a.error!==void 0&&{error:a.error}}),i.add(a.toolCallId));break;case`thinking`:(a.content||a.signature)&&(n.toolCalls.some(lD)&&c(),r.push({content:a.content,...a.signature&&{signature:a.signature}}));break;case`structured-output`:if(a.status===`complete`){let e=a.raw===``?a.data===void 0?``:fD(a.data):a.raw;e!==``&&(n.contentParts.push({type:`text`,content:e}),n.structuredOutput=a)}}c();for(let n of e.parts)if(n.type===`tool-call`&&(n.output!==void 0&&!i.has(n.id)&&(t.push({role:`tool`,content:sD(n.output),toolCallId:n.id}),i.add(n.id)),n.output===void 0&&n.state===`approval-responded`&&n.approval?.approved!==void 0&&!i.has(n.id))){let e=n.approval.approved;t.push({role:`tool`,content:JSON.stringify({approved:e,...e&&{pendingExecution:!0},message:e?`User approved this action`:`User denied this action`}),toolCallId:n.id}),i.add(n.id)}return t.length===0&&t.push({...s,role:`assistant`,content:null}),t}function ND(e,t){let n=[],r=yD(e.createdAt);if(e.role===`assistant`&&e.thinking?.length)for(let t of e.thinking)(t.content||t.signature)&&n.push({type:`thinking`,content:t.content,...t.signature&&{signature:t.signature}});let i=e.structuredOutput??ID(uE(e)?.structuredOutput);if(e.role===`assistant`&&i){if(typeof e.content==`string`&&e.content&&e.content!==i.raw){let t=i.raw,r=t!==``&&e.content.endsWith(t)?e.content.slice(0,-t.length):e.content;r&&n.push({type:`text`,content:r})}n.push(i)}else if(e.role===`tool`&&e.toolCallId)n.push({type:`tool-result`,toolCallId:e.toolCallId,content:_D(e.content),state:e.error===void 0?`complete`:`error`,...e.id!==void 0&&{id:e.id},...e.name!==void 0&&{name:e.name},...e.metadata!==void 0&&{metadata:e.metadata},...r!==void 0&&{createdAt:r},...e.error!==void 0&&{error:e.error}});else if(Array.isArray(e.content))for(let t of e.content)n.push(t);else{let t=gD(e.content);t&&n.push({type:`text`,content:t})}if(e.toolCalls&&e.toolCalls.length>0)for(let t of e.toolCalls){let e;try{e=JSON.parse(t.function.arguments)}catch{e=void 0}n.push({type:`tool-call`,id:t.id,name:t.function.name,arguments:t.function.arguments,state:`input-complete`,...e!==void 0&&{input:e},...t.metadata!==void 0&&{metadata:t.metadata}})}let a={id:t||zD(),role:e.role===`tool`?`assistant`:e.role,parts:n,...CD(e),...r!==void 0&&{createdAt:r},...e.metadata!==void 0&&{metadata:e.metadata}},o=uE(e)?.uiResources;return ED(a,Array.isArray(o)?o.filter(wD):[])}function PD(e){if(`parts`in e)return FD(e,{...e,id:e.id||zD()});let t=e.id||zD();switch(e.role){case`user`:return FD(e,{id:t,role:`user`,parts:LD(e.content)});case`assistant`:{let n=uE(e),r=n?.toolCallMetadata,i=ID(n?.structuredOutput),a=e.toolCalls?.map(e=>{let t=typeof r==`object`&&r?r[e.id]:void 0;return t===void 0?e:{...e,metadata:t}});return FD(e,ND({role:`assistant`,content:e.content??null,...CD(e),...a&&{toolCalls:a},...i&&{structuredOutput:i}},t))}case`tool`:{e=vD(e);let n=yD(`createdAt`in e?e.createdAt:void 0)??xD(e);return FD(e,ND({role:`tool`,content:e.content,toolCallId:e.toolCallId,...`name`in e&&typeof e.name==`string`?{name:e.name}:{},...`id`in e&&typeof e.id==`string`?{id:e.id}:{},...`metadata`in e&&e.metadata!=null?{metadata:e.metadata}:{},...n===void 0?{}:{createdAt:n},...e.error!==void 0&&{error:e.error}},t))}case`system`:case`developer`:return FD(e,{id:t,role:`system`,parts:e.content?[{type:`text`,content:e.content}]:[]});case`reasoning`:{let n=mD(e),r=typeof e.content==`string`?e.content:``;return FD(e,{id:t,role:`assistant`,parts:r||n!==void 0?[{type:`thinking`,content:r,...n===void 0?{}:{signature:n}}]:[]})}default:return FD(e,{id:t,role:`assistant`,parts:[]})}}function FD(e,t){let n=t.parts.map(e=>bD(e));n!==t.parts&&(t={...t,parts:n});let r=`name`in e&&typeof e.name==`string`?e.name:void 0,i=r===void 0?t:{...t,name:r},a;if(`metadata`in e){let t=e.metadata;typeof t==`object`&&t&&!Array.isArray(t)&&(a=t,i={...i,metadata:a})}let o=yD(i.createdAt)??(a===void 0?void 0:xD(a));if(o!==void 0&&!Object.is(o,i.createdAt))i={...i,createdAt:o};else if(o===void 0&&i.createdAt!==void 0){let{createdAt:e,...t}=i;i=t}let s=uE(a)?.uiResources,c=Array.isArray(s)?s.filter(wD):[];return ED(i,c)}function ID(e){if(!(e==null||e.status!==`streaming`&&e.status!==`complete`&&e.status!==`error`||typeof e.raw!=`string`))return{type:`structured-output`,status:e.status,raw:e.raw,...e.partial===void 0?{}:{partial:e.partial},...e.data===void 0?{}:{data:e.data},...e.reasoning?{reasoning:e.reasoning}:{},...e.errorMessage===void 0?{}:{errorMessage:e.errorMessage}}}function LD(e){if(typeof e==`string`)return e?[{type:`text`,content:e}]:[];let t=[];for(let n of e)n.type===`text`?t.push({type:`text`,content:n.text}):n.type!==`binary`&&t.push(n);return t}function RD(e,t){if(`parts`in e){let n=e.parts.map(e=>bD(e));return{...e,parts:n,id:e.id||t(),createdAt:yD(e.createdAt)??new Date}}return{...ND(e,t()),createdAt:yD(e.createdAt)??new Date}}function zD(){return`msg-${Date.now()}-${Math.random().toString(36).substring(7)}`}function BD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function VD(e,t,n,r,i=!1){let a=BD(e)?e:{},o=BD(a.tanstack)?{...a.tanstack}:{};i&&delete o.uiResources;let s=yD(t),c={...n===void 0?{}:{id:n},...s&&{createdAt:s.toISOString()},...Array.isArray(r)&&{content:r}},l={...a,tanstack:{...o,toolResult:c}};return Object.keys(l).length?l:void 0}function HD(e,t){let n=[],r=new Set(e.flatMap(e=>`id`in e&&e.id&&e.role!==`tool`?[e.id]:[])),i=t?.includeSnapshotStructuredOutput??!1,a=new Set;for(let t of e)t.role===`assistant`&&t.id!==void 0&&a.add(t.id);for(let t of e){if(!(`parts`in t)&&t.role===`tool`&&t.toolCallId){let e=$D(tO(t.id,t.toolCallId,a),r),i=VD(t.metadata,t.createdAt,t.id,t.content);n.push({role:`tool`,id:e,...t.name!==void 0&&{name:t.name},toolCallId:t.toolCallId,content:typeof t.content==`string`?t.content:JSON.stringify(t.content),...t.error!==void 0&&{error:t.error},...i!==void 0&&{metadata:i}});continue}let e=`parts`in t?t:ND(t,t.id),o=e.parts;if(r.add(e.id),t.role===`system`){n.push(UD(e,`system`,{content:o.length>0?qD(o):t.content??``},o,i));continue}if(t.role===`user`){n.push(UD(e,`user`,{content:o.length>0?JD(o):t.content??``},o,i));continue}for(let t of o)if(t.type===`thinking`){let i={role:`reasoning`,id:eO(ZD(e.id,t),r),content:t.content};t.signature&&(i.encryptedValue=t.signature),n.push(i)}let s=qD(o),c=XD(o);n.push(UD(e,`assistant`,{...s!==``&&{content:s},...c&&{toolCalls:c}},o,i));let l=new Set(o.flatMap(e=>e.type===`tool-result`?[e.toolCallId]:[]));for(let e of o)if(e.type===`tool-result`){let t=$D(e.id??QD(e.toolCallId),r),i=VD(e.metadata,e.createdAt,e.id,e.content,!0);n.push({role:`tool`,id:t,toolCallId:e.toolCallId,...e.name!==void 0&&{name:e.name},content:typeof e.content==`string`?e.content:JSON.stringify(e.content),...e.error!==void 0&&{error:e.error},...i!==void 0&&{metadata:i}})}else if(e.type===`tool-call`){let t=e.approval?.approved;if(l.has(e.id)||e.output===void 0&&(e.state!==`approval-responded`||t===void 0))continue;let i=e.output===void 0?JSON.stringify({approved:t,...t&&{pendingExecution:!0},message:t?`User approved this action`:`User denied this action`}):sD(e.output),a=typeof i==`string`?i:JSON.stringify(i);n.push({role:`tool`,id:$D(QD(e.id),r),toolCallId:e.id,content:a,metadata:VD(void 0,void 0,void 0,i)})}}return n}function UD(e,t,n,r,i){let a=WD(e,r,i),o={id:e.id,...e.name!==void 0&&{name:e.name},...a!==void 0&&{metadata:a}};return t===`system`?{...o,role:t,content:String(n.content??``)}:t===`user`?{...o,role:t,content:n.content??``}:{...o,role:t,...typeof n.content==`string`&&{content:n.content},...n.toolCalls!==void 0&&{toolCalls:n.toolCalls}}}function WD(e,t,n){let r={...e.metadata??{}},i=uE(e),a={};i?.model!==void 0&&(a.model=i.model),i?.signature!==void 0&&(a.signature=i.signature);let o=yD(e.createdAt);o!==void 0&&(a.createdAt=o.toISOString());let s=GD(t,n);s&&(a.structuredOutput=s);let c={};for(let e of t)e.type===`tool-call`&&e.metadata!==void 0&&(c[e.id]=e.metadata);Object.keys(c).length>0&&(a.toolCallMetadata=c);let l=t.filter(e=>e.type===`ui-resource`);return l.length>0&&(a.uiResources=l),Object.keys(a).length>0?r.tanstack=a:delete r.tanstack,Object.keys(r).length>0?r:void 0}function GD(e,t){for(let n of e)if(n.type===`structured-output`&&(t||n.status!==`complete`))return KD(n,t)}function KD(e,t){return{status:e.status,raw:e.raw,...t&&e.partial!==void 0?{partial:e.partial}:{},...t&&e.data!==void 0?{data:e.data}:{},...t&&e.reasoning?{reasoning:e.reasoning}:{},...e.errorMessage!==void 0&&{errorMessage:e.errorMessage}}}function qD(e){let t=[];for(let n of e)n.type===`text`?t.push(n.content):n.type===`structured-output`&&n.status===`complete`&&n.raw!==``&&t.push(n.raw);return t.join(``)}function JD(e){if(!e.some(e=>e.type===`image`||e.type===`audio`||e.type===`video`||e.type===`document`))return qD(e);let t=[];for(let n of e)n.type===`text`?t.push({type:`text`,text:n.content}):(n.type===`image`||n.type===`audio`||n.type===`video`||n.type===`document`)&&t.push(n);return t}function YD(e){if(typeof e!=`object`||!e||Array.isArray(e)||!(`thoughtSignature`in e))return;let t=e.thoughtSignature;return typeof t==`string`&&t!==``?t:void 0}function XD(e){let t=[];for(let n of e)if(n.type===`tool-call`){let e=YD(n.metadata);t.push({id:n.id,type:`function`,function:{name:n.name,arguments:n.arguments},...e===void 0?{}:{encryptedValue:e}})}return t.length>0?t:void 0}function ZD(e,t){return`${e}-reasoning-${t.id??nO(t.content)}`}function QD(e){return`tool-${e}`}function $D(e,t){return eO(e,t)}function eO(e,t){if(!t.has(e))return t.add(e),e;let n=2;for(;t.has(`${e}-${n}`);)n++;let r=`${e}-${n}`;return t.add(r),r}function tO(e,t,n){let r=QD(t);return e===void 0||n.has(e)?r:e}function nO(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t).toString(36)}function rO(e){if((e.type===rE.RUN_FINISHED||e.type===rE.RUN_ERROR)&&(Array.isArray(e.usage)||aE(e.usage))){let t=oE(e.usage,uE(e)?.usage);t!==void 0&&(e.usage=t)}if(e.type===rE.TOOL_CALL_START&&e.toolName===void 0&&e.toolCallName&&(e.toolName=e.toolCallName),e.type===rE.TOOL_CALL_END&&e.input===void 0){let t=uE(e)?.input;t!==void 0&&(e.input=t)}return e}function iO(e){rO(e);let t=uE(e),n=e;if(t==null)return n;for(let[e,r]of Object.entries(t))e!==`usage`&&e!==`interruptErrors`&&n[e]===void 0&&r!==void 0&&(n[e]=r);return t.interruptErrors!==void 0&&(n[`tanstack:interruptErrors`]=t.interruptErrors),n}function aO(){let e=globalThis.crypto;return e?.randomUUID?e.randomUUID():Math.random().toString(36).slice(2)}var oO;function sO(){return oO===void 0?(globalThis.__TANSTACK_AI_DEVTOOLS_RUNTIME_ID__||(globalThis.__TANSTACK_AI_DEVTOOLS_RUNTIME_ID__=aO()),oO=globalThis.__TANSTACK_AI_DEVTOOLS_RUNTIME_ID__,oO):oO}var cO=0;function lO(e){return e==null||e===``?`missing`:`value-${encodeURIComponent(String(e))}`}function uO(e){let t=e.runtimeId??sO(),n=e.eventId&&e.eventId.length>0?e.eventId:[e.source,e.eventType,lO(t),lO(e.clientId),lO(e.requestId),lO(e.streamId),lO(e.hookId),lO(e.threadId),lO(e.runId),lO(e.messageId),lO(e.toolCallId),lO(e.sequence),e.timestamp,sO(),cO++].join(`:`);return{...e,runtimeId:t,eventId:n}}var dO=class{#e=!0;#t;#n;#r;#i;#a;#o;#s;#c=0;#l=5;#u=!1;#d=!1;#f=null;#p=()=>{this.debugLog(`Connected to event bus`),this.#a=!0,this.#u=!1,this.debugLog(`Emitting queued events`,this.#i),this.#i.forEach(e=>this.emitEventToBus(e)),this.#i=[],this.stopConnectLoop(),this.#n().removeEventListener(`tanstack-connect-success`,this.#p)};#m=()=>{if(this.#c<this.#l){this.#c++,this.dispatchCustomEvent(`tanstack-connect`,{});return}this.#n().removeEventListener(`tanstack-connect`,this.#m),this.#d=!0,this.debugLog(`Max retries reached, giving up on connection`),this.stopConnectLoop()};#h=()=>{this.#u||(this.#u=!0,this.#n().addEventListener(`tanstack-connect-success`,this.#p),this.#m())};constructor({pluginId:e,debug:t=!1,enabled:n=!0,reconnectEveryMs:r=300}){this.#t=e,this.#e=n,this.#n=this.getGlobalTarget,this.#r=t,this.debugLog(` Initializing event subscription for plugin`,this.#t),this.#i=[],this.#a=!1,this.#d=!1,this.#o=null,this.#s=r}startConnectLoop(){this.#o!==null||this.#a||(this.debugLog(`Starting connect loop (every ${this.#s}ms)`),this.#o=setInterval(this.#m,this.#s))}stopConnectLoop(){this.#u=!1,this.#o!==null&&(clearInterval(this.#o),this.#o=null,this.#i=[],this.debugLog(`Stopped connect loop`))}debugLog(...e){this.#r&&console.log(`🌴 [tanstack-devtools:${this.#t}-plugin]`,...e)}getGlobalTarget(){if(typeof globalThis<`u`&&globalThis.__TANSTACK_EVENT_TARGET__)return this.debugLog(`Using global event target`),globalThis.__TANSTACK_EVENT_TARGET__;if(typeof window<`u`&&window.addEventListener!==void 0)return this.debugLog(`Using window as event target`),window;let e=typeof EventTarget<`u`?new EventTarget:void 0;return e===void 0||e.addEventListener===void 0?(this.debugLog(`No event mechanism available, running in non-web environment`),{addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!1}):(this.debugLog(`Using new EventTarget as fallback`),e)}getPluginId(){return this.#t}dispatchCustomEventShim(e,t){try{let n=new Event(e,{detail:t});this.#n().dispatchEvent(n)}catch{this.debugLog(`Failed to dispatch shim event`)}}dispatchCustomEvent(e,t){try{this.#n().dispatchEvent(new CustomEvent(e,{detail:t}))}catch{this.dispatchCustomEventShim(e,t)}}emitEventToBus(e){this.debugLog(`Emitting event to client bus`,e),this.dispatchCustomEvent(`tanstack-dispatch-event`,e)}createEventPayload(e,t){return{type:`${this.#t}:${e}`,payload:t,pluginId:this.#t}}emit(e,t){if(!this.#e){this.debugLog(`Event bus client is disabled, not emitting event`,e,t);return}if(this.#f&&(this.debugLog(`Emitting event to internal event target`,e,t),this.#f.dispatchEvent(new CustomEvent(`${this.#t}:${e}`,{detail:this.createEventPayload(e,t)}))),this.#d){this.debugLog(`Previously failed to connect, not emitting to bus`);return}if(!this.#a){this.debugLog(`Bus not available, will be pushed as soon as connected`),this.#i.push(this.createEventPayload(e,t)),typeof CustomEvent<`u`&&!this.#u&&(this.#h(),this.startConnectLoop());return}return this.emitEventToBus(this.createEventPayload(e,t))}on(e,t,n){let r=n?.withEventTarget??!1,i=`${this.#t}:${e}`;if(r&&(this.#f||=new EventTarget,this.#f.addEventListener(i,e=>{t(e.detail)})),!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`,i),()=>{};let a=e=>{this.debugLog(`Received event from bus`,e.detail),t(e.detail)};return this.#n().addEventListener(i,a),this.debugLog(`Registered event to bus`,i),()=>{r&&this.#f?.removeEventListener(i,a),this.#n().removeEventListener(i,a)}}onAll(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}onAllPluginEvents(e){if(!this.#e)return this.debugLog(`Event bus client is disabled, not registering event`),()=>{};let t=t=>{let n=t.detail;this.#t&&n.pluginId!==this.#t||e(n)};return this.#n().addEventListener(`tanstack-devtools-global`,t),()=>this.#n().removeEventListener(`tanstack-devtools-global`,t)}},fO=class extends dO{constructor(){super({pluginId:`tanstack-ai-devtools`})}},pO=Symbol.for(`tanstack.ai.devtools.eventClient`);function mO(){let e=globalThis,t=e[pO];if(t)return t;let n=new fO;return e[pO]=n,n}var hO=mO();function gO(e,t){hO.emit(e,t)}function _O(e){if(e.approvalSchema!==void 0&&e.needsApproval!==!0)throw TypeError(`approvalSchema requires needsApproval: true.`);let t=e.inputSchema,n=e.outputSchema,r=e.approvalSchema,i=e.needsApproval;return{__toolSide:`definition`,...e,inputSchema:t,outputSchema:n,approvalSchema:r,needsApproval:i,server(a){return{__toolSide:`server`,...e,inputSchema:t,outputSchema:n,approvalSchema:r,needsApproval:i,execute:a}},client(a){return{__toolSide:`client`,...e,inputSchema:t,outputSchema:n,approvalSchema:r,needsApproval:i,...a!==void 0&&{execute:a}}}}}function vO(e){return typeof e==`string`&&e!==``?e:void 0}function yO(e){if(`runId`in e){let t=vO(e.runId);if(t!==void 0)return t}return vO(uE(e)?.runId)}var bO=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Allow=e.ALL=e.COLLECTION=e.ATOM=e.SPECIAL=e.INF=e._INFINITY=e.INFINITY=e.NAN=e.BOOL=e.NULL=e.OBJ=e.ARR=e.NUM=e.STR=void 0,e.STR=1,e.NUM=2,e.ARR=4,e.OBJ=8,e.NULL=16,e.BOOL=32,e.NAN=64,e.INFINITY=128,e._INFINITY=256,e.INF=e.INFINITY|e._INFINITY,e.SPECIAL=e.NULL|e.BOOL|e.INF|e.NAN,e.ATOM=e.STR|e.NUM|e.SPECIAL,e.COLLECTION=e.ARR|e.OBJ,e.ALL=e.ATOM|e.COLLECTION,e.Allow={STR:e.STR,NUM:e.NUM,ARR:e.ARR,OBJ:e.OBJ,NULL:e.NULL,BOOL:e.BOOL,NAN:e.NAN,INFINITY:e.INFINITY,_INFINITY:e._INFINITY,INF:e.INF,SPECIAL:e.SPECIAL,ATOM:e.ATOM,COLLECTION:e.COLLECTION,ALL:e.ALL},e.default=e.Allow})),xO=t((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.Allow=e.MalformedJSON=e.PartialJSON=e.parseJSON=e.parse=void 0;var r=bO();Object.defineProperty(e,"Allow",{enumerable:!0,get:function(){return r.Allow}}),n(bO(),e);var i=class extends Error{};e.PartialJSON=i;var a=class extends Error{};e.MalformedJSON=a;function o(e,t=r.Allow.ALL){if(typeof e!=`string`)throw TypeError(`expecting str, got ${typeof e}`);if(!e.trim())throw Error(`${e} is empty`);return s(e.trim(),t)}e.parseJSON=o;var s=(e,t)=>{let n=e.length,o=0,s=e=>{throw new i(`${e} at position ${o}`)},c=e=>{throw new a(`${e} at position ${o}`)},l=()=>(m(),o>=n&&s(`Unexpected end of input`),e[o]===`"`?u():e[o]===`{`?d():e[o]===`[`?f():e.substring(o,o+4)===`null`||r.Allow.NULL&t&&n-o<4&&`null`.startsWith(e.substring(o))?(o+=4,null):e.substring(o,o+4)===`true`||r.Allow.BOOL&t&&n-o<4&&`true`.startsWith(e.substring(o))?(o+=4,!0):e.substring(o,o+5)===`false`||r.Allow.BOOL&t&&n-o<5&&`false`.startsWith(e.substring(o))?(o+=5,!1):e.substring(o,o+8)===`Infinity`||r.Allow.INFINITY&t&&n-o<8&&`Infinity`.startsWith(e.substring(o))?(o+=8,1/0):e.substring(o,o+9)===`-Infinity`||r.Allow._INFINITY&t&&1<n-o&&n-o<9&&`-Infinity`.startsWith(e.substring(o))?(o+=9,-1/0):e.substring(o,o+3)===`NaN`||r.Allow.NAN&t&&n-o<3&&`NaN`.startsWith(e.substring(o))?(o+=3,NaN):p()),u=()=>{let i=o,a=!1;for(o++;o<n&&(e[o]!==`"`||a&&e[o-1]===`\\`);)a=e[o]===`\\`&&!a,o++;if(e.charAt(o)==`"`)try{return JSON.parse(e.substring(i,++o-Number(a)))}catch(e){c(String(e))}else if(r.Allow.STR&t)try{return JSON.parse(e.substring(i,o-Number(a))+`"`)}catch{return JSON.parse(e.substring(i,e.lastIndexOf(`\\`))+`"`)}s(`Unterminated string literal`)},d=()=>{o++,m();let i={};try{for(;e[o]!==`}`;){if(m(),o>=n&&r.Allow.OBJ&t)return i;let a=u();m(),o++;try{i[a]=l()}catch(e){if(r.Allow.OBJ&t)return i;throw e}m(),e[o]===`,`&&o++}}catch{if(r.Allow.OBJ&t)return i;s(`Expected '}' at end of object`)}return o++,i},f=()=>{o++;let n=[];try{for(;e[o]!==`]`;)n.push(l()),m(),e[o]===`,`&&o++}catch{if(r.Allow.ARR&t)return n;s(`Expected ']' at end of array`)}return o++,n},p=()=>{if(o===0){e===`-`&&c(`Not sure what '-' is`);try{return JSON.parse(e)}catch(n){if(r.Allow.NUM&t)try{return JSON.parse(e.substring(0,e.lastIndexOf(`e`)))}catch{}c(String(n))}}let i=o;for(e[o]===`-`&&o++;e[o]&&`,]}`.indexOf(e[o])===-1;)o++;o==n&&!(r.Allow.NUM&t)&&s(`Unterminated number literal`);try{return JSON.parse(e.substring(i,o))}catch{e.substring(i,o)===`-`&&s(`Not sure what '-' is`);try{return JSON.parse(e.substring(i,e.lastIndexOf(`e`)))}catch(e){c(String(e))}}},m=()=>{for(;o<n&&`
13
+ \r `.includes(e[o]);)o++};return l()};e.parse=o}))(),SO=new class{parse(e){if(e&&e.trim()!==``)try{return(0,xO.parse)(e)}catch{return}}};function CO(e){return SO.parse(e)}var wO=class{shouldEmit(e,t){return!0}};function TO(e,t,n){return e.map(e=>{if(e.id!==t)return e;let r=[...e.parts],i=r.length>0?r[r.length-1]:null;return i&&i.type===`text`?r[r.length-1]={type:`text`,content:n}:r.push({type:`text`,content:n}),{...e,parts:r}})}function EO(e,t,n){return e.map(e=>{if(e.id!==t)return e;let r=[...e.parts],i=r.find(e=>e.type===`tool-call`&&e.id===n.id),a=n.metadata??i?.metadata,o=n.input??i?.input,s={type:`tool-call`,id:n.id,name:n.name,arguments:n.arguments,state:n.state,...i?.approval&&{approval:{...i.approval}},...i?.output!==void 0&&{output:i.output},...o!==void 0&&{input:o},...a!==void 0&&{metadata:a}};return i?r[r.indexOf(i)]=s:r.push(s),{...e,parts:r}})}function DO(e,t,n,r,i,a){return e.map(e=>{if(e.id!==t)return e;let o=[...e.parts],s=o.findIndex(e=>e.type===`tool-result`&&e.toolCallId===n),c={type:`tool-result`,toolCallId:n,content:r,state:i,...a&&{error:a}};return s>=0?o[s]=c:o.push(c),{...e,parts:o}})}function OO(e,t,n,r){return e.map(e=>{if(e.id!==t)return e;let i=[...e.parts],a=i.find(e=>e.type===`tool-call`&&e.id===n);if(a){let e=i.indexOf(a);i[e]={...a,state:`approval-requested`,approval:{id:r,needsApproval:!0}}}return{...e,parts:i}})}function kO(e,t,n,r,i){return e.map(e=>{let a=[...e.parts],o=a.find(e=>e.type===`tool-call`&&e.id===t);if(o){let e=a.indexOf(o);a[e]={...o,output:i?{error:i}:n,state:r??(i?`error`:`complete`)}}return{...e,parts:a}})}function AO(e,t,n){return e.map(e=>{let r=[...e.parts],i=r.find(e=>e.type===`tool-call`&&e.approval?.id===t);if(i&&i.approval){let e=r.indexOf(i);r[e]={...i,approval:{...i.approval,approved:n},state:`approval-responded`}}return{...e,parts:r}})}function jO(e,t,n){return e.map(e=>{if(e.id!==t)return e;let r=[...e.parts],i=r.findIndex(e=>e.type===`structured-output`),a=i>=0?r[i]:null,o=(a?.raw??``)+n,s=CO(o)??a?.partial,c={type:`structured-output`,status:`streaming`,raw:o,...s===void 0?{}:{partial:s},...a?.reasoning===void 0?{}:{reasoning:a.reasoning}};return i>=0?r[i]=c:r.push(c),{...e,parts:r}})}function MO(e,t,n,r,i){return e.map(e=>{if(e.id!==t)return e;let a=[...e.parts],o=a.findIndex(e=>e.type===`structured-output`),s=o>=0?a[o].raw:``,c=r||s;if(c===``&&n!==void 0)try{c=JSON.stringify(n)}catch{}let l={type:`structured-output`,status:`complete`,data:n,partial:n,raw:c,...i===void 0?{}:{reasoning:i}};return o>=0?a[o]=l:a.push(l),{...e,parts:a}})}function NO(e,t,n){return e.map(e=>{if(e.id!==t)return e;let r=[...e.parts],i=r.findIndex(e=>e.type===`structured-output`);if(i<0)return r.push({type:`structured-output`,status:`error`,raw:``,errorMessage:n}),{...e,parts:r};let a=r[i];return a.status===`complete`?e:(r[i]={...a,status:`error`,errorMessage:n},{...e,parts:r})})}function PO(e,t,n,r,i){return e.map(e=>{if(e.id!==t)return e;let a=[...e.parts],o=a.findIndex(e=>e.type===`thinking`&&e.stepId===n),s={type:`thinking`,content:r,stepId:n,...i&&{signature:i}};return o>=0?a[o]=s:a.push(s),{...e,parts:a}})}var FO=12;function IO(e){return e.some(e=>{let t=e.metadata;if(!t||typeof t!=`object`||Array.isArray(t))return!1;let n=t[WE];return typeof n==`object`&&!!n&&!Array.isArray(n)&&n.kind===`generic`})}var LO=class e{chunkStrategy;events;jsonParser;recordingEnabled;messages=[];messageStates=new Map;activeMessageIds=new Set;toolCallToMessage=new Map;pendingManualMessageId=null;pendingThinkingStepId=null;structuredMessageIds=new Set;structuredOutputUpdateBatches=new Map;activeRuns=new Set;finishReason=null;hasError=!1;isDone=!1;streamEndEmitted=!1;recording=null;recordingStartTime=0;constructor(e={}){this.chunkStrategy=e.chunkStrategy||new wO,this.events=e.events||{},this.jsonParser=e.jsonParser||SO,this.recordingEnabled=e.recording??!1,e.initialMessages&&(this.messages=[...e.initialMessages])}setMessages(e){this.messages=[...e],this.emitMessagesChange()}addUserMessage(e,t,n){let r=typeof e==`string`?[{type:`text`,content:e}]:e.map(e=>e),i={id:t??zD(),role:`user`,parts:r,createdAt:new Date,...n==null?{}:{metadata:n}};return this.messages=[...this.messages,i],this.emitMessagesChange(),i}prepareAssistantMessage(){this.resetStreamState()}startAssistantMessage(e){this.prepareAssistantMessage();let{messageId:t}=this.ensureAssistantMessage(e);return this.pendingManualMessageId=t,t}getCurrentAssistantMessageId(){let e=null;for(let[t,n]of this.messageStates)n.role===`assistant`&&(e=t);return e}addToolResult(e,t,n){let r=this.messages.find(t=>t.parts.some(t=>t.type===`tool-call`&&t.id===e));if(!r){console.warn(`[StreamProcessor] Could not find message with tool call ${e}`);return}let i=kO(this.messages,e,t,n?`error`:void 0,n),a=sD(t),o=n?`error`:`complete`;i=DO(i,r.id,e,a,o,n),this.messages=i,this.emitMessagesChange()}addToolApprovalResponse(e,t){this.messages=AO(this.messages,e,t),this.emitMessagesChange()}toModelMessages(){let e=[];for(let t of this.messages)e.push(...OD(t));return e}getMessages(){return this.messages}areAllToolsComplete(){let e=this.messages.findLast(e=>e.role===`assistant`);if(!e)return!0;let t=e.parts.filter(e=>e.type===`tool-call`);if(t.length===0)return!0;let n=new Set(e.parts.filter(e=>e.type===`tool-result`).map(e=>e.toolCallId));return t.every(e=>e.state===`complete`||e.state===`approval-responded`||e.output!==void 0&&!e.approval||n.has(e.id)||lD(e))}removeMessagesAfter(e){let t=new Set(this.messages.slice(0,e+1).map(e=>e.id));for(let e of this.structuredMessageIds)t.has(e)||this.structuredMessageIds.delete(e);for(let e of this.structuredOutputUpdateBatches.keys())t.has(e)||this.structuredOutputUpdateBatches.delete(e);for(let e of this.messageStates.keys())t.has(e)||this.messageStates.delete(e);for(let[e,n]of this.toolCallToMessage)t.has(n)||this.toolCallToMessage.delete(e);for(let e of this.activeMessageIds)t.has(e)||this.activeMessageIds.delete(e);this.messages=this.messages.slice(0,e+1),this.emitMessagesChange()}clearMessages(){this.messages=[],this.messageStates.clear(),this.activeMessageIds.clear(),this.toolCallToMessage.clear(),this.structuredMessageIds.clear(),this.structuredOutputUpdateBatches.clear(),this.pendingManualMessageId=null,this.emitMessagesChange()}async process(e){this.resetStreamState(),this.recordingEnabled&&this.startRecording();for await(let t of e)this.processChunk(t);return this.finalizeStream(),this.recording&&(this.recording.result=this.getResult()),this.getResult()}processChunk(e){switch(this.recording&&this.recording.chunks.push({chunk:e,timestamp:Date.now(),index:this.recording.chunks.length}),e.type){case`TEXT_MESSAGE_START`:this.handleTextMessageStartEvent(e);break;case`TEXT_MESSAGE_CONTENT`:this.handleTextMessageContentEvent(e);break;case`TEXT_MESSAGE_END`:this.handleTextMessageEndEvent(e);break;case`TOOL_CALL_START`:this.handleToolCallStartEvent(e);break;case`TOOL_CALL_ARGS`:this.handleToolCallArgsEvent(e);break;case`TOOL_CALL_END`:this.handleToolCallEndEvent(e);break;case`RUN_FINISHED`:this.handleRunFinishedEvent(e);break;case`RUN_ERROR`:this.handleRunErrorEvent(e);break;case`STEP_FINISHED`:this.handleStepFinishedEvent(e);break;case`MESSAGES_SNAPSHOT`:this.handleMessagesSnapshotEvent(e);break;case`CUSTOM`:this.handleCustomEvent(e);break;case`RUN_STARTED`:this.handleRunStartedEvent(e);break;case`REASONING_START`:case`REASONING_MESSAGE_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:break;case`REASONING_MESSAGE_CONTENT`:this.handleReasoningMessageContentEvent(e);break;case`REASONING_ENCRYPTED_VALUE`:this.handleReasoningEncryptedValueEvent(e);break;case`TOOL_CALL_RESULT`:this.handleToolCallResultEvent(e);break;case`STEP_STARTED`:this.handleStepStartedEvent(e)}}createMessageState(e,t){let n={id:e,role:t,totalTextContent:``,currentSegmentText:``,lastEmittedText:``,hasSeenReasoningEvents:!1,thinkingSteps:new Map,thinkingStepSignatures:new Map,thinkingStepOrder:[],currentThinkingStepId:null,toolCalls:new Map,toolCallOrder:[],hasToolCallsSinceTextStart:!1,isComplete:!1};return this.messageStates.set(e,n),n}getMessageState(e){return this.messageStates.get(e)}consumePendingThinkingStep(e){if(!this.pendingThinkingStepId)return;let t=this.pendingThinkingStepId;e.currentThinkingStepId=t,e.thinkingSteps.has(t)||(e.thinkingSteps.set(t,``),e.thinkingStepOrder.push(t)),this.pendingThinkingStepId=null}getActiveAssistantMessageId(){let e=Array.from(this.activeMessageIds).reverse();for(let t of e){let e=this.messageStates.get(t);if(e&&e.role===`assistant`)return t}for(let[e,t]of[...this.messageStates].reverse())if(t.role===`assistant`)return e;return null}resumeAssistantState(e,t){this.activeMessageIds.add(e),(t.isComplete||this.isDone)&&(t.isComplete=!1,this.isDone=!1)}ensureAssistantMessage(e){if(e){let t=this.getMessageState(e);if(t)return this.resumeAssistantState(e,t),{messageId:e,state:t}}let t=this.getActiveAssistantMessageId();if(t){let e=this.getMessageState(t);if(e)return this.resumeAssistantState(t,e),{messageId:t,state:e}}if(e){let t=this.messages.find(t=>t.id===e);if(t){let n=this.createMessageState(e,t.role);this.activeMessageIds.add(e);let r=t.parts.length>0?t.parts[t.parts.length-1]:null;return r&&r.type===`text`&&(n.currentSegmentText=r.content,n.lastEmittedText=r.content,n.totalTextContent=r.content),{messageId:e,state:n}}}let n=e||zD(),r={id:n,role:`assistant`,parts:[],createdAt:new Date};this.messages=[...this.messages,r];let i=this.createMessageState(n,`assistant`);return this.activeMessageIds.add(n),this.pendingManualMessageId=n,this.events.onStreamStart?.(),this.emitMessagesChange(),{messageId:n,state:i}}mergeMessageMetadata(e,t){if(typeof t!=`object`||!t||Array.isArray(t))return;let n=this.messages.find(t=>t.id===e);if(!n)return;let r=t,i=uE(r),a=i!=null&&(`content`in i||`args`in i)?{...r,tanstack:Object.fromEntries(Object.entries(i).filter(([e])=>e!==`content`&&e!==`args`))}:r,o=lE(n.metadata,a),s=yD(uE(r)?.createdAt),c=s!==void 0;this.messages=this.messages.map(t=>t.id===e?{...t,...o===void 0?{}:{metadata:o},...c?{createdAt:s}:{}}:t),this.emitMessagesChange()}handleTextMessageStartEvent(e){let{messageId:t,role:n}=e,r=n===`user`||n===`system`?n:`assistant`;if(this.pendingManualMessageId){let n=this.pendingManualMessageId;if(this.pendingManualMessageId=null,n!==t){this.messages=this.messages.map(e=>e.id===n?{...e,id:t}:e);let e=this.messageStates.get(n);e&&(e.id=t,this.messageStates.delete(n),this.messageStates.set(t,e)),this.activeMessageIds.delete(n),this.activeMessageIds.add(t);for(let[e,r]of this.toolCallToMessage)r===n&&this.toolCallToMessage.set(e,t)}let i=this.messageStates.get(t);i?i.hasToolCallsSinceTextStart&&(i.currentSegmentText!==i.lastEmittedText&&this.emitTextUpdateForMessage(t),i.currentSegmentText=``,i.lastEmittedText=``,i.hasToolCallsSinceTextStart=!1):(i=this.createMessageState(t,r),this.activeMessageIds.add(t)),this.mergeMessageMetadata(t,e.metadata),this.emitMessagesChange();return}if(this.messages.find(e=>e.id===t)){this.activeMessageIds.add(t);let n=this.messageStates.get(t);n?n.hasToolCallsSinceTextStart&&=(n.currentSegmentText!==n.lastEmittedText&&this.emitTextUpdateForMessage(t),n.currentSegmentText=``,n.lastEmittedText=``,!1):this.createMessageState(t,r),this.mergeMessageMetadata(t,e.metadata);return}let i={id:t,role:r,parts:[],createdAt:new Date};this.messages=[...this.messages,i],this.createMessageState(t,r),this.activeMessageIds.add(t),this.mergeMessageMetadata(t,e.metadata),this.events.onStreamStart?.(),this.emitMessagesChange()}handleTextMessageEndEvent(e){let{messageId:t}=e;this.mergeMessageMetadata(t,e.metadata);let n=this.getMessageState(t);n&&(n.isComplete||n.currentSegmentText!==n.lastEmittedText&&this.emitTextUpdateForMessage(t))}handleMessagesSnapshotEvent(e){this.resetStreamState();let t=this.messages,n=new Map(t.map(e=>[e.id,e])),r=this.mergeReasoningFanOut(e.messages.map(PD));this.messages=this.reconcileSnapshotToolCalls(r,t).map(e=>{if(e.metadata!=null)return e;let t=n.get(e.id);return t?.metadata==null?e:{...e,metadata:t.metadata}}),this.emitMessagesChange()}mergeReasoningFanOut(e){let t=[],n=[],r=e=>e.parts.filter(e=>e.type===`thinking`),i=e=>e.role===`assistant`&&e.parts.length>0&&e.parts.every(e=>e.type===`thinking`),a=e=>e.role===`assistant`&&e.parts.some(e=>e.type===`tool-result`)&&e.parts.every(e=>e.type===`tool-result`||e.type===`ui-resource`),o=()=>{t.push(...n),n=[]};for(let s of e){if(i(s)){n.push(s);continue}if(s.role===`assistant`&&n.length>0&&!a(s)){t.push({...s,parts:[...n.flatMap(r),...s.parts]}),n=[];continue}o(),t.push(s)}return o(),t}reconcileSnapshotToolCalls(e,t){let n=new Map;for(let e of t)for(let t of e.parts)t.type===`tool-call`&&n.set(t.id,t);let r=new Set;for(let t of e)for(let e of t.parts)e.type===`tool-call`&&r.add(e.id);let i=[];for(let t of e){let e=t.parts.filter(e=>e.type===`tool-result`),a=t.role===`assistant`&&e.length===1&&t.parts.every(e=>e.type===`tool-result`||e.type===`ui-resource`)?e[0]:void 0;if(!a){i.push(t);continue}let o=i.findLast(e=>e.parts.some(e=>e.type===`tool-call`&&e.id===a.toolCallId))??i.findLast(e=>e.role===`assistant`&&(e.parts.length!==1||e.parts[0]?.type!==`tool-result`));if(!o){r.has(a.toolCallId)||console.warn(`[StreamProcessor] MESSAGES_SNAPSHOT contains a tool-result for "${a.toolCallId}" but no matching tool-call exists in the snapshot, and there is no assistant message to anchor into; addToolResult("${a.toolCallId}") will not be able to locate this call`),i.push(t);continue}let s=[...o.parts];if(!r.has(a.toolCallId)&&!s.some(e=>e.type===`tool-call`&&e.id===a.toolCallId)){let e=n.get(a.toolCallId);e?(s.push({...e}),r.add(e.id)):console.warn(`[StreamProcessor] MESSAGES_SNAPSHOT contains a tool-result for "${a.toolCallId}" but no matching tool-call exists in the snapshot or the pre-snapshot state; addToolResult("${a.toolCallId}") will not be able to locate this call`)}s.push(...t.parts),o.parts=s}return this.enrichSnapshotToolCallsFromResults(i,n)}enrichSnapshotToolCallsFromResults(e,t){let n=new Map;for(let t of e)for(let e of t.parts)e.type===`tool-result`&&n.set(e.toolCallId,e);return e.map(e=>{let r=e.parts.map(e=>{if(e.type!==`tool-call`)return e;let r=t.get(e.id),i=n.get(e.id),a=e;if(r&&(r.output!==void 0||r.state===`complete`||r.state===`error`)&&(e.output===void 0||e.state===`input-complete`||e.state===`input-streaming`||e.state===`awaiting-input`)&&(a={...e,...r.output===void 0?{}:{output:r.output},state:r.state,...r.approval===void 0?{}:{approval:r.approval},...r.metadata===void 0?{}:{metadata:r.metadata}}),i&&a.output===void 0){let e;if(Array.isArray(i.content))e=i.content;else try{e=JSON.parse(i.content)}catch{e=i.content}let t=i.state===`error`?this.extractToolResultError(e):void 0;a={...a,output:t?{error:t}:e,state:i.state===`error`?`error`:`complete`}}return a});return r.some((t,n)=>t!==e.parts[n])?{...e,parts:r}:e})}handleTextMessageContentEvent(e){let{messageId:t,state:n}=this.ensureAssistantMessage(e.messageId);if(this.mergeMessageMetadata(t,e.metadata),this.structuredMessageIds.has(t)){let r=e.delta||``;r!==``&&(this.messages=jO(this.messages,t,r),n.totalTextContent+=r,this.queueStructuredOutputUpdate(t,r),this.emitMessagesChange());return}let r=n.currentSegmentText;n.hasToolCallsSinceTextStart&&r.length>0&&this.isNewTextSegment(e,r)&&(r!==n.lastEmittedText&&this.emitTextUpdateForMessage(t),n.currentSegmentText=``,n.lastEmittedText=``,n.hasToolCallsSinceTextStart=!1),n.hasToolCallsSinceTextStart=!1;let i=n.currentSegmentText,a=e.delta||``,o=a===``?i:i+a,s=o.slice(i.length);n.currentSegmentText=o,n.totalTextContent+=s;let c=e.delta||``;this.chunkStrategy.shouldEmit(c,n.currentSegmentText)&&n.currentSegmentText!==n.lastEmittedText&&this.emitTextUpdateForMessage(t)}handleToolCallStartEvent(e){let t=e.parentMessageId??this.getActiveAssistantMessageId(),{messageId:n,state:r}=this.ensureAssistantMessage(t??void 0);r.hasToolCallsSinceTextStart=!0;let i=e.toolCallId;if(!r.toolCalls.get(i)){let t=`awaiting-input`,a=e.toolCallName,o=e.metadata,s={id:e.toolCallId,name:a,arguments:``,state:t,parsedArguments:void 0,index:r.toolCalls.size,...o!==void 0&&{metadata:o}};r.toolCalls.set(i,s),r.toolCallOrder.push(i),this.toolCallToMessage.set(i,n),this.messages=EO(this.messages,n,{id:e.toolCallId,name:a,arguments:``,state:t,...o!==void 0&&{metadata:o}}),this.emitMessagesChange(),this.events.onToolCallStateChange?.(n,e.toolCallId,t,``)}}handleToolCallArgsEvent(e){let t=e.toolCallId,n=this.toolCallToMessage.get(t);if(!n)return;let r=this.getMessageState(n);if(!r)return;let i=r.toolCalls.get(t);if(!i)return;let a=i.state===`awaiting-input`;i.arguments+=e.delta||``,a&&e.delta&&(i.state=`input-streaming`),i.parsedArguments=this.jsonParser.parse(i.arguments),this.messages=EO(this.messages,n,{id:i.id,name:i.name,arguments:i.arguments,state:i.state}),this.emitMessagesChange(),this.events.onToolCallStateChange?.(n,i.id,i.state,i.arguments)}handleToolCallEndEvent(e){let t=this.toolCallToMessage.get(e.toolCallId);if(!t)return;let n=this.getMessageState(t);if(!n)return;let r=e.input===void 0?uE(e)?.input:e.input,i=n.toolCalls.get(e.toolCallId);if(i&&i.state!==`input-complete`){if(r!==void 0&&!i.arguments)try{i.arguments=JSON.stringify(r)}catch{}let a=n.toolCallOrder.indexOf(e.toolCallId);this.completeToolCall(t,a,i),r!==void 0&&(i.parsedArguments=r,this.messages=EO(this.messages,t,{id:i.id,name:i.name,arguments:i.arguments,state:`input-complete`,input:r,...i.metadata!==void 0&&{metadata:i.metadata}}),this.emitMessagesChange())}}extractToolResultError(e){return e&&typeof e==`object`&&`error`in e&&typeof e.error==`string`?e.error:typeof e==`string`?e:`Tool execution failed`}handleToolCallResultEvent(e){let t=this.toolCallToMessage.get(e.toolCallId)??this.messages.find(t=>t.parts.some(t=>t.type===`tool-call`&&t.id===e.toolCallId))?.id;if(!t)return;let n=e.state===`output-error`||uE(e)?.state===`output-error`,r;try{r=JSON.parse(e.content)}catch{r=e.content}this.messages=kO(this.messages,e.toolCallId,r,n?`error`:void 0);let i=n?`error`:`complete`;this.messages=DO(this.messages,t,e.toolCallId,e.content,i,i===`error`?this.extractToolResultError(r):void 0),this.emitMessagesChange()}handleRunStartedEvent(e){this.activeRuns.add(e.runId)}handleRunFinishedEvent(e){let t=e;if(this.finishReason=t.finishReason===void 0?uE(e)?.finishReason??null:t.finishReason,this.activeRuns.delete(e.runId),e.outcome?.type===`interrupt`&&this.handleInterrupts(e.outcome.interrupts),this.activeRuns.size===0){if(this.completeAllToolCalls(),this.finishReason===`tool_calls`&&e.outcome?.type!==`interrupt`)return;this.isDone=!0,this.finalizeStream()}}handleInterrupts(e){let t=IO(e);for(let n of e){let e=n.metadata&&typeof n.metadata==`object`?n.metadata:{},r=typeof e.kind==`string`?e.kind:void 0,i=n.toolCallId;if(!i)continue;let a=typeof e.toolName==`string`?e.toolName:this.findToolCallName(i),o=Object.hasOwn(e,`input`)?e.input:{};if(r===`approval`||n.reason===`approval_required`){let e=this.getActiveAssistantMessageId()??this.toolCallToMessage.get(i)??this.messages.find(e=>e.role===`assistant`&&e.parts.some(e=>e.type===`tool-call`&&e.id===i))?.id;e&&(this.messages=OO(this.messages,e,i,n.id),this.emitMessagesChange()),this.events.onApprovalRequest?.({toolCallId:i,toolName:a,input:o,approvalId:n.id});continue}if(r===`client_tool`||n.reason===`client_tool_input`){if(t)continue;this.events.onToolCall?.({toolCallId:i,toolName:a,input:o})}}}findToolCallName(e){for(let t of this.messageStates.values()){let n=t.toolCalls.get(e);if(n)return n.name}return``}handleRunErrorEvent(e){this.hasError=!0;let t=yO(e);t?this.activeRuns.delete(t):this.activeRuns.clear();let{messageId:n}=this.ensureAssistantMessage(),r=e.message||`An error occurred`;e.message||console.error(`[StreamProcessor] RUN_ERROR with no message; original chunk:`,e),this.structuredMessageIds.has(n)&&(this.flushStructuredOutputUpdate(n),this.messages=NO(this.messages,n,r),this.structuredMessageIds.delete(n),this.emitStructuredOutputChange(n,`error`),this.emitMessagesChange()),this.events.onError?.(fE(e))}handleStepStartedEvent(e){let t=e.stepName||zD(),n=this.getActiveAssistantMessageId();if(n){let e=this.getMessageState(n);if(e){e.currentThinkingStepId=t,e.thinkingSteps.has(t)||(e.thinkingSteps.set(t,``),e.thinkingStepOrder.push(t)),this.pendingThinkingStepId=null;return}}this.pendingThinkingStepId=t}handleStepFinishedEvent(e){let t=e,n=t.signature;if(!n)return;let{messageId:r,state:i}=this.ensureAssistantMessage(this.getActiveAssistantMessageId()??void 0),a=i.currentThinkingStepId??t.stepId;if(!a)return;let o=i.thinkingSteps.get(a);o!==void 0&&(i.thinkingStepSignatures.set(a,n),this.messages=PO(this.messages,r,a,o,n),this.emitMessagesChange())}handleReasoningMessageContentEvent(e){let{messageId:t,state:n}=this.ensureAssistantMessage(this.getActiveAssistantMessageId()??void 0);n.hasSeenReasoningEvents=!0;let r=e.delta||``;this.consumePendingThinkingStep(n);let i=n.currentThinkingStepId??e.messageId;n.thinkingSteps.has(i)||(n.thinkingSteps.set(i,``),n.thinkingStepOrder.push(i),n.currentThinkingStepId=i);let a=(n.thinkingSteps.get(i)??``)+r;n.thinkingSteps.set(i,a),this.messages=PO(this.messages,t,i,a,n.thinkingStepSignatures.get(i)),this.emitMessagesChange(),this.events.onThinkingUpdate?.(t,i,a)}handleReasoningEncryptedValueEvent(e){let t=e.encryptedValue;if(typeof t!=`string`||t===``)return;if(e.subtype===`tool-call`){this.attachToolCallSignature(e.entityId,t);return}let{messageId:n,state:r}=this.ensureAssistantMessage(this.getActiveAssistantMessageId()??void 0),i=r.currentThinkingStepId??e.entityId;r.thinkingStepSignatures.set(i,t);let a=r.thinkingSteps.get(i)??``;r.thinkingSteps.has(i)||(r.thinkingSteps.set(i,a),r.thinkingStepOrder.push(i)),this.messages=PO(this.messages,n,i,a,t),this.emitMessagesChange()}attachToolCallSignature(e,t){this.messages=this.messages.map(n=>{let r=!1,i=n.parts.map(n=>n.type!==`tool-call`||n.id!==e?n:(r=!0,{...n,metadata:{...n.metadata!=null&&typeof n.metadata==`object`?n.metadata:{},thoughtSignature:t}}));return r?{...n,parts:i}:n});for(let n of this.messageStates.values()){let r=n.toolCalls.get(e);r&&(r.metadata={...r.metadata??{},thoughtSignature:t})}this.emitMessagesChange()}handleCustomEvent(e){let t=this.getActiveAssistantMessageId();if(e.name===`structured-output.start`&&e.value){let n=e.value,{messageId:r}=this.ensureAssistantMessage(n.messageId??t??void 0);r&&(this.structuredMessageIds.add(r),this.structuredOutputUpdateBatches.delete(r),this.events.onStructuredOutputChange?.({phase:`start`,messageId:r,status:`streaming`,raw:``}));return}if(e.name===`structured-output.complete`&&e.value){let n=e.value,{messageId:r}=this.ensureAssistantMessage(n.messageId??t??void 0);r&&(this.flushStructuredOutputUpdate(r),this.messages=MO(this.messages,r,n.object,n.raw??``,n.reasoning),this.structuredMessageIds.delete(r),this.emitStructuredOutputChange(r,`complete`),this.emitMessagesChange())}if(e.name===`tool-input-available`&&e.value){let{toolCallId:t,toolName:n,input:r}=e.value;this.events.onToolCall?.({toolCallId:t,toolName:n,input:r});return}if(e.name===`approval-requested`&&e.value){let{toolCallId:n,toolName:r,input:i,approval:a}=e.value,o=t??this.toolCallToMessage.get(n);o&&(this.messages=OO(this.messages,o,n,a.id),this.emitMessagesChange()),this.events.onApprovalRequest?.({toolCallId:n,toolName:r,input:i,approvalId:a.id});return}if(e.name===`ui-resource`&&e.value){let n=e.value,r=this.toolCallToMessage.get(n.toolCallId)??t;if(r){let e={type:`ui-resource`,resource:n.resource,toolCallId:n.toolCallId,toolName:n.toolName,...n.serverId!==void 0&&{serverId:n.serverId},...n.meta!==void 0&&{meta:n.meta}};this.messages=this.messages.map(t=>t.id===r?{...t,parts:[...t.parts,e]}:t),this.emitMessagesChange()}else console.warn(`[mcp-apps] dropped ui-resource: no target message for toolCallId "${n.toolCallId}" (toolName "${n.toolName}")`);return}if(this.events.onCustomEvent){let t=e.value&&typeof e.value==`object`?e.value.toolCallId:void 0;this.events.onCustomEvent(e.name,e.value,{toolCallId:t})}}isNewTextSegment(e,t){return!0}completeAllToolCalls(){for(let e of this.activeMessageIds)this.completeAllToolCallsForMessage(e)}completeAllToolCallsForMessage(e){let t=this.getMessageState(e);t&&t.toolCalls.forEach((n,r)=>{if(n.state!==`input-complete`){let i=t.toolCallOrder.indexOf(r);this.completeToolCall(e,i,n)}})}completeToolCall(e,t,n){n.state=`input-complete`;let r=!1;try{n.parsedArguments=JSON.parse(n.arguments),r=!0}catch{n.parsedArguments=void 0}this.isToolCallPartErrored(n.id)||this.isToolCallPartAwaitingUserAction(n.id)||(this.messages=EO(this.messages,e,{id:n.id,name:n.name,arguments:n.arguments,state:`input-complete`,...r&&{input:n.parsedArguments},...n.metadata!==void 0&&{metadata:n.metadata}}),this.emitMessagesChange(),this.events.onToolCallStateChange?.(e,n.id,`input-complete`,n.arguments))}isToolCallPartAwaitingUserAction(e){return this.messages.some(t=>t.parts?.some(t=>t.type===`tool-call`&&t.id===e&&(t.state===`approval-requested`||t.state===`approval-responded`)))}isToolCallPartErrored(e){return this.messages.some(t=>t.parts?.some(t=>t.type===`tool-call`&&t.id===e&&t.state===`error`))}emitTextUpdateForMessage(e){let t=this.getMessageState(e);t&&(t.lastEmittedText=t.currentSegmentText,this.messages=TO(this.messages,e,t.currentSegmentText),this.emitMessagesChange(),this.events.onTextUpdate?.(e,t.currentSegmentText))}queueStructuredOutputUpdate(e,t){let n=this.structuredOutputUpdateBatches.get(e),r={delta:`${n?.delta??``}${t}`,chunkCount:(n?.chunkCount??0)+1};this.structuredOutputUpdateBatches.set(e,r),r.chunkCount>=FO&&this.flushStructuredOutputUpdate(e)}flushStructuredOutputUpdate(e){let t=this.structuredOutputUpdateBatches.get(e);t&&t.chunkCount!==0&&(this.structuredOutputUpdateBatches.delete(e),this.emitStructuredOutputChange(e,`update`,t.delta))}emitStructuredOutputChange(e,t,n){let r=this.messages.find(t=>t.id===e)?.parts.find(e=>e.type===`structured-output`);r&&this.events.onStructuredOutputChange?.({phase:t,messageId:e,status:r.status,raw:r.raw,...r.partial===void 0?{}:{partial:r.partial},...r.data===void 0?{}:{data:r.data},...r.reasoning===void 0?{}:{reasoning:r.reasoning},...r.errorMessage===void 0?{}:{errorMessage:r.errorMessage},...n===void 0?{}:{delta:n}})}emitMessagesChange(){this.events.onMessagesChange?.([...this.messages])}finalizeStream(){this.isDone=!0;let e;for(let t of this.activeMessageIds){let n=this.getMessageState(t);if(!n)continue;this.completeAllToolCallsForMessage(t),n.currentSegmentText!==n.lastEmittedText&&this.emitTextUpdateForMessage(t),n.isComplete=!0;let r=this.messages.find(e=>e.id===t);r&&r.role===`assistant`&&(e=r)}for(let e of this.structuredMessageIds)this.flushStructuredOutputUpdate(e),this.messages=NO(this.messages,e,`Stream ended without structured-output.complete`),this.emitStructuredOutputChange(e,`error`);if(this.structuredMessageIds.clear(),this.structuredOutputUpdateBatches.clear(),this.activeMessageIds.clear(),e&&!this.hasError&&this.isWhitespaceOnlyMessage(e)){this.messages=this.messages.filter(t=>t.id!==e.id),this.emitMessagesChange();return}e&&!this.streamEndEmitted&&(this.streamEndEmitted=!0,this.events.onStreamEnd?.(e))}getCompletedToolCalls(){let e=[];for(let t of this.messageStates.values())for(let n of t.toolCalls.values())n.state===`input-complete`&&e.push({id:n.id,type:`function`,function:{name:n.name,arguments:n.arguments},...n.metadata!==void 0&&{metadata:n.metadata}});return e}getResult(){let e=this.getCompletedToolCalls(),t=``,n=``;for(let e of this.messageStates.values()){t+=e.totalTextContent;for(let t of e.thinkingStepOrder)n+=e.thinkingSteps.get(t)??``}return{content:t,thinking:n||void 0,toolCalls:e.length>0?e:void 0,finishReason:this.finishReason}}getState(){let e=``,t=``,n=new Map,r=[];for(let i of this.messageStates.values()){e+=i.totalTextContent;for(let e of i.thinkingStepOrder)t+=i.thinkingSteps.get(e)??``;for(let[e,t]of i.toolCalls)n.set(e,t);r.push(...i.toolCallOrder)}return{content:e,thinking:t,toolCalls:n,toolCallOrder:r,finishReason:this.finishReason,done:this.isDone}}startRecording(){this.recordingEnabled=!0,this.recordingStartTime=Date.now(),this.recording={version:`1.0`,timestamp:this.recordingStartTime,chunks:[]}}getRecording(){return this.recording}resetStreamState(){this.messageStates.clear(),this.activeMessageIds.clear(),this.activeRuns.clear(),this.toolCallToMessage.clear(),this.structuredMessageIds.clear(),this.structuredOutputUpdateBatches.clear(),this.pendingManualMessageId=null,this.pendingThinkingStepId=null,this.finishReason=null,this.hasError=!1,this.isDone=!1,this.streamEndEmitted=!1,this.chunkStrategy.reset?.()}reset(){this.resetStreamState(),this.messages=[]}isWhitespaceOnlyMessage(e){return e.parts.length!==0&&e.parts.every(e=>e.type===`text`&&e.content.trim()===``)}static async replay(t,n){return new e(n).process(RO(t))}};function RO(e){return{async*[Symbol.asyncIterator](){for(let{chunk:t}of e.chunks)yield t}}}var zO=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.THINKING_START=`THINKING_START`,e.THINKING_END=`THINKING_END`,e.THINKING_TEXT_MESSAGE_START=`THINKING_TEXT_MESSAGE_START`,e.THINKING_TEXT_MESSAGE_CONTENT=`THINKING_TEXT_MESSAGE_CONTENT`,e.THINKING_TEXT_MESSAGE_END=`THINKING_TEXT_MESSAGE_END`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e}({}),BO=class extends Error{missingFeature;constructor(e){super(VO(e)),this.name=`UnsupportedResponseStreamError`,this.missingFeature=e}};function VO(e){return`Streaming fetch responses are not supported in this runtime because ${e} is unavailable. React Native users need a compatible fetch/stream/TextDecoder polyfill, or should use a fetch, XHR, or custom transport that can deliver streaming chunks.`}function HO(e){if(!e.body)throw new BO(`Response.body`);if(typeof e.body.getReader!=`function`)throw new BO(`Response.body.getReader`);return e.body.getReader()}function UO(){if(typeof globalThis.TextDecoder!=`function`)throw new BO(`TextDecoder`);return new globalThis.TextDecoder}function WO(e){if(!e.startsWith(`data:`))return e;let t=e.slice(5);return t.startsWith(` `)?t.slice(1):t}function GO(e){if(e instanceof Date)return Number.isNaN(e.getTime())?void 0:e;if(typeof e!=`string`)return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function KO(e){let t=GO(e.createdAt),n=e.parts.map(e=>{if(e.type!==`tool-result`)return e;let t=GO(e.createdAt),{createdAt:n,...r}=e;return t?{...r,createdAt:t}:r}),{createdAt:r,...i}=e;return t?{...i,parts:n,createdAt:t}:{...i,parts:n}}function qO(e){return e.map(KO)}var JO=/^[a-z][a-z0-9-]{0,63}$/;function YO(e){return typeof e==`string`&&JO.test(e)}function XO(e){if(typeof e!=`object`||!e||!(`error`in e))return!1;let t=e.error;return!(typeof t!=`object`||!t||!(`type`in t)||t.type!==`byok_missing`||!(`provider`in t)||typeof t.provider!=`string`||!YO(t.provider)||!(`message`in t)||typeof t.message!=`string`)}var ZO=class extends Error{provider;constructor(e){super(`Missing ${e} API key`),this.name=`ByokMissingError`,this.provider=e}},QO=class extends Error{provider;reason;constructor(e,t){super(t===`locked`?`${e} key is locked`:`Missing ${e} API key`),this.name=`ByokBlockedError`,this.provider=e,this.reason=t}},$O=class extends Error{constructor(){super(`BYOK is enabled but no provider slug was resolved. Pass byokProvider or forwardedProps.provider.`),this.name=`ByokUnresolvedProviderError`}},ek=new WeakMap;function tk(e){return ek.get(e)??yO(e)}var nk=class extends Error{constructor(){super(`Stream ended with unterminated trailing data — connection was likely cut short.`),this.name=`StreamTruncatedError`}},rk=class extends Error{constructor(e){super(`Stream response body read failed`,{cause:e}),this.name=`StreamReadError`}},ik=class extends Error{constructor(){super(`Durable run ended without a terminal event and could not resume — the run did not complete.`),this.name=`DurableStreamIncompleteError`}},ak=class extends Error{constructor(e){super(`Durable run exceeded its reconnect ceiling of ${e} attempts — giving up.`),this.name=`StreamReconnectLimitError`}};function ok(e){let t=e?.maxAttempts??5,n=e?.delayMs??250;if(!Number.isInteger(t)||t<0)throw Error(`Invalid reconnect.maxAttempts: ${t}. Must be a non-negative integer.`);if(!Number.isFinite(n)||n<0)throw Error(`Invalid reconnect.delayMs: ${n}. Must be a non-negative finite number.`);return{maxAttempts:t,delayMs:n}}function sk(e){let t=ok(e),n=new Set,r,i=0;return{get lastEventId(){return r},note(e){return e===void 0?`new`:e===``?(r=void 0,n.clear(),`reset`):n.has(e)?`duplicate`:(n.add(e),r=e,`new`)},async waitBeforeReconnect(e,n){if(e)i=0;else if(i+=1,i>t.maxAttempts)throw new ak(t.maxAttempts);await ck(t.delayMs,n)}}}function ck(e,t){return e<=0||t?.aborted?Promise.resolve():new Promise(n=>{let r=()=>{clearTimeout(i),n()},i=setTimeout(()=>{t?.removeEventListener(`abort`,r),n()},e);t?.addEventListener(`abort`,r,{once:!0})})}function lk(e){return`${e}-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function uk(e,t){if(!e)throw Error(`Cannot synthesize terminal event: ${t} not supplied via runContext and not observed in the upstream stream.`);return e}function dk(e){if(!e)return{};if(e instanceof Headers){let t={};return e.forEach((e,n)=>{t[n]=e}),t}return e}var fk=`X-Run-Id`;function pk(e){return e===void 0?{}:{[fk]:e}}function mk(e,t){let n=e.indexOf(`#`),r=n===-1?``:e.slice(n),i=n===-1?e:e.slice(0,n),a=i.indexOf(`?`),o=a===-1?i:i.slice(0,a),s=new URLSearchParams(a===-1?``:i.slice(a+1));for(let[e,n]of Object.entries(t))s.set(e,n);let c=s.toString();return`${o}${c.length===0?``:`?${c}`}${r}`}async function*hk(e,t){try{let n=UO(),r=``;for(;!t?.aborted;){let i;try{i=await e.read()}catch(e){if(t?.aborted)return;throw new rk(e)}let{done:a,value:o}=i;if(a)break;r+=n.decode(o,{stream:!0});let s=r.split(`
14
+ `);r=s.pop()||``;for(let e of s){let t=e.endsWith(`\r`)?e.slice(0,-1):e;t.trim()&&(yield t)}}if(r+=n.decode(),r.trim()&&!t?.aborted)throw new nk}finally{e.releaseLock()}}function gk(e){return iO(e)}function _k(e){let t=uE(e)?.model;if(typeof t==`string`)return t;let n=`usage`in e?e.usage:void 0;if(Array.isArray(n)){let e=n[0]?.model;if(typeof e==`string`)return e}}async function*vk(e,t){let n,r,i,a;for await(let o of e){if(o===`id`||o.startsWith(`id:`)){let e=o===`id`?``:o.slice(3);a=e.startsWith(` `)?e.slice(1):e;continue}if(o.startsWith(`:`)||o.startsWith(`event:`)||o.startsWith(`retry:`))continue;let e=WO(o);if(e===`[DONE]`){yield{chunk:dE({type:zO.RUN_FINISHED,threadId:n??t?.threadId??``,runId:r??t?.runId??``,timestamp:Date.now()},{finishReason:`stop`,...i===void 0?{}:{model:i}})};return}let s=gk(JSON.parse(e));`threadId`in s&&typeof s.threadId==`string`&&(n=s.threadId),`runId`in s&&typeof s.runId==`string`&&(r=s.runId);let c=_k(s);c!==void 0&&(i=c);let l=a;a=void 0,yield{chunk:s,...l===void 0?{}:{id:l}}}}async function yk(e){if(!e.ok){if(e.status===401){let t=await e.clone().json().catch(()=>null);if(XO(t))throw new ZO(t.error.provider)}throw Error(`HTTP error! status: ${e.status} ${e.statusText}`)}}async function bk(e,t,n,r,i){let a=await e(mk(t,{threadId:i}),{method:`GET`,headers:{Accept:`application/json`,...n},credentials:r});await yk(a);let o=await a.json(),s=o.activeRun&&typeof o.activeRun.runId==`string`?{runId:o.activeRun.runId}:null,c=o.interrupts&&typeof o.interrupts.runId==`string`&&Array.isArray(o.interrupts.pending)&&o.interrupts.pending.length>0?{runId:o.interrupts.runId,pending:o.interrupts.pending}:null;return{messages:Array.isArray(o.messages)?qO(o.messages):[],activeRun:s,interrupts:c}}async function xk(e,t,n,r,i){let a=await e(mk(t,{threadId:i}),{method:`GET`,headers:{Accept:`application/json`,...n},credentials:r});await yk(a);let o=await a.json();if(o===null)return{resumeSnapshot:null,activeRun:null};if(typeof o!=`object`||Array.isArray(o))throw Error(`Generation hydration expected a JSON object from ${t}, received ${Array.isArray(o)?`an array`:typeof o}.`);let s=o,c=s.activeRun&&typeof s.activeRun.runId==`string`?{runId:s.activeRun.runId}:null;return{resumeSnapshot:s.resumeSnapshot??null,activeRun:c}}async function*Sk(e,t,n){await yk(e),yield*vk(hk(HO(e),t),n)}async function*Ck(e,t){for await(let{chunk:n}of Sk(e,t))yield n}function wk(e,t,n,r){return async function*(i,a){let o;try{o=await e(t,{...n,headers:{...n.headers,...i},...a?{signal:a}:{}})}catch(e){throw new rk(e)}yield*r(o,a)}}async function*Tk(e,t,n){let r=sk(n);for(;;){if(t?.aborted)return;let n=r.lastEventId===void 0?{}:{"Last-Event-ID":r.lastEventId},i=!1,a=!1;try{for await(let{chunk:o,id:s}of e(n,t))r.note(s)!==`duplicate`&&(a=!0,(o.type===`RUN_FINISHED`||o.type===`RUN_ERROR`)&&(i=!0),yield o)}catch(e){if(t?.aborted)return;if((e instanceof nk||e instanceof rk)&&r.lastEventId!==void 0){await r.waitBeforeReconnect(a,t);continue}throw e}if(t?.aborted||i)return;if(r.lastEventId!==void 0){if(a){await r.waitBeforeReconnect(!0,t);continue}throw new ik}return}}function Ek(e){if(!e)throw Error(`Connection adapter is required`);let t=`connect`in e,n=`subscribe`in e,r=`send`in e;if(t&&(n||r))throw Error(`Connection adapter must provide either connect or both subscribe and send, not both modes`);if(n&&r){let t=e.joinRun?.bind(e),n=e.hydrate?.bind(e);return{subscribe:e.subscribe.bind(e),send:e.send.bind(e),...t?{joinRun:t}:{},...n?{hydrate:n}:{}}}if(!t)throw Error(`Connection adapter must provide either connect or both subscribe and send`);let i=[],a=[],o;function s(e,t){t&&ek.set(e,t);let n=a.shift();n?n(e):i.push(e)}async function c(e){let t=()=>o!==a||i.length===0&&(a.length>0||e?.aborted);for(let n=0;n<16&&!e?.aborted;n++){if(t())return;await Promise.resolve()}for(;!e?.aborted;){if(t())return;await new Promise(e=>setTimeout(e,0))}}return{subscribe(e){let t=i.splice(0),n=[];return i=t,a=n,(async function*(){o=n;try{for(;!e?.aborted;){let r,i=t.shift();r=i===void 0?await new Promise(t=>{let r=()=>t(null);n.push(n=>{e?.removeEventListener(`abort`,r),t(n)}),e?.addEventListener(`abort`,r,{once:!0})}):i,r!==null&&(yield r)}}finally{o===n&&(o=void 0)}})()},async send(t,n,r,i){let a=!1,o,l;try{let c=e.connect(t,n,r,i);for await(let e of c)`threadId`in e&&typeof e.threadId==`string`&&(o=e.threadId),`runId`in e&&typeof e.runId==`string`&&(l=e.runId),(e.type===`RUN_FINISHED`||e.type===`RUN_ERROR`)&&(a=!0),s(e,i?.runId);!r?.aborted&&!a&&s(dE({type:zO.RUN_FINISHED,threadId:uk(o??i?.threadId,`threadId`),runId:uk(l??i?.runId,`runId`),timestamp:Date.now()},{finishReason:`stop`,model:`connect-wrapper`}),i?.runId)}catch(e){if(!r?.aborted&&!a)try{let t=e instanceof Error?e.message:`Unknown error in connect()`;s({type:zO.RUN_ERROR,threadId:uk(o??i?.threadId,`threadId`),runId:uk(l??i?.runId,`runId`),timestamp:Date.now(),message:t},i?.runId)}catch{}throw e}await c(r)},...typeof e.joinRun==`function`?{joinRun:(t,n)=>e.joinRun(t,n)}:{},...(()=>{let t=e.hydrate;return typeof t==`function`?{hydrate:e=>t(e)}:{}})()}}function Dk(e,t,n,r){let i=HD(e),a={...r.body,...n?.forwardedProps??{},...t};return{threadId:n?.threadId??lk(`thread`),runId:n?.runId??lk(`run`),...n?.parentRunId!==void 0&&{parentRunId:n.parentRunId},...n?.resume!==void 0&&{resume:n.resume},state:{},messages:i,tools:n?.clientTools??[],context:[],forwardedProps:a,data:{...a}}}function Ok(e,t={}){return{async*connect(n,r,i,a){let o=typeof e==`function`?e():e,s=typeof t==`function`?await t():t,c={"Content-Type":`application/json`,...dk(s.headers),...dk(a?.headers),...pk(a?.runId)},l=Dk(n,r,a,s),u=s.fetchClient??fetch,d=i||s.signal;yield*Tk(wk(u,o,{method:`POST`,headers:c,body:JSON.stringify(l),credentials:s.credentials||`same-origin`},(e,t)=>Sk(e,t,{...a?.threadId===void 0?{}:{threadId:a.threadId},...a?.runId===void 0?{}:{runId:a.runId}})),d,s.reconnect)},async*joinRun(n,r){let i=typeof e==`function`?e():e,a=typeof t==`function`?await t():t,o=mk(i,{offset:`-1`,runId:n}),s={...dk(a.headers)},c=a.fetchClient??fetch,l=r||a.signal;yield*Tk(wk(c,o,{method:`GET`,headers:s,credentials:a.credentials||`same-origin`},(e,t)=>Sk(e,t,{runId:n})),l,a.reconnect)},async hydrate(n){let r=typeof e==`function`?e():e,i=typeof t==`function`?await t():t;return bk(i.fetchClient??fetch,r,dk(i.headers),i.credentials||`same-origin`,n)},async hydrateGeneration(n){let r=typeof e==`function`?e():e,i=typeof t==`function`?await t():t;return xk(i.fetchClient??fetch,r,dk(i.headers),i.credentials||`same-origin`,n)}}}function kk(e){return{async*connect(t,n,r,i){if(!r)throw Error(`fetcherToConnectionAdapter requires an AbortSignal — the chat client always supplies one.`);if(!i)throw Error(`fetcherToConnectionAdapter requires a RunAgentInputContext — the chat client always supplies one.`);let a=await e({messages:t,data:n,threadId:i.threadId,runId:i.runId,...i.parentRunId===void 0?{}:{parentRunId:i.parentRunId},...i.resume===void 0?{}:{resume:i.resume}},{signal:r,headers:i.headers});a instanceof Response?yield*Ck(a,r):yield*Ak(a,r)}}}async function*Ak(e,t){if(t.aborted)return;let n=e[Symbol.asyncIterator](),r=new Promise(e=>{t.addEventListener(`abort`,()=>e({done:!0,value:void 0}),{once:!0})});try{for(;;){let e=await Promise.race([n.next(),r]);if(e.done)return;yield e.value}}finally{await n.return?.()}}function jk(e){return e.resumable}function Mk(e,t){let n=rD(e.descriptor);return n?{...t,metadata:nD(n)}:t}function Nk(e){return`cancel`in e&&`clearResolution`in e}var Pk=new Set([`invalid-payload`,`invalid-edited-args`,`invalid-tool-output`,`invalid-response-schema`,`unknown-interrupt`,`expired`,`stale`,`conflict`,`legacy-unsupported`]),Fk=new Set([`incomplete-batch`,`item-validation-failed`,`unsupported-bulk-operation`,`async-resolver`,`inactive-transaction`,`mixed-provenance`,`transport`,`server`,`protocol`,`invalid-response-schema`,`expired`,`stale`,`conflict`,`legacy-submit-failed`]);function Ik(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Lk(e){return Ik(e)&&e.kind===`approval`&&typeof e.toolName==`string`&&`input`in e}function Rk(e){return Ik(e)&&e.kind===`client_tool`&&typeof e.toolName==`string`&&`input`in e}function zk(e){return Lk(e.metadata)||Rk(e.metadata)}function Bk(e){return XE(e)}function Vk(e){if(!Ik(e.metadata))return!1;let t=e.metadata[WE];return!Ik(t)||t.v!==void 0&&t.v!==1?!1:t.kind===`generic`||t.kind===`tool-approval`||t.kind===`client-tool-execution`||`definitionId`in t||`key`in t||`batchIndex`in t||`payloadSchemaHash`in t}function Hk(e){if(!Ik(e.metadata))return!1;let t=e.metadata[WE];return!Ik(t)||t.kind!==`generic`?!1:`definitionId`in t||`key`in t||`batchIndex`in t||`payloadSchemaHash`in t}function Uk(e){return e.metadata?.[`tanstack:interruptPayload`]}function Wk(e){return e===`tanstack:client_tool_execution`||e===`client_tool_input`}function Gk(e){if(e.responseSchema!==void 0)try{return yE(vE(e.responseSchema))}catch{return}}function Kk(e){if(e!==void 0)try{return $E(e)}catch{return}}function qk(e){return e!==null&&(typeof e==`object`||typeof e==`function`)&&`then`in e&&typeof e.then==`function`}function Jk(e,t,n){if(e===void 0)return{valid:!0,payload:t};if(EE(e)){let r=e[`~standard`].validate(t),i=e=>e.issues?{code:n,message:e.issues[0]?.message??`Schema validation failed.`}:{valid:!0,payload:e.value};return qk(r)?Promise.resolve(r).then(i):i(r)}return{valid:!0,payload:t}}function Yk(e){for(let t of Pk)if(t===e)return!0;return!1}function Xk(e){for(let t of Fk)if(t===e)return!0;return!1}function Zk(e){if(!Ik(e))return!1;let t=e.scope,n=e.code;return typeof n!=`string`||typeof e.message!=`string`||typeof e.retryable!=`boolean`||typeof e.threadId!=`string`||typeof e.interruptedRunId!=`string`||typeof e.generation!=`number`?!1:t===`item`?Yk(n)&&typeof e.interruptId==`string`&&(e.source===`client`||e.source===`server`):t===`batch`&&Xk(n)&&Array.isArray(e.interruptIds)&&e.interruptIds.every(e=>typeof e==`string`)&&(e.source===`client`||e.source===`server`||e.source===`transport`)}function Qk(e){return Zk(e)?[e]:!Ik(e)||!Array.isArray(e.errors)?[]:e.errors.every(Zk)?e.errors:[]}function $k(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])}function eA(e,t){return e.threadId===t.threadId&&e.interruptedRunId===t.interruptedRunId&&e.generation===t.generation&&$k(e.interruptIds,t.interruptIds)}function tA(e,t,n){let r=n.filter(e=>e.source!==`transport`),i=e=>t.includes(e)&&r.some(t=>eA(e,t)),a=e.filter(e=>!i(e)),o=t.filter(e=>!r.some(t=>eA(e,t)));return Object.freeze({rootErrors:Object.freeze([...a,...n]),submissionRootErrors:Object.freeze([...o,...r])})}function nA(e,t){if(e.threadId!==t.threadId||e.interruptedRunId!==t.interruptedRunId||e.generation!==t.generation)return!1;let n=t.resolutions.map(e=>e.interruptId);return e.scope===`item`?n.includes(e.interruptId):$k(e.interruptIds,n)}function rA(e,t,n){let r=Gk(e)??n?.responseSchemaHash;return xE({v:1,kind:`generic`,interruptId:e.id,interruptedRunId:t.interruptedRunId,generation:t.generation,...r===void 0?{}:{responseSchemaHash:r},...e.expiresAt===void 0?{}:{expiresAt:e.expiresAt}})}function iA(e,t){let n=xE(e.descriptor),r=e.error===void 0?Object.freeze([]):Object.freeze([xE(e.error)]),i=r[0];return{id:n.id,interruptId:n.id,reason:n.reason,...n.message===void 0?{}:{message:n.message},...n.responseSchema===void 0?{}:{responseSchema:n.responseSchema},...n.expiresAt===void 0?{}:{expiresAt:n.expiresAt},...n.metadata===void 0?{}:{metadata:n.metadata},threadId:t.threadId,interruptedRunId:t.interruptedRunId,generation:t.generation,status:e.status,errors:r,...i===void 0?{}:{error:i},canResolve:e.canResolve}}var aA=class{options;hydration;items=[];snapshot=Object.freeze([]);rootErrors=Object.freeze([]);submissionRootErrors=Object.freeze([]);state=Object.freeze({interrupts:this.snapshot,pendingInterrupts:this.snapshot,interruptErrors:this.rootErrors,resuming:!1});activeTransaction;activeSubmissionOperation;retrySubmission;resuming=!1;tools;interruptDefinitions;constructor(e){this.options=e,this.tools=e.tools;let t=new Map;for(let n of e.interrupts??[]){if(t.has(n.id))throw Error(`Duplicate interrupt definition id: ${n.id}`);t.set(n.id,n)}this.interruptDefinitions=t}updateTools(e){this.tools=e}hydrate(e,t=`live`){this.activeSubmissionOperation=void 0,this.hydration={threadId:e.threadId,interruptedRunId:e.interruptedRunId,generation:e.generation,interrupts:xE(e.interrupts)};let n=new Map;for(let t of e.interrupts){let e=Bk(t);e?.kind===`generic`&&e.definitionId!==void 0&&e.key!==void 0&&e.batchIndex!==void 0&&n.set(e.batchIndex,(n.get(e.batchIndex)??0)+1)}this.items=e.interrupts.map(t=>this.hydrateInterrupt(t,e,n)),this.rootErrors=Object.freeze([]),this.submissionRootErrors=Object.freeze([]),this.retrySubmission=void 0,this.resuming=!1,this.publish(t)}getInterrupts(){return this.snapshot}getState(){return this.state}getDescriptors(){return this.hydration?.interrupts??Object.freeze([])}hasValidatedFirstPartyGenericBatch(){return this.items.some(e=>e.kind===`generic`&&e.definition!==void 0)}reset(e){this.activeSubmissionOperation=void 0,this.hydration=void 0,this.items=[],this.snapshot=Object.freeze([]),e?.preserveRootErrors!==!0&&(this.rootErrors=Object.freeze([]),this.submissionRootErrors=Object.freeze([])),this.retrySubmission=void 0,this.resuming=!1,this.state=Object.freeze({interrupts:this.snapshot,pendingInterrupts:this.snapshot,interruptErrors:this.rootErrors,resuming:!1}),this.options.onChange?.(e?.source??`live`)}getInterruptErrors(){return this.rootErrors}getResuming(){return this.resuming}resolve(e){if(this.assertRootMutable(),typeof e==`boolean`){this.resolveBooleanBulk(e);return}this.resolveTransaction(e)}cancel(){this.assertRootMutable(),this.invalidateRetry();for(let e of this.items)jk(e)&&(e.validationGeneration++,e.resolution=Object.freeze(Mk(e,{interruptId:e.descriptor.id,status:`cancelled`})),e.status=`staged`,e.error=void 0);this.publish(),this.maybeSubmit()}retry(){if(this.resuming)throw Error(`Interrupt submission is already active.`);let e=this.retrySubmission;if(!e){this.addRootError(`transport`,`There is no retryable interrupt submission.`,!1);return}this.submitBatch(e)}resolveClientToolOutput(e,t){let n=this.items.find(t=>t.kind===`client-tool-execution`&&t.binding?.kind===`client-tool-execution`&&t.binding.toolCallId===e||t.kind===`generic`&&Wk(t.descriptor.reason)&&t.descriptor.toolCallId===e&&Rk(t.descriptor.metadata));return n?(this.resolveItem(n.descriptor.id,t),!0):!1}resolveToolApprovalDecision(e,t){let n=this.items.find(t=>t.descriptor.id===e&&(t.kind===`tool-approval`||t.kind===`generic`&&t.descriptor.reason===`approval_required`&&Lk(t.descriptor.metadata)));return n?(this.resolveItem(n.descriptor.id,{approved:t}),!0):!1}hydrateInterrupt(e,t,n){let r=xE(e),i=Bk(r),a=i===void 0&&zk(r);if(i===void 0&&!a)return Vk(r)?{descriptor:r,binding:rA(r,t,void 0),kind:`generic`,status:`error`,canResolve:!1,resumable:!1,error:this.itemError(r.id,`stale`,`The interrupt binding is invalid or incomplete.`),validationGeneration:0}:{descriptor:r,binding:void 0,kind:`unbound`,status:`pending`,canResolve:!1,resumable:!1,validationGeneration:0};let o=i!==void 0&&i.interruptId===r.id&&i.interruptedRunId===t.interruptedRunId&&i.generation===t.generation&&Gk(r)===i.responseSchemaHash,s=i!==void 0&&i.interruptId===r.id&&i.interruptedRunId===t.interruptedRunId&&i.generation===t.generation&&i.responseSchemaHash===(Gk(r)??i.responseSchemaHash);if(i!==void 0&&Hk(r)&&(!s||i.kind!==`generic`||i.definitionId===void 0||i.key===void 0||i.batchIndex===void 0))return{descriptor:r,binding:rA(r,t,i),kind:`generic`,status:`error`,canResolve:!1,resumable:!1,error:this.itemError(r.id,`stale`,`The interrupt binding does not match this interrupted run.`),validationGeneration:0};if(s&&i.kind===`tool-approval`){let e=this.tools?.find(e=>e.name===i.toolName);if(e?.needsApproval===!0&&r.toolCallId===i.toolCallId)try{let t=HE(e.approvalSchema,e.inputSchema);if(UE(e.inputSchema)===i.inputSchemaHash&&t.approvalSchemaHash===i.approvalSchemaHash&&t.responseSchemaHash===i.responseSchemaHash)return{descriptor:r,binding:xE(i),kind:`tool-approval`,status:`pending`,canResolve:!0,resumable:!0,tool:e,validationGeneration:0}}catch{}}if(s&&i.kind===`client-tool-execution`){let e=this.tools?.find(e=>e.name===i.toolName);if(e!==void 0&&r.toolCallId===i.toolCallId&&UE(e.outputSchema)===i.outputSchemaHash)return{descriptor:r,binding:xE(i),kind:`client-tool-execution`,status:`pending`,canResolve:!0,resumable:!0,tool:e,validationGeneration:0}}if(i!==void 0&&i.kind===`generic`&&i.definitionId!==void 0&&i.key!==void 0&&i.batchIndex!==void 0&&i.key.length>0&&n.get(i.batchIndex)!==1)return{descriptor:r,binding:xE(i),kind:`generic`,status:`error`,canResolve:!1,resumable:!1,error:this.itemError(r.id,`stale`,`Generic interrupt batch contains a duplicate batchIndex.`),validationGeneration:0};if(o&&i.kind===`generic`&&i.definitionId!==void 0&&i.key!==void 0&&i.batchIndex!==void 0&&i.key.length>0&&n.get(i.batchIndex)===1){let e=this.interruptDefinitions.get(i.definitionId);if(e!==void 0&&Kk(e.responseSchema)===i.responseSchemaHash&&(e.payloadSchema===void 0?i.payloadSchemaHash===void 0:i.payloadSchemaHash===Kk(e.payloadSchema))){let t=Uk(r);return{descriptor:r,binding:xE(i),definition:e,kind:`generic`,status:`pending`,canResolve:!0,resumable:!0,...t===void 0?{}:{payload:xE(t)},validationGeneration:0}}}let c=a||i!==void 0&&i.interruptId===r.id&&i.interruptedRunId===t.interruptedRunId&&i.generation===t.generation&&(i.kind!==`generic`||Gk(r)===void 0||i.responseSchemaHash===Gk(r));return{descriptor:r,binding:rA(r,t,i),kind:`generic`,status:`pending`,canResolve:c,resumable:c,validationGeneration:0}}buildSnapshot(e){let t=this.requireHydration(),n=this.items.filter(e=>e.kind!==`client-tool-execution`&&e.status!==`submitting`).map(n=>{let r=iA(n,t);if(n.kind===`unbound`||n.binding===void 0){let e={...r,kind:`unbound`,canResolve:!1};return Object.freeze(e)}if(n.kind===`tool-approval`&&n.binding.kind===`tool-approval`){let t=xE(n.binding),i={...r,kind:`tool-approval`,binding:t,toolName:n.binding.toolName,toolCallId:n.binding.toolCallId,originalArgs:xE(n.binding.originalArgs),cancel:()=>this.cancelItem(n.descriptor.id,e),clearResolution:()=>this.clearItem(n.descriptor.id,e),resolveInterrupt:(t,r)=>{let i=Ik(r)?r:void 0;this.resolveItem(n.descriptor.id,{approved:t,...t&&i?.editedArgs!==void 0?{editedArgs:i.editedArgs}:{},...i?.payload===void 0?{}:{payload:i.payload}},e)}};return Object.freeze(i)}let i=n.binding.kind===`generic`?xE(n.binding):xE({v:1,kind:`generic`,interruptId:n.descriptor.id,interruptedRunId:t.interruptedRunId,generation:t.generation,...typeof n.binding.responseSchemaHash==`string`?{responseSchemaHash:n.binding.responseSchemaHash}:{}});if(n.definition!==void 0&&n.binding.kind===`generic`){let t={...r,kind:`generic`,definitionId:n.definition.id,key:n.binding.key??``,payload:n.payload,binding:i,cancel:()=>this.cancelItem(n.descriptor.id,e),clearResolution:()=>this.clearItem(n.descriptor.id,e),resolveInterrupt:t=>this.resolveItem(n.descriptor.id,t,e)};return Object.freeze(t)}let a={...r,kind:`generic`,binding:i,cancel:()=>this.cancelItem(n.descriptor.id,e),clearResolution:()=>this.clearItem(n.descriptor.id,e),resolveInterrupt:t=>this.resolveItem(n.descriptor.id,t,e)};return Object.freeze(a)});return Object.freeze(n)}publish(e=`live`){if(!this.hydration){this.snapshot=Object.freeze([]),this.state=Object.freeze({interrupts:this.snapshot,pendingInterrupts:this.snapshot,interruptErrors:this.rootErrors,resuming:this.resuming}),this.options.onChange?.(e);return}this.snapshot=this.buildSnapshot(),this.state=Object.freeze({interrupts:this.snapshot,pendingInterrupts:this.snapshot,interruptErrors:this.rootErrors,resuming:this.resuming}),this.options.onChange?.(e)}resolveItem(e,t,n){this.assertItemMutable(n);let r=this.findItem(e);if(this.invalidateRetry(),!r.canResolve){r.status=`error`,r.error=this.itemError(e,`invalid-response-schema`,`The interrupt response schema is invalid and cannot be resolved.`),n||this.publish();return}let i=++r.validationGeneration,a=this.validateCandidate(r,t);if(qk(a)){r.status=`validating`,r.error=void 0,n||this.publish(),Promise.resolve(a).then(e=>{i===r.validationGeneration&&this.applyValidation(r,e,n)}).catch(e=>{i===r.validationGeneration&&this.applyValidation(r,{code:this.validationCode(r),message:e instanceof Error?e.message:String(e)},n)});return}this.applyValidation(r,a,n)}cancelItem(e,t){this.assertItemMutable(t);let n=this.findItem(e);this.invalidateRetry(),n.validationGeneration++,n.resolution=Object.freeze(Mk(n,{interruptId:e,status:`cancelled`})),n.status=`staged`,n.error=void 0,t||(this.publish(),this.maybeSubmit())}clearItem(e,t){this.assertItemMutable(t);let n=this.findItem(e);this.invalidateRetry(),n.validationGeneration++,n.resolution=void 0,n.error=void 0,n.status=`pending`,t||this.publish()}maybeSubmit(){let e=this.items.some(e=>e.kind===`generic`),t=this.items.filter(t=>jk(t)&&!(e&&t.kind===`client-tool-execution`));if(t.length===0||t.some(e=>e.resolution===void 0||e.status!==`staged`))return;let n=this.requireHydration(),r=SE(t.map(e=>e.resolution).filter(e=>e!==void 0)),i=Object.freeze({threadId:n.threadId,interruptedRunId:n.interruptedRunId,generation:n.generation,resolutions:r.resolutions,canonicalResolutions:r.canonicalResolutions,fingerprint:r.fingerprint});this.submitBatch(i)}applyValidation(e,t,n){if(!(`valid`in t)){e.status=`error`;let r=this.itemError(e.descriptor.id,t.code,t.message,t.path);e.error=r,e.kind===`client-tool-execution`&&(this.rootErrors=Object.freeze([...this.rootErrors.filter(t=>!(t.code===`item-validation-failed`&&t.interruptIds.includes(e.descriptor.id))),Object.freeze({scope:`batch`,code:`item-validation-failed`,message:r.message,source:`client`,retryable:!1,interruptIds:Object.freeze([e.descriptor.id]),threadId:r.threadId,interruptedRunId:r.interruptedRunId,generation:r.generation})])),n||this.publish();return}e.resolution=xE(Mk(e,{interruptId:e.descriptor.id,status:`resolved`,payload:t.payload})),e.status=`staged`,e.error=void 0,n||(this.publish(),this.maybeSubmit())}validateCandidate(e,t){if(e.kind===`generic`){let n=Jk(e.definition?.responseSchema??e.descriptor.responseSchema,t,`invalid-payload`);if(e.definition===void 0)return n;let r=e=>`valid`in e?{valid:!0,payload:t}:e;return qk(n)?Promise.resolve(n).then(r):r(n)}return e.kind===`client-tool-execution`?Jk(e.tool?.outputSchema,t,`invalid-tool-output`):this.validateApprovalCandidate(e,t)}validateApprovalCandidate(e,t){if(!Ik(t)||typeof t.approved!=`boolean`)return{code:`invalid-payload`,message:`Tool approval resolutions require an approved boolean.`};let n=t.approved,r=t.editedArgs;if(!n&&r!==void 0)return{code:`invalid-edited-args`,message:`Rejected tool approvals cannot edit tool arguments.`};if(n&&r!==void 0){let n=Jk(e.tool?.inputSchema,r,`invalid-edited-args`);return qk(n)?Promise.resolve(n).then(n=>`valid`in n?this.validateApprovalPayload(e,t,n.payload):n):`valid`in n?this.validateApprovalPayload(e,t,n.payload):n}return this.validateApprovalPayload(e,t,void 0)}validateApprovalPayload(e,t,n){let r=t.approved===!0,i=this.approvalBranchSchema(e.tool,r),a=t.payload;if(i===void 0&&a!==void 0)return{code:`invalid-payload`,message:`This approval branch does not accept a payload.`};if(i!==void 0&&a===void 0)return{code:`invalid-payload`,message:`This approval branch requires a payload.`};let o=Jk(i,a,`invalid-payload`),s=e=>`valid`in e?{valid:!0,payload:{approved:r,...n===void 0?{}:{editedArgs:n},...i===void 0?{}:{payload:e.payload}}}:e;return qk(o)?Promise.resolve(o).then(s):s(o)}approvalBranchSchema(e,t){let n=e?.approvalSchema;return!Ik(n)||!(`approve`in n||`reject`in n)?n:t?n.approve:n.reject}validationCode(e){return e.kind===`client-tool-execution`?`invalid-tool-output`:`invalid-payload`}resolveBooleanBulk(e){let t=this.items.filter(e=>jk(e)&&e.kind!==`client-tool-execution`);if(!t.every(t=>t.kind===`tool-approval`&&this.approvalBranchSchema(t.tool,e)===void 0)||t.length===0){this.addRootError(`unsupported-bulk-operation`,`Boolean bulk resolution requires payloadless tool approvals.`,!1);return}this.invalidateRetry();for(let n of t)n.validationGeneration++,n.resolution=xE({interruptId:n.descriptor.id,status:`resolved`,payload:{approved:e}}),n.status=`staged`,n.error=void 0;this.publish(),this.maybeSubmit()}resolveTransaction(e){let t=this.items.map(e=>({status:e.status,...e.resolution===void 0?{}:{resolution:e.resolution},...e.error===void 0?{}:{error:e.error},validationGeneration:e.validationGeneration})),n={active:!0};this.activeTransaction=n;let r=this.buildSnapshot(n).filter(Nk),i;try{for(let t of r){let n=e(t);if(n!==void 0){i={code:qk(n)?`async-resolver`:`inactive-transaction`,message:qk(n)?`Interrupt transaction resolvers must be synchronous.`:`Interrupt transaction resolvers must return literal undefined.`};break}}i===void 0&&this.items.some(e=>jk(e)&&e.kind!==`client-tool-execution`&&(e.resolution===void 0||e.status!==`staged`))&&(i={code:`incomplete-batch`,message:`Interrupt transaction did not resolve every item.`})}catch(e){i={code:`item-validation-failed`,message:e instanceof Error?e.message:String(e)}}finally{n.active=!1,this.activeTransaction=void 0}if(i){this.restoreCheckpoints(t),this.addRootError(i.code,i.message,!1);return}this.publish(),this.maybeSubmit()}restoreCheckpoints(e){this.items.forEach((t,n)=>{let r=e[n];r&&(t.status=r.status,t.resolution=r.resolution,t.error=r.error,t.validationGeneration=r.validationGeneration+1)}),this.publish()}assertItemMutable(e){if(e&&!e.active||this.activeTransaction&&e!==this.activeTransaction)throw Error(`Interrupt transaction is inactive.`);if(this.resuming)throw Error(`Interrupts cannot be mutated while submitting.`)}assertRootMutable(){if(this.activeTransaction)throw Error(`Interrupt transaction is already active.`);if(this.resuming)throw Error(`Interrupts cannot be mutated while submitting.`)}invalidateRetry(){this.retrySubmission=void 0}submitBatch(e){let t={submission:e};this.activeSubmissionOperation=t,this.resuming=!0,this.retrySubmission=void 0;for(let e of this.items)jk(e)&&(e.status=`submitting`);this.publish(),this.performSubmission(t)}async performSubmission(e){try{await this.options.submit(e.submission)}catch(t){if(this.activeSubmissionOperation!==e)return;this.handleSubmissionFailure(t,e.submission)}finally{this.activeSubmissionOperation===e&&(this.activeSubmissionOperation=void 0,this.resuming=!1,this.publish())}}handleSubmissionFailure(e,t){let n=Qk(e);if(n.length===0){let n=e instanceof Error?e.message:String(e);this.addRootError(`transport`,n,!0,`transport`),this.retrySubmission=t;for(let e of this.items)jk(e)&&(e.status=`error`);return}let r=n.filter(e=>nA(e,t));r.length!==n.length&&this.addRootError(`protocol`,`Interrupt submission errors did not match the active batch.`,!1);let i=!1,a=!1,o=[];for(let e of r)if((e.code===`stale`||e.code===`expired`||e.code===`conflict`)&&(i=!0),a||=e.retryable,e.scope===`item`){let t=this.items.find(t=>jk(t)&&t.descriptor.id===e.interruptId);t&&(t.status=`error`,t.error=xE(e))}else o.push(xE(e));let s=tA(this.rootErrors,this.submissionRootErrors,o);this.rootErrors=s.rootErrors,this.submissionRootErrors=s.submissionRootErrors;for(let e of this.items)jk(e)&&e.status===`submitting`&&(e.status=`error`);this.retrySubmission=a&&!i?t:void 0}addRootError(e,t,n,r=`client`){let i=this.requireHydration();this.rootErrors=Object.freeze([...this.rootErrors,Object.freeze({scope:`batch`,code:e,message:t,source:r,retryable:n,interruptIds:Object.freeze(this.items.filter(jk).map(e=>e.descriptor.id)),threadId:i.threadId,interruptedRunId:i.interruptedRunId,generation:i.generation})]),this.publish()}findItem(e){let t=this.items.find(t=>t.descriptor.id===e);if(!t)throw Error(`Unknown interrupt: ${e}`);return t}requireHydration(){if(!this.hydration)throw Error(`InterruptManager is not hydrated.`);return this.hydration}itemError(e,t,n,r){let i=this.requireHydration();return Object.freeze({scope:`item`,interruptId:e,code:t,message:n,...r===void 0?{}:{path:Object.freeze([...r])},source:`client`,retryable:!1,threadId:i.threadId,interruptedRunId:i.interruptedRunId,generation:i.generation})}};function oA(e,...t){let n=e?.();if(YO(n))return n;for(let e of t)if(YO(e))return e}async function sA(e,t){if(!t)throw new $O;return await e.prepare(t),e.headers(t)}var cA=class{clientId;constructor(e){this.clientId=e}clientCreated(e){this.emitEvent(`client:created`,{initialMessageCount:e})}loadingChanged(e){this.emitEvent(`client:loading:changed`,{isLoading:e})}errorChanged(e){this.emitEvent(`client:error:changed`,{error:e})}textUpdated(e,t,n,r){this.emitEvent(`text:chunk:content`,{streamId:e,messageId:t,content:n,...r})}toolCallStateChanged(e,t,n,r,i,a,o){this.emitEvent(`tools:call:updated`,{streamId:e,messageId:t,toolCallId:n,toolName:r,state:i,arguments:a,...o})}thinkingUpdated(e,t,n,r,i){this.emitEvent(`text:chunk:thinking`,{streamId:e,messageId:t,content:n,delta:r,...i})}structuredOutputChanged(e,t,n,r,i){this.emitEvent(e,{streamId:t,messageId:n,...r,...i})}approvalRequested(e,t,n,r,i,a,o){this.emitEvent(`tools:approval:requested`,{streamId:e,messageId:t,toolCallId:n,toolName:r,input:i,approvalId:a,...o})}messageAppended(e,t,n){let r=e.parts.filter(e=>e.type===`text`).map(e=>e.content).join(` `);this.emitEvent(`text:message:created`,{streamId:t,messageId:e.id,role:e.role,content:r,parts:e.parts,...n})}messageSent(e,t){let n=typeof t==`string`?t:t.filter(e=>e.type===`text`).map(e=>e.content).join(``);this.emitEvent(`text:message:created`,{messageId:e,role:`user`,content:n,...Array.isArray(t)&&{parts:t}}),this.emitEvent(`text:message:user`,{messageId:e,role:`user`,content:n,...Array.isArray(t)&&{parts:t}})}reloaded(e){this.emitEvent(`client:reloaded`,{fromMessageIndex:e})}stopped(){this.emitEvent(`client:stopped`)}messagesCleared(){this.emitEvent(`client:messages:cleared`)}toolResultAdded(e,t,n,r,i){this.emitEvent(`tools:result:added`,{toolCallId:e,toolName:t,output:n,state:r,...i})}toolApprovalResponded(e,t,n,r){this.emitEvent(`tools:approval:responded`,{approvalId:e,toolCallId:t,approved:n,...r})}toolFixtureApplied(e){this.emitEvent(`devtools:tool-fixture:applied`,{...e})}},lA=class extends cA{emitEvent(e,t){let n=Date.now(),r=e.startsWith(`text:`)||e.startsWith(`tools:`)||e.startsWith(`structured-output:`)||e===`devtools:tool-fixture:applied`,i=e.startsWith(`client:`)||e.startsWith(`tools:`)||e.startsWith(`text:`)||e.startsWith(`structured-output:`)||e===`devtools:tool-fixture:applied`,a=r?`user-visible`:`client-state`,o={hookId:this.clientId,...typeof t?.threadId==`string`?{threadId:t.threadId}:{},...typeof t?.runId==`string`?{runId:t.runId}:{},...typeof t?.streamId==`string`?{streamId:t.streamId}:{},...typeof t?.messageId==`string`?{messageId:t.messageId}:{},...typeof t?.toolCallId==`string`?{toolCallId:t.toolCallId}:{}};if(i){let r=uO({eventType:e,clientId:this.clientId,...o,source:`client`,visibility:a,timestamp:n});hO.emit(e,{...t,...r})}else{let r=uO({eventType:e,source:`client`,visibility:`client-state`,timestamp:n});hO.emit(e,{...t,...r})}}},uA=class extends cA{emitEvent(){}},dA=class{events;constructor(e){this.events=new uA(e.clientId)}emitRegistered(){}emitUpdated(){}emitSnapshot(){}emitToolsRegistered(){}emitRunLifecycle(e,t,n,r){}deactivate(){}supersede(){}dispose(){}mountWithTools(e){}notifyToolsChanged(){}setCurrentStreamId(e){}recordStreamId(e){}getCurrentStreamId(){return null}getLastStreamId(){return null}resolveStreamId(){return``}observeChunk(e){}recordMemoryState(e){}recordCompactionEvent(e,t){}recordCompactionState(e){}recordSkillsState(e){}beginRun(e,t){}getCurrentRunEventContext(){}getCurrentOrLastRunEventContext(){}findToolCallContext(e){return{toolCallId:e}}async applyFixture(e){}},fA=e=>new dA(e);function pA(e){if(Array.isArray(e))return{messages:e};if(e&&Array.isArray(e.messages))return e}function mA(e){return`toolCallId`in e&&typeof e.toolCallId==`string`?e.toolCallId:void 0}function hA(e){return`messageId`in e&&typeof e.messageId==`string`?e.messageId:void 0}function gA(e){return`parentMessageId`in e&&typeof e.parentMessageId==`string`?e.parentMessageId:void 0}var _A=class{adapter;id;applyMessages;applyResume;skipNextPersist=!1;generation=0;queue=Promise.resolve();queuePending=!1;messagesGeneration=0;lastMessages=[];lastResume=null;clearedMessageIds=new Set;clearedRunIds=new Set;ignoredActiveRunIds=new Set;clearedToolCallIds=new Set;currentRunlessRunId=null;constructor(e,t,n,r){this.adapter=e,this.id=t,this.applyMessages=n,this.applyResume=r}writeState(){let e=[...this.lastMessages];if(e.length===0&&!this.lastResume){let e=this.generation;this.runOperation(()=>{if(e===this.generation)return this.adapter.removeItem(this.id)});return}let t=this.generation,n={messages:e,...this.lastResume?{resume:this.lastResume}:{}};this.runOperation(()=>{if(t===this.generation)return this.adapter.setItem(this.id,n)})}readInitial(){try{let e=this.adapter.getItem(this.id);if(e instanceof Promise)return e.then(pA).catch(()=>void 0);let t=pA(e);return t&&(this.lastMessages=t.messages,this.lastResume=t.resume??null),t}catch{return}}hydrateAsync(e){if(!(e instanceof Promise))return;let t=this.messagesGeneration;e.then(e=>{e&&this.messagesGeneration===t&&(this.lastResume=e.resume??null,this.lastMessages=e.messages,this.applyMessages(e.messages),e.resume&&this.applyResume&&this.applyResume(e.resume))}).catch(()=>{})}notifyMessagesChanged(e){if(this.messagesGeneration++,this.lastMessages=[...e],this.skipNextPersist){this.skipNextPersist=!1;return}this.writeState()}persistResumeSnapshot(e){this.lastResume=e,!this.skipNextPersist&&this.writeState()}remove(){this.lastMessages=[],this.lastResume=null;let e=++this.generation;this.runOperation(()=>{if(e===this.generation)return this.adapter.removeItem(this.id)})}runOperation(e){if(this.queuePending){let t=this.queue.then(e).catch(()=>{});this.queue=t,t.finally(()=>{this.queue===t&&(this.queuePending=!1)});return}try{let t=e();if(t instanceof Promise){this.queuePending=!0;let e=t.catch(()=>{});this.queue=e,e.finally(()=>{this.queue===e&&(this.queuePending=!1)})}}catch{}}snapshotClear(e){for(let t of e.messages)this.clearedMessageIds.add(t.id);for(let t of e.activeRunIds)this.clearedRunIds.add(t),this.ignoredActiveRunIds.add(t);e.currentRunId&&(this.clearedRunIds.add(e.currentRunId),this.ignoredActiveRunIds.add(e.currentRunId))}beginClear(){this.skipNextPersist=!0}shouldIgnoreChunk(e){let t=tk(e);if(t&&this.clearedRunIds.has(t))return e.type===`RUN_STARTED`&&(this.ignoredActiveRunIds.add(t),this.currentRunlessRunId=t),this.markIgnoredChunkIds(e),!0;if(t&&this.ignoredActiveRunIds.has(t)||this.isRunlessChunkFromIgnoredRun(e))return this.markIgnoredChunkIds(e),!0;let n=mA(e);if(n&&this.clearedToolCallIds.has(n))return!0;let r=gA(e);if(r&&this.clearedMessageIds.has(r))return n&&this.clearedToolCallIds.add(n),!0;let i=hA(e);return i?!!this.clearedMessageIds.has(i):!1}onRunStarted(e){this.currentRunlessRunId=e}onRunSettled(e){this.ignoredActiveRunIds.delete(e),this.clearedRunIds.delete(e),this.currentRunlessRunId===e&&(this.currentRunlessRunId=this.ignoredActiveRunIds.values().next().value??null)}onSessionRunError(){this.ignoredActiveRunIds.clear(),this.currentRunlessRunId=null}resetIgnored(){this.ignoredActiveRunIds.clear()}takeRunlessRunId(){let e=this.currentRunlessRunId;return e?(this.ignoredActiveRunIds.delete(e),this.clearedRunIds.delete(e),this.currentRunlessRunId=this.ignoredActiveRunIds.values().next().value??null,e):null}markIgnoredChunkIds(e){let t=hA(e);t&&this.clearedMessageIds.add(t);let n=mA(e);n&&this.clearedToolCallIds.add(n)}isRunlessChunkFromIgnoredRun(e){return tk(e)||!this.currentRunlessRunId||!this.ignoredActiveRunIds.has(this.currentRunlessRunId)&&!this.clearedRunIds.has(this.currentRunlessRunId)?!1:e.type===`TEXT_MESSAGE_START`||e.type===`TEXT_MESSAGE_CONTENT`||e.type===`TOOL_CALL_START`||e.type===`TOOL_CALL_ARGS`||e.type===`TOOL_CALL_END`||e.type===`TOOL_CALL_RESULT`||e.type===`MESSAGES_SNAPSHOT`||e.type===`RUN_ERROR`}};function vA(e){return`toolCallId`in e&&typeof e.toolCallId==`string`?e.toolCallId:void 0}function yA(e){return`messageId`in e&&typeof e.messageId==`string`?e.messageId:void 0}function bA(e){return`parentMessageId`in e&&typeof e.parentMessageId==`string`?e.parentMessageId:void 0}var xA=class{clearedMessageIds=new Set;clearedRunIds=new Set;ignoredActiveRunIds=new Set;clearedToolCallIds=new Set;currentRunlessRunId=null;snapshotClear(e){for(let t of e.messages)this.clearedMessageIds.add(t.id);for(let t of e.activeRunIds)this.clearedRunIds.add(t),this.ignoredActiveRunIds.add(t);e.currentRunId&&(this.clearedRunIds.add(e.currentRunId),this.ignoredActiveRunIds.add(e.currentRunId))}shouldIgnoreChunk(e){let t=tk(e);if(t&&this.clearedRunIds.has(t))return e.type===`RUN_STARTED`&&(this.ignoredActiveRunIds.add(t),this.currentRunlessRunId=t),this.markIgnoredChunkIds(e),!0;if(t&&this.ignoredActiveRunIds.has(t)||this.isRunlessChunkFromIgnoredRun(e))return this.markIgnoredChunkIds(e),!0;let n=vA(e);if(n&&this.clearedToolCallIds.has(n))return!0;let r=bA(e);if(r&&this.clearedMessageIds.has(r))return n&&this.clearedToolCallIds.add(n),!0;let i=yA(e);return!!(i&&this.clearedMessageIds.has(i))}onRunStarted(e){this.currentRunlessRunId=e}onRunSettled(e){this.ignoredActiveRunIds.delete(e),this.clearedRunIds.delete(e),this.currentRunlessRunId===e&&(this.currentRunlessRunId=this.ignoredActiveRunIds.values().next().value??null)}onSessionRunError(){this.ignoredActiveRunIds.clear(),this.currentRunlessRunId=null}resetActiveRuns(){this.ignoredActiveRunIds.clear(),this.currentRunlessRunId=null}takeRunlessRunId(){let e=this.currentRunlessRunId;return e?(this.ignoredActiveRunIds.delete(e),this.clearedRunIds.delete(e),this.currentRunlessRunId=this.ignoredActiveRunIds.values().next().value??null,e):null}markIgnoredChunkIds(e){let t=yA(e);t&&this.clearedMessageIds.add(t);let n=vA(e);n&&this.clearedToolCallIds.add(n)}isRunlessChunkFromIgnoredRun(e){return tk(e)||!this.currentRunlessRunId||!this.ignoredActiveRunIds.has(this.currentRunlessRunId)&&!this.clearedRunIds.has(this.currentRunlessRunId)?!1:e.type===`TEXT_MESSAGE_START`||e.type===`TEXT_MESSAGE_CONTENT`||e.type===`TOOL_CALL_START`||e.type===`TOOL_CALL_ARGS`||e.type===`TOOL_CALL_END`||e.type===`TOOL_CALL_RESULT`||e.type===`MESSAGES_SNAPSHOT`||e.type===`RUN_ERROR`}};function SA(e){let t=new Set;for(let n of e??[]){if(t.has(n.id))throw Error(`Duplicate interrupt definition id: ${n.id}`);t.add(n.id)}}function CA(e){let{connection:t,fetcher:n}=e;if(t&&n)throw Error("ChatClient: pass either `connection` or `fetcher`, not both.");if(t)return t;if(n)return kk(n);throw Error("ChatClient: either `connection` or `fetcher` is required.")}function wA(e){return`connect`in e}function TA(e){if(e.type!==`RUN_FINISHED`||e.outcome?.type===`interrupt`)return!1;let t=e;return t.finishReason===void 0?uE(e)?.finishReason===`tool_calls`:t.finishReason===`tool_calls`}function EA(e){let t={whenBusy:`queue`,drain:`fifo`,onOverflow:`reject`};if(!e)return t;if(typeof e==`string`)return{...t,whenBusy:e};if(typeof e==`function`)return{...t,strategy:e};let n=e.maxSize;if(n!==void 0&&(!Number.isInteger(n)||n<0))throw Error(`ChatClient: queue.maxSize must be a non-negative integer`);return{whenBusy:e.whenBusy??`queue`,drain:e.drain??`fifo`,onOverflow:e.onOverflow??`reject`,...n===void 0?{}:{maxSize:n}}}function DA(e){let t=e.at(-1)?.body,n=[];for(let t of e){if(typeof t.content!=`string`)break;n.push(t.content)}if(n.length===e.length)return{content:n.join(`
15
+ `),...t===void 0?{}:{body:t}};let r=[],i;for(let t of e){if(typeof t.content==`string`){r.push({type:`text`,content:t.content});continue}typeof t.content.content==`string`?r.push({type:`text`,content:t.content.content}):r.push(...t.content.content),i=lE(i,t.content.metadata)}return{content:{content:r,...i===void 0?{}:{metadata:i}},...t===void 0?{}:{body:t}}}function OA(e){if(typeof e==`object`&&e&&!Array.isArray(e)&&`approved`in e&&typeof e.approved==`boolean`)return e.approved}function kA(e){let t=e;if(typeof t!=`object`||!t||!(`resumeState`in t))return;let n=t.resumeState;if(typeof n==`object`&&n&&`threadId`in n&&typeof n.threadId==`string`&&n.threadId.length!==0&&`runId`in n&&typeof n.runId==`string`&&n.runId.length!==0)return{threadId:n.threadId,runId:n.runId}}var AA=2e3,jA=new Set([`TEXT_MESSAGE_START`,`TEXT_MESSAGE_CONTENT`,`TOOL_CALL_START`,`MESSAGES_SNAPSHOT`]),MA=class{processor;connection;uniqueId;threadId;persistor;clearedStreamTracker=new xA;currentRunId=null;lastResume=null;rejoinedRunId=null;interruptManager;activeInterruptSubmission;interruptSubmissionFailure;joinedRunWaiters=new Map;pendingResumeParentRunId=null;pendingResumeThreadId=null;pendingResumeItems=null;activeResumeThreadId=null;activeResumeRunId=null;bodyOption={};forwardedPropsOption={};byok;byokProvider;context=void 0;pendingMessageBody=void 0;queueConfig;messageQueue=[];sendInFlight=!1;messageQueueDraining=!1;stopMessageQueueDrain=!1;deliverClaim=!1;isLoading=!1;isSubscribed=!1;error=void 0;status=`ready`;connectionStatus=`disconnected`;abortController=null;clientToolsRef;devtoolsBridge;events;currentStreamId=null;currentMessageId=null;postStreamActions=[];pendingToolExecutions=new Map;activeClientTools=null;activeContext=void 0;continuationPending=!1;subscriptionAbortController=null;processingResolve=null;connectionDrainsOnSend=!1;errorReportedGeneration=null;streamGeneration=0;continuationGeneration=0;streamContinuationGeneration=0;continuationSkipped=!1;draining=!1;sessionGenerating=!1;activeRunIds=new Set;disposed=!1;tailing=!1;rejoinRunId;cachesMessages;devtoolsMounted=!1;callbacksRef;constructor(e){SA(e.interrupts),this.threadId=e.threadId||``,this.uniqueId=this.threadId;let t=!0;if(e.persistence===!0){if(!e.threadId)throw Error("[TanStack AI] persistence needs a stable `threadId` to key on. Pass a threadId from your app (for example support-42).");t=!1}else if(e.persistence){if(!e.threadId)throw Error("[TanStack AI] persistence needs a stable `threadId` to key on. Pass a threadId from your app (for example support-42).");this.persistor=new _A(e.persistence,e.threadId,e=>this.processor.setMessages(e),e=>this.applyPersistedResume(e))}this.bodyOption=e.body||{},this.forwardedPropsOption=e.forwardedProps||{},this.byok=e.byok,this.byokProvider=e.byokProvider,this.context=e.context,this.queueConfig=EA(e.queue);let n=CA(e);if(this.connectionDrainsOnSend=wA(n),this.connection=Ek(n),this.clientToolsRef={current:new Map},e.tools)for(let t of e.tools)this.clientToolsRef.current.set(t.name,t);this.devtoolsBridge=(e.devtoolsBridgeFactory??fA)(this.buildDevtoolsBridgeOptions(e.devtools)),this.events=this.devtoolsBridge.events,this.callbacksRef={current:{onResponse:e.onResponse||(()=>{}),onChunk:e.onChunk||(()=>{}),onFinish:e.onFinish||(()=>{}),onError:e.onError||(()=>{}),onMessagesChange:e.onMessagesChange||(()=>{}),onLoadingChange:e.onLoadingChange||(()=>{}),onErrorChange:e.onErrorChange||(()=>{}),onStatusChange:e.onStatusChange||(()=>{}),onSubscriptionChange:e.onSubscriptionChange||(()=>{}),onConnectionStatusChange:e.onConnectionStatusChange||(()=>{}),onSessionGeneratingChange:e.onSessionGeneratingChange||(()=>{}),onQueueChange:e.onQueueChange||(()=>{}),onResumeStateChange:e.onResumeStateChange||(()=>{}),onRunIdChange:e.onRunIdChange||(()=>{}),onInterruptStateChange:e.onInterruptStateChange||(()=>{}),onCustomEvent:e.onCustomEvent||(()=>{})}},this.interruptManager=new aA({...e.tools===void 0?{}:{tools:e.tools},...e.interrupts===void 0?{}:{interrupts:e.interrupts},submit:e=>this.submitInterruptBatch(e),onChange:e=>this.notifyResumeStateChange(e)}),e.initialResumeSnapshot&&this.applyResumeSnapshot(e.initialResumeSnapshot);let r=this.persistor?.readInitial(),i=r instanceof Promise?void 0:r,a=i?i.messages:e.initialMessages,o=null;if(i?.resume){let e=i.resume;Array.isArray(e.pendingInterrupts)&&e.pendingInterrupts.length>0?this.applyResumeSnapshot(e):e.resumeState.runId&&(o=e.resumeState.runId)}if(!o&&e.initialResumeSnapshot){let t=e.initialResumeSnapshot;!(Array.isArray(t.pendingInterrupts)&&t.pendingInterrupts.length>0)&&t.resumeState.runId&&(o=t.resumeState.runId)}this.processor=new LO({...e.streamProcessor?.chunkStrategy?{chunkStrategy:e.streamProcessor.chunkStrategy}:{},...a?{initialMessages:a}:{},events:{onMessagesChange:e=>{this.persistor?.notifyMessagesChanged(e),this.callbacksRef.current.onMessagesChange(e)},onStreamStart:()=>{this.setStatus(`streaming`);let e=this.processor.getCurrentAssistantMessageId();if(!e)return;let t=this.processor.getMessages().find(t=>t.id===e);t&&(this.currentMessageId=t.id,this.events.messageAppended(t,this.currentStreamId||void 0))},onStreamEnd:e=>{this.callbacksRef.current.onFinish(e),this.setStatus(`ready`),this.resolveProcessing()},onError:e=>{this.reportStreamError(e)},onTextUpdate:(e,t)=>{this.currentStreamId&&this.events.textUpdated(this.currentStreamId,e,t)},onThinkingUpdate:(e,t)=>{this.currentStreamId&&this.events.thinkingUpdated(this.currentStreamId,e,t,void 0)},onStructuredOutputChange:e=>{let t=this.devtoolsBridge.resolveStreamId(),n=e.phase===`start`?`structured-output:started`:e.phase===`complete`?`structured-output:completed`:e.phase===`error`?`structured-output:errored`:`structured-output:updated`;this.currentMessageId=e.messageId,this.events.structuredOutputChanged(n,t,e.messageId,{status:e.status,raw:e.raw,...e.partial===void 0?{}:{partial:e.partial},...e.data===void 0?{}:{data:e.data},...e.reasoning===void 0?{}:{reasoning:e.reasoning},...e.errorMessage===void 0?{}:{errorMessage:e.errorMessage},...e.delta===void 0?{}:{delta:e.delta}})},onToolCallStateChange:(e,t,n,r)=>{let i=this.processor.getMessages().find(t=>t.id===e)?.parts.find(e=>e.type===`tool-call`&&e.id===t)?.name||`unknown`;this.currentStreamId&&this.events.toolCallStateChanged(this.currentStreamId,e,t,i,n,r)},onToolCall:e=>{let t=(this.activeClientTools??this.clientToolsRef.current).get(e.toolName),n=t?.execute;if(n){let r=this.continuationGeneration,i=this.devtoolsBridge.getCurrentRunEventContext(),a=(async()=>{try{let a=this.activeClientTools===null?this.context:this.activeContext,o=await n(e.input,{toolCallId:e.toolCallId,context:a,emitCustomEvent:()=>{}});await this.addToolResultForClientTool({toolCallId:e.toolCallId,tool:e.toolName,output:o,state:`output-available`},t,r,i)}catch(n){await this.addToolResultForClientTool({toolCallId:e.toolCallId,tool:e.toolName,output:null,state:`output-error`,errorText:n.message},t,r,i)}finally{this.pendingToolExecutions.delete(e.toolCallId)}})();this.pendingToolExecutions.set(e.toolCallId,a)}},onApprovalRequest:e=>{let t=this.devtoolsBridge.resolveStreamId(),n=this.findMessageIdForToolCall(e.toolCallId)??this.currentMessageId??``;this.events.approvalRequested(t,n,e.toolCallId,e.toolName,e.input,e.approvalId)},onCustomEvent:(e,t,n)=>{e===`memory:state`&&this.devtoolsBridge.recordMemoryState(t),(e===`compaction:started`||e===`compaction:state`||e===`compaction:ended`)&&this.devtoolsBridge.recordCompactionEvent(e,t),e===`skills:state`&&this.devtoolsBridge.recordSkillsState(t),this.callbacksRef.current.onCustomEvent(e,t,n)}}}),this.persistor?.hydrateAsync(r),this.rejoinRunId=o,this.cachesMessages=t}attach(){this.disposed||this.tailing||(this.ensureThreadId(),this.tailing=!0,this.rejoinRunId&&this.maybeRejoinInFlight(this.rejoinRunId),!this.cachesMessages&&this.connection.hydrate&&this.hydrateFromServer())}detach(){this.tailing&&(this.tailing=!1,this.cancelInFlightStream({setReadyStatus:!0}),this.rejoinedRunId=null)}applyResumeSnapshot(e){let t=kA(e);if(t===void 0){this.interruptManager.reset({source:`hydrate`});return}this.lastResume=t;let n=Array.isArray(e.pendingInterrupts)?e.pendingInterrupts:[];if(n.length===0){this.interruptManager.reset({source:`hydrate`});return}let r=this.interruptGeneration(n);this.interruptManager.hydrate({threadId:t.threadId,interruptedRunId:t.runId,generation:r,interrupts:n},`hydrate`)}applyPersistedResume(e){this.applyResumeSnapshot(e);let t=Array.isArray(e.pendingInterrupts)&&e.pendingInterrupts.length>0,n=e.resumeState?.runId;!t&&n&&this.maybeRejoinInFlight(n)}maybeRejoinInFlight(e){this.connection.joinRun&&!this.disposed&&this.tailing&&this.rejoinedRunId!==e&&(this.isLoading||this.abortController||(this.rejoinedRunId=e,this.resumeInFlightRun(e)))}hydrateFromServer(){let e=this.connection.hydrate;e&&(this.isLoading||this.abortController||this.disposed||(async()=>{let t;try{t=await e(this.threadId)}catch{return}!this.disposed&&this.tailing&&(this.isLoading||this.abortController||(t.messages.length>0&&this.processor.setMessages(qO(t.messages)),t.interrupts&&t.interrupts.pending.length>0?this.applyResumeSnapshot({resumeState:{threadId:this.threadId,runId:t.interrupts.runId},pendingInterrupts:t.interrupts.pending}):t.activeRun?.runId&&this.maybeRejoinInFlight(t.activeRun.runId)))})())}mountDevtools(){this.ensureThreadId(),!this.devtoolsMounted&&(this.devtoolsMounted=!0,this.devtoolsBridge.mountWithTools(this.processor.getMessages().length))}ensureThreadId(){return this.threadId||=this.generateUniqueId(`thread`),this.uniqueId=this.threadId,this.threadId}drainIgnoredRunlessChunk(e){if(e.type!==`RUN_ERROR`)return;let t=this.clearedStreamTracker.takeRunlessRunId();t&&(this.activeRunIds.delete(t),this.setSessionGenerating(this.activeRunIds.size>0),this.resolveProcessing())}retireIgnoredClearedTerminalChunk(e){if(e.type!==`RUN_FINISHED`&&e.type!==`RUN_ERROR`)return;let t=tk(e)??this.clearedStreamTracker.takeRunlessRunId();t&&(this.activeRunIds.delete(t),this.setSessionGenerating(this.activeRunIds.size>0),tk(e)||this.resolveProcessing())}updateRunLifecycle(e,t){if(e.type===`RUN_STARTED`){let t=tk(e)??e.runId;this.activeResumeThreadId=`threadId`in e&&typeof e.threadId==`string`?e.threadId:this.activeResumeThreadId,this.activeResumeRunId=t,this.activeRunIds.add(t),this.clearedStreamTracker.onRunStarted(t),this.setSessionGenerating(!0),this.persistor&&this.connection.joinRun&&!this.lastResume&&this.persistResumeSnapshot({threadId:this.activeResumeThreadId??this.threadId,runId:t});return}if(e.type!==`RUN_FINISHED`&&e.type!==`RUN_ERROR`)return;let n=tk(e);n?(this.activeRunIds.delete(n),this.clearedStreamTracker.onRunSettled(n)):e.type===`RUN_ERROR`&&(this.activeRunIds.clear(),this.clearedStreamTracker.onSessionRunError()),this.setSessionGenerating(this.activeRunIds.size>0);let r=e.type===`RUN_FINISHED`&&TA(e);t?.resolveProcessing!==!1&&!r&&this.resolveProcessing()}observeInterruptState(e){if(e.type!==`RUN_FINISHED`&&e.type!==`RUN_ERROR`||this.activeInterruptSubmission&&e.type===`RUN_ERROR`)return;let t=tk(e),n=`threadId`in e&&typeof e.threadId==`string`?e.threadId:this.activeResumeThreadId;if(e.type===`RUN_FINISHED`&&e.outcome?.type===`interrupt`){let r=this.currentRunId??t??this.activeResumeRunId??``;this.lastResume={threadId:n??this.threadId,runId:r},this.interruptManager.hydrate({threadId:this.lastResume.threadId,interruptedRunId:r,generation:this.interruptGeneration(e.outcome.interrupts),interrupts:e.outcome.interrupts},`live`);return}let r=e.type===`RUN_ERROR`&&!t,i=!!(t&&this.lastResume?.runId===t),a=!!(t&&this.currentRunId===t||this.currentRunId&&this.lastResume?.runId===this.currentRunId),o=!(!this.isLoading||!t||t!==this.activeResumeRunId&&t!==this.currentRunId),s=this.isLoading&&e.type===`RUN_FINISHED`&&!t,c=!!(this.activeInterruptSubmission&&this.isLoading&&e.type===`RUN_FINISHED`&&e.outcome?.type!==`interrupt`);if(r||i||a||o||s||c){this.lastResume=null,this.persistor?.persistResumeSnapshot(null),this.interruptManager.reset();return}this.notifyResumeStateChange(`live`)}getResumeState(){return this.lastResume?{...this.lastResume}:null}getCurrentRunId(){return this.currentRunId}setCurrentRunId(e){this.currentRunId!==e&&(this.currentRunId=e,this.callbacksRef.current.onRunIdChange(e))}getInterruptState(){return this.interruptManager.getState()}getInterrupts(){return this.interruptManager.getInterrupts()}getPendingInterrupts(){return this.interruptManager.getInterrupts()}resolveInterrupts(e){if(typeof e==`boolean`){this.interruptManager.resolve(e);return}this.interruptManager.resolve(e)}cancelInterrupts(){this.interruptManager.cancel()}retryInterrupts(){this.interruptManager.retry()}resumeInterruptsUnsafe(e,t){let n=t??this.lastResume;return n?this.resumeInterruptsUnsafeForGeneration(e,n,this.continuationGeneration):Promise.resolve(!1)}resumeInterruptsUnsafeForGeneration(e,t,n){return n===this.continuationGeneration?this.isLoading?new Promise((r,i)=>{this.queuePostStreamAction(async()=>{try{r(await this.resumeInterruptsUnsafeForGeneration(e,t,n))}catch(e){i(e)}})}):(this.pendingResumeThreadId=t.threadId,this.pendingResumeParentRunId=t.runId,this.pendingResumeItems=[...e],this.streamResponse()):Promise.resolve(!1)}resumeInterrupts(e,t){return this.resumeInterruptsUnsafe(e,t)}async submitInterruptBatch(e){let t=this.continuationGeneration;this.activeInterruptSubmission=e,this.interruptSubmissionFailure=void 0;for(let t of e.resolutions){let e=OA(t.payload);if(e===void 0)continue;let n=t.interruptId;this.processor.addToolApprovalResponse(n,e)}let n=await this.resumeInterruptsUnsafeForGeneration([...e.resolutions],{threadId:e.threadId,runId:e.interruptedRunId},t).finally(()=>{this.activeInterruptSubmission===e&&(this.activeInterruptSubmission=void 0)});if(t!==this.continuationGeneration)return;let r=this.takeInterruptSubmissionFailure();if(r!==void 0)throw{errors:r.errors};if(!n)throw Error(`Interrupt continuation could not be started.`);this.lastResume?.runId===e.interruptedRunId&&(this.lastResume=null,this.interruptManager.reset())}takeInterruptSubmissionFailure(){let e=this.interruptSubmissionFailure;return this.interruptSubmissionFailure=void 0,e}interruptGeneration(e){let t;for(let n of e){let e=n.metadata?.[`tanstack:interruptBinding`];if(typeof e!=`object`||!e||!(`generation`in e)||typeof e.generation!=`number`||!Number.isInteger(e.generation)||e.generation<0||t!==void 0&&t!==e.generation)return 0;t=e.generation}return t??0}generateUniqueId(e){return`${e}-${Date.now()}-${Math.random().toString(36).substring(7)}`}setIsLoading(e){this.isLoading=e,this.callbacksRef.current.onLoadingChange(e),this.events.loadingChanged(e)}setStatus(e){this.status=e,this.callbacksRef.current.onStatusChange(e),this.devtoolsBridge.emitSnapshot()}setIsSubscribed(e){this.isSubscribed=e,this.callbacksRef.current.onSubscriptionChange(e),this.devtoolsBridge.emitSnapshot()}setConnectionStatus(e){this.connectionStatus=e,this.callbacksRef.current.onConnectionStatusChange(e),this.devtoolsBridge.emitSnapshot()}setSessionGenerating(e){this.sessionGenerating!==e&&(this.sessionGenerating=e,this.callbacksRef.current.onSessionGeneratingChange(e),this.devtoolsBridge.emitSnapshot())}notifyResumeStateChange(e){let t=this.getResumeState(),n=this.interruptManager.getState();this.persistResumeSnapshot(t),this.callbacksRef.current.onResumeStateChange(t,n.interrupts),this.callbacksRef.current.onInterruptStateChange(n,{source:e})}persistResumeSnapshot(e){if(!this.persistor)return;if(!e){this.persistor.persistResumeSnapshot(null);return}let t=this.interruptManager.getDescriptors();this.persistor.persistResumeSnapshot({resumeState:e,...t.length>0?{pendingInterrupts:[...t]}:{}})}resetSessionGenerating(e){this.activeRunIds.clear(),e?.preserveClearedStreamTracking||this.clearedStreamTracker.resetActiveRuns(),this.setSessionGenerating(!1)}setError(e){this.error=e,this.callbacksRef.current.onErrorChange(e),this.events.errorChanged(e?.message||null)}buildDevtoolsBridgeOptions(e){let t=this;return{get hookId(){return t.uniqueId},get clientId(){return t.uniqueId},get threadId(){return t.threadId},metadata:{hookName:e?.hookName??`useChat`,outputKind:e?.outputKind??`chat`,...e?.framework?{framework:e.framework}:{},...e?.name?{name:e.name}:{}},getSnapshot:()=>this.getDevtoolsSnapshot(),getTools:()=>this.clientToolsRef.current.values(),getMessages:()=>this.processor.getMessages(),setMessages:e=>{this.processor.setMessages(e)},addToolResult:(e,t,n)=>{this.processor.addToolResult(e,t,n)},generateId:e=>this.generateUniqueId(e)}}getDevtoolsSnapshot(){return{messages:this.processor.getMessages(),status:this.status,isLoading:this.isLoading,isSubscribed:this.isSubscribed,connectionStatus:this.connectionStatus,sessionGenerating:this.sessionGenerating,activeRunIds:Array.from(this.activeRunIds),queue:this.getQueue(),...this.error?{error:this.error.message}:{}}}findMessageIdForToolCall(e){let t=this.processor.getMessages();for(let n of t)if(n.parts.find(t=>t.type===`tool-call`&&t.id===e))return n.id}abortSubscriptionLoop(){this.subscriptionAbortController?.abort(),this.subscriptionAbortController=null}resolveProcessing(){this.processingResolve?.(),this.processingResolve=null}cancelInFlightStream(e){this.abortController?.abort(),this.abortController=null,e?.abortSubscription&&this.abortSubscriptionLoop(),this.resolveProcessing(),this.setIsLoading(!1),this.deliverClaim=!1,e?.setReadyStatus&&this.setStatus(`ready`)}reportStreamError(e){let t=this.errorReportedGeneration===this.streamGeneration;this.setError(e),(this.isLoading||this.status===`submitted`||this.status===`streaming`)&&this.setStatus(`error`),t||(this.errorReportedGeneration=this.streamGeneration,this.callbacksRef.current.onError(e))}startSubscription(){this.subscriptionAbortController=new AbortController;let e=this.subscriptionAbortController.signal;this.consumeSubscription(e).catch(e=>{e instanceof Error&&e.name!==`AbortError`&&(this.setConnectionStatus(`error`),this.resetSessionGenerating(),this.setIsSubscribed(!1),this.reportStreamError(e)),this.resolveProcessing()}).finally(()=>{this.subscriptionAbortController?.signal===e&&(this.subscriptionAbortController=null,!e.aborted&&this.isSubscribed&&(this.setIsSubscribed(!1),this.connectionStatus!==`error`&&this.setConnectionStatus(`disconnected`)))})}async consumeSubscription(e){let t=this.connection.subscribe(e);for await(let n of t){if(e.aborted)break;await this.processIncomingChunk(n)}}resumeInFlightRun(e){let t=this.connection.joinRun;if(!t)return;let n=new AbortController;this.abortController=n,this.setCurrentRunId(e),this.lastResume={threadId:this.threadId,runId:e},this.streamContinuationGeneration=this.continuationGeneration,this.setIsLoading(!0),this.setStatus(`streaming`),(async()=>{let r=!1,i=!1,a=!1,o=setTimeout(()=>{i||n.abort()},AA);try{for await(let a of t(e,n.signal)){if(n.signal.aborted)break;i||(i=!0,clearTimeout(o)),!r&&jA.has(a.type)&&(r=!0,this.dropTrailingInFlightAssistant()),await this.processIncomingChunk(a,{defer:!1})}this.pendingToolExecutions.size>0&&await Promise.all(this.pendingToolExecutions.values())}catch(e){let t=e instanceof Error&&(e.name===`AbortError`||e.name===`TimeoutError`);!i&&!t&&(a=!0),i&&!t&&this.reportStreamError(e instanceof Error?e:Error(String(e)))}finally{clearTimeout(o),!i&&a&&this.tailing&&!this.disposed&&(this.lastResume=null,this.persistor?.persistResumeSnapshot(null)),this.abortController===n&&(this.abortController=null,this.setIsLoading(!1),this.status===`streaming`&&this.setStatus(`ready`),await this.drainPostStreamActions())}})()}dropTrailingInFlightAssistant(){let e=this.processor.getMessages(),t=e[e.length-1];t&&t.role===`assistant`&&this.processor.setMessages(e.slice(0,-1))}async processIncomingChunk(e,t){if(e=iO(e),e.type===`RUN_ERROR`&&this.isActiveInterruptSubmissionFailure(e)){let t=uE(e)?.interruptErrors;this.interruptSubmissionFailure={errors:Array.isArray(t)?t:[]}}if(this.connectionStatus===`connecting`&&this.setConnectionStatus(`connected`),this.clearedStreamTracker.shouldIgnoreChunk(e)){(e.type===`RUN_FINISHED`||e.type===`RUN_ERROR`)&&(tk(e)?this.updateRunLifecycle(e,{resolveProcessing:!1}):this.drainIgnoredRunlessChunk(e),this.retireIgnoredClearedTerminalChunk(e),this.resolveJoinedRun(e));return}this.callbacksRef.current.onChunk(e),this.devtoolsBridge.observeChunk(e),this.processor.processChunk(e),this.updateRunLifecycle(e),this.observeInterruptState(e),t?.defer!==!1&&(typeof document>`u`||!document.hidden)&&await new Promise(e=>setTimeout(e,0)),this.resolveJoinedRun(e)}isActiveInterruptSubmissionFailure(e){let t=this.activeInterruptSubmission,n=uE(e)?.interruptErrors;if(!t||!Array.isArray(n)||n.length===0)return!1;let r=tk(e);return r!==void 0&&r!==this.currentRunId||typeof e.threadId==`string`&&e.threadId!==t.threadId?!1:n.every(e=>typeof e!=`object`||!e||typeof e.threadId!=`string`||typeof e.interruptedRunId!=`string`||typeof e.generation!=`number`?!1:e.threadId===t.threadId&&e.interruptedRunId===t.interruptedRunId&&e.generation===t.generation)}resolveJoinedRun(e){if(e.type!==`RUN_FINISHED`&&e.type!==`RUN_ERROR`)return;let t=tk(e);if(t===void 0)return;let n=this.joinedRunWaiters.get(t);n!==void 0&&(this.joinedRunWaiters.delete(t),n())}ensureSubscription(){if(!this.isSubscribed){this.subscribe();return}(!this.subscriptionAbortController||this.subscriptionAbortController.signal.aborted)&&this.subscribe({restart:!0})}waitForProcessing(){return this.resolveProcessing(),new Promise(e=>{this.processingResolve=e})}async sendMessage(e,t,n){if(this.mountDevtools(),typeof e==`string`&&!e.trim())return;if(this.hasPendingInterrupts())throw Error(`ChatClient: cannot send normal input while pending interrupts exist. Use resumeInterrupts() instead.`);let r={...t,...n?.body};if(this.isSendBusy()){let{action:t,id:i}=this.decideWhenBusy(e,n);if(t===`drop`)return;if(t===`queue`){this.enqueueMessage(e,r,i);return}this.stopMessageQueueDrain=!0,this.sendInFlight=!0,this.cancelInFlightStream({setReadyStatus:!0}),this.resetSessionGenerating()}else this.sendInFlight=!0;try{await this.deliverMessage(e,r)}finally{this.sendInFlight=!1}}hasPendingInterrupts(){return this.interruptManager.getDescriptors().length>0}isSendBusy(){return this.isLoading||this.sendInFlight||this.messageQueueDraining}resolveBusyReason(){return this.isLoading?`streaming`:this.messageQueueDraining?`draining`:`sendInFlight`}async deliverMessage(e,t){if(this.isLoading||this.deliverClaim)return!1;this.deliverClaim=!0;try{let n=this.normalizeMessageInput(e);this.pendingMessageBody=t;let r=this.processor.addUserMessage(n.content,n.id,n.metadata);return this.events.messageSent(r.id,n.content),await this.streamResponse()}finally{this.deliverClaim=!1}}decideWhenBusy(e,t){let n=this.generateUniqueId(`queued`);if(t?.whenBusy)return{action:t.whenBusy,id:n};let{strategy:r,whenBusy:i}=this.queueConfig;if(r){let{action:t}=r({pending:{id:n,content:e,createdAt:Date.now()},busyReason:this.resolveBusyReason(),queued:this.getQueue()});return{action:t,id:n}}return{action:i,id:n}}enqueueMessage(e,t,n){let{maxSize:r,onOverflow:i}=this.queueConfig;if(r!==void 0&&this.messageQueue.length>=r){if(i===`reject`||r===0)return;this.messageQueue.shift()}this.messageQueue.push({id:n??this.generateUniqueId(`queued`),content:e,createdAt:Date.now(),...t===void 0?{}:{body:t}}),this.emitQueueChange()}normalizeMessageInput(e){return typeof e==`string`?{content:e.trim()}:{content:e.content,id:e.id,...e.metadata===void 0?{}:{metadata:e.metadata}}}async append(e){if(this.mountDevtools(),this.hasPendingInterrupts())throw Error(`ChatClient: cannot append normal input while pending interrupts exist. Use resumeInterrupts() instead.`);let t=RD(e,zD);if(t.role===`system`)return;let n=t;this.events.messageAppended(n);let r=this.processor.getMessages();if(this.processor.setMessages([...r,n]),this.devtoolsBridge.emitSnapshot(),this.isLoading){this.queuePostStreamAction(async()=>{await this.streamResponse()});return}await this.streamResponse()}async streamResponse(){if(this.isLoading)return!1;let e=++this.streamGeneration;this.streamContinuationGeneration=this.continuationGeneration;let t=this.pendingResumeThreadId,n=this.pendingResumeParentRunId,r=this.pendingResumeItems;this.pendingResumeThreadId=null,this.pendingResumeParentRunId=null,this.pendingResumeItems=null;let i=`run-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;this.setCurrentRunId(i),this.activeResumeThreadId=t??this.threadId,this.activeResumeRunId=i,this.setIsLoading(!0),this.deliverClaim=!1,this.setStatus(`submitted`),this.setError(void 0),this.errorReportedGeneration=null,this.abortController=new AbortController;let a=this.abortController.signal;this.pendingToolExecutions.clear();let o=!1,s=null,c=!1;try{let l=this.processor.getMessages(),u=new Map(this.clientToolsRef.current),d=this.context;if(await this.callbacksRef.current.onResponse(),a.aborted)return!1;let f={...this.bodyOption,...this.forwardedPropsOption,...this.pendingMessageBody};this.pendingMessageBody=void 0,this.currentStreamId=this.generateUniqueId(`stream`),this.devtoolsBridge.setCurrentStreamId(this.currentStreamId),this.currentMessageId=null,this.activeClientTools=u,this.activeContext=d,this.processor.prepareAssistantMessage(),this.ensureSubscription();let p=this.waitForProcessing(),m;if(this.byok){let e=oA(this.byokProvider,f.provider);m=await sA(this.byok,e)}let h={threadId:t??this.threadId,runId:i,...n===null?{}:{parentRunId:n},clientTools:Array.from(u.values()).map(e=>({name:e.name,description:e.description,parameters:e.inputSchema?jE(e.inputSchema):{type:`object`}})),forwardedProps:{...f},...r?{resume:r}:{},...m?{headers:m}:{}};if(this.devtoolsBridge.beginRun(h.runId,h.threadId),s=h.runId,this.devtoolsBridge.emitRunLifecycle(`run:created`,h.runId,`created`),this.devtoolsBridge.emitRunLifecycle(`run:started`,h.runId,`started`),this.devtoolsBridge.emitSnapshot(),await this.connection.send(l,f,a,h),e!==this.streamGeneration||a.aborted||(this.connectionDrainsOnSend&&this.resolveProcessing(),await p,e!==this.streamGeneration))return!1;if(this.status===`error`)return s&&(this.devtoolsBridge.emitRunLifecycle(`run:errored`,s,`errored`,this.error?{error:this.error.message}:{}),c=!0),!1;this.pendingToolExecutions.size>0&&await Promise.all(this.pendingToolExecutions.values()),this.processor.finalizeStream(),o=!0}catch(t){let n=t instanceof Error?t:Error(String(t));if(n.name===`AbortError`)return s&&(this.devtoolsBridge.emitRunLifecycle(`run:cancelled`,s,`cancelled`),c=!0),!1;if(n instanceof ZO&&this.byok?.request(n.provider,`missing`),n instanceof QO&&n.reason===`locked`&&this.byok?.request(n.provider,`locked`),e===this.streamGeneration&&(this.reportStreamError(n),s&&(this.devtoolsBridge.emitRunLifecycle(`run:errored`,s,`errored`,{error:n.message}),c=!0)),e===this.streamGeneration&&(n instanceof ZO||n instanceof QO||n instanceof $O))throw n}finally{e===this.streamGeneration&&(this.currentStreamId=null,this.devtoolsBridge.setCurrentStreamId(null),this.currentMessageId=null,this.setCurrentRunId(null),this.activeClientTools=null,this.activeContext=void 0,this.abortController=null,this.setIsLoading(!1),this.pendingMessageBody=void 0,s&&!c&&(o?this.devtoolsBridge.emitRunLifecycle(`run:completed`,s,`completed`):a.aborted&&this.devtoolsBridge.emitRunLifecycle(`run:cancelled`,s,`cancelled`)),await this.drainPostStreamActions(),o?(this.status!==`ready`&&this.setStatus(`ready`),this.messageQueueDraining||await this.drainQueue()):this.flushQueue())}return o}subscribe(e){let t=e?.restart===!0;(!this.isSubscribed||t)&&(this.isSubscribed&&t&&this.abortSubscriptionLoop(),this.setIsSubscribed(!0),this.setConnectionStatus(`connecting`),this.startSubscription())}unsubscribe(){this.cancelInFlightStream({setReadyStatus:!0,abortSubscription:!0}),this.discardPendingSends(),this.resetSessionGenerating(),this.setIsSubscribed(!1),this.setConnectionStatus(`disconnected`)}async reload(){let e=this.processor.getMessages();if(e.length===0)return;let t=e.findLastIndex(e=>e.role===`user`);t!==-1&&(this.isLoading&&this.cancelInFlightStream(),this.discardPendingSends(),this.events.reloaded(t),this.processor.removeMessagesAfter(t),this.devtoolsBridge.emitSnapshot(),await this.streamResponse())}stop(){this.continuationGeneration++;let e=this.abortController!==null;this.cancelInFlightStream({setReadyStatus:!0}),this.discardPendingSends(),this.lastResume=null,this.activeInterruptSubmission=void 0,this.interruptManager.reset(),e&&this.resetSessionGenerating(),this.events.stopped()}clear(){let e=this.abortController!==null;this.clearedStreamTracker.snapshotClear({messages:this.processor.getMessages(),activeRunIds:this.activeRunIds,currentRunId:this.currentRunId}),this.isLoading||e?(this.cancelInFlightStream({setReadyStatus:!0}),this.resetSessionGenerating({preserveClearedStreamTracking:!0})):this.activeRunIds.size>0&&this.resetSessionGenerating({preserveClearedStreamTracking:!0}),this.persistor?.beginClear(),this.processor.clearMessages(),this.discardPendingSends(),this.persistor?.remove(),this.lastResume=null,this.interruptManager.reset(),this.pendingResumeThreadId=null,this.pendingResumeParentRunId=null,this.pendingResumeItems=null,this.setError(void 0),this.events.messagesCleared()}async addToolResult(e){let t=this.clientToolsRef.current.get(e.tool);await this.addToolResultForClientTool(e,t,this.streamContinuationGeneration)}async addToolResultForClientTool(e,t,n,r){if(t&&e.state!==`output-error`)try{e={...e,output:this.validateClientToolOutput(t,e.output)}}catch(t){e={...e,output:null,state:`output-error`,errorText:t.message}}if(this.events.toolResultAdded(e.toolCallId,e.tool,e.output,e.state||`output-available`,r),n===this.continuationGeneration&&(this.processor.addToolResult(e.toolCallId,e.output,e.state===`output-error`?e.errorText||`Tool execution failed`:void 0),this.devtoolsBridge.emitSnapshot(),!this.interruptManager.resolveClientToolOutput(e.toolCallId,e.state===`output-error`?{error:e.errorText||`Tool execution failed`}:e.output))){if(this.isLoading){this.queuePostStreamAction(()=>n===this.continuationGeneration?this.checkForContinuation():Promise.resolve());return}await this.checkForContinuation()}}validateClientToolOutput(e,t){return e.outputSchema&&EE(e.outputSchema)?NE(e.outputSchema,t):t}async addToolApprovalResponse(e){if(this.processor.addToolApprovalResponse(e.id,e.approved),this.devtoolsBridge.emitSnapshot(),this.interruptManager.resolveToolApprovalDecision(e.id,e.approved))return;let t=this.processor.getMessages(),n;for(let r of t){let t=r.parts.find(t=>t.type===`tool-call`&&t.approval?.id===e.id);if(t){n=t.id;break}}if(n&&this.events.toolApprovalResponded(e.id,n,e.approved),this.processor.addToolApprovalResponse(e.id,e.approved),this.devtoolsBridge.emitSnapshot(),this.isLoading){this.queuePostStreamAction(()=>this.checkForContinuation());return}await this.checkForContinuation()}queuePostStreamAction(e){let t=this.continuationGeneration;this.postStreamActions.push(async()=>{t===this.continuationGeneration&&await e()})}async drainPostStreamActions(){if(!this.draining){this.draining=!0;try{let e;for(;(e=this.postStreamActions.shift())!==void 0;)await e()}finally{this.draining=!1}}}async checkForContinuation(){if(this.streamContinuationGeneration===this.continuationGeneration&&!this.hasPendingInterrupts()){if(this.continuationPending||this.isLoading){this.continuationSkipped=!0;return}if(this.shouldAutoSend()){this.continuationPending=!0,this.continuationSkipped=!1;let e=!1;try{e=await this.streamResponse()}finally{this.continuationPending=!1}this.continuationSkipped&&e&&(this.continuationSkipped=!1,await this.checkForContinuation())}}}shouldAutoSend(){if(this.lastResume||this.activeInterruptSubmission&&this.hasPendingInterrupts()||this.interruptManager.getInterrupts().length>0)return!1;let e=this.processor.getMessages().findLast(e=>e.role===`assistant`);return!e||!e.parts.some(e=>e.type===`tool-call`)?!1:this.processor.areAllToolsComplete()}getMessages(){return this.processor.getMessages()}shouldAbortMessageQueueDrain(){return this.isLoading||this.stopMessageQueueDrain}async drainQueue(){if(!(this.messageQueueDraining||this.isLoading||this.messageQueue.length===0)){this.messageQueueDraining=!0,this.stopMessageQueueDrain=!1;try{if(this.queueConfig.drain===`batch`){for(;this.messageQueue.length>0;){if(this.shouldAbortMessageQueueDrain())return;let e=this.messageQueue.splice(0);this.emitQueueChange();let t=DA(e);if(!await this.deliverMessage(t.content,t.body)||this.shouldAbortMessageQueueDrain())return}return}for(;this.messageQueue.length>0;){if(this.shouldAbortMessageQueueDrain())return;let e=this.messageQueue.shift();if(e===void 0||(this.emitQueueChange(),!await this.deliverMessage(e.content,e.body)||this.shouldAbortMessageQueueDrain()))return}}finally{this.messageQueueDraining=!1,this.stopMessageQueueDrain=!1}}}discardPendingSends(){this.sendInFlight=!1,this.flushQueue()}getQueue(){return this.messageQueue.map(({id:e,content:t,createdAt:n})=>({id:e,content:t,createdAt:n}))}emitQueueChange(){this.callbacksRef.current.onQueueChange(this.getQueue()),this.devtoolsBridge.emitSnapshot()}cancelQueued(e){let t=this.messageQueue.findIndex(t=>t.id===e);t!==-1&&(this.messageQueue.splice(t,1),this.emitQueueChange())}flushQueue(){this.messageQueue.length!==0&&(this.messageQueue=[],this.emitQueueChange())}getIsLoading(){return this.isLoading}getStatus(){return this.status}getIsSubscribed(){return this.isSubscribed}getConnectionStatus(){return this.connectionStatus}getSessionGenerating(){return this.sessionGenerating}getError(){return this.error}setMessagesManually(e){this.processor.setMessages(e),this.devtoolsBridge.emitSnapshot()}updateOptions(e){if(e.connection!==void 0||e.fetcher!==void 0){let t=this.isSubscribed;this.isLoading?this.cancelInFlightStream({setReadyStatus:!0,abortSubscription:!0}):t&&this.abortSubscriptionLoop(),this.resetSessionGenerating(),this.setIsSubscribed(!1),this.setConnectionStatus(`disconnected`);let n=CA({connection:e.connection,fetcher:e.fetcher});this.connectionDrainsOnSend=wA(n),this.connection=Ek(n),t&&this.subscribe()}if(e.body!==void 0&&(this.bodyOption=e.body),e.forwardedProps!==void 0&&(this.forwardedPropsOption=e.forwardedProps),e.byok!==void 0&&(this.byok=e.byok),e.byokProvider!==void 0&&(this.byokProvider=e.byokProvider),`context`in e&&(this.context=e.context),e.tools!==void 0){this.interruptManager.updateTools(e.tools),this.clientToolsRef.current=new Map;for(let t of e.tools)this.clientToolsRef.current.set(t.name,t);this.devtoolsBridge.notifyToolsChanged()}e.queue!==void 0&&(this.queueConfig=EA(e.queue)),e.onResponse!==void 0&&(this.callbacksRef.current.onResponse=e.onResponse),e.onChunk!==void 0&&(this.callbacksRef.current.onChunk=e.onChunk),e.onFinish!==void 0&&(this.callbacksRef.current.onFinish=e.onFinish),e.onError!==void 0&&(this.callbacksRef.current.onError=e.onError),e.onSubscriptionChange!==void 0&&(this.callbacksRef.current.onSubscriptionChange=e.onSubscriptionChange),e.onConnectionStatusChange!==void 0&&(this.callbacksRef.current.onConnectionStatusChange=e.onConnectionStatusChange),e.onSessionGeneratingChange!==void 0&&(this.callbacksRef.current.onSessionGeneratingChange=e.onSessionGeneratingChange),e.onQueueChange!==void 0&&(this.callbacksRef.current.onQueueChange=e.onQueueChange),e.onResumeStateChange!==void 0&&(this.callbacksRef.current.onResumeStateChange=e.onResumeStateChange),e.onRunIdChange!==void 0&&(this.callbacksRef.current.onRunIdChange=e.onRunIdChange),e.onInterruptStateChange!==void 0&&(this.callbacksRef.current.onInterruptStateChange=e.onInterruptStateChange),e.onCustomEvent!==void 0&&(this.callbacksRef.current.onCustomEvent=e.onCustomEvent)}dispose(){this.disposed=!0,this.unsubscribe(),this.devtoolsBridge.dispose(),this.devtoolsMounted=!1}};function NA(e){return!e||typeof e!=`object`?{}:{...`before`in e&&typeof e.before==`number`?{before:e.before}:{},...`after`in e&&typeof e.after==`number`?{after:e.after}:{},...`messagesBefore`in e&&typeof e.messagesBefore==`number`?{messagesBefore:e.messagesBefore}:{},...`messagesAfter`in e&&typeof e.messagesAfter==`number`?{messagesAfter:e.messagesAfter}:{},...`reusedCheckpoint`in e&&typeof e.reusedCheckpoint==`boolean`?{reusedCheckpoint:e.reusedCheckpoint}:{},...`maxTokens`in e&&typeof e.maxTokens==`number`?{maxTokens:e.maxTokens}:{},...`strategyKey`in e&&typeof e.strategyKey==`string`?{strategyKey:e.strategyKey}:{},...`durationMs`in e&&typeof e.durationMs==`number`?{durationMs:e.durationMs}:{}}}function PA(e){if(!Array.isArray(e))return;let t=[];for(let n of e)n&&typeof n==`object`&&`role`in n&&`tokens`in n&&`text`in n&&typeof n.role==`string`&&typeof n.tokens==`number`&&typeof n.text==`string`&&t.push({role:n.role,tokens:n.tokens,text:n.text});return t}function FA(e){if(!e||typeof e!=`object`||!(`before`in e)||!(`after`in e)||!(`messagesBefore`in e)||!(`messagesAfter`in e)||typeof e.before!=`number`||typeof e.after!=`number`||typeof e.messagesBefore!=`number`||typeof e.messagesAfter!=`number`)return null;let t=`reusedCheckpoint`in e&&e.reusedCheckpoint===!0,n=`maxTokens`in e&&typeof e.maxTokens==`number`?e.maxTokens:void 0,r=`strategyKey`in e&&typeof e.strategyKey==`string`?e.strategyKey:void 0,i=`dropped`in e?PA(e.dropped):void 0,a=`result`in e?PA(e.result):void 0;return{before:e.before,after:e.after,messagesBefore:e.messagesBefore,messagesAfter:e.messagesAfter,reusedCheckpoint:t,...n===void 0?{}:{maxTokens:n},...r?{strategyKey:r}:{},...i?{dropped:i}:{},...a?{result:a}:{}}}var IA=Symbol.for(`tanstack.ai.devtools.activeBridgeByHookId`);function LA(){let e=globalThis,t=e[IA];if(t)return t;let n=new Map;return e[IA]=n,n}function RA(e,t){return{get hookId(){return e.hookId},get clientId(){return e.clientId},get threadId(){return e.threadId},metadata:e.metadata,getSnapshot:t.getSnapshot,...t.getTools||e.getTools?{getTools:t.getTools??e.getTools}:{},...t.applyToolFixture||e.applyToolFixture?{applyToolFixture:t.applyToolFixture??e.applyToolFixture}:{}}}var zA=class{options;unsubscribers=[];disposed=!1;superseded=!1;registered=!1;constructor(e){this.options=e}emitRegistered(){this.prepareForMountEmit()&&(this.registered=!0,gO(`hook:registered`,{...this.createEnvelope(`hook:registered`),...this.createMetadataPayload(),lifecycle:`mounted`}))}emitUpdated(){this.prepareForEmit()&&gO(`hook:updated`,{...this.createEnvelope(`hook:updated`),...this.createMetadataPayload(),lifecycle:`active`})}emitSnapshot(){this.prepareForEmit()&&gO(`hook:state-snapshot`,{...this.createEnvelope(`hook:state-snapshot`),...this.createMetadataPayload(),state:this.options.getSnapshot()})}emitToolsRegistered(){if(!this.prepareForEmit())return;let e=this.options.getTools?Array.from(this.options.getTools()).map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema?jE(e.inputSchema):{type:`object`},outputSchema:e.outputSchema?jE(e.outputSchema):void 0,needsApproval:e.needsApproval,metadata:e.metadata})):[];gO(`tools:registered`,{...this.createEnvelope(`tools:registered`),...this.createMetadataPayload(),tools:e})}emitRunLifecycle(e,t,n,r={}){this.prepareForEmit()&&gO(e,{...this.createEnvelope(e,`client-state`,{runId:t}),runId:t,status:n,...r.error?{error:r.error}:{}})}deactivate(){let e=LA();e.get(this.options.hookId)===this&&e.delete(this.options.hookId);for(let e of this.unsubscribers.splice(0))e()}supersede(){this.disposed||(this.superseded=!0,this.disposed=!0,this.deactivate())}dispose(){if(!this.disposed){if(this.disposed=!0,!this.registered){this.deactivate();return}if(LA().get(this.options.hookId)!==this){this.deactivate();return}gO(`hook:unregistered`,{...this.createEnvelope(`hook:unregistered`),...this.createMetadataPayload(),reason:`disposed`}),this.deactivate()}}prepareForEmit(){return this.disposed||this.superseded?!1:(this.activate(),!0)}prepareForMountEmit(){return!this.superseded&&(this.disposed&&(this.disposed=!1,this.registered=!1),this.activate(),!0)}activate(){if(this.disposed)return;let e=LA(),t=e.get(this.options.hookId);t&&t!==this&&(typeof t.supersede==`function`?t.supersede():t.deactivate()),e.set(this.options.hookId,this),!(this.unsubscribers.length>0)&&(this.unsubscribers.push(hO.on(`devtools:request-state`,e=>{this.handleRequestState(e)})),this.options.applyToolFixture&&this.unsubscribers.push(hO.on(`devtools:tool-fixture:apply`,e=>{this.handleToolFixtureApply(e)})))}handleRequestState(e){if(this.disposed||this.superseded)return;let t=e.payload.targetHookId;t&&t!==this.options.hookId||(this.emitRegistered(),this.emitToolsRegistered(),this.emitSnapshot(),this.onReplayState())}onReplayState(){}async handleToolFixtureApply(e){let t=e.payload;this.matchesFixtureTarget(t)&&await this.options.applyToolFixture?.(t)}matchesFixtureTarget(e){return!e.hookId&&!e.threadId?!1:e.hookId?e.hookId===this.options.hookId:!e.threadId||!!this.options.threadId&&e.threadId===this.options.threadId}createEnvelope(e,t=`client-state`,n={}){return uO({eventType:e,source:`client`,visibility:t,clientId:this.options.clientId,hookId:this.options.hookId,...this.options.threadId?{threadId:this.options.threadId}:{},...n.runId?{runId:n.runId}:{},timestamp:Date.now()})}createMetadataPayload(){return{hookId:this.options.hookId,hookName:this.options.metadata.hookName,...this.options.metadata.name?{displayName:this.options.metadata.name}:{},...this.options.metadata.outputKind?{outputKind:this.options.metadata.outputKind}:{},...this.options.metadata.framework?{framework:this.options.metadata.framework}:{}}}},BA=class extends zA{events;chatOptions;currentRunId=null;currentRunThreadId=null;currentStreamId=null;lastStreamId=null;lastRunEventContext;lastMemoryStateValue=null;lastCompactionEvents=[];lastSkillsStateValue=null;constructor(e){super(RA(e,{getSnapshot:e.getSnapshot,applyToolFixture:e=>this.applyFixture(e)})),this.chatOptions=e,this.events=new JA(()=>e.clientId,this)}setCurrentStreamId(e){this.currentStreamId=e,e&&(this.lastStreamId=e)}recordStreamId(e){e&&(this.lastStreamId=e)}mountWithTools(e){this.events.clientCreated(e),this.emitRegistered(),this.emitToolsRegistered(),this.emitSnapshot()}notifyToolsChanged(){this.emitToolsRegistered(),this.emitSnapshot()}getCurrentStreamId(){return this.currentStreamId}getLastStreamId(){return this.lastStreamId}resolveStreamId(){return this.currentStreamId??this.lastStreamId??this.chatOptions.generateId(`stream`)}beginRun(e,t){this.currentRunId=e,this.currentRunThreadId=t,this.lastRunEventContext={runId:e,threadId:t}}observeChunk(e){if(e.type===`RUN_STARTED`){this.beginRun(e.runId,e.threadId);return}if(e.type===`RUN_FINISHED`||e.type===`RUN_ERROR`){let t=(e.type,e.runId);if(!t||t===this.currentRunId){let e=this.getCurrentRunEventContext();e&&(this.lastRunEventContext=e),this.currentRunId=null,this.currentRunThreadId=null}}}recordMemoryState(e){this.lastMemoryStateValue=e,this.emitMemoryState(e)}recordSkillsState(e){this.lastSkillsStateValue=e,this.emitSkillsState(e)}emitMemoryState(e){if(!e||typeof e!=`object`)return;let t=e,n=t.scope,r=t.adapter;if(!n||typeof r!=`string`)return;let i=this.currentRunId?{runId:this.currentRunId}:{};gO(`memory:retrieve:started`,{...this.createEnvelope(`memory:retrieve:started`,`client-state`,i),scope:n,adapter:r,query:t.query??``}),t.recall&&gO(`memory:retrieve:completed`,{...this.createEnvelope(`memory:retrieve:completed`,`client-state`,i),scope:n,adapter:r,fragmentCount:t.recall.fragmentCount??0,hasTools:!!t.recall.hasTools,systemPromptChars:t.recall.systemPromptChars??0,durationMs:t.recall.durationMs??0}),t.snapshot&&gO(`memory:snapshot`,{...this.createEnvelope(`memory:snapshot`,`client-state`,i),scope:n,adapter:r,takenAt:t.snapshot.takenAt,data:t.snapshot.data,facts:t.snapshot.facts??[]})}recordCompactionEvent(e,t){this.lastCompactionEvents.push({eventType:e,value:t}),this.lastCompactionEvents.length>60&&this.lastCompactionEvents.splice(0,this.lastCompactionEvents.length-60),this.emitCompactionEvent(e,t)}recordCompactionState(e){this.recordCompactionEvent(`compaction:state`,e)}emitCompactionEvent(e,t){let n=this.currentRunId?{runId:this.currentRunId}:{};if(e===`compaction:started`){let e=NA(t);gO(`compaction:started`,{...this.createEnvelope(`compaction:started`,`client-state`,n),...e});return}if(e===`compaction:ended`){let e=NA(t);gO(`compaction:ended`,{...this.createEnvelope(`compaction:ended`,`client-state`,n),...e});return}if(e===`compaction:state`){let e=FA(t);if(!e)return;gO(`compaction:state`,{...this.createEnvelope(`compaction:state`,`client-state`,n),...e})}}emitSkillsState(e){if(!e||typeof e!=`object`)return;let t=e,n=Array.isArray(t.catalog)?t.catalog:[],r=Array.isArray(t.activated)?t.activated:[],i=this.currentRunId?{runId:this.currentRunId}:{};gO(`skills:snapshot`,{...this.createEnvelope(`skills:snapshot`,`client-state`,i),catalog:n,activated:r})}onReplayState(){this.lastMemoryStateValue!=null&&this.emitMemoryState(this.lastMemoryStateValue);for(let e of this.lastCompactionEvents)this.emitCompactionEvent(e.eventType,e.value);this.lastSkillsStateValue!=null&&this.emitSkillsState(this.lastSkillsStateValue)}getCurrentRunEventContext(){if(this.currentRunId)return{threadId:this.currentRunThreadId??this.chatOptions.threadId??``,runId:this.currentRunId}}getCurrentOrLastRunEventContext(){return this.getCurrentRunEventContext()??this.lastRunEventContext}findToolCallContext(e){let t={toolCallId:e},n=this.getCurrentRunEventContext();return n?{threadId:n.threadId,runId:n.runId,toolCallId:e}:this.chatOptions.threadId?{threadId:this.chatOptions.threadId,toolCallId:e}:t}async applyFixture(e){let t=this.chatOptions.getMessages(),n=e.threadId??this.chatOptions.threadId??``;if(e.execute){await this.executeFixture(e,t,n);return}let{message:r,toolCallId:i}=this.createReplayMessageFromFixture(e,t),a=r.id;this.events.messageAppended(r,void 0,{threadId:n,toolCallId:i,...e.runId?{runId:e.runId}:{}}),this.chatOptions.setMessages([...t,r]),this.events.toolFixtureApplied({hookId:this.chatOptions.hookId,threadId:n,...e.runId?{runId:e.runId}:{},toolName:e.toolName,input:e.input,output:e.output,messageId:a,toolCallId:i,...e.execute===void 0?{}:{execute:e.execute},...e.message?{message:e.message}:{},...e.errorText?{errorText:e.errorText}:{}}),this.emitSnapshot()}async executeFixture(e,t,n){let r=this.resolveFixtureToolCallId(e.toolCallId,t),i=this.resolveFixtureMessageId(e.messageId,t),a={id:i,role:`assistant`,parts:[{type:`tool-call`,id:r,name:e.toolName,arguments:HA(e.input),input:e.input,state:`input-complete`}],createdAt:new Date};this.events.messageAppended(a,void 0,{threadId:n,toolCallId:r,...e.runId?{runId:e.runId}:{}}),this.chatOptions.setMessages([...t,a]),this.emitSnapshot();let o=this.findClientTool(e.toolName)?.execute;if(!o){console.warn(`[ai-devtools] tool fixture "${e.toolName}" requested execute=true but no client tool implementation is registered; replaying saved output instead.`),this.addToolResultForFixture({fixture:e,messageId:i,toolCallId:r,threadId:n,output:e.output,errorText:e.errorText});return}let s;try{s=await o(e.input)}catch(t){console.error(`[ai-devtools] tool fixture "${e.toolName}" execute threw`,t),this.addToolResultForFixture({fixture:e,messageId:i,toolCallId:r,threadId:n,output:null,errorText:t instanceof Error?`${t.name}: ${t.message}`:`Tool execution failed: ${String(t)}`});return}this.addToolResultForFixture({fixture:e,messageId:i,toolCallId:r,threadId:n,output:s})}addToolResultForFixture(e){let t=e.errorText?`output-error`:`output-available`;this.events.toolResultAdded(e.toolCallId,e.fixture.toolName,e.output,t,{threadId:e.threadId,...e.fixture.runId?{runId:e.fixture.runId}:{},toolCallId:e.toolCallId}),this.chatOptions.addToolResult(e.toolCallId,e.output,e.errorText),this.events.toolFixtureApplied({hookId:this.chatOptions.hookId,threadId:e.threadId,...e.fixture.runId?{runId:e.fixture.runId}:{},toolName:e.fixture.toolName,input:e.fixture.input,output:e.output,execute:!0,messageId:e.messageId,toolCallId:e.toolCallId,...e.errorText?{errorText:e.errorText}:{}}),this.emitSnapshot()}createReplayMessageFromFixture(e,t){let n=this.cloneFixtureSourceMessage(e,t);if(n)return n;let r=this.resolveFixtureToolCallId(e.toolCallId,t),i=this.resolveFixtureMessageId(e.messageId,t),a=e.errorText?`error`:`complete`;return{toolCallId:r,message:{id:i,role:`assistant`,parts:[{type:`tool-call`,id:r,name:e.toolName,arguments:HA(e.input),input:e.input,state:`input-complete`,output:e.output},{type:`tool-result`,toolCallId:r,content:HA(e.output),state:a,...e.errorText?{error:e.errorText}:{}}],createdAt:new Date}}}cloneFixtureSourceMessage(e,t){let n=e.message;if(!n||!Array.isArray(n.parts))return;let r=this.createFixtureToolCallIdMap(n.parts,t),i=n.parts.map(e=>WA(e,r)).filter(e=>!!e),a=e.toolCallId?r.get(e.toolCallId):void 0;if(KA(i,{...a?{mappedToolCallId:a}:{},output:e.output}),i.length===0)return;let o=(e.toolCallId?r.get(e.toolCallId):void 0)??GA(i);if(o)return{toolCallId:o,message:{id:this.resolveFixtureMessageId(n.id,t),role:n.role,parts:i,createdAt:new Date}}}createFixtureToolCallIdMap(e,t){let n=new Map;for(let r of e)VA(r)&&r.type===`tool-call`&&typeof r.id==`string`&&n.set(r.id,this.resolveFixtureToolCallId(r.id,t));return n}resolveFixtureMessageId(e,t){return e&&!t.some(t=>t.id===e)?e:this.chatOptions.generateId(`fixture-msg`)}resolveFixtureToolCallId(e,t){return e&&!qA(t,e)?e:this.chatOptions.generateId(`fixture-tool-call`)}findClientTool(e){let t=this.chatOptions.getTools?.();if(t){for(let n of t)if(n.name===e)return n}}};function VA(e){return typeof e==`object`&&!!e}function HA(e){if(typeof e==`string`)return e;if(e===void 0||typeof e==`function`||typeof e==`symbol`)return String(e);try{return JSON.stringify(e)}catch(t){return console.error(`[ai-devtools] failed to JSON.stringify fixture value; falling back to String(). Tool call arguments may be malformed.`,{error:t,value:e}),String(e)}}function UA(e){try{return JSON.parse(e)}catch(t){return console.error(`[ai-devtools] failed to JSON.parse fixture result content; replaying as raw string. Fixture payload may be corrupted.`,{error:t,content:e}),e}}function WA(e,t){if(!VA(e)||typeof e.type!=`string`)return;let n={...e};return e.type===`tool-call`&&typeof e.id==`string`&&(n.id=t.get(e.id)??e.id),e.type===`tool-result`&&typeof e.toolCallId==`string`&&(n.toolCallId=t.get(e.toolCallId)??e.toolCallId),n}function GA(e){let t=e.find(e=>e.type===`tool-call`);return t?.type===`tool-call`?t.id:void 0}function KA(e,t){for(let t of e){if(t.type!==`tool-result`)continue;let n=e.find(e=>e.type===`tool-call`&&e.id===t.toolCallId&&e.output===void 0);n&&(n.output=Array.isArray(t.content)?t.content:UA(t.content))}if(t.mappedToolCallId&&t.output!==void 0){let n=e.find(e=>e.type===`tool-call`&&e.id===t.mappedToolCallId&&e.output===void 0);n&&(n.output=t.output)}}function qA(e,t){return e.some(e=>e.parts.some(e=>e.type===`tool-call`?e.id===t:e.type===`tool-result`&&e.toolCallId===t))}var JA=class extends lA{getClientId;helper;constructor(e,t){super(e()),this.getClientId=e,this.helper=t}emitEvent(e,t){this.clientId=this.getClientId(),super.emitEvent(e,t)}afterEmit(e){e&&this.helper.recordStreamId(e),this.helper.emitSnapshot()}textUpdated(e,t,n,r){super.textUpdated(e,t,n,r??this.helper.getCurrentRunEventContext()),this.afterEmit(e)}thinkingUpdated(e,t,n,r,i){super.thinkingUpdated(e,t,n,r,i??this.helper.getCurrentRunEventContext()),this.afterEmit(e)}messageAppended(e,t,n){super.messageAppended(e,t,n??this.helper.getCurrentRunEventContext()),this.afterEmit(t)}toolCallStateChanged(e,t,n,r,i,a,o){super.toolCallStateChanged(e,t,n,r,i,a,o??this.helper.getCurrentRunEventContext()),this.afterEmit(e)}structuredOutputChanged(e,t,n,r,i){super.structuredOutputChanged(e,t,n,r,i??this.helper.getCurrentOrLastRunEventContext()),this.afterEmit(t)}approvalRequested(e,t,n,r,i,a,o){super.approvalRequested(e,t,n,r,i,a,o??this.helper.getCurrentOrLastRunEventContext()),this.afterEmit(e)}toolResultAdded(e,t,n,r,i){super.toolResultAdded(e,t,n,r,i??this.helper.getCurrentRunEventContext()),this.afterEmit()}toolApprovalResponded(e,t,n,r){super.toolApprovalResponded(e,t,n,r??this.helper.getCurrentRunEventContext()),this.afterEmit()}clientCreated(e){super.clientCreated(e),this.afterEmit()}loadingChanged(e){super.loadingChanged(e),this.afterEmit()}errorChanged(e){super.errorChanged(e),this.afterEmit()}reloaded(e){super.reloaded(e),this.afterEmit()}stopped(){super.stopped(),this.afterEmit()}messagesCleared(){super.messagesCleared(),this.afterEmit()}messageSent(e,t){super.messageSent(e,t),this.afterEmit()}toolFixtureApplied(e){super.toolFixtureApplied(e),this.afterEmit()}};function YA(e){return new BA(e)}var XA=Object.freeze([]),ZA=Object.freeze([]);function QA(e={}){let t=$t(e.initialMessages||[]),n=$t(!1),r=$t(void 0),i=$t(`ready`),a=$t(!1),o=$t(`disconnected`),s=$t(!1),c=$t([]),l=$t(null),u=$t({interrupts:XA,pendingInterrupts:XA,interruptErrors:ZA,resuming:!1}),d=new MA({devtoolsBridgeFactory:YA,...e.connection?{connection:e.connection}:{fetcher:e.fetcher},...e.initialMessages!==void 0&&{initialMessages:e.initialMessages},...typeof e.threadId==`string`&&e.persistence?{persistence:e.persistence,threadId:e.threadId}:{...e.threadId!==void 0&&{threadId:e.threadId}},...e.initialResumeSnapshot!==void 0&&{initialResumeSnapshot:e.initialResumeSnapshot},...e.body!==void 0&&{body:e.body},...e.forwardedProps!==void 0&&{forwardedProps:e.forwardedProps},...e.byok!==void 0&&{byok:e.byok},byokProvider:()=>e.byokProvider?.(),...e.context!==void 0&&{context:e.context},devtools:{...e.devtools,framework:`vue`,hookName:`useChat`,outputKind:e.outputSchema?`structured`:`chat`},onResponse:t=>e.onResponse?.(t),onChunk:t=>{e.onChunk?.(t)},onFinish:t=>{e.onFinish?.(t)},onError:t=>{e.onError?.(t)},tools:e.tools,...e.interrupts!==void 0&&{interrupts:e.interrupts},onCustomEvent:(t,n,r)=>e.onCustomEvent?.(t,n,r),...e.streamProcessor!==void 0&&{streamProcessor:e.streamProcessor},onMessagesChange:e=>{t.value=e},onLoadingChange:e=>{n.value=e,f()},onStatusChange:e=>{i.value=e},onErrorChange:e=>{r.value=e},onSubscriptionChange:e=>{a.value=e},onConnectionStatusChange:e=>{o.value=e},onSessionGeneratingChange:e=>{s.value=e},...e.queue!==void 0&&{queue:e.queue},onQueueChange:e=>{c.value=e},onRunIdChange:e=>{l.value=e},onInterruptStateChange:(t,n)=>{u.value=t,e.onInterruptStateChange?.(t,n)}});function f(){l.value=d.getCurrentRunId(),u.value=d.getInterruptState()}t.value=d.getMessages(),u.value=d.getInterruptState(),$n(()=>[e.body,e.forwardedProps,e.context,e.queue],([e,t,n,r])=>{d.updateOptions({body:e,...t!==void 0&&{forwardedProps:t},context:n,...r!==void 0&&{queue:r}})}),$n(()=>e.live,e=>{e?d.subscribe():d.unsubscribe()},{immediate:!0}),$r(()=>{d.attach(),d.mountDevtools(),f()}),Oe(()=>{d.detach(),e.live?d.unsubscribe():d.stop(),d.dispose()});let p=async(e,t)=>{try{await d.sendMessage(e,void 0,t)}finally{f()}},m=e=>d.cancelQueued(e),h=async e=>{try{await d.append(e)}finally{f()}},g=async()=>{try{await d.reload()}finally{f()}},v=()=>{d.stop()},y=()=>{d.clear(),f()},b=e=>{d.setMessagesManually(e)},x=async e=>{await d.addToolResult(e)},S=async e=>{await d.addToolApprovalResponse(e),f()},C=async(e,t)=>{let n=await d.resumeInterrupts(e,t);return f(),n},w=G(()=>u.value.interrupts),T=G(()=>u.value.interrupts),E=G(()=>u.value.interruptErrors),D=G(()=>u.value.resuming),O=e=>{d.resolveInterrupts(e)},k=()=>{d.cancelInterrupts()},ee=()=>{d.retryInterrupts()},A=(e,t)=>d.resumeInterruptsUnsafe(e,t),j=G(()=>{let e=t.value,n=-1;for(let t=e.length-1;t>=0;t--)if(e[t]?.role===`user`){n=t;break}if(n===-1)return null;for(let t=e.length-1;t>n;t--){let n=e[t];if(n?.role!==`assistant`)continue;let r=n.parts.find(e=>e.type===`structured-output`);if(r)return r}return null}),M=G(()=>{let e=j.value;return e?e.partial??e.data??{}:{}}),te=G(()=>{let e=j.value;return!e||e.status!==`complete`?null:e.data});return{messages:Ht(t),sendMessage:p,queue:Ht(c),cancelQueued:m,append:h,reload:g,stop:v,isLoading:Ht(n),error:Ht(r),status:Ht(i),isSubscribed:Ht(a),connectionStatus:Ht(o),sessionGenerating:Ht(s),setMessages:b,clear:y,addToolResult:x,addToolApprovalResponse:S,runId:Ht(l),interrupts:Ht(w),pendingInterrupts:Ht(T),interruptErrors:Ht(E),resuming:Ht(D),resolveInterrupts:O,cancelInterrupts:k,retryInterrupts:ee,resumeInterruptsUnsafe:A,resumeInterrupts:C,partial:Ht(M),final:Ht(te)}}var $A=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),ej=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),tj=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),nj=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),rj=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),ij=t((e=>{var t=ej().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),aj=t((e=>{var t=ej().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),oj=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),sj=t((e=>{var t=tj(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),cj=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),lj=t((e=>{var t=cj();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),uj=t(((e,t)=>{var n=lj();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),dj=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),fj=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
16
+ ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^[0-9]+$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),pj=t((e=>{var t=dj(),n=fj();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),mj=t((e=>{var t=ej(),n=sj(),r=tj(),i=pj(),a=dj(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),hj=t((e=>{var t=ej(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),gj=t(((e,t)=>{var n=pj();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),_j=t(((e,t)=>{var n=pj(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),vj=t(((e,t)=>{var n=pj();function r(e){this.mode=n.BYTE,this.data=typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),yj=t(((e,t)=>{var n=pj(),r=ej();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
17
+ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),bj=t(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),xj=t((e=>{var t=pj(),n=gj(),r=_j(),i=vj(),a=yj(),o=fj(),s=ej(),c=bj();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
18
+ Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),Sj=t((e=>{var t=ej(),n=tj(),r=nj(),i=rj(),a=ij(),o=aj(),s=oj(),c=sj(),l=uj(),u=mj(),d=hj(),f=pj(),p=xj();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function v(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function y(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function b(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function x(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return S(a,e,n)}function S(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),v=Array(o),y=0,b=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=b.slice(h,h+t),v[e]=m.encode(g[e]),h+=t,y=Math.max(y,t)}let x=new Uint8Array(i),S=0,C,w;for(C=0;C<y;C++)for(w=0;w<o;w++)C<g[w].length&&(x[S++]=g[w][C]);for(C=0;C<p;C++)for(w=0;w<o;w++)x[S++]=v[w][C];return x}function C(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
19
19
  The chosen QR Code version cannot contain this amount of data.
20
20
  Minimum version required to store current data is: `+c+`.
21
- `);let l=x(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),y(d,r,0),n>=7&&v(d,n),b(d,l),isNaN(a)&&(a=s.getBestMask(d,y.bind(null,d,r))),s.applyMask(a,d),y(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),C(e,a,i,o)}})),Sj=t((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||(e.color={});let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),Cj=t((e=>{var t=Sj();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),wj=t((e=>{var t=Sj();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
22
- `;return typeof a==`function`&&a(null,p),p}})),Tj=t((e=>{var t=QA(),n=xj(),r=Cj(),i=wj();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})})),Ej=1,Dj=new class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{let{message:t,...n}=e,r=typeof e.id==`number`||e.id&&e.id?.length>0?e.id:Ej++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:`default`});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],po(e))i=!1,this.create({id:n,type:`default`,message:e});else if(kj(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!po(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!po(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!po(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!po(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})};custom=(e,t)=>{let n=t?.id||Ej++,r=this.toasts.find(e=>e.id===n),i=t?.dismissible===void 0||t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),r?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:e,dismissible:i,id:n,...t}),{...r,component:e,dismissible:i,id:n,...t}):r):this.addToast({component:e,dismissible:i,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};function Oj(e,t){let n=t?.id||Ej++;return Dj.create({message:e,id:n,type:`default`,...t}),n}var kj=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Aj=Object.assign(Oj,{success:Dj.success,info:Dj.info,warning:Dj.warning,error:Dj.error,custom:Dj.custom,message:Dj.message,promise:Dj.promise,dismiss:Dj.dismiss,loading:Dj.loading},{getHistory:()=>Dj.toasts,getToasts:()=>Dj.getActiveToasts()});function jj(e){return e.label!==void 0}var Mj=3,Nj=`24px`,Pj=`16px`,Fj=4e3,Ij=356,Lj=14,Rj=45,zj=200;function Bj(){let e=z(!1);return Zn(()=>{let t=()=>{e.value=document.hidden};return document.addEventListener(`visibilitychange`,t),()=>window.removeEventListener(`visibilitychange`,t)}),{isDocumentHidden:e}}function Vj(...e){return e.filter(Boolean).join(` `)}function Hj(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function Uj(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Pj:Nj;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Wj=[`data-rich-colors`,`data-styled`,`data-mounted`,`data-promise`,`data-swiped`,`data-removed`,`data-visible`,`data-y-position`,`data-x-position`,`data-index`,`data-front`,`data-swiping`,`data-dismissible`,`data-type`,`data-invert`,`data-swipe-out`,`data-swipe-direction`,`data-expanded`,`data-testid`],Gj=[`aria-label`,`data-disabled`,`data-close-button-position`],Kj=Mr({__name:`Toast`,props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:[`update:heights`,`update:height`,`removeToast`],setup(e,{emit:t}){let n=e,r=t,i=z(null),a=z(null),o=z(!1),s=z(!1),c=z(!1),l=z(!1),u=z(!1),d=z(0),f=z(0),p=z(n.toast.duration||n.duration||Fj),m=z(null),h=z(null),g=G(()=>n.index===0),v=G(()=>n.index+1<=n.visibleToasts),y=G(()=>n.toast.type),b=G(()=>n.toast.dismissible!==!1),x=G(()=>n.toast.class||``),S=G(()=>n.descriptionClass||``),C=G(()=>{let e=n.toast.position||n.position,t=n.heights.filter(t=>t.position===e).findIndex(e=>e.toastId===n.toast.id);return t>=0?t:0}),w=G(()=>{let e=n.toast.position||n.position;return n.heights.filter(t=>t.position===e).reduce((e,t,n)=>n>=C.value?e:e+t.height,0)}),T=G(()=>C.value*n.gap+w.value||0),E=G(()=>n.toast.closeButton??n.closeButton),D=G(()=>n.toast.duration||n.duration||Fj),O=z(0),k=z(0),ee=z(null),A=G(()=>n.position.split(`-`)),j=G(()=>A.value[0]),M=G(()=>A.value[1]),te=G(()=>typeof n.toast.title!=`string`),ne=G(()=>typeof n.toast.description!=`string`),{isDocumentHidden:N}=Bj(),re=G(()=>y.value&&y.value===`loading`);$r(()=>{o.value=!0,p.value=D.value}),Zn(async()=>{if(!o.value||!h.value)return;await jn();let e=h.value,t=e.style.height;e.style.height=`auto`;let i=e.getBoundingClientRect().height;e.style.height=t,f.value=i,r(`update:height`,{toastId:n.toast.id,height:i,position:n.toast.position||n.position})});function P(){s.value=!0,d.value=T.value,setTimeout(()=>{r(`removeToast`,n.toast)},zj)}function F(){if(re.value||!b.value)return{};P(),n.toast.onDismiss?.(n.toast)}function ie(e){e.button!==2&&!re.value&&b.value&&(m.value=new Date,d.value=T.value,e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(c.value=!0,ee.value={x:e.clientX,y:e.clientY}))}function I(){if(l.value||!b.value)return;ee.value=null;let e=Number(h.value?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(h.value?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-(m.value?.getTime()||0),o=i.value===`x`?e:t,s=Math.abs(o)/r;if(Math.abs(o)>=Rj||s>.11){d.value=T.value,n.toast.onDismiss?.(n.toast),i.value===`x`?a.value=e>0?`right`:`left`:a.value=t>0?`down`:`up`,P(),l.value=!0;return}h.value?.style.setProperty(`--swipe-amount-x`,`0px`),h.value?.style.setProperty(`--swipe-amount-y`,`0px`),u.value=!1,c.value=!1,i.value=null}function ae(e){if(!ee.value||!b.value||(window?.getSelection()?.toString()?.length??!1))return;let t=e.clientY-ee.value.y,r=e.clientX-ee.value.x,a=n.swipeDirections??Hj(n.position);!i.value&&(Math.abs(r)>1||Math.abs(t)>1)&&(i.value=Math.abs(r)>Math.abs(t)?`x`:`y`);let o={x:0,y:0},s=e=>1/(1.5+Math.abs(e)/20);if(i.value===`y`){if(a.includes(`top`)||a.includes(`bottom`)){if(a.includes(`top`)&&t<0||a.includes(`bottom`)&&t>0)o.y=t;else{let e=t*s(t);o.y=Math.abs(e)<Math.abs(t)?e:t}}}else if(i.value===`x`&&(a.includes(`left`)||a.includes(`right`))){if(a.includes(`left`)&&r<0||a.includes(`right`)&&r>0)o.x=r;else{let e=r*s(r);o.x=Math.abs(e)<Math.abs(r)?e:r}}(Math.abs(o.x)>0||Math.abs(o.y)>0)&&(u.value=!0),h.value?.style.setProperty(`--swipe-amount-x`,`${o.x}px`),h.value?.style.setProperty(`--swipe-amount-y`,`${o.y}px`)}$r(()=>{if(o.value=!0,!h.value)return;let e=h.value.getBoundingClientRect().height;f.value=e;let t=[{toastId:n.toast.id,height:e,position:n.toast.position},...n.heights];r(`update:heights`,t)}),ni(()=>{h.value&&r(`removeToast`,n.toast)}),Zn(e=>{if(n.toast.promise&&y.value===`loading`||n.toast.duration===1/0||n.toast.type===`loading`)return;let t;n.expanded||n.interacting||N.value?(()=>{if(k.value<O.value){let e=new Date().getTime()-O.value;p.value-=e}k.value=new Date().getTime()})():p.value!==1/0&&(O.value=new Date().getTime(),t=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),P()},p.value)),e(()=>{clearTimeout(t)})}),$n(()=>n.toast.delete,e=>{e!==void 0&&e&&(P(),n.toast.onDismiss?.(n.toast))},{deep:!0});function se(){c.value=!1,i.value=null,ee.value=null}return(e,t)=>(H(),uo(`li`,{tabindex:`0`,ref_key:`toastRef`,ref:h,class:de(B(Vj)(n.class,x.value,e.classes?.toast,e.toast.classes?.toast,e.classes?.[y.value],e.toast?.classes?.[y.value])),"data-sonner-toast":``,"data-rich-colors":e.toast.richColors??e.defaultRichColors,"data-styled":!(e.toast.component||e.toast?.unstyled||e.unstyled),"data-mounted":o.value,"data-promise":!!e.toast.promise,"data-swiped":u.value,"data-removed":s.value,"data-visible":v.value,"data-y-position":j.value,"data-x-position":M.value,"data-index":e.index,"data-front":g.value,"data-swiping":c.value,"data-dismissible":b.value,"data-type":y.value,"data-invert":e.toast.invert||e.invert,"data-swipe-out":l.value,"data-swipe-direction":a.value,"data-expanded":!!(e.expanded||e.expandByDefault&&o.value),"data-testid":e.toast.testId,style:oe({"--index":e.index,"--toasts-before":e.index,"--z-index":e.toasts.length-e.index,"--offset":`${s.value?d.value:T.value}px`,"--initial-height":e.expandByDefault?`auto`:`${f.value}px`,...e.style,...n.toast.style}),onDragend:se,onPointerdown:ie,onPointerup:I,onPointermove:ae},[E.value&&!e.toast.component&&y.value!==`loading`?(H(),uo(`button`,{key:0,"aria-label":e.closeButtonAriaLabel||`Close toast`,"data-disabled":re.value,"data-close-button":`true`,"data-close-button-position":e.closeButtonPosition,class:de(B(Vj)(e.classes?.closeButton,e.toast?.classes?.closeButton)),onClick:F},[e.icons?.close?(H(),fo(fi(e.icons?.close),{key:0})):vi(e.$slots,`close-icon`,{key:1})],10,Gj)):So(`v-if`,!0),e.toast.component?(H(),fo(fi(e.toast.component),Eo({key:1},e.toast.componentProps,{onCloseToast:F,isPaused:e.$props.expanded||e.$props.interacting||B(N)}),null,16,[`isPaused`])):(H(),uo(eo,{key:2},[y.value!=="default"||e.toast.icon||e.toast.promise?(H(),uo(`div`,{key:0,"data-icon":``,class:de(B(Vj)(e.classes?.icon,e.toast?.classes?.icon))},[e.toast.icon?(H(),fo(fi(e.toast.icon),{key:0})):(H(),uo(eo,{key:1},[y.value===`loading`?vi(e.$slots,`loading-icon`,{key:0}):y.value===`success`?vi(e.$slots,`success-icon`,{key:1}):y.value===`error`?vi(e.$slots,`error-icon`,{key:2}):y.value===`warning`?vi(e.$slots,`warning-icon`,{key:3}):y.value===`info`?vi(e.$slots,`info-icon`,{key:4}):So(`v-if`,!0)],64))],2)):So(`v-if`,!0),U(`div`,{"data-content":``,class:de(B(Vj)(e.classes?.content,e.toast?.classes?.content))},[U(`div`,{"data-title":``,class:de(B(Vj)(e.classes?.title,e.toast.classes?.title))},[te.value?(H(),fo(fi(e.toast.title),fe(Eo({key:0},e.toast.componentProps)),null,16)):(H(),uo(eo,{key:1},[bo(be(e.toast.title),1)],64))],2),e.toast.description?(H(),uo(`div`,{key:0,"data-description":``,class:de(B(Vj)(e.descriptionClass,S.value,e.classes?.description,e.toast.classes?.description))},[ne.value?(H(),fo(fi(e.toast.description),fe(Eo({key:0},e.toast.componentProps)),null,16)):(H(),uo(eo,{key:1},[bo(be(e.toast.description),1)],64))],2)):So(`v-if`,!0)],2),e.toast.cancel?(H(),uo(`button`,{key:1,style:oe(e.toast.cancelButtonStyle||e.cancelButtonStyle),class:de(B(Vj)(e.classes?.cancelButton,e.toast.classes?.cancelButton)),"data-button":``,"data-cancel":``,onClick:t[0]||=t=>{B(jj)(e.toast.cancel)&&b.value&&(e.toast.cancel.onClick?.(t),P())}},be(B(jj)(e.toast.cancel)?e.toast.cancel?.label:e.toast.cancel),7)):So(`v-if`,!0),e.toast.action?(H(),uo(`button`,{key:2,style:oe(e.toast.actionButtonStyle||e.actionButtonStyle),class:de(B(Vj)(e.classes?.actionButton,e.toast.classes?.actionButton)),"data-button":``,"data-action":``,onClick:t[1]||=t=>{B(jj)(e.toast.action)&&(e.toast.action.onClick?.(t),!t.defaultPrevented&&P())}},be(B(jj)(e.toast.action)?e.toast.action?.label:e.toast.action),7)):So(`v-if`,!0)],64))],46,Wj))}}),qj=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Jj={},Yj={xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stoke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Xj(e,t){return H(),uo(`svg`,Yj,t[0]||=[U(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),U(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)])}var Zj=qj(Jj,[[`render`,Xj]]),Qj=[`data-visible`],$j={class:`sonner-spinner`},eM=Mr({__name:`Loader`,props:{visible:{type:Boolean}},setup(e){let t=Array(12).fill(0);return(e,n)=>(H(),uo(`div`,{class:`sonner-loading-wrapper`,"data-visible":e.visible},[U(`div`,$j,[(H(!0),uo(eo,null,gi(B(t),e=>(H(),uo(`div`,{key:`spinner-bar-${e}`,class:`sonner-loading-bar`}))),128))])],8,Qj))}}),tM={},nM={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function rM(e,t){return H(),uo(`svg`,nM,t[0]||=[U(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,"clip-rule":`evenodd`},null,-1)])}var iM=qj(tM,[[`render`,rM]]),aM={},oM={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function sM(e,t){return H(),uo(`svg`,oM,t[0]||=[U(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,"clip-rule":`evenodd`},null,-1)])}var cM=qj(aM,[[`render`,sM]]),lM={},uM={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`};function dM(e,t){return H(),uo(`svg`,uM,t[0]||=[U(`path`,{"fill-rule":`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,"clip-rule":`evenodd`},null,-1)])}var fM=qj(lM,[[`render`,dM]]),pM={},mM={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function hM(e,t){return H(),uo(`svg`,mM,t[0]||=[U(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,"clip-rule":`evenodd`},null,-1)])}var gM=qj(pM,[[`render`,hM]]),_M=[`aria-label`],vM=[`data-sonner-theme`,`dir`,`data-theme`,`data-rich-colors`,`data-y-position`,`data-x-position`],yM=typeof window<`u`&&typeof document<`u`;function bM(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}var xM=Mr({name:`Toaster`,inheritAttrs:!1,__name:`Toaster`,props:{id:{},invert:{type:Boolean,default:!1},theme:{default:`light`},position:{default:`bottom-right`},closeButtonPosition:{default:`top-left`},hotkey:{default:()=>[`altKey`,`KeyT`]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:Lj},visibleToasts:{default:Mj},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:``},style:{},offset:{default:Nj},mobileOffset:{default:Pj},dir:{default:`auto`},swipeDirections:{},icons:{},containerAriaLabel:{default:`Notifications`}},setup(e){let t=e,n=Ei(),r=z([]),i=G(()=>t.id?r.value.filter(e=>e.toasterId===t.id):r.value.filter(e=>!e.toasterId));function a(e,t){return i.value.filter(n=>!n.position&&t===0||n.position===e)}let o=G(()=>{let e=i.value.filter(e=>e.position).map(e=>e.position);return e.length>0?Array.from(new Set([t.position].concat(e))):[t.position]}),s=G(()=>{let e={};return o.value.forEach(t=>{e[t]=r.value.filter(e=>e.position===t)}),e}),c=z([]),l=z({}),u=z(!1);Zn(()=>{o.value.forEach(e=>{e in l.value||(l.value[e]=!1)})});let d=z(t.theme===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t.theme),f=z(null),p=z(null),m=z(!1),h=t.hotkey.join(`+`).replace(/Key/g,``).replace(/Digit/g,``);function g(e){r.value.find(t=>t.id===e.id)?.delete||Dj.dismiss(e.id),r.value=r.value.filter(({id:t})=>t!==e.id),setTimeout(()=>{r.value.find(t=>t.id===e.id)||(c.value=c.value.filter(t=>t.toastId!==e.id))},250)}function v(e){m.value&&!e.currentTarget?.contains?.(e.relatedTarget)&&(m.value=!1,p.value&&=(p.value.focus({preventScroll:!0}),null))}function y(e){e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||m.value||(m.value=!0,p.value=e.relatedTarget)}function b(e){e.target&&e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||(u.value=!0)}Zn(e=>{e(Dj.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{r.value=r.value.map(t=>t.id===e.id?{...t,delete:!0}:t)});return}jn(()=>{let t=r.value.findIndex(t=>t.id===e.id);t===-1?r.value=[e,...r.value]:r.value=[...r.value.slice(0,t),{...r.value[t],...e},...r.value.slice(t+1)]})}))}),Zn(e=>{if(typeof window>`u`)return;if(t.theme!==`system`){d.value=t.theme;return}let n=window.matchMedia(`(prefers-color-scheme: dark)`),r=e=>{d.value=e?`dark`:`light`};r(n.matches);let i=e=>{r(e.matches)};try{n.addEventListener(`change`,i)}catch{n.addListener(i)}e(()=>{try{n.removeEventListener(`change`,i)}catch{n.removeListener(i)}})}),Zn(()=>{f.value&&p.value&&(p.value.focus({preventScroll:!0}),p.value=null,m.value=!1)}),Zn(()=>{r.value.length<=1&&Object.keys(l.value).forEach(e=>{l.value[e]=!1})}),Zn(e=>{function n(e){let n=t.hotkey.every(t=>e[t]||e.code===t),r=Array.isArray(f.value)?f.value[0]:f.value;n&&(o.value.forEach(e=>{l.value[e]=!0}),r?.focus());let i=document.activeElement===f.value||r?.contains(document.activeElement);e.code===`Escape`&&i&&o.value.forEach(e=>{l.value[e]=!1})}yM&&(document.addEventListener(`keydown`,n),e(()=>{document.removeEventListener(`keydown`,n)}))});function x(e){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);l.value[n]=!0}function S(e){if(!u.value){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);l.value[n]=!1}}function C(){Object.keys(l.value).forEach(e=>{l.value[e]=!1})}function w(){u.value=!1}function T(e){c.value=e}function E(e){let t=c.value.findIndex(t=>t.toastId===e.toastId);if(t!==-1)c.value[t]=e;else{let t=c.value.findIndex(t=>t.position===e.position);t===-1?c.value.unshift(e):c.value.splice(t,0,e)}}return(e,r)=>(H(),uo(eo,null,[So(` Remove item from normal navigation flow, only available via hotkey `),U(`section`,{"aria-label":`${e.containerAriaLabel} ${B(h)}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`},[(H(!0),uo(eo,null,gi(o.value,(r,i)=>(H(),uo(`ol`,Eo({key:r,ref_for:!0,ref_key:`listRef`,ref:f,"data-sonner-toaster":``,"data-sonner-theme":d.value,class:t.class,dir:e.dir===`auto`?bM():e.dir,tabIndex:-1,"data-theme":e.theme,"data-rich-colors":e.richColors,"data-y-position":r.split(`-`)[0],"data-x-position":r.split(`-`)[1],style:{"--front-toast-height":`${c.value[0]?.height||0}px`,"--width":`${B(Ij)}px`,"--gap":`${e.gap}px`,...e.style,...B(n).style,...B(Uj)(e.offset,e.mobileOffset)}},{ref_for:!0},e.$attrs,{onBlur:v,onFocus:y,onMouseenter:x,onMousemove:x,onMouseleave:S,onDragend:C,onPointerdown:b,onPointerup:w}),[(H(!0),uo(eo,null,gi(a(r,i),(n,i)=>(H(),fo(Kj,{key:n.id,heights:c.value,icons:e.icons,index:i,toast:n,defaultRichColors:e.richColors,duration:e.toastOptions?.duration??e.duration,class:de(e.toastOptions?.class??``),descriptionClass:e.toastOptions?.descriptionClass,invert:e.invert,visibleToasts:e.visibleToasts,closeButton:e.toastOptions?.closeButton??e.closeButton,interacting:u.value,position:r,closeButtonPosition:e.toastOptions?.closeButtonPosition??e.closeButtonPosition,style:oe(e.toastOptions?.style),unstyled:e.toastOptions?.unstyled,classes:e.toastOptions?.classes,cancelButtonStyle:e.toastOptions?.cancelButtonStyle,actionButtonStyle:e.toastOptions?.actionButtonStyle,"close-button-aria-label":e.toastOptions?.closeButtonAriaLabel,toasts:s.value[r],expandByDefault:e.expand,gap:e.gap,expanded:l.value[r]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":T,"onUpdate:height":E,onRemoveToast:g},{"close-icon":Un(()=>[vi(e.$slots,`close-icon`,{},()=>[W(Zj)])]),"loading-icon":Un(()=>[vi(e.$slots,`loading-icon`,{},()=>[W(eM,{visible:n.type===`loading`},null,8,[`visible`])])]),"success-icon":Un(()=>[vi(e.$slots,`success-icon`,{},()=>[W(iM)])]),"error-icon":Un(()=>[vi(e.$slots,`error-icon`,{},()=>[W(gM)])]),"warning-icon":Un(()=>[vi(e.$slots,`warning-icon`,{},()=>[W(fM)])]),"info-icon":Un(()=>[vi(e.$slots,`info-icon`,{},()=>[W(cM)])]),_:2},1032,[`heights`,`icons`,`index`,`toast`,`defaultRichColors`,`duration`,`class`,`descriptionClass`,`invert`,`visibleToasts`,`closeButton`,`interacting`,`position`,`closeButtonPosition`,`style`,`unstyled`,`classes`,`cancelButtonStyle`,`actionButtonStyle`,`close-button-aria-label`,`toasts`,`expandByDefault`,`gap`,`expanded`,`swipeDirections`]))),128))],16,vM))),128))],8,_M)],2112))}}),SM=class e extends kS{constructor(){super(),this.restore()}async checkPermissions(){return{display:`granted`}}async requestPermissions(){return{display:`granted`}}async get(){let t=localStorage.getItem(e.STORAGE_KEY);return{count:t?parseInt(t,10):0}}async set(t){let n=t.count;n===0?await navigator.clearAppBadge():await navigator.setAppBadge(n);let r=n.toString();localStorage.setItem(e.STORAGE_KEY,r)}async increase(){let{count:e}=await this.get();await this.set({count:e+1})}async decrease(){let{count:e}=await this.get();e<1||await this.set({count:e-1})}async clear(){await this.set({count:0})}async isSupported(){return{isSupported:`setAppBadge`in navigator}}async restore(){let t=localStorage.getItem(e.STORAGE_KEY);if(!t)return;let n=parseInt(t,10);await navigator.setAppBadge(n)}};SM.STORAGE_KEY=`capacitor.badge`;try{self[`workbox:window:7.4.0`]&&_()}catch{}function CM(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function wM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TM(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,OM(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function EM(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if(typeof e==`string`)return wM(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wM(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
23
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DM(e,t){return DM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},DM(e,t)}function OM(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return typeof t==`symbol`?t:t+``}try{self[`workbox:core:7.4.0`]&&_()}catch{}var kM=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function AM(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var jM=function(e,t){this.type=e,Object.assign(this,t)};function MM(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}function NM(){}var PM={type:`SKIP_WAITING`};function FM(e,t){return e&&e.then?e.then(NM):Promise.resolve()}var IM=function(e){function t(t,n){var r,i;return n===void 0&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new kM,r.en=new kM,r.on=new kM,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!AM(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener(`updatefound`,r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener(`statechange`,r.ln)},r.ln=function(e){var t=r.fn,n=e.target,i=n.state,a=n===r.vn,o={sw:n,isExternal:a,originalEvent:e};!a&&r.mn&&(o.isUpdate=!0),r.dispatchEvent(new jM(i,o)),i===`installed`?r.wn=self.setTimeout((function(){i===`installed`&&t.waiting===n&&r.dispatchEvent(new jM(`waiting`,o))}),200):i===`activating`&&(clearTimeout(r.wn),a||r.en.resolve(n))},r.yn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new jM(`controlling`,{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(i=function(e){var t=e.data,n=e.ports,i=e.source;return MM(r.getSW(),(function(){r.an.has(i)&&r.dispatchEvent(new jM(`message`,{data:t,originalEvent:e,ports:n,sw:i}))}))},function(){var e=[...arguments];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener(`message`,r.gn),r}var n,r=e;(n=t).prototype=Object.create(r.prototype),n.prototype.constructor=n,DM(n,r);var i=t.prototype;return i.register=function(e){var t=(e===void 0?{}:e).immediate,n=t!==void 0&&t;try{var r=this;return MM(function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(!n&&document.readyState!==`complete`)return FM(new Promise((function(e){return window.addEventListener(`load`,e)})))}),(function(){return r.mn=!!navigator.serviceWorker.controller,r.dn=r.pn(),MM(r.bn(),(function(e){r.fn=e,r.dn&&(r.hn=r.dn,r.en.resolve(r.dn),r.on.resolve(r.dn),r.dn.addEventListener(`statechange`,r.ln,{once:!0}));var t=r.fn.waiting;return t&&AM(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new jM(`waiting`,{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener(`updatefound`,r.cn),navigator.serviceWorker.addEventListener(`controllerchange`,r.yn),r.fn}))})))}catch(e){return Promise.reject(e)}},i.update=function(){try{return this.fn?MM(FM(this.fn.update())):MM()}catch(e){return Promise.reject(e)}},i.getSW=function(){return this.hn===void 0?this.rn.promise:Promise.resolve(this.hn)},i.messageSW=function(e){try{return MM(this.getSW(),(function(t){return CM(t,e)}))}catch(e){return Promise.reject(e)}},i.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&CM(this.fn.waiting,PM)},i.pn=function(){var e=navigator.serviceWorker.controller;return e&&AM(e.scriptURL,this.sn.toString())?e:void 0},i.bn=function(){try{var e=this;return MM(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return MM(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e})))}catch(e){return Promise.reject(e)}},TM(t,[{key:`active`,get:function(){return this.en.promise}},{key:`controlling`,get:function(){return this.on.promise}}])}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.jn(e).add(t)},t.removeEventListener=function(e,t){this.jn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=EM(this.jn(e.type));!(t=n()).done;)(0,t.value)(e)},t.jn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}()),LM=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,RM=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(LM);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},zM=e=>e===`*`||e===`x`||e===`X`,BM=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},VM=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],HM=(e,t)=>{if(zM(e)||zM(t))return 0;let[n,r]=VM(BM(e),BM(t));return n>r?1:n<r?-1:0},UM=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){let r=HM(e[n]||`0`,t[n]||`0`);if(r!==0)return r}return 0},WM=(e,t)=>{let n=RM(e),r=RM(t),i=n.pop(),a=r.pop(),o=UM(n,r);return o===0?i&&a?UM(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o};export{iv as $,Un as $n,js as $t,CS as A,Qr as An,nh as At,Xx as B,ui as Bn,rh as Bt,Vw as C,qn as Cn,be as Cr,Y_ as Ct,PS as D,Eo as Dn,Gh as Dt,DS as E,Ai as En,fh as Et,AS as F,ri as Fn,oh as Ft,nb as G,Nr as Gn,Bf as Gt,qx as H,fi as Hn,Nm as Ht,RS as I,H as In,bh as It,Qy as J,Fr as Jn,Tf as Jt,eb as K,Qi as Kn,wf as Kt,OS as L,Kn as Ln,wh as Lt,WS as M,ei as Mn,yh as Mt,VS as N,qr as Nn,lh as Nt,wS as O,jn as On,mh as Ot,kS as P,$r as Pn,vh as Pt,qg as Q,Mi as Qn,wc as Qt,SS as R,gi as Rn,ch as Rt,Nw as S,Jn as Sn,oe as Sr,xv as St,GS as T,ki as Tn,uh as Tt,Q as U,bi as Un,km as Ut,Yx as V,pi as Vn,th as Vt,rb as W,Ei as Wn,Dm as Wt,yy as X,$n as Xn,us as Xt,Xy as Y,Xo as Yn,Sf as Yt,Iv as Z,Zn,uc as Zt,Xw as _,Ur as _n,sn as _r,I_ as _t,SM as a,mr as an,Gt as ar,K_ as at,Uw as b,vo as bn,de as br,i_ as bt,Tj as c,U as cn,Oe as cr,W_ as ct,gO as d,uo as dn,z as dr,sv as dt,Os as en,Wn as er,A_ as et,tE as f,ji as fn,Vt as fr,av as ft,Zw as g,W as gn,un as gr,P_ as gt,lT as h,bo as hn,R as hr,R_ as ht,CM as i,Ua as in,Jt as ir,n_ as it,HS as j,ni as jn,_h as jt,BS as k,Kr as kn,gh as kt,ZA as l,fo as ln,Bt as lr,kg as lt,uT as m,xo as mn,$t as mr,Ev as mt,jM as n,vc as nn,Ee as nr,ov as nt,xM as o,to as on,Qt as or,rv as ot,OT as p,_i as pn,Ut as pr,lv as pt,$y as q,Ti as qn,Pf as qt,IM as r,eo as rn,De as rr,uv as rt,Aj as s,G as sn,Yt as sr,m_ as st,WM as t,bc as tn,on as tr,cv as tt,Dk as u,So as un,Ht as ur,bv as ut,qw as v,Mr as vn,V as vr,D_ as vt,QS as w,Yo as wn,Jh as wt,Hw as x,Jo as xn,fe as xr,U_ as xt,Ww as y,Mo as yn,B as yr,B_ as yt,Qx as z,vi as zn,Y as zt};
21
+ `);let l=x(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),y(d,r,0),n>=7&&v(d,n),b(d,l),isNaN(a)&&(a=s.getBestMask(d,y.bind(null,d,r))),s.applyMask(a,d),y(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),C(e,a,i,o)}})),Cj=t((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||(e.color={});let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),wj=t((e=>{var t=Cj();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),Tj=t((e=>{var t=Cj();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
22
+ `;return typeof a==`function`&&a(null,p),p}})),Ej=t((e=>{var t=$A(),n=Sj(),r=wj(),i=Tj();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})})),Dj=1,Oj=new class{subscribers;toasts;dismissedToasts;constructor(){this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)});publish=e=>{this.subscribers.forEach(t=>t(e))};addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]};create=e=>{let{message:t,...n}=e,r=typeof e.id==`number`||e.id&&e.id?.length>0?e.id:Dj++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r};dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e);message=(e,t)=>this.create({...t,message:e,type:`default`});error=(e,t)=>this.create({...t,type:`error`,message:e});success=(e,t)=>this.create({...t,type:`success`,message:e});info=(e,t)=>this.create({...t,type:`info`,message:e});warning=(e,t)=>this.create({...t,type:`warning`,message:e});loading=(e,t)=>this.create({...t,type:`loading`,message:e});promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],po(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Aj(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!po(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!po(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!po(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!po(r)?r:{message:r||``,id:n||``};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally?.()}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})};custom=(e,t)=>{let n=t?.id||Dj++,r=this.toasts.find(e=>e.id===n),i=t?.dismissible===void 0||t.dismissible;return this.dismissedToasts.has(n)&&this.dismissedToasts.delete(n),r?this.toasts=this.toasts.map(r=>r.id===n?(this.publish({...r,component:e,dismissible:i,id:n,...t}),{...r,component:e,dismissible:i,id:n,...t}):r):this.addToast({component:e,dismissible:i,id:n,...t}),n};getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id))};function kj(e,t){let n=t?.id||Dj++;return Oj.create({message:e,id:n,type:`default`,...t}),n}var Aj=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,jj=Object.assign(kj,{success:Oj.success,info:Oj.info,warning:Oj.warning,error:Oj.error,custom:Oj.custom,message:Oj.message,promise:Oj.promise,dismiss:Oj.dismiss,loading:Oj.loading},{getHistory:()=>Oj.toasts,getToasts:()=>Oj.getActiveToasts()});function Mj(e){return e.label!==void 0}var Nj=3,Pj=`24px`,Fj=`16px`,Ij=4e3,Lj=356,Rj=14,zj=45,Bj=200;function Vj(){let e=z(!1);return Zn(()=>{let t=()=>{e.value=document.hidden};return document.addEventListener(`visibilitychange`,t),()=>window.removeEventListener(`visibilitychange`,t)}),{isDocumentHidden:e}}function Hj(...e){return e.filter(Boolean).join(` `)}function Uj(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}function Wj(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Fj:Pj;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Gj=[`data-rich-colors`,`data-styled`,`data-mounted`,`data-promise`,`data-swiped`,`data-removed`,`data-visible`,`data-y-position`,`data-x-position`,`data-index`,`data-front`,`data-swiping`,`data-dismissible`,`data-type`,`data-invert`,`data-swipe-out`,`data-swipe-direction`,`data-expanded`,`data-testid`],Kj=[`aria-label`,`data-disabled`,`data-close-button-position`],qj=Mr({__name:`Toast`,props:{toast:{},toasts:{},index:{},swipeDirections:{},expanded:{type:Boolean},invert:{type:Boolean},heights:{},gap:{},position:{},closeButtonPosition:{},visibleToasts:{},expandByDefault:{type:Boolean},closeButton:{type:Boolean},interacting:{type:Boolean},style:{},cancelButtonStyle:{},actionButtonStyle:{},duration:{},class:{},unstyled:{type:Boolean},descriptionClass:{},loadingIcon:{},classes:{},icons:{},closeButtonAriaLabel:{},defaultRichColors:{type:Boolean}},emits:[`update:heights`,`update:height`,`removeToast`],setup(e,{emit:t}){let n=e,r=t,i=z(null),a=z(null),o=z(!1),s=z(!1),c=z(!1),l=z(!1),u=z(!1),d=z(0),f=z(0),p=z(n.toast.duration||n.duration||Ij),m=z(null),h=z(null),g=G(()=>n.index===0),v=G(()=>n.index+1<=n.visibleToasts),y=G(()=>n.toast.type),b=G(()=>n.toast.dismissible!==!1),x=G(()=>n.toast.class||``),S=G(()=>n.descriptionClass||``),C=G(()=>{let e=n.toast.position||n.position,t=n.heights.filter(t=>t.position===e).findIndex(e=>e.toastId===n.toast.id);return t>=0?t:0}),w=G(()=>{let e=n.toast.position||n.position;return n.heights.filter(t=>t.position===e).reduce((e,t,n)=>n>=C.value?e:e+t.height,0)}),T=G(()=>C.value*n.gap+w.value||0),E=G(()=>n.toast.closeButton??n.closeButton),D=G(()=>n.toast.duration||n.duration||Ij),O=z(0),k=z(0),ee=z(null),A=G(()=>n.position.split(`-`)),j=G(()=>A.value[0]),M=G(()=>A.value[1]),te=G(()=>typeof n.toast.title!=`string`),ne=G(()=>typeof n.toast.description!=`string`),{isDocumentHidden:N}=Vj(),re=G(()=>y.value&&y.value===`loading`);$r(()=>{o.value=!0,p.value=D.value}),Zn(async()=>{if(!o.value||!h.value)return;await jn();let e=h.value,t=e.style.height;e.style.height=`auto`;let i=e.getBoundingClientRect().height;e.style.height=t,f.value=i,r(`update:height`,{toastId:n.toast.id,height:i,position:n.toast.position||n.position})});function P(){s.value=!0,d.value=T.value,setTimeout(()=>{r(`removeToast`,n.toast)},Bj)}function F(){if(re.value||!b.value)return{};P(),n.toast.onDismiss?.(n.toast)}function ie(e){e.button!==2&&!re.value&&b.value&&(m.value=new Date,d.value=T.value,e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(c.value=!0,ee.value={x:e.clientX,y:e.clientY}))}function I(){if(l.value||!b.value)return;ee.value=null;let e=Number(h.value?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(h.value?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-(m.value?.getTime()||0),o=i.value===`x`?e:t,s=Math.abs(o)/r;if(Math.abs(o)>=zj||s>.11){d.value=T.value,n.toast.onDismiss?.(n.toast),i.value===`x`?a.value=e>0?`right`:`left`:a.value=t>0?`down`:`up`,P(),l.value=!0;return}h.value?.style.setProperty(`--swipe-amount-x`,`0px`),h.value?.style.setProperty(`--swipe-amount-y`,`0px`),u.value=!1,c.value=!1,i.value=null}function ae(e){if(!ee.value||!b.value||(window?.getSelection()?.toString()?.length??!1))return;let t=e.clientY-ee.value.y,r=e.clientX-ee.value.x,a=n.swipeDirections??Uj(n.position);!i.value&&(Math.abs(r)>1||Math.abs(t)>1)&&(i.value=Math.abs(r)>Math.abs(t)?`x`:`y`);let o={x:0,y:0},s=e=>1/(1.5+Math.abs(e)/20);if(i.value===`y`){if(a.includes(`top`)||a.includes(`bottom`)){if(a.includes(`top`)&&t<0||a.includes(`bottom`)&&t>0)o.y=t;else{let e=t*s(t);o.y=Math.abs(e)<Math.abs(t)?e:t}}}else if(i.value===`x`&&(a.includes(`left`)||a.includes(`right`))){if(a.includes(`left`)&&r<0||a.includes(`right`)&&r>0)o.x=r;else{let e=r*s(r);o.x=Math.abs(e)<Math.abs(r)?e:r}}(Math.abs(o.x)>0||Math.abs(o.y)>0)&&(u.value=!0),h.value?.style.setProperty(`--swipe-amount-x`,`${o.x}px`),h.value?.style.setProperty(`--swipe-amount-y`,`${o.y}px`)}$r(()=>{if(o.value=!0,!h.value)return;let e=h.value.getBoundingClientRect().height;f.value=e;let t=[{toastId:n.toast.id,height:e,position:n.toast.position},...n.heights];r(`update:heights`,t)}),ni(()=>{h.value&&r(`removeToast`,n.toast)}),Zn(e=>{if(n.toast.promise&&y.value===`loading`||n.toast.duration===1/0||n.toast.type===`loading`)return;let t;n.expanded||n.interacting||N.value?(()=>{if(k.value<O.value){let e=new Date().getTime()-O.value;p.value-=e}k.value=new Date().getTime()})():p.value!==1/0&&(O.value=new Date().getTime(),t=setTimeout(()=>{n.toast.onAutoClose?.(n.toast),P()},p.value)),e(()=>{clearTimeout(t)})}),$n(()=>n.toast.delete,e=>{e!==void 0&&e&&(P(),n.toast.onDismiss?.(n.toast))},{deep:!0});function se(){c.value=!1,i.value=null,ee.value=null}return(e,t)=>(H(),uo(`li`,{tabindex:`0`,ref_key:`toastRef`,ref:h,class:de(B(Hj)(n.class,x.value,e.classes?.toast,e.toast.classes?.toast,e.classes?.[y.value],e.toast?.classes?.[y.value])),"data-sonner-toast":``,"data-rich-colors":e.toast.richColors??e.defaultRichColors,"data-styled":!(e.toast.component||e.toast?.unstyled||e.unstyled),"data-mounted":o.value,"data-promise":!!e.toast.promise,"data-swiped":u.value,"data-removed":s.value,"data-visible":v.value,"data-y-position":j.value,"data-x-position":M.value,"data-index":e.index,"data-front":g.value,"data-swiping":c.value,"data-dismissible":b.value,"data-type":y.value,"data-invert":e.toast.invert||e.invert,"data-swipe-out":l.value,"data-swipe-direction":a.value,"data-expanded":!!(e.expanded||e.expandByDefault&&o.value),"data-testid":e.toast.testId,style:oe({"--index":e.index,"--toasts-before":e.index,"--z-index":e.toasts.length-e.index,"--offset":`${s.value?d.value:T.value}px`,"--initial-height":e.expandByDefault?`auto`:`${f.value}px`,...e.style,...n.toast.style}),onDragend:se,onPointerdown:ie,onPointerup:I,onPointermove:ae},[E.value&&!e.toast.component&&y.value!==`loading`?(H(),uo(`button`,{key:0,"aria-label":e.closeButtonAriaLabel||`Close toast`,"data-disabled":re.value,"data-close-button":`true`,"data-close-button-position":e.closeButtonPosition,class:de(B(Hj)(e.classes?.closeButton,e.toast?.classes?.closeButton)),onClick:F},[e.icons?.close?(H(),fo(fi(e.icons?.close),{key:0})):vi(e.$slots,`close-icon`,{key:1})],10,Kj)):So(`v-if`,!0),e.toast.component?(H(),fo(fi(e.toast.component),Eo({key:1},e.toast.componentProps,{onCloseToast:F,isPaused:e.$props.expanded||e.$props.interacting||B(N)}),null,16,[`isPaused`])):(H(),uo(eo,{key:2},[y.value!=="default"||e.toast.icon||e.toast.promise?(H(),uo(`div`,{key:0,"data-icon":``,class:de(B(Hj)(e.classes?.icon,e.toast?.classes?.icon))},[e.toast.icon?(H(),fo(fi(e.toast.icon),{key:0})):(H(),uo(eo,{key:1},[y.value===`loading`?vi(e.$slots,`loading-icon`,{key:0}):y.value===`success`?vi(e.$slots,`success-icon`,{key:1}):y.value===`error`?vi(e.$slots,`error-icon`,{key:2}):y.value===`warning`?vi(e.$slots,`warning-icon`,{key:3}):y.value===`info`?vi(e.$slots,`info-icon`,{key:4}):So(`v-if`,!0)],64))],2)):So(`v-if`,!0),U(`div`,{"data-content":``,class:de(B(Hj)(e.classes?.content,e.toast?.classes?.content))},[U(`div`,{"data-title":``,class:de(B(Hj)(e.classes?.title,e.toast.classes?.title))},[te.value?(H(),fo(fi(e.toast.title),fe(Eo({key:0},e.toast.componentProps)),null,16)):(H(),uo(eo,{key:1},[bo(be(e.toast.title),1)],64))],2),e.toast.description?(H(),uo(`div`,{key:0,"data-description":``,class:de(B(Hj)(e.descriptionClass,S.value,e.classes?.description,e.toast.classes?.description))},[ne.value?(H(),fo(fi(e.toast.description),fe(Eo({key:0},e.toast.componentProps)),null,16)):(H(),uo(eo,{key:1},[bo(be(e.toast.description),1)],64))],2)):So(`v-if`,!0)],2),e.toast.cancel?(H(),uo(`button`,{key:1,style:oe(e.toast.cancelButtonStyle||e.cancelButtonStyle),class:de(B(Hj)(e.classes?.cancelButton,e.toast.classes?.cancelButton)),"data-button":``,"data-cancel":``,onClick:t[0]||=t=>{B(Mj)(e.toast.cancel)&&b.value&&(e.toast.cancel.onClick?.(t),P())}},be(B(Mj)(e.toast.cancel)?e.toast.cancel?.label:e.toast.cancel),7)):So(`v-if`,!0),e.toast.action?(H(),uo(`button`,{key:2,style:oe(e.toast.actionButtonStyle||e.actionButtonStyle),class:de(B(Hj)(e.classes?.actionButton,e.toast.classes?.actionButton)),"data-button":``,"data-action":``,onClick:t[1]||=t=>{B(Mj)(e.toast.action)&&(e.toast.action.onClick?.(t),!t.defaultPrevented&&P())}},be(B(Mj)(e.toast.action)?e.toast.action?.label:e.toast.action),7)):So(`v-if`,!0)],64))],46,Gj))}}),Jj=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Yj={},Xj={xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stoke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Zj(e,t){return H(),uo(`svg`,Xj,t[0]||=[U(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1),U(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1)])}var Qj=Jj(Yj,[[`render`,Zj]]),$j=[`data-visible`],eM={class:`sonner-spinner`},tM=Mr({__name:`Loader`,props:{visible:{type:Boolean}},setup(e){let t=Array(12).fill(0);return(e,n)=>(H(),uo(`div`,{class:`sonner-loading-wrapper`,"data-visible":e.visible},[U(`div`,eM,[(H(!0),uo(eo,null,gi(B(t),e=>(H(),uo(`div`,{key:`spinner-bar-${e}`,class:`sonner-loading-bar`}))),128))])],8,$j))}}),nM={},rM={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function iM(e,t){return H(),uo(`svg`,rM,t[0]||=[U(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,"clip-rule":`evenodd`},null,-1)])}var aM=Jj(nM,[[`render`,iM]]),oM={},sM={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function cM(e,t){return H(),uo(`svg`,sM,t[0]||=[U(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,"clip-rule":`evenodd`},null,-1)])}var lM=Jj(oM,[[`render`,cM]]),uM={},dM={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`};function fM(e,t){return H(),uo(`svg`,dM,t[0]||=[U(`path`,{"fill-rule":`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,"clip-rule":`evenodd`},null,-1)])}var pM=Jj(uM,[[`render`,fM]]),mM={},hM={xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`};function gM(e,t){return H(),uo(`svg`,hM,t[0]||=[U(`path`,{"fill-rule":`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,"clip-rule":`evenodd`},null,-1)])}var _M=Jj(mM,[[`render`,gM]]),vM=[`aria-label`],yM=[`data-sonner-theme`,`dir`,`data-theme`,`data-rich-colors`,`data-y-position`,`data-x-position`],bM=typeof window<`u`&&typeof document<`u`;function xM(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}var SM=Mr({name:`Toaster`,inheritAttrs:!1,__name:`Toaster`,props:{id:{},invert:{type:Boolean,default:!1},theme:{default:`light`},position:{default:`bottom-right`},closeButtonPosition:{default:`top-left`},hotkey:{default:()=>[`altKey`,`KeyT`]},richColors:{type:Boolean,default:!1},expand:{type:Boolean,default:!1},duration:{},gap:{default:Rj},visibleToasts:{default:Nj},closeButton:{type:Boolean,default:!1},toastOptions:{default:()=>({})},class:{default:``},style:{},offset:{default:Pj},mobileOffset:{default:Fj},dir:{default:`auto`},swipeDirections:{},icons:{},containerAriaLabel:{default:`Notifications`}},setup(e){let t=e,n=Ei(),r=z([]),i=G(()=>t.id?r.value.filter(e=>e.toasterId===t.id):r.value.filter(e=>!e.toasterId));function a(e,t){return i.value.filter(n=>!n.position&&t===0||n.position===e)}let o=G(()=>{let e=i.value.filter(e=>e.position).map(e=>e.position);return e.length>0?Array.from(new Set([t.position].concat(e))):[t.position]}),s=G(()=>{let e={};return o.value.forEach(t=>{e[t]=r.value.filter(e=>e.position===t)}),e}),c=z([]),l=z({}),u=z(!1);Zn(()=>{o.value.forEach(e=>{e in l.value||(l.value[e]=!1)})});let d=z(t.theme===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:t.theme),f=z(null),p=z(null),m=z(!1),h=t.hotkey.join(`+`).replace(/Key/g,``).replace(/Digit/g,``);function g(e){r.value.find(t=>t.id===e.id)?.delete||Oj.dismiss(e.id),r.value=r.value.filter(({id:t})=>t!==e.id),setTimeout(()=>{r.value.find(t=>t.id===e.id)||(c.value=c.value.filter(t=>t.toastId!==e.id))},250)}function v(e){m.value&&!e.currentTarget?.contains?.(e.relatedTarget)&&(m.value=!1,p.value&&=(p.value.focus({preventScroll:!0}),null))}function y(e){e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||m.value||(m.value=!0,p.value=e.relatedTarget)}function b(e){e.target&&e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||(u.value=!0)}Zn(e=>{e(Oj.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{r.value=r.value.map(t=>t.id===e.id?{...t,delete:!0}:t)});return}jn(()=>{let t=r.value.findIndex(t=>t.id===e.id);t===-1?r.value=[e,...r.value]:r.value=[...r.value.slice(0,t),{...r.value[t],...e},...r.value.slice(t+1)]})}))}),Zn(e=>{if(typeof window>`u`)return;if(t.theme!==`system`){d.value=t.theme;return}let n=window.matchMedia(`(prefers-color-scheme: dark)`),r=e=>{d.value=e?`dark`:`light`};r(n.matches);let i=e=>{r(e.matches)};try{n.addEventListener(`change`,i)}catch{n.addListener(i)}e(()=>{try{n.removeEventListener(`change`,i)}catch{n.removeListener(i)}})}),Zn(()=>{f.value&&p.value&&(p.value.focus({preventScroll:!0}),p.value=null,m.value=!1)}),Zn(()=>{r.value.length<=1&&Object.keys(l.value).forEach(e=>{l.value[e]=!1})}),Zn(e=>{function n(e){let n=t.hotkey.every(t=>e[t]||e.code===t),r=Array.isArray(f.value)?f.value[0]:f.value;n&&(o.value.forEach(e=>{l.value[e]=!0}),r?.focus());let i=document.activeElement===f.value||r?.contains(document.activeElement);e.code===`Escape`&&i&&o.value.forEach(e=>{l.value[e]=!1})}bM&&(document.addEventListener(`keydown`,n),e(()=>{document.removeEventListener(`keydown`,n)}))});function x(e){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);l.value[n]=!0}function S(e){if(!u.value){let t=e.currentTarget,n=t.getAttribute(`data-y-position`)+`-`+t.getAttribute(`data-x-position`);l.value[n]=!1}}function C(){Object.keys(l.value).forEach(e=>{l.value[e]=!1})}function w(){u.value=!1}function T(e){c.value=e}function E(e){let t=c.value.findIndex(t=>t.toastId===e.toastId);if(t!==-1)c.value[t]=e;else{let t=c.value.findIndex(t=>t.position===e.position);t===-1?c.value.unshift(e):c.value.splice(t,0,e)}}return(e,r)=>(H(),uo(eo,null,[So(` Remove item from normal navigation flow, only available via hotkey `),U(`section`,{"aria-label":`${e.containerAriaLabel} ${B(h)}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`},[(H(!0),uo(eo,null,gi(o.value,(r,i)=>(H(),uo(`ol`,Eo({key:r,ref_for:!0,ref_key:`listRef`,ref:f,"data-sonner-toaster":``,"data-sonner-theme":d.value,class:t.class,dir:e.dir===`auto`?xM():e.dir,tabIndex:-1,"data-theme":e.theme,"data-rich-colors":e.richColors,"data-y-position":r.split(`-`)[0],"data-x-position":r.split(`-`)[1],style:{"--front-toast-height":`${c.value[0]?.height||0}px`,"--width":`${B(Lj)}px`,"--gap":`${e.gap}px`,...e.style,...B(n).style,...B(Wj)(e.offset,e.mobileOffset)}},{ref_for:!0},e.$attrs,{onBlur:v,onFocus:y,onMouseenter:x,onMousemove:x,onMouseleave:S,onDragend:C,onPointerdown:b,onPointerup:w}),[(H(!0),uo(eo,null,gi(a(r,i),(n,i)=>(H(),fo(qj,{key:n.id,heights:c.value,icons:e.icons,index:i,toast:n,defaultRichColors:e.richColors,duration:e.toastOptions?.duration??e.duration,class:de(e.toastOptions?.class??``),descriptionClass:e.toastOptions?.descriptionClass,invert:e.invert,visibleToasts:e.visibleToasts,closeButton:e.toastOptions?.closeButton??e.closeButton,interacting:u.value,position:r,closeButtonPosition:e.toastOptions?.closeButtonPosition??e.closeButtonPosition,style:oe(e.toastOptions?.style),unstyled:e.toastOptions?.unstyled,classes:e.toastOptions?.classes,cancelButtonStyle:e.toastOptions?.cancelButtonStyle,actionButtonStyle:e.toastOptions?.actionButtonStyle,"close-button-aria-label":e.toastOptions?.closeButtonAriaLabel,toasts:s.value[r],expandByDefault:e.expand,gap:e.gap,expanded:l.value[r]||!1,swipeDirections:t.swipeDirections,"onUpdate:heights":T,"onUpdate:height":E,onRemoveToast:g},{"close-icon":Un(()=>[vi(e.$slots,`close-icon`,{},()=>[W(Qj)])]),"loading-icon":Un(()=>[vi(e.$slots,`loading-icon`,{},()=>[W(tM,{visible:n.type===`loading`},null,8,[`visible`])])]),"success-icon":Un(()=>[vi(e.$slots,`success-icon`,{},()=>[W(aM)])]),"error-icon":Un(()=>[vi(e.$slots,`error-icon`,{},()=>[W(_M)])]),"warning-icon":Un(()=>[vi(e.$slots,`warning-icon`,{},()=>[W(pM)])]),"info-icon":Un(()=>[vi(e.$slots,`info-icon`,{},()=>[W(lM)])]),_:2},1032,[`heights`,`icons`,`index`,`toast`,`defaultRichColors`,`duration`,`class`,`descriptionClass`,`invert`,`visibleToasts`,`closeButton`,`interacting`,`position`,`closeButtonPosition`,`style`,`unstyled`,`classes`,`cancelButtonStyle`,`actionButtonStyle`,`close-button-aria-label`,`toasts`,`expandByDefault`,`gap`,`expanded`,`swipeDirections`]))),128))],16,yM))),128))],8,vM)],2112))}}),CM=class e extends AS{constructor(){super(),this.restore()}async checkPermissions(){return{display:`granted`}}async requestPermissions(){return{display:`granted`}}async get(){let t=localStorage.getItem(e.STORAGE_KEY);return{count:t?parseInt(t,10):0}}async set(t){let n=t.count;n===0?await navigator.clearAppBadge():await navigator.setAppBadge(n);let r=n.toString();localStorage.setItem(e.STORAGE_KEY,r)}async increase(){let{count:e}=await this.get();await this.set({count:e+1})}async decrease(){let{count:e}=await this.get();e<1||await this.set({count:e-1})}async clear(){await this.set({count:0})}async isSupported(){return{isSupported:`setAppBadge`in navigator}}async restore(){let t=localStorage.getItem(e.STORAGE_KEY);if(!t)return;let n=parseInt(t,10);await navigator.setAppBadge(n)}};CM.STORAGE_KEY=`capacitor.badge`;try{self[`workbox:window:7.4.0`]&&_()}catch{}function wM(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function TM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function EM(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,kM(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function DM(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if(typeof e==`string`)return TM(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TM(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
23
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OM(e,t){return OM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OM(e,t)}function kM(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return typeof t==`symbol`?t:t+``}try{self[`workbox:core:7.4.0`]&&_()}catch{}var AM=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function jM(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var MM=function(e,t){this.type=e,Object.assign(this,t)};function NM(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}function PM(){}var FM={type:`SKIP_WAITING`};function IM(e,t){return e&&e.then?e.then(PM):Promise.resolve()}var LM=function(e){function t(t,n){var r,i;return n===void 0&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new AM,r.en=new AM,r.on=new AM,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!jM(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener(`updatefound`,r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener(`statechange`,r.ln)},r.ln=function(e){var t=r.fn,n=e.target,i=n.state,a=n===r.vn,o={sw:n,isExternal:a,originalEvent:e};!a&&r.mn&&(o.isUpdate=!0),r.dispatchEvent(new MM(i,o)),i===`installed`?r.wn=self.setTimeout((function(){i===`installed`&&t.waiting===n&&r.dispatchEvent(new MM(`waiting`,o))}),200):i===`activating`&&(clearTimeout(r.wn),a||r.en.resolve(n))},r.yn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new MM(`controlling`,{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(i=function(e){var t=e.data,n=e.ports,i=e.source;return NM(r.getSW(),(function(){r.an.has(i)&&r.dispatchEvent(new MM(`message`,{data:t,originalEvent:e,ports:n,sw:i}))}))},function(){var e=[...arguments];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener(`message`,r.gn),r}var n,r=e;(n=t).prototype=Object.create(r.prototype),n.prototype.constructor=n,OM(n,r);var i=t.prototype;return i.register=function(e){var t=(e===void 0?{}:e).immediate,n=t!==void 0&&t;try{var r=this;return NM(function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(!n&&document.readyState!==`complete`)return IM(new Promise((function(e){return window.addEventListener(`load`,e)})))}),(function(){return r.mn=!!navigator.serviceWorker.controller,r.dn=r.pn(),NM(r.bn(),(function(e){r.fn=e,r.dn&&(r.hn=r.dn,r.en.resolve(r.dn),r.on.resolve(r.dn),r.dn.addEventListener(`statechange`,r.ln,{once:!0}));var t=r.fn.waiting;return t&&jM(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new MM(`waiting`,{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener(`updatefound`,r.cn),navigator.serviceWorker.addEventListener(`controllerchange`,r.yn),r.fn}))})))}catch(e){return Promise.reject(e)}},i.update=function(){try{return this.fn?NM(IM(this.fn.update())):NM()}catch(e){return Promise.reject(e)}},i.getSW=function(){return this.hn===void 0?this.rn.promise:Promise.resolve(this.hn)},i.messageSW=function(e){try{return NM(this.getSW(),(function(t){return wM(t,e)}))}catch(e){return Promise.reject(e)}},i.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&wM(this.fn.waiting,FM)},i.pn=function(){var e=navigator.serviceWorker.controller;return e&&jM(e.scriptURL,this.sn.toString())?e:void 0},i.bn=function(){try{var e=this;return NM(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return NM(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e})))}catch(e){return Promise.reject(e)}},EM(t,[{key:`active`,get:function(){return this.en.promise}},{key:`controlling`,get:function(){return this.on.promise}}])}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.jn(e).add(t)},t.removeEventListener=function(e,t){this.jn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=DM(this.jn(e.type));!(t=n()).done;)(0,t.value)(e)},t.jn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}()),RM=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,zM=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(RM);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},BM=e=>e===`*`||e===`x`||e===`X`,VM=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},HM=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],UM=(e,t)=>{if(BM(e)||BM(t))return 0;let[n,r]=HM(VM(e),VM(t));return n>r?1:n<r?-1:0},WM=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){let r=UM(e[n]||`0`,t[n]||`0`);if(r!==0)return r}return 0},GM=(e,t)=>{let n=zM(e),r=zM(t),i=n.pop(),a=r.pop(),o=WM(n,r);return o===0?i&&a?WM(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o};export{av as $,Un as $n,js as $t,wS as A,Qr as An,nh as At,Zx as B,ui as Bn,rh as Bt,Hw as C,qn as Cn,be as Cr,X_ as Ct,FS as D,Eo as Dn,Gh as Dt,OS as E,Ai as En,fh as Et,jS as F,ri as Fn,oh as Ft,rb as G,Nr as Gn,Bf as Gt,Jx as H,fi as Hn,Nm as Ht,zS as I,H as In,bh as It,$y as J,Fr as Jn,Tf as Jt,tb as K,Qi as Kn,wf as Kt,kS as L,Kn as Ln,wh as Lt,GS as M,ei as Mn,yh as Mt,HS as N,qr as Nn,lh as Nt,TS as O,jn as On,mh as Ot,AS as P,$r as Pn,vh as Pt,qg as Q,Mi as Qn,wc as Qt,CS as R,gi as Rn,ch as Rt,Pw as S,Jn as Sn,oe as Sr,Sv as St,KS as T,ki as Tn,uh as Tt,Q as U,bi as Un,km as Ut,Xx as V,pi as Vn,th as Vt,ib as W,Ei as Wn,Dm as Wt,by as X,$n as Xn,us as Xt,Zy as Y,Xo as Yn,Sf as Yt,Lv as Z,Zn,uc as Zt,Zw as _,Ur as _n,sn as _r,I_ as _t,CM as a,mr as an,Gt as ar,K_ as at,Ww as b,vo as bn,de as br,i_ as bt,Ej as c,U as cn,Oe as cr,W_ as ct,_O as d,uo as dn,z as dr,cv as dt,Os as en,Wn as er,A_ as et,nE as f,ji as fn,Vt as fr,ov as ft,Qw as g,W as gn,un as gr,P_ as gt,uT as h,bo as hn,R as hr,R_ as ht,wM as i,Ua as in,Jt as ir,n_ as it,US as j,ni as jn,_h as jt,VS as k,Kr as kn,gh as kt,QA as l,fo as ln,Bt as lr,kg as lt,dT as m,xo as mn,$t as mr,Dv as mt,MM as n,vc as nn,Ee as nr,sv as nt,SM as o,to as on,Qt as or,iv as ot,kT as p,_i as pn,Ut as pr,uv as pt,eb as q,Ti as qn,Pf as qt,LM as r,eo as rn,De as rr,dv as rt,jj as s,G as sn,Yt as sr,m_ as st,GM as t,bc as tn,on as tr,lv as tt,Ok as u,So as un,Ht as ur,xv as ut,Jw as v,Mr as vn,V as vr,D_ as vt,$S as w,Yo as wn,Jh as wt,Uw as x,Jo as xn,fe as xr,U_ as xt,Gw as y,Mo as yn,B as yr,B_ as yt,$x as z,vi as zn,Y as zt};