plutonium 0.16.5 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (715) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/plutonium.css +9 -1
  3. data/app/assets/plutonium.js +23273 -9599
  4. data/app/assets/plutonium.js.map +4 -4
  5. data/app/assets/plutonium.min.js +159 -49
  6. data/app/assets/plutonium.min.js.map +4 -4
  7. data/app/views/plutonium/_resource_header.html.erb +33 -24
  8. data/app/views/rodauth/otp_unlock.html.erb +22 -0
  9. data/app/views/rodauth/otp_unlock_not_available.html.erb +14 -0
  10. data/app/views/rodauth/webauthn_remove.html.erb +1 -0
  11. data/docs/guide/getting-started/resources.md +2 -2
  12. data/docs/guide/tutorial.md +4 -4
  13. data/gemfiles/rails_7.gemfile.lock +406 -0
  14. data/lib/generators/pu/core/assets/assets_generator.rb +1 -1
  15. data/lib/generators/pu/res/conn/conn_generator.rb +24 -10
  16. data/lib/generators/pu/rodauth/concerns/configuration.rb +11 -0
  17. data/lib/generators/pu/rodauth/concerns/feature_selector.rb +4 -0
  18. data/lib/generators/pu/rodauth/install_generator.rb +3 -1
  19. data/lib/generators/pu/rodauth/migration/active_record/otp_unlock.erb +7 -0
  20. data/lib/generators/pu/rodauth/templates/INSTRUCTIONS +2 -46
  21. data/lib/generators/pu/rodauth/templates/app/controllers/plugin_controller.rb.tt +3 -3
  22. data/lib/generators/pu/rodauth/templates/app/mailers/rodauth_mailer.rb.tt +50 -1
  23. data/lib/generators/pu/rodauth/templates/app/rodauth/account_rodauth_plugin.rb.tt +37 -3
  24. data/lib/generators/pu/rodauth/templates/app/rodauth/rodauth_plugin.rb.tt +33 -8
  25. data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_disabled.text.erb +2 -0
  26. data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_locked_out.text.erb +9 -0
  27. data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_setup.text.erb +2 -0
  28. data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_unlock_failed.text.erb +8 -0
  29. data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/otp_unlocked.text.erb +2 -0
  30. data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/webauthn_authenticator_added.text.erb +3 -0
  31. data/lib/generators/pu/rodauth/templates/app/views/rodauth_mailer/webauthn_authenticator_removed.text.erb +3 -0
  32. data/lib/generators/pu/rodauth/views_generator.rb +1 -12
  33. data/lib/plutonium/core/controllers/authorizable.rb +3 -1
  34. data/lib/plutonium/helpers/application_helper.rb +0 -8
  35. data/lib/plutonium/helpers.rb +0 -3
  36. data/lib/plutonium/railtie.rb +0 -14
  37. data/lib/plutonium/reloader.rb +2 -12
  38. data/lib/plutonium/rodauth/controller_methods.rb +1 -3
  39. data/lib/plutonium/ui/component/behaviour.rb +1 -1
  40. data/lib/plutonium/ui/component/kit.rb +59 -15
  41. data/lib/plutonium/ui/display/base.rb +6 -2
  42. data/lib/plutonium/ui/display/{component → components}/association.rb +1 -1
  43. data/lib/plutonium/ui/display/components/attachment.rb +93 -0
  44. data/lib/plutonium/ui/display/{component → components}/markdown.rb +2 -1
  45. data/lib/plutonium/ui/display/resource.rb +21 -6
  46. data/lib/plutonium/ui/display/theme.rb +2 -1
  47. data/lib/plutonium/ui/form/base.rb +7 -0
  48. data/lib/plutonium/ui/form/components/belongs_to.rb +45 -1
  49. data/lib/plutonium/ui/form/components/has_many.rb +45 -1
  50. data/lib/plutonium/ui/form/components/uppy.rb +173 -0
  51. data/lib/plutonium/ui/form/query.rb +5 -5
  52. data/lib/plutonium/ui/form/resource.rb +6 -6
  53. data/lib/plutonium/ui/form/theme.rb +6 -2
  54. data/lib/plutonium/ui/frame_navigator_panel.rb +25 -4
  55. data/lib/plutonium/ui/layout/base.rb +1 -1
  56. data/lib/plutonium/ui/layout/header.rb +1 -1
  57. data/lib/plutonium/ui/layout/sidebar.rb +0 -1
  58. data/lib/plutonium/ui/nav_grid_menu.rb +93 -0
  59. data/lib/plutonium/ui/nav_user.rb +121 -0
  60. data/lib/plutonium/ui/panel.rb +2 -2
  61. data/lib/plutonium/ui/tab_list.rb +73 -0
  62. data/lib/plutonium/ui/table/base.rb +7 -1
  63. data/lib/plutonium/ui/table/components/attachment.rb +71 -0
  64. data/lib/plutonium/ui/table/components/pagy_info.rb +12 -4
  65. data/lib/plutonium/ui/table/components/pagy_pagination.rb +5 -5
  66. data/lib/plutonium/ui/table/display_theme.rb +2 -1
  67. data/lib/plutonium/ui/table/resource.rb +11 -12
  68. data/lib/plutonium/version.rb +1 -1
  69. data/package-lock.json +356 -18
  70. data/package.json +6 -2
  71. data/src/css/plutonium.css +3 -0
  72. data/src/js/controllers/attachment_input_controller.js +241 -0
  73. data/src/js/controllers/attachment_preview_container_controller.js +15 -0
  74. data/src/js/controllers/attachment_preview_controller.js +63 -0
  75. data/src/js/controllers/color_mode_controller.js +0 -1
  76. data/src/js/controllers/easymde_controller.js +0 -1
  77. data/src/js/controllers/flatpickr_controller.js +0 -1
  78. data/src/js/controllers/form_controller.js +0 -1
  79. data/src/js/controllers/frame_navigator_controller.js +16 -12
  80. data/src/js/controllers/intl_tel_input_controller.js +0 -1
  81. data/src/js/controllers/register_controllers.js +12 -30
  82. data/src/js/controllers/resource_collapse_controller.js +0 -1
  83. data/src/js/controllers/resource_dismiss_controller.js +0 -1
  84. data/src/js/controllers/resource_drop_down_controller.js +161 -9
  85. data/src/js/controllers/{header_controller.js → resource_header_controller.js} +1 -0
  86. data/src/js/controllers/resource_tab_list_controller.js +64 -0
  87. data/src/js/controllers/select_navigator.js +16 -0
  88. data/src/js/controllers/slim_select_controller.js +0 -1
  89. data/src/js/support/dom_element.js +78 -0
  90. data/src/js/support/mime_icon.js +127 -0
  91. data/tailwind.options.js +0 -5
  92. metadata +29 -642
  93. data/README copy.md +0 -83
  94. data/app/assets/application.js.bk +0 -31419
  95. data/app/assets/icons/flags/ghana.svg +0 -49
  96. data/app/assets/icons/outline/address-book.svg +0 -3
  97. data/app/assets/icons/outline/adjustments-horizontal.svg +0 -3
  98. data/app/assets/icons/outline/adjustments-vertical.svg +0 -3
  99. data/app/assets/icons/outline/align-center.svg +0 -3
  100. data/app/assets/icons/outline/angle-down.svg +0 -3
  101. data/app/assets/icons/outline/angle-left.svg +0 -3
  102. data/app/assets/icons/outline/angle-right.svg +0 -3
  103. data/app/assets/icons/outline/angle-up.svg +0 -3
  104. data/app/assets/icons/outline/annotation.svg +0 -3
  105. data/app/assets/icons/outline/archive-arrow-down.svg +0 -3
  106. data/app/assets/icons/outline/archive.svg +0 -3
  107. data/app/assets/icons/outline/arrow-down-to-bracket.svg +0 -3
  108. data/app/assets/icons/outline/arrow-down.svg +0 -3
  109. data/app/assets/icons/outline/arrow-left-to-bracket.svg +0 -3
  110. data/app/assets/icons/outline/arrow-left.svg +0 -3
  111. data/app/assets/icons/outline/arrow-right-alt.svg +0 -3
  112. data/app/assets/icons/outline/arrow-right-to-bracket.svg +0 -3
  113. data/app/assets/icons/outline/arrow-right.svg +0 -3
  114. data/app/assets/icons/outline/arrow-sort-letters.svg +0 -3
  115. data/app/assets/icons/outline/arrow-up-down.svg +0 -3
  116. data/app/assets/icons/outline/arrow-up-from-bracket.svg +0 -3
  117. data/app/assets/icons/outline/arrow-up-right-down-left.svg +0 -3
  118. data/app/assets/icons/outline/arrow-up-right-from-square.svg +0 -3
  119. data/app/assets/icons/outline/arrow-up.svg +0 -3
  120. data/app/assets/icons/outline/arrows-repeat-count.svg +0 -3
  121. data/app/assets/icons/outline/arrows-repeat.svg +0 -3
  122. data/app/assets/icons/outline/atom.svg +0 -3
  123. data/app/assets/icons/outline/backward-step.svg +0 -3
  124. data/app/assets/icons/outline/badge-check.svg +0 -3
  125. data/app/assets/icons/outline/bars-from-left.svg +0 -3
  126. data/app/assets/icons/outline/bars.svg +0 -3
  127. data/app/assets/icons/outline/bell-active-alt.svg +0 -3
  128. data/app/assets/icons/outline/bell-active.svg +0 -3
  129. data/app/assets/icons/outline/bell-ring.svg +0 -3
  130. data/app/assets/icons/outline/bell.svg +0 -3
  131. data/app/assets/icons/outline/blender-phone.svg +0 -3
  132. data/app/assets/icons/outline/book-open.svg +0 -3
  133. data/app/assets/icons/outline/book.svg +0 -3
  134. data/app/assets/icons/outline/bookmark.svg +0 -3
  135. data/app/assets/icons/outline/brain.svg +0 -3
  136. data/app/assets/icons/outline/briefcase.svg +0 -3
  137. data/app/assets/icons/outline/bug.svg +0 -3
  138. data/app/assets/icons/outline/building.svg +0 -3
  139. data/app/assets/icons/outline/bullhorn.svg +0 -3
  140. data/app/assets/icons/outline/calendar-edit.svg +0 -3
  141. data/app/assets/icons/outline/calendar-month.svg +0 -3
  142. data/app/assets/icons/outline/calendar-plus.svg +0 -3
  143. data/app/assets/icons/outline/calendar-week.svg +0 -3
  144. data/app/assets/icons/outline/camera-photo.svg +0 -4
  145. data/app/assets/icons/outline/caption.svg +0 -3
  146. data/app/assets/icons/outline/caret-down.svg +0 -3
  147. data/app/assets/icons/outline/caret-left.svg +0 -3
  148. data/app/assets/icons/outline/caret-right.svg +0 -3
  149. data/app/assets/icons/outline/caret-sort.svg +0 -3
  150. data/app/assets/icons/outline/caret-up.svg +0 -3
  151. data/app/assets/icons/outline/cart-plus-alt.svg +0 -3
  152. data/app/assets/icons/outline/cart-plus.svg +0 -3
  153. data/app/assets/icons/outline/cart.svg +0 -3
  154. data/app/assets/icons/outline/cash.svg +0 -3
  155. data/app/assets/icons/outline/chart-line-down.svg +0 -3
  156. data/app/assets/icons/outline/chart-line-up.svg +0 -3
  157. data/app/assets/icons/outline/chart-mixed-dollar.svg +0 -3
  158. data/app/assets/icons/outline/chart-mixed.svg +0 -3
  159. data/app/assets/icons/outline/chart-pie.svg +0 -4
  160. data/app/assets/icons/outline/chart.svg +0 -3
  161. data/app/assets/icons/outline/check-circle.svg +0 -3
  162. data/app/assets/icons/outline/check-plus-circle.svg +0 -3
  163. data/app/assets/icons/outline/check.svg +0 -3
  164. data/app/assets/icons/outline/chevron-double-down.svg +0 -3
  165. data/app/assets/icons/outline/chevron-double-left.svg +0 -3
  166. data/app/assets/icons/outline/chevron-double-right.svg +0 -3
  167. data/app/assets/icons/outline/chevron-double-up.svg +0 -3
  168. data/app/assets/icons/outline/chevron-down.svg +0 -3
  169. data/app/assets/icons/outline/chevron-left.svg +0 -3
  170. data/app/assets/icons/outline/chevron-right.svg +0 -3
  171. data/app/assets/icons/outline/chevron-sort.svg +0 -3
  172. data/app/assets/icons/outline/chevron-up.svg +0 -3
  173. data/app/assets/icons/outline/circle-pause.svg +0 -3
  174. data/app/assets/icons/outline/circle-plus.svg +0 -3
  175. data/app/assets/icons/outline/clapperboard-play.svg +0 -3
  176. data/app/assets/icons/outline/clipboard-check.svg +0 -3
  177. data/app/assets/icons/outline/clipboard-list.svg +0 -3
  178. data/app/assets/icons/outline/clipboard.svg +0 -3
  179. data/app/assets/icons/outline/clock.svg +0 -3
  180. data/app/assets/icons/outline/close-circle.svg +0 -3
  181. data/app/assets/icons/outline/close.svg +0 -3
  182. data/app/assets/icons/outline/cloud-arrow-up.svg +0 -3
  183. data/app/assets/icons/outline/code-branch.svg +0 -3
  184. data/app/assets/icons/outline/code-fork.svg +0 -3
  185. data/app/assets/icons/outline/code-merge.svg +0 -3
  186. data/app/assets/icons/outline/code-pull-request.svg +0 -3
  187. data/app/assets/icons/outline/code.svg +0 -3
  188. data/app/assets/icons/outline/cog.svg +0 -4
  189. data/app/assets/icons/outline/column.svg +0 -3
  190. data/app/assets/icons/outline/command.svg +0 -3
  191. data/app/assets/icons/outline/compress.svg +0 -3
  192. data/app/assets/icons/outline/computer-speaker.svg +0 -3
  193. data/app/assets/icons/outline/credit-card.svg +0 -3
  194. data/app/assets/icons/outline/database.svg +0 -3
  195. data/app/assets/icons/outline/desktop-pc.svg +0 -3
  196. data/app/assets/icons/outline/dna.svg +0 -3
  197. data/app/assets/icons/outline/dollar.svg +0 -3
  198. data/app/assets/icons/outline/dots-horizontal.svg +0 -3
  199. data/app/assets/icons/outline/dots-vertical.svg +0 -3
  200. data/app/assets/icons/outline/download.svg +0 -3
  201. data/app/assets/icons/outline/draw-square.svg +0 -3
  202. data/app/assets/icons/outline/edit.svg +0 -3
  203. data/app/assets/icons/outline/envelope-open.svg +0 -3
  204. data/app/assets/icons/outline/envelope.svg +0 -3
  205. data/app/assets/icons/outline/euro.svg +0 -3
  206. data/app/assets/icons/outline/exclamation-circle.svg +0 -3
  207. data/app/assets/icons/outline/expand.svg +0 -3
  208. data/app/assets/icons/outline/eye-slash.svg +0 -3
  209. data/app/assets/icons/outline/eye.svg +0 -4
  210. data/app/assets/icons/outline/face-explode.svg +0 -4
  211. data/app/assets/icons/outline/face-grin-stars.svg +0 -6
  212. data/app/assets/icons/outline/face-grin.svg +0 -3
  213. data/app/assets/icons/outline/face-laugh.svg +0 -3
  214. data/app/assets/icons/outline/file-chart-bar.svg +0 -3
  215. data/app/assets/icons/outline/file-check.svg +0 -3
  216. data/app/assets/icons/outline/file-circle-plus.svg +0 -3
  217. data/app/assets/icons/outline/file-clone.svg +0 -3
  218. data/app/assets/icons/outline/file-code.svg +0 -3
  219. data/app/assets/icons/outline/file-copy-alt.svg +0 -3
  220. data/app/assets/icons/outline/file-copy.svg +0 -3
  221. data/app/assets/icons/outline/file-csv.svg +0 -3
  222. data/app/assets/icons/outline/file-export.svg +0 -3
  223. data/app/assets/icons/outline/file-image.svg +0 -4
  224. data/app/assets/icons/outline/file-import.svg +0 -3
  225. data/app/assets/icons/outline/file-invoice.svg +0 -3
  226. data/app/assets/icons/outline/file-lines.svg +0 -3
  227. data/app/assets/icons/outline/file-music.svg +0 -3
  228. data/app/assets/icons/outline/file-paste.svg +0 -3
  229. data/app/assets/icons/outline/file-pdf.svg +0 -3
  230. data/app/assets/icons/outline/file-pen.svg +0 -3
  231. data/app/assets/icons/outline/file-ppt.svg +0 -3
  232. data/app/assets/icons/outline/file-search.svg +0 -3
  233. data/app/assets/icons/outline/file-shield.svg +0 -3
  234. data/app/assets/icons/outline/file-video.svg +0 -3
  235. data/app/assets/icons/outline/file-word.svg +0 -3
  236. data/app/assets/icons/outline/file-zip.svg +0 -3
  237. data/app/assets/icons/outline/file.svg +0 -3
  238. data/app/assets/icons/outline/filter.svg +0 -3
  239. data/app/assets/icons/outline/fingerprint.svg +0 -3
  240. data/app/assets/icons/outline/fire.svg +0 -3
  241. data/app/assets/icons/outline/flag.svg +0 -3
  242. data/app/assets/icons/outline/folder-arrow-right.svg +0 -3
  243. data/app/assets/icons/outline/folder-duplicate.svg +0 -3
  244. data/app/assets/icons/outline/folder-open.svg +0 -3
  245. data/app/assets/icons/outline/folder-plus.svg +0 -3
  246. data/app/assets/icons/outline/folder.svg +0 -3
  247. data/app/assets/icons/outline/forward-step.svg +0 -3
  248. data/app/assets/icons/outline/forward.svg +0 -3
  249. data/app/assets/icons/outline/gift-box.svg +0 -3
  250. data/app/assets/icons/outline/globe.svg +0 -3
  251. data/app/assets/icons/outline/grid-plus.svg +0 -3
  252. data/app/assets/icons/outline/grid.svg +0 -3
  253. data/app/assets/icons/outline/headphones.svg +0 -3
  254. data/app/assets/icons/outline/heart.svg +0 -3
  255. data/app/assets/icons/outline/home.svg +0 -3
  256. data/app/assets/icons/outline/hourglass.svg +0 -3
  257. data/app/assets/icons/outline/image.svg +0 -3
  258. data/app/assets/icons/outline/inbox-full.svg +0 -3
  259. data/app/assets/icons/outline/inbox.svg +0 -3
  260. data/app/assets/icons/outline/indent.svg +0 -3
  261. data/app/assets/icons/outline/info-circle.svg +0 -3
  262. data/app/assets/icons/outline/keyboard.svg +0 -5
  263. data/app/assets/icons/outline/label.svg +0 -3
  264. data/app/assets/icons/outline/landmark.svg +0 -3
  265. data/app/assets/icons/outline/layers.svg +0 -3
  266. data/app/assets/icons/outline/letter-bold.svg +0 -3
  267. data/app/assets/icons/outline/letter-italic.svg +0 -3
  268. data/app/assets/icons/outline/letter-underline.svg +0 -3
  269. data/app/assets/icons/outline/life-saver.svg +0 -3
  270. data/app/assets/icons/outline/lightbulb.svg +0 -3
  271. data/app/assets/icons/outline/link.svg +0 -3
  272. data/app/assets/icons/outline/list-music.svg +0 -3
  273. data/app/assets/icons/outline/list.svg +0 -3
  274. data/app/assets/icons/outline/lock-open.svg +0 -3
  275. data/app/assets/icons/outline/lock-time.svg +0 -3
  276. data/app/assets/icons/outline/lock.svg +0 -3
  277. data/app/assets/icons/outline/mail-box.svg +0 -3
  278. data/app/assets/icons/outline/map-pin-alt.svg +0 -4
  279. data/app/assets/icons/outline/map-pin.svg +0 -3
  280. data/app/assets/icons/outline/message-caption.svg +0 -3
  281. data/app/assets/icons/outline/message-dots.svg +0 -3
  282. data/app/assets/icons/outline/messages.svg +0 -3
  283. data/app/assets/icons/outline/microphone.svg +0 -3
  284. data/app/assets/icons/outline/minimize.svg +0 -3
  285. data/app/assets/icons/outline/minus.svg +0 -3
  286. data/app/assets/icons/outline/mobile-phone.svg +0 -3
  287. data/app/assets/icons/outline/moon.svg +0 -3
  288. data/app/assets/icons/outline/newspaper.svg +0 -3
  289. data/app/assets/icons/outline/ordered-list.svg +0 -3
  290. data/app/assets/icons/outline/outdent.svg +0 -3
  291. data/app/assets/icons/outline/palette.svg +0 -3
  292. data/app/assets/icons/outline/paper-clip.svg +0 -3
  293. data/app/assets/icons/outline/paper-plane.svg +0 -3
  294. data/app/assets/icons/outline/paragraph.svg +0 -3
  295. data/app/assets/icons/outline/pause.svg +0 -3
  296. data/app/assets/icons/outline/pen-nib.svg +0 -3
  297. data/app/assets/icons/outline/pen.svg +0 -3
  298. data/app/assets/icons/outline/phone.svg +0 -3
  299. data/app/assets/icons/outline/play.svg +0 -3
  300. data/app/assets/icons/outline/plus.svg +0 -3
  301. data/app/assets/icons/outline/printer.svg +0 -3
  302. data/app/assets/icons/outline/profile-card.svg +0 -3
  303. data/app/assets/icons/outline/question-circle.svg +0 -3
  304. data/app/assets/icons/outline/quote.svg +0 -3
  305. data/app/assets/icons/outline/receipt.svg +0 -3
  306. data/app/assets/icons/outline/rectangle-list.svg +0 -3
  307. data/app/assets/icons/outline/redo.svg +0 -3
  308. data/app/assets/icons/outline/refresh.svg +0 -3
  309. data/app/assets/icons/outline/reply-all.svg +0 -3
  310. data/app/assets/icons/outline/reply.svg +0 -3
  311. data/app/assets/icons/outline/restore-window.svg +0 -3
  312. data/app/assets/icons/outline/rocket.svg +0 -3
  313. data/app/assets/icons/outline/ruler-combined.svg +0 -3
  314. data/app/assets/icons/outline/sale-percent.svg +0 -3
  315. data/app/assets/icons/outline/scale-balanced.svg +0 -3
  316. data/app/assets/icons/outline/search.svg +0 -3
  317. data/app/assets/icons/outline/share-all.svg +0 -3
  318. data/app/assets/icons/outline/share-nodes.svg +0 -3
  319. data/app/assets/icons/outline/shield-check.svg +0 -3
  320. data/app/assets/icons/outline/shield.svg +0 -3
  321. data/app/assets/icons/outline/shopping-bag.svg +0 -3
  322. data/app/assets/icons/outline/shuffle.svg +0 -3
  323. data/app/assets/icons/outline/sort-horizontal.svg +0 -3
  324. data/app/assets/icons/outline/sort.svg +0 -3
  325. data/app/assets/icons/outline/star-half-stroke.svg +0 -3
  326. data/app/assets/icons/outline/star-half.svg +0 -3
  327. data/app/assets/icons/outline/star.svg +0 -3
  328. data/app/assets/icons/outline/store.svg +0 -3
  329. data/app/assets/icons/outline/sun.svg +0 -3
  330. data/app/assets/icons/outline/swatchbook.svg +0 -3
  331. data/app/assets/icons/outline/table-column.svg +0 -3
  332. data/app/assets/icons/outline/table-row.svg +0 -3
  333. data/app/assets/icons/outline/tablet.svg +0 -3
  334. data/app/assets/icons/outline/tag.svg +0 -3
  335. data/app/assets/icons/outline/terminal.svg +0 -3
  336. data/app/assets/icons/outline/text-size.svg +0 -3
  337. data/app/assets/icons/outline/text-slash.svg +0 -3
  338. data/app/assets/icons/outline/thumbs-down.svg +0 -3
  339. data/app/assets/icons/outline/thumbs-up.svg +0 -3
  340. data/app/assets/icons/outline/ticket.svg +0 -3
  341. data/app/assets/icons/outline/trash-bin.svg +0 -3
  342. data/app/assets/icons/outline/truck.svg +0 -3
  343. data/app/assets/icons/outline/undo.svg +0 -3
  344. data/app/assets/icons/outline/upload.svg +0 -3
  345. data/app/assets/icons/outline/user-add.svg +0 -3
  346. data/app/assets/icons/outline/user-circle.svg +0 -3
  347. data/app/assets/icons/outline/user-edit.svg +0 -3
  348. data/app/assets/icons/outline/user-headset.svg +0 -3
  349. data/app/assets/icons/outline/user-remove.svg +0 -3
  350. data/app/assets/icons/outline/user-settings.svg +0 -3
  351. data/app/assets/icons/outline/user.svg +0 -3
  352. data/app/assets/icons/outline/users-group.svg +0 -3
  353. data/app/assets/icons/outline/users.svg +0 -3
  354. data/app/assets/icons/outline/video-camera.svg +0 -3
  355. data/app/assets/icons/outline/volume-down.svg +0 -3
  356. data/app/assets/icons/outline/volume-up.svg +0 -3
  357. data/app/assets/icons/outline/wallet.svg +0 -3
  358. data/app/assets/icons/outline/wand-magic-sparkles.svg +0 -3
  359. data/app/assets/icons/outline/window.svg +0 -3
  360. data/app/assets/icons/outline/zoom-in.svg +0 -3
  361. data/app/assets/icons/outline/zoom-out.svg +0 -3
  362. data/app/assets/icons/solid/X.svg +0 -3
  363. data/app/assets/icons/solid/address-book.svg +0 -3
  364. data/app/assets/icons/solid/adjustments-horizontal.svg +0 -3
  365. data/app/assets/icons/solid/adjustments-vertical.svg +0 -3
  366. data/app/assets/icons/solid/annotation.svg +0 -3
  367. data/app/assets/icons/solid/apple.svg +0 -3
  368. data/app/assets/icons/solid/archive-arrow-down.svg +0 -3
  369. data/app/assets/icons/solid/archive.svg +0 -4
  370. data/app/assets/icons/solid/arrow-right-alt.svg +0 -3
  371. data/app/assets/icons/solid/arrow-up-right-from-square.svg +0 -4
  372. data/app/assets/icons/solid/backward-step.svg +0 -3
  373. data/app/assets/icons/solid/badge-check.svg +0 -3
  374. data/app/assets/icons/solid/bell-active-alt.svg +0 -3
  375. data/app/assets/icons/solid/bell-active.svg +0 -5
  376. data/app/assets/icons/solid/bell-ring.svg +0 -3
  377. data/app/assets/icons/solid/bell.svg +0 -3
  378. data/app/assets/icons/solid/blender-phone.svg +0 -3
  379. data/app/assets/icons/solid/book-open.svg +0 -3
  380. data/app/assets/icons/solid/book.svg +0 -3
  381. data/app/assets/icons/solid/bookmark.svg +0 -3
  382. data/app/assets/icons/solid/brain.svg +0 -3
  383. data/app/assets/icons/solid/briefcase.svg +0 -3
  384. data/app/assets/icons/solid/bug.svg +0 -3
  385. data/app/assets/icons/solid/building.svg +0 -3
  386. data/app/assets/icons/solid/bullhorn.svg +0 -3
  387. data/app/assets/icons/solid/calendar-edit.svg +0 -4
  388. data/app/assets/icons/solid/calendar-month.svg +0 -3
  389. data/app/assets/icons/solid/calendar-plus.svg +0 -3
  390. data/app/assets/icons/solid/calendar-week.svg +0 -3
  391. data/app/assets/icons/solid/camera-photo.svg +0 -3
  392. data/app/assets/icons/solid/caption.svg +0 -3
  393. data/app/assets/icons/solid/caret-down.svg +0 -3
  394. data/app/assets/icons/solid/caret-left.svg +0 -3
  395. data/app/assets/icons/solid/caret-right.svg +0 -3
  396. data/app/assets/icons/solid/caret-sort.svg +0 -3
  397. data/app/assets/icons/solid/caret-up.svg +0 -3
  398. data/app/assets/icons/solid/cart-plus-alt.svg +0 -4
  399. data/app/assets/icons/solid/cart-plus.svg +0 -4
  400. data/app/assets/icons/solid/cart.svg +0 -3
  401. data/app/assets/icons/solid/cash.svg +0 -5
  402. data/app/assets/icons/solid/chart-mixed-dollar.svg +0 -3
  403. data/app/assets/icons/solid/chart-pie.svg +0 -4
  404. data/app/assets/icons/solid/check-circle.svg +0 -3
  405. data/app/assets/icons/solid/check-plus-circle.svg +0 -4
  406. data/app/assets/icons/solid/circle-pause.svg +0 -3
  407. data/app/assets/icons/solid/circle-plus.svg +0 -3
  408. data/app/assets/icons/solid/clapperboard-play.svg +0 -3
  409. data/app/assets/icons/solid/clipboard-check.svg +0 -3
  410. data/app/assets/icons/solid/clipboard-list.svg +0 -3
  411. data/app/assets/icons/solid/clipboard.svg +0 -3
  412. data/app/assets/icons/solid/clock.svg +0 -3
  413. data/app/assets/icons/solid/close-circle.svg +0 -3
  414. data/app/assets/icons/solid/cloud-arrow-up.svg +0 -4
  415. data/app/assets/icons/solid/code-branch.svg +0 -3
  416. data/app/assets/icons/solid/code-fork.svg +0 -3
  417. data/app/assets/icons/solid/code-merge.svg +0 -3
  418. data/app/assets/icons/solid/code-pull-request.svg +0 -3
  419. data/app/assets/icons/solid/cog.svg +0 -3
  420. data/app/assets/icons/solid/column.svg +0 -3
  421. data/app/assets/icons/solid/computer-speaker.svg +0 -4
  422. data/app/assets/icons/solid/credit-card.svg +0 -4
  423. data/app/assets/icons/solid/css.svg +0 -3
  424. data/app/assets/icons/solid/database.svg +0 -3
  425. data/app/assets/icons/solid/desktop-pc.svg +0 -3
  426. data/app/assets/icons/solid/discord.svg +0 -3
  427. data/app/assets/icons/solid/download.svg +0 -4
  428. data/app/assets/icons/solid/draw-square.svg +0 -4
  429. data/app/assets/icons/solid/dribbble.svg +0 -3
  430. data/app/assets/icons/solid/dropbox.svg +0 -4
  431. data/app/assets/icons/solid/edit.svg +0 -4
  432. data/app/assets/icons/solid/envelope-open.svg +0 -4
  433. data/app/assets/icons/solid/envelope.svg +0 -4
  434. data/app/assets/icons/solid/exclamation-circle.svg +0 -3
  435. data/app/assets/icons/solid/eye-slash.svg +0 -5
  436. data/app/assets/icons/solid/eye.svg +0 -3
  437. data/app/assets/icons/solid/face-explode.svg +0 -3
  438. data/app/assets/icons/solid/face-grin-stars.svg +0 -3
  439. data/app/assets/icons/solid/face-grin.svg +0 -3
  440. data/app/assets/icons/solid/face-laugh.svg +0 -3
  441. data/app/assets/icons/solid/facebook.svg +0 -3
  442. data/app/assets/icons/solid/file-chart-bar.svg +0 -3
  443. data/app/assets/icons/solid/file-check.svg +0 -4
  444. data/app/assets/icons/solid/file-circle-plus.svg +0 -4
  445. data/app/assets/icons/solid/file-clone.svg +0 -4
  446. data/app/assets/icons/solid/file-code.svg +0 -3
  447. data/app/assets/icons/solid/file-copy-alt.svg +0 -4
  448. data/app/assets/icons/solid/file-copy.svg +0 -4
  449. data/app/assets/icons/solid/file-csv.svg +0 -3
  450. data/app/assets/icons/solid/file-export.svg +0 -3
  451. data/app/assets/icons/solid/file-image.svg +0 -3
  452. data/app/assets/icons/solid/file-import.svg +0 -3
  453. data/app/assets/icons/solid/file-invoice.svg +0 -3
  454. data/app/assets/icons/solid/file-lines.svg +0 -3
  455. data/app/assets/icons/solid/file-music.svg +0 -3
  456. data/app/assets/icons/solid/file-paste.svg +0 -4
  457. data/app/assets/icons/solid/file-pdf.svg +0 -3
  458. data/app/assets/icons/solid/file-pen.svg +0 -4
  459. data/app/assets/icons/solid/file-ppt.svg +0 -3
  460. data/app/assets/icons/solid/file-search.svg +0 -3
  461. data/app/assets/icons/solid/file-shield.svg +0 -4
  462. data/app/assets/icons/solid/file-video.svg +0 -3
  463. data/app/assets/icons/solid/file-word.svg +0 -3
  464. data/app/assets/icons/solid/file-zip.svg +0 -3
  465. data/app/assets/icons/solid/file.svg +0 -3
  466. data/app/assets/icons/solid/filter.svg +0 -3
  467. data/app/assets/icons/solid/fire.svg +0 -3
  468. data/app/assets/icons/solid/flag.svg +0 -3
  469. data/app/assets/icons/solid/flowbite.svg +0 -6
  470. data/app/assets/icons/solid/folder-arrow-right.svg +0 -3
  471. data/app/assets/icons/solid/folder-duplicate.svg +0 -4
  472. data/app/assets/icons/solid/folder-open.svg +0 -3
  473. data/app/assets/icons/solid/folder-plus.svg +0 -3
  474. data/app/assets/icons/solid/folder.svg +0 -3
  475. data/app/assets/icons/solid/forward-step.svg +0 -3
  476. data/app/assets/icons/solid/forward.svg +0 -3
  477. data/app/assets/icons/solid/gift-box.svg +0 -3
  478. data/app/assets/icons/solid/github.svg +0 -3
  479. data/app/assets/icons/solid/globe.svg +0 -3
  480. data/app/assets/icons/solid/google.svg +0 -3
  481. data/app/assets/icons/solid/grid-plus.svg +0 -3
  482. data/app/assets/icons/solid/grid.svg +0 -3
  483. data/app/assets/icons/solid/headphones.svg +0 -3
  484. data/app/assets/icons/solid/heart.svg +0 -3
  485. data/app/assets/icons/solid/home.svg +0 -3
  486. data/app/assets/icons/solid/hourglass.svg +0 -3
  487. data/app/assets/icons/solid/html.svg +0 -3
  488. data/app/assets/icons/solid/image.svg +0 -4
  489. data/app/assets/icons/solid/inbox-full.svg +0 -3
  490. data/app/assets/icons/solid/inbox.svg +0 -3
  491. data/app/assets/icons/solid/indent.svg +0 -3
  492. data/app/assets/icons/solid/info-circle.svg +0 -3
  493. data/app/assets/icons/solid/keyboard.svg +0 -3
  494. data/app/assets/icons/solid/label.svg +0 -3
  495. data/app/assets/icons/solid/landmark.svg +0 -4
  496. data/app/assets/icons/solid/layers.svg +0 -4
  497. data/app/assets/icons/solid/life-saver.svg +0 -3
  498. data/app/assets/icons/solid/lightbulb.svg +0 -3
  499. data/app/assets/icons/solid/linkedin.svg +0 -4
  500. data/app/assets/icons/solid/list-music.svg +0 -3
  501. data/app/assets/icons/solid/lock-open.svg +0 -3
  502. data/app/assets/icons/solid/lock-time.svg +0 -4
  503. data/app/assets/icons/solid/lock.svg +0 -3
  504. data/app/assets/icons/solid/mail-box.svg +0 -3
  505. data/app/assets/icons/solid/map-pin-alt.svg +0 -3
  506. data/app/assets/icons/solid/map-pin.svg +0 -3
  507. data/app/assets/icons/solid/message-caption.svg +0 -3
  508. data/app/assets/icons/solid/message-dots.svg +0 -3
  509. data/app/assets/icons/solid/messages.svg +0 -4
  510. data/app/assets/icons/solid/microphone.svg +0 -4
  511. data/app/assets/icons/solid/mobile-phone.svg +0 -3
  512. data/app/assets/icons/solid/moon.svg +0 -3
  513. data/app/assets/icons/solid/newspaper.svg +0 -3
  514. data/app/assets/icons/solid/npm.svg +0 -3
  515. data/app/assets/icons/solid/outdent.svg +0 -3
  516. data/app/assets/icons/solid/palette.svg +0 -3
  517. data/app/assets/icons/solid/paper-plane.svg +0 -3
  518. data/app/assets/icons/solid/paragraph.svg +0 -3
  519. data/app/assets/icons/solid/pause.svg +0 -3
  520. data/app/assets/icons/solid/pen-nib.svg +0 -3
  521. data/app/assets/icons/solid/pen.svg +0 -3
  522. data/app/assets/icons/solid/phone.svg +0 -3
  523. data/app/assets/icons/solid/play.svg +0 -3
  524. data/app/assets/icons/solid/printer.svg +0 -3
  525. data/app/assets/icons/solid/profile-card.svg +0 -3
  526. data/app/assets/icons/solid/question-circle.svg +0 -3
  527. data/app/assets/icons/solid/quote.svg +0 -3
  528. data/app/assets/icons/solid/react.svg +0 -4
  529. data/app/assets/icons/solid/receipt.svg +0 -3
  530. data/app/assets/icons/solid/rectangle-list.svg +0 -3
  531. data/app/assets/icons/solid/reply-all.svg +0 -3
  532. data/app/assets/icons/solid/reply.svg +0 -3
  533. data/app/assets/icons/solid/rocket.svg +0 -3
  534. data/app/assets/icons/solid/sale-percent.svg +0 -3
  535. data/app/assets/icons/solid/scale-balanced.svg +0 -3
  536. data/app/assets/icons/solid/search.svg +0 -4
  537. data/app/assets/icons/solid/share-all.svg +0 -3
  538. data/app/assets/icons/solid/share-nodes.svg +0 -3
  539. data/app/assets/icons/solid/shield-check.svg +0 -3
  540. data/app/assets/icons/solid/shield.svg +0 -3
  541. data/app/assets/icons/solid/shopping-bag.svg +0 -3
  542. data/app/assets/icons/solid/stackoverflow.svg +0 -4
  543. data/app/assets/icons/solid/star-half-stroke.svg +0 -3
  544. data/app/assets/icons/solid/star-half.svg +0 -3
  545. data/app/assets/icons/solid/star.svg +0 -3
  546. data/app/assets/icons/solid/store.svg +0 -3
  547. data/app/assets/icons/solid/sun.svg +0 -3
  548. data/app/assets/icons/solid/swatchbook.svg +0 -3
  549. data/app/assets/icons/solid/table-column.svg +0 -3
  550. data/app/assets/icons/solid/table-row.svg +0 -3
  551. data/app/assets/icons/solid/tablet.svg +0 -3
  552. data/app/assets/icons/solid/tag.svg +0 -3
  553. data/app/assets/icons/solid/tailwind.svg +0 -3
  554. data/app/assets/icons/solid/terminal.svg +0 -3
  555. data/app/assets/icons/solid/thumbs-down.svg +0 -3
  556. data/app/assets/icons/solid/thumbs-up.svg +0 -3
  557. data/app/assets/icons/solid/ticket.svg +0 -3
  558. data/app/assets/icons/solid/trash-bin.svg +0 -3
  559. data/app/assets/icons/solid/truck.svg +0 -3
  560. data/app/assets/icons/solid/twitter.svg +0 -3
  561. data/app/assets/icons/solid/upload.svg +0 -3
  562. data/app/assets/icons/solid/user-add.svg +0 -3
  563. data/app/assets/icons/solid/user-circle.svg +0 -3
  564. data/app/assets/icons/solid/user-edit.svg +0 -3
  565. data/app/assets/icons/solid/user-headset.svg +0 -3
  566. data/app/assets/icons/solid/user-remove.svg +0 -3
  567. data/app/assets/icons/solid/user-settings.svg +0 -3
  568. data/app/assets/icons/solid/user.svg +0 -3
  569. data/app/assets/icons/solid/users-group.svg +0 -3
  570. data/app/assets/icons/solid/users.svg +0 -3
  571. data/app/assets/icons/solid/video-camera.svg +0 -3
  572. data/app/assets/icons/solid/volume-down.svg +0 -4
  573. data/app/assets/icons/solid/volume-up.svg +0 -5
  574. data/app/assets/icons/solid/vue.svg +0 -3
  575. data/app/assets/icons/solid/wallet.svg +0 -4
  576. data/app/assets/icons/solid/wand-magic-sparkles.svg +0 -4
  577. data/app/assets/icons/solid/window-restore.svg +0 -4
  578. data/app/assets/icons/solid/window.svg +0 -3
  579. data/app/assets/icons/solid/youtube.svg +0 -3
  580. data/app/assets/icons/solid/zoom-in.svg +0 -3
  581. data/app/assets/icons/solid/zoom-out.svg +0 -3
  582. data/app/views/components/action_button/action_button_component.html.erb +0 -7
  583. data/app/views/components/action_button/action_button_component.rb +0 -15
  584. data/app/views/components/attributes.rb +0 -184
  585. data/app/views/components/base.rb +0 -29
  586. data/app/views/components/block/block_component.html.erb +0 -3
  587. data/app/views/components/block/block_component.rb +0 -44
  588. data/app/views/components/breadcrumbs/breadcrumbs_component.html.erb +0 -96
  589. data/app/views/components/breadcrumbs/breadcrumbs_component.rb +0 -9
  590. data/app/views/components/button/button_component.html.erb +0 -11
  591. data/app/views/components/button/button_component.rb +0 -128
  592. data/app/views/components/dyna_frame_content/dyna_frame_content_component.html.erb +0 -8
  593. data/app/views/components/dyna_frame_content/dyna_frame_content_component.rb +0 -6
  594. data/app/views/components/dyna_frame_host/dyna_frame_host_component.html.erb +0 -3
  595. data/app/views/components/dyna_frame_host/dyna_frame_host_component.rb +0 -18
  596. data/app/views/components/empty_card/empty_card_component.html.erb +0 -6
  597. data/app/views/components/empty_card/empty_card_component.rb +0 -7
  598. data/app/views/components/form/form_builder.rb +0 -75
  599. data/app/views/components/form/form_component.html.erb +0 -73
  600. data/app/views/components/form/form_component.rb +0 -23
  601. data/app/views/components/has_many_panel/has_many_panel_component.html.erb +0 -25
  602. data/app/views/components/has_many_panel/has_many_panel_component.rb +0 -16
  603. data/app/views/components/header/header_component.html.erb +0 -1
  604. data/app/views/components/header/header_component.rb +0 -7
  605. data/app/views/components/interactive_action_form/interactive_action_form_component.html.erb +0 -39
  606. data/app/views/components/interactive_action_form/interactive_action_form_component.rb +0 -8
  607. data/app/views/components/nav_grid_menu/nav_grid_menu_component.html.erb +0 -24
  608. data/app/views/components/nav_grid_menu/nav_grid_menu_component.rb +0 -23
  609. data/app/views/components/nav_grid_menu_item/nav_grid_menu_item_component.html.erb +0 -4
  610. data/app/views/components/nav_grid_menu_item/nav_grid_menu_item_component.rb +0 -20
  611. data/app/views/components/nav_user/nav_user_component.html.erb +0 -50
  612. data/app/views/components/nav_user/nav_user_component.rb +0 -32
  613. data/app/views/components/nav_user_link/nav_user_link_component.html.erb +0 -7
  614. data/app/views/components/nav_user_link/nav_user_link_component.rb +0 -23
  615. data/app/views/components/nav_user_section/nav_user_section_component.html.erb +0 -7
  616. data/app/views/components/nav_user_section/nav_user_section_component.rb +0 -18
  617. data/app/views/components/nested_resource_form_fields/nested_resource_form_fields_component.html.erb +0 -64
  618. data/app/views/components/nested_resource_form_fields/nested_resource_form_fields_component.rb +0 -29
  619. data/app/views/components/pagination/pagination_component.html.erb +0 -6
  620. data/app/views/components/pagination/pagination_component.rb +0 -94
  621. data/app/views/components/panel/panel_component.html.erb +0 -17
  622. data/app/views/components/panel/panel_component.rb +0 -17
  623. data/app/views/components/resource_header/resource_header_component.html.erb +0 -83
  624. data/app/views/components/resource_header/resource_header_component.rb +0 -30
  625. data/app/views/components/resource_layout/resource_layout_component.html.erb +0 -53
  626. data/app/views/components/resource_layout/resource_layout_component.rb +0 -41
  627. data/app/views/components/sidebar/sidebar_component.html.erb +0 -69
  628. data/app/views/components/sidebar/sidebar_component.rb +0 -23
  629. data/app/views/components/sidebar_menu/sidebar_menu_component.html.erb +0 -5
  630. data/app/views/components/sidebar_menu/sidebar_menu_component.rb +0 -17
  631. data/app/views/components/sidebar_menu_item/sidebar_menu_item_component.html.erb +0 -64
  632. data/app/views/components/sidebar_menu_item/sidebar_menu_item_component.rb +0 -52
  633. data/app/views/components/skeleton/table/table_component.html.erb +0 -18
  634. data/app/views/components/skeleton/table/table_component.rb +0 -6
  635. data/app/views/components/table/table_component.html.erb +0 -43
  636. data/app/views/components/table/table_component.rb +0 -159
  637. data/app/views/components/table_search_input/table_search_input_component.html.erb +0 -48
  638. data/app/views/components/table_search_input/table_search_input_component.rb +0 -15
  639. data/app/views/components/table_toolbar/table_toolbar_component.html.erb +0 -7
  640. data/app/views/components/table_toolbar/table_toolbar_component.rb +0 -17
  641. data/app/views/components/toolbar/toolbar_component.html.erb +0 -67
  642. data/app/views/components/toolbar/toolbar_component.rb +0 -26
  643. data/app/views/layouts/resource.html copy.erb +0 -49
  644. data/app/views/plutonium/_resource_header.html copy.erb +0 -287
  645. data/lib/generators/pu/gen/component/component_generator.rb +0 -99
  646. data/lib/generators/pu/gen/component/templates/component.html.erb.tt +0 -3
  647. data/lib/generators/pu/gen/component/templates/component.rb.tt +0 -15
  648. data/lib/generators/pu/gen/component/templates/controller.js.tt +0 -8
  649. data/lib/plutonium/builders/menus/sidebar_menu.rb.bk +0 -26
  650. data/lib/plutonium/builders/menus/sidebar_menu_item.rb.bk +0 -28
  651. data/lib/plutonium/component_registry.rb +0 -19
  652. data/lib/plutonium/core/action.rb +0 -49
  653. data/lib/plutonium/core/actions/basic_action.rb +0 -16
  654. data/lib/plutonium/core/actions/collection.rb +0 -37
  655. data/lib/plutonium/core/actions/destroy_action.rb +0 -23
  656. data/lib/plutonium/core/actions/edit_action.rb +0 -21
  657. data/lib/plutonium/core/actions/interactive_action.rb +0 -64
  658. data/lib/plutonium/core/actions/new_action.rb +0 -20
  659. data/lib/plutonium/core/actions/show_action.rb +0 -19
  660. data/lib/plutonium/core/associations/renderers/base.rb +0 -77
  661. data/lib/plutonium/core/associations/renderers/factory.rb +0 -36
  662. data/lib/plutonium/core/associations/renderers/has_many_renderer.rb +0 -18
  663. data/lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb +0 -31
  664. data/lib/plutonium/core/autodiscovery/discoverer.rb +0 -15
  665. data/lib/plutonium/core/autodiscovery/input_discoverer.rb +0 -31
  666. data/lib/plutonium/core/autodiscovery/renderer_discoverer.rb +0 -31
  667. data/lib/plutonium/core/definers/action_definer.rb +0 -25
  668. data/lib/plutonium/core/definers/association_renderer_definer.rb +0 -33
  669. data/lib/plutonium/core/definers/field_definer.rb +0 -19
  670. data/lib/plutonium/core/definers/field_input_definer.rb +0 -77
  671. data/lib/plutonium/core/definers/field_renderer_definer.rb +0 -37
  672. data/lib/plutonium/core/fields/inputs/attachment_input.rb +0 -24
  673. data/lib/plutonium/core/fields/inputs/base.rb +0 -110
  674. data/lib/plutonium/core/fields/inputs/belongs_to_association_input.rb +0 -15
  675. data/lib/plutonium/core/fields/inputs/checkbox_input.rb +0 -15
  676. data/lib/plutonium/core/fields/inputs/date_time_input.rb +0 -15
  677. data/lib/plutonium/core/fields/inputs/factory.rb +0 -50
  678. data/lib/plutonium/core/fields/inputs/has_many_association_input.rb +0 -15
  679. data/lib/plutonium/core/fields/inputs/nested_input.rb +0 -72
  680. data/lib/plutonium/core/fields/inputs/noop_input.rb +0 -16
  681. data/lib/plutonium/core/fields/inputs/phone_input.rb +0 -22
  682. data/lib/plutonium/core/fields/inputs/polymorphic_belongs_to_association_input.rb +0 -48
  683. data/lib/plutonium/core/fields/inputs/simple_form_association_input.rb +0 -26
  684. data/lib/plutonium/core/fields/inputs/simple_form_input.rb +0 -13
  685. data/lib/plutonium/core/fields/renderers/association_renderer.rb +0 -28
  686. data/lib/plutonium/core/fields/renderers/attachment_renderer.rb +0 -21
  687. data/lib/plutonium/core/fields/renderers/base.rb +0 -83
  688. data/lib/plutonium/core/fields/renderers/basic_renderer.rb +0 -13
  689. data/lib/plutonium/core/fields/renderers/factory.rb +0 -37
  690. data/lib/plutonium/core/renderable.rb +0 -20
  691. data/lib/plutonium/core/ui/collection.rb +0 -18
  692. data/lib/plutonium/core/ui/detail.rb +0 -15
  693. data/lib/plutonium/core/ui/form.rb +0 -12
  694. data/lib/plutonium/helpers/action_buttons_helper.rb +0 -32
  695. data/lib/plutonium/helpers/component_helper.rb +0 -14
  696. data/lib/plutonium/helpers/form_helper.rb +0 -50
  697. data/lib/plutonium/icons.rb +0 -32
  698. data/lib/plutonium/preserved__/field.rb.bk +0 -65
  699. data/lib/plutonium/preserved__/input.rb.bk +0 -93
  700. data/lib/plutonium/ui/table/components/pagy_page_info.rb +0 -70
  701. data/src/js/controllers/has_many_panel_controller.js +0 -8
  702. data/src/js/controllers/interactive_action_form_controller.js +0 -13
  703. data/src/js/controllers/nav_grid_menu_controller.js +0 -8
  704. data/src/js/controllers/nav_grid_menu_item_controller.js +0 -8
  705. data/src/js/controllers/nav_user_controller.js +0 -8
  706. data/src/js/controllers/nav_user_link_controller.js +0 -8
  707. data/src/js/controllers/nav_user_section_controller.js +0 -8
  708. data/src/js/controllers/resource_layout_controller.js +0 -8
  709. data/src/js/controllers/sidebar_controller.js +0 -8
  710. data/src/js/controllers/sidebar_menu_controller.js +0 -8
  711. data/src/js/controllers/sidebar_menu_item_controller.js +0 -8
  712. data/src/js/controllers/table_controller.js +0 -8
  713. data/src/js/controllers/table_search_input_controller.js +0 -8
  714. data/src/js/controllers/table_toolbar_controller.js +0 -8
  715. data/src/js/controllers/toolbar_controller.js +0 -8
@@ -1,66 +1,143 @@
1
- (()=>{var Ol=Object.create;var To=Object.defineProperty;var Rl=Object.getOwnPropertyDescriptor;var Ml=Object.getOwnPropertyNames;var Pl=Object.getPrototypeOf,Dl=Object.prototype.hasOwnProperty;var Fl=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Bl=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ml(e))!Dl.call(i,n)&&n!==t&&To(i,n,{get:()=>e[n],enumerable:!(r=Rl(e,n))||r.enumerable});return i};var Nl=(i,e,t)=>(t=i!=null?Ol(Pl(i)):{},Bl(e||!i||!i.__esModule?To(t,"default",{value:i,enumerable:!0}):t,i));var Vo=Fl((Qp,zo)=>{var Lc="Expected a function",Ho=NaN,Cc="[object Symbol]",Ic=/^\s+|\s+$/g,Oc=/^[-+]0x[0-9a-f]+$/i,Rc=/^0b[01]+$/i,Mc=/^0o[0-7]+$/i,Pc=parseInt,Dc=typeof global=="object"&&global&&global.Object===Object&&global,Fc=typeof self=="object"&&self&&self.Object===Object&&self,Bc=Dc||Fc||Function("return this")(),Nc=Object.prototype,Hc=Nc.toString,qc=Math.max,zc=Math.min,Kn=function(){return Bc.Date.now()};function Vc(i,e,t){var r,n,s,o,a,l,d=0,p=!1,m=!1,E=!0;if(typeof i!="function")throw new TypeError(Lc);e=qo(e)||0,Gn(t)&&(p=!!t.leading,m="maxWait"in t,s=m?qc(qo(t.maxWait)||0,e):s,E="trailing"in t?!!t.trailing:E);function v(x){var P=r,N=n;return r=n=void 0,d=x,o=i.apply(N,P),o}function C(x){return d=x,a=setTimeout(D,e),p?v(x):o}function _(x){var P=x-l,N=x-d,U=e-P;return m?zc(U,s-N):U}function k(x){var P=x-l,N=x-d;return l===void 0||P>=e||P<0||m&&N>=s}function D(){var x=Kn();if(k(x))return q(x);a=setTimeout(D,_(x))}function q(x){return a=void 0,E&&r?v(x):(r=n=void 0,o)}function B(){a!==void 0&&clearTimeout(a),d=0,r=l=n=a=void 0}function S(){return a===void 0?o:q(Kn())}function R(){var x=Kn(),P=k(x);if(r=arguments,n=this,l=x,P){if(a===void 0)return C(l);if(m)return a=setTimeout(D,e),v(l)}return a===void 0&&(a=setTimeout(D,e)),o}return R.cancel=B,R.flush=S,R}function Gn(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function $c(i){return!!i&&typeof i=="object"}function jc(i){return typeof i=="symbol"||$c(i)&&Hc.call(i)==Cc}function qo(i){if(typeof i=="number")return i;if(jc(i))return Ho;if(Gn(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Gn(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Ic,"");var t=Rc.test(i);return t||Mc.test(i)?Pc(i.slice(2),t?2:8):Oc.test(i)?Ho:+i}zo.exports=Vc});var An=class{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let t=Hl(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,n=t.index;return r<n?-1:r>n?1:0})}};function Hl(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:e}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var Sn=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:r,eventOptions:n}=e,s=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,n);s.delete(o),s.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:n}=e;return this.fetchEventListener(t,r,n)}fetchEventListener(e,t,r){let n=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,r),o=n.get(s);return o||(o=this.createEventListener(e,t,r),n.set(s,o)),o}createEventListener(e,t,r){let n=new An(e,t,r);return this.started&&n.connect(),n}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(n=>{r.push(`${t[n]?"":"!"}${n}`)}),r.join(":")}},ql={stop({event:i,value:e}){return e&&i.stopPropagation(),!0},prevent({event:i,value:e}){return e&&i.preventDefault(),!0},self({event:i,value:e,element:t}){return e?t===i.target:!0}},zl=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Vl(i){let t=i.trim().match(zl)||[],r=t[2],n=t[3];return n&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${n}`,n=""),{eventTarget:$l(t[4]),eventName:r,eventOptions:t[7]?jl(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||n}}function $l(i){if(i=="window")return window;if(i=="document")return document}function jl(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function Ul(i){if(i==window)return"window";if(i==document)return"document"}function Wn(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function Tn(i){return Wn(i.replace(/--/g,"-").replace(/__/g,"_"))}function wi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Do(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Wl(i){return i.match(/[^\s]+/g)||[]}function ko(i){return i!=null}function kn(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var xo=["meta","ctrl","alt","shift"],xn=class{constructor(e,t,r,n){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||Kl(e)||Zi("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||Zi("missing identifier"),this.methodName=r.methodName||Zi("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=n}static forToken(e,t){return new this(e.element,e.index,Vl(e.content),t)}toString(){let e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let r=t.filter(n=>!xo.includes(n))[0];return r?(kn(this.keyMappings,r)||Zi(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:r,value:n}of Array.from(this.element.attributes)){let s=r.match(t),o=s&&s[1];o&&(e[Wn(o)]=Gl(n))}return e}get eventTargetName(){return Ul(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,n,s,o]=xo.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==n||e.altKey!==s||e.shiftKey!==o}},Lo={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Kl(i){let e=i.tagName.toLowerCase();if(e in Lo)return Lo[e](i)}function Zi(i){throw new Error(i)}function Gl(i){try{return JSON.parse(i)}catch{return i}}var Ln=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:n}=this.context,s=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let l=r[o];s=s&&l({name:o,value:a,event:e,element:t,controller:n})}else continue;return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(n){let{identifier:s,controller:o,element:a,index:l}=this,d={identifier:s,controller:o,element:a,index:l,event:e};this.context.handleError(n,`invoking action "${this.action}"`,d)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0:t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},Qi=class{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.processTree(r,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}},Ji=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new Qi(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}};function Xl(i,e,t){Fo(i,e).add(t)}function Yl(i,e,t){Fo(i,e).delete(t),Zl(i,e)}function Fo(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function Zl(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var Ge=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t.concat(Array.from(r)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t+r.size,0)}add(e,t){Xl(this.valuesByKey,e,t)}delete(e,t){Yl(this.valuesByKey,e,t)}has(e,t){let r=this.valuesByKey.get(e);return r!=null&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(r=>r.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([t,r])=>t)}};var Cn=class{constructor(e,t,r,n){this._selector=t,this.details=n,this.elementObserver=new Qi(e,this),this.delegate=r,this.matchesByElement=new Ge}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){let{selector:t}=this;if(t){let r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let r=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(t)).filter(s=>this.matchElement(s));return r.concat(n)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){let{selector:r}=this;if(r){let n=this.matchElement(e),s=this.matchesByElement.has(r,e);n&&!s?this.selectorMatched(e,r):!n&&s&&this.selectorUnmatched(e,r)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}},In=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);let n=this.element.getAttribute(e);if(this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,r,t),n==null){let s=this.stringMap.get(e);this.stringMap.delete(e),s&&this.stringMapKeyRemoved(r,e,s)}else this.stringMap.set(e,n)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}},er=class{constructor(e,t,r){this.attributeObserver=new Ji(e,t,this),this.delegate=r,this.tokensByElement=new Ge}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),n=Jl(t,r).findIndex(([s,o])=>!ec(s,o));return n==-1?[[],[]]:[t.slice(n),r.slice(n)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return Ql(r,e,t)}};function Ql(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,n)=>({element:e,attributeName:t,content:r,index:n}))}function Jl(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,n)=>[i[n],e[n]])}function ec(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var tr=class{constructor(e,t,r){this.tokenListObserver=new er(e,t,this),this.delegate=r,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(t){return{error:t}}}},On=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new tr(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){let t=new Ln(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){let t=xn.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},Rn=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new In(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){let r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){let n=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=n.writer(n.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let n=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,n.writer(this.receiver[e]),r):this.invokeChangedCallback(e,n.writer(n.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:n}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,n(r),void 0)}invokeChangedCallback(e,t,r){let n=`${e}Changed`,s=this.receiver[n];if(typeof s=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(t),l=r;r&&(l=o.reader(r)),s.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let r=this.valueDescriptorMap[t];e[r.name]=r}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],r=`has${wi(t.name)}`;return this.receiver[r]}},Mn=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Ge}start(){this.tokenListObserver||(this.tokenListObserver=new er(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}};function Ei(i,e){let t=Bo(i);return Array.from(t.reduce((r,n)=>(ic(n,e).forEach(s=>r.add(s)),r),new Set))}function tc(i,e){return Bo(i).reduce((r,n)=>(r.push(...rc(n,e)),r),[])}function Bo(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function ic(i,e){let t=i[e];return Array.isArray(t)?t:[]}function rc(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Pn=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Ge,this.outletElementsByName=new Ge,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:r}){let n=this.getOutlet(e,r);n&&this.connectOutlet(n,e,r)}selectorUnmatched(e,t,{outletName:r}){let n=this.getOutletFromMap(e,r);n&&this.disconnectOutlet(n,e,r)}selectorMatchElement(e,{outletName:t}){let r=this.selector(t),n=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return r?n&&s&&e.matches(r):!1}elementMatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletDisconnected(e,t,r)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),r=new Cn(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new Ji(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){let e=new Ge;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;Ei(r,"outlets").forEach(s=>e.add(s,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(r=>r.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}},Dn=class{constructor(e,t){this.logDebugActivity=(r,n={})=>{let{identifier:s,controller:o,element:a}=this;n=Object.assign({identifier:s,controller:o,element:a},n),this.application.logDebugActivity(this.identifier,r,n)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new On(this,this.dispatcher),this.valueObserver=new Rn(this,this.controller),this.targetObserver=new Mn(this,this),this.outletObserver=new Pn(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(r){this.handleError(r,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,r={}){let{identifier:n,controller:s,element:o}=this;r=Object.assign({identifier:n,controller:s,element:o},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${Tn(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${Tn(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function nc(i){return sc(i,oc(i))}function sc(i,e){let t=uc(i),r=ac(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function oc(i){return Ei(i,"blessings").reduce((t,r)=>{let n=r(i);for(let s in n){let o=t[s]||{};t[s]=Object.assign(o,n[s])}return t},{})}function ac(i,e){return cc(e).reduce((t,r)=>{let n=lc(i,e,r);return n&&Object.assign(t,{[r]:n}),t},{})}function lc(i,e,t){let r=Object.getOwnPropertyDescriptor(i,t);if(!(r&&"value"in r)){let s=Object.getOwnPropertyDescriptor(e,t).value;return r&&(s.get=r.get||s.get,s.set=r.set||s.set),s}}var cc=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,uc=(()=>{function i(t){function r(){return Reflect.construct(t,arguments,new.target)}return r.prototype=Object.create(t.prototype,{constructor:{value:r}}),Reflect.setPrototypeOf(r,t),r}function e(){let r=i(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return e(),i}catch{return r=>class extends r{}}})();function hc(i){return{identifier:i.identifier,controllerConstructor:nc(i.controllerConstructor)}}var Fn=class{constructor(e,t){this.application=e,this.definition=hc(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Dn(this,e),this.contextsByScope.set(e,t)),t}},Bn=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return Wl(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Nn=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${Do(e)}`}},Hn=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let n=this.warnedKeysByObject.get(e);n||(n=new Set,this.warnedKeysByObject.set(e,n)),n.has(t)||(n.add(t),this.logger.warn(r,e))}};function qn(i,e){return`[${i}~="${e}"]`}var zn=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findTarget(r)||this.findLegacyTarget(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllTargets(r),...this.findAllLegacyTargets(r)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return qn(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(r=>this.deprecate(r,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return qn(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,n=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${n}="${r}.${t}" with ${s}="${t}". The ${n} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},Vn=class{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findOutlet(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllOutlets(r)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))}matchesElement(e,t,r){let n=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&n.split(" ").includes(r)}},$n=class i{constructor(e,t,r,n){this.targets=new zn(this),this.classes=new Bn(this),this.data=new Nn(this),this.containsElement=s=>s.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new Hn(n),this.outlets=new Vn(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return qn(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(this.schema,document.documentElement,this.identifier,this.guide.logger)}},jn=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new tr(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){let{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){let r=this.fetchScopesByIdentifierForElement(e),n=r.get(t);return n||(n=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,n)),n}elementMatchedValue(e,t){let r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),r==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),r==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},Un=class{constructor(e){this.application=e,this.scopeObserver=new jn(this.element,this.schema,this),this.scopesByIdentifier=new Ge,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let t=new Fn(this.application,e);this.connectModule(t);let r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(n=>n.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new $n(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.connectContextForScope(r))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.disconnectContextForScope(r))}},dc={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:i=>`data-${i}-target`,outletAttributeForScope:(i,e)=>`data-${i}-${e}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},Co("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),Co("0123456789".split("").map(i=>[i,i])))};function Co(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var ir=class{constructor(e=document.documentElement,t=dc){this.logger=console,this.debug=!1,this.logDebugActivity=(r,n,s={})=>{this.debug&&this.logFormattedMessage(r,n,s)},this.element=e,this.schema=t,this.dispatcher=new Sn(this),this.router=new Un(this),this.actionDescriptorFilters=Object.assign({},ql)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await pc(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(n=>{n.controllerConstructor.shouldLoad&&this.router.loadDefinition(n)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(n=>this.router.unloadIdentifier(n))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var n;this.logger.error(`%s
1
+ (()=>{var Dv=Object.create;var wd=Object.defineProperty;var Nv=Object.getOwnPropertyDescriptor;var Bv=Object.getOwnPropertyNames;var Uv=Object.getPrototypeOf,zv=Object.prototype.hasOwnProperty;var _e=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Hv=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Bv(e))!zv.call(i,s)&&s!==t&&wd(i,s,{get:()=>e[s],enumerable:!(r=Nv(e,s))||r.enumerable});return i};var Ce=(i,e,t)=>(t=i!=null?Dv(Uv(i)):{},Hv(e||!i||!i.__esModule?wd(t,"default",{value:i,enumerable:!0}):t,i));var Nd=_e((gx,Dd)=>{var Ob="Expected a function",Md=NaN,Rb="[object Symbol]",Lb=/^\s+|\s+$/g,Mb=/^[-+]0x[0-9a-f]+$/i,Ib=/^0b[01]+$/i,Db=/^0o[0-7]+$/i,Nb=parseInt,Bb=typeof global=="object"&&global&&global.Object===Object&&global,Ub=typeof self=="object"&&self&&self.Object===Object&&self,zb=Bb||Ub||Function("return this")(),Hb=Object.prototype,$b=Hb.toString,qb=Math.max,Vb=Math.min,sc=function(){return zb.Date.now()};function jb(i,e,t){var r,s,n,o,a,l,c=0,d=!1,f=!1,y=!0;if(typeof i!="function")throw new TypeError(Ob);e=Id(e)||0,nc(t)&&(d=!!t.leading,f="maxWait"in t,n=f?qb(Id(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function v(R){var G=r,K=s;return r=s=void 0,c=R,o=i.apply(K,G),o}function x(R){return c=R,a=setTimeout(I,e),d?v(R):o}function P(R){var G=R-l,K=R-c,Y=e-G;return f?Vb(Y,n-K):Y}function C(R){var G=R-l,K=R-c;return l===void 0||G>=e||G<0||f&&K>=n}function I(){var R=sc();if(C(R))return D(R);a=setTimeout(I,P(R))}function D(R){return a=void 0,y&&r?v(R):(r=s=void 0,o)}function q(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function M(){return a===void 0?o:D(sc())}function H(){var R=sc(),G=C(R);if(r=arguments,s=this,l=R,G){if(a===void 0)return x(l);if(f)return a=setTimeout(I,e),v(l)}return a===void 0&&(a=setTimeout(I,e)),o}return H.cancel=q,H.flush=M,H}function nc(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function Wb(i){return!!i&&typeof i=="object"}function Gb(i){return typeof i=="symbol"||Wb(i)&&$b.call(i)==Rb}function Id(i){if(typeof i=="number")return i;if(Gb(i))return Md;if(nc(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=nc(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Lb,"");var t=Ib.test(i);return t||Db.test(i)?Nb(i.slice(2),t?2:8):Mb.test(i)?Md:+i}Dd.exports=jb});var Dp=_e((aC,Ip)=>{Ip.exports=function(){var e={},t=e._fns={};e.emit=function(o,a,l,c,d,f,y){var v=r(o);v.length&&s(o,v,[a,l,c,d,f,y])},e.on=function(o,a){t[o]||(t[o]=[]),t[o].push(a)},e.once=function(o,a){function l(){a.apply(this,arguments),e.off(o,l)}this.on(o,l)},e.off=function(o,a){var l=[];if(o&&a){var c=this._fns[o],d=0,f=c?c.length:0;for(d;d<f;d++)c[d]!==a&&l.push(c[d])}l.length?this._fns[o]=l:delete this._fns[o]};function r(n){var o=t[n]?t[n]:[],a=n.indexOf(":"),l=a===-1?[n]:[n.substring(0,a),n.substring(a+1)],c=Object.keys(t),d=0,f=c.length;for(d;d<f;d++){var y=c[d];if(y==="*"&&(o=o.concat(t[y])),l.length===2&&l[0]===y){o=o.concat(t[y]);break}}return o}function s(n,o,a){var l=0,c=o.length;for(l;l<c&&o[l];l++)o[l].event=n,o[l].apply(o[l],a)}return e}});var Sa=_e((cC,Bp)=>{function k0(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}Bp.exports=k0});var zp=_e((uC,Up)=>{var P0=typeof global=="object"&&global&&global.Object===Object&&global;Up.exports=P0});var Dc=_e((hC,Hp)=>{var C0=zp(),F0=typeof self=="object"&&self&&self.Object===Object&&self,_0=C0||F0||Function("return this")();Hp.exports=_0});var qp=_e((dC,$p)=>{var O0=Dc(),R0=function(){return O0.Date.now()};$p.exports=R0});var jp=_e((pC,Vp)=>{var L0=/\s/;function M0(i){for(var e=i.length;e--&&L0.test(i.charAt(e)););return e}Vp.exports=M0});var Gp=_e((fC,Wp)=>{var I0=jp(),D0=/^\s+/;function N0(i){return i&&i.slice(0,I0(i)+1).replace(D0,"")}Wp.exports=N0});var Nc=_e((mC,Kp)=>{var B0=Dc(),U0=B0.Symbol;Kp.exports=U0});var Qp=_e((gC,Zp)=>{var Xp=Nc(),Yp=Object.prototype,z0=Yp.hasOwnProperty,H0=Yp.toString,Pn=Xp?Xp.toStringTag:void 0;function $0(i){var e=z0.call(i,Pn),t=i[Pn];try{i[Pn]=void 0;var r=!0}catch{}var s=H0.call(i);return r&&(e?i[Pn]=t:delete i[Pn]),s}Zp.exports=$0});var ef=_e((vC,Jp)=>{var q0=Object.prototype,V0=q0.toString;function j0(i){return V0.call(i)}Jp.exports=j0});var nf=_e((bC,sf)=>{var tf=Nc(),W0=Qp(),G0=ef(),K0="[object Null]",X0="[object Undefined]",rf=tf?tf.toStringTag:void 0;function Y0(i){return i==null?i===void 0?X0:K0:rf&&rf in Object(i)?W0(i):G0(i)}sf.exports=Y0});var af=_e((yC,of)=>{function Z0(i){return i!=null&&typeof i=="object"}of.exports=Z0});var cf=_e((wC,lf)=>{var Q0=nf(),J0=af(),ew="[object Symbol]";function tw(i){return typeof i=="symbol"||J0(i)&&Q0(i)==ew}lf.exports=tw});var pf=_e((SC,df)=>{var iw=Gp(),uf=Sa(),rw=cf(),hf=NaN,sw=/^[-+]0x[0-9a-f]+$/i,nw=/^0b[01]+$/i,ow=/^0o[0-7]+$/i,aw=parseInt;function lw(i){if(typeof i=="number")return i;if(rw(i))return hf;if(uf(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=uf(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=iw(i);var t=nw.test(i);return t||ow.test(i)?aw(i.slice(2),t?2:8):sw.test(i)?hf:+i}df.exports=lw});var Uc=_e((EC,mf)=>{var cw=Sa(),Bc=qp(),ff=pf(),uw="Expected a function",hw=Math.max,dw=Math.min;function pw(i,e,t){var r,s,n,o,a,l,c=0,d=!1,f=!1,y=!0;if(typeof i!="function")throw new TypeError(uw);e=ff(e)||0,cw(t)&&(d=!!t.leading,f="maxWait"in t,n=f?hw(ff(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function v(R){var G=r,K=s;return r=s=void 0,c=R,o=i.apply(K,G),o}function x(R){return c=R,a=setTimeout(I,e),d?v(R):o}function P(R){var G=R-l,K=R-c,Y=e-G;return f?dw(Y,n-K):Y}function C(R){var G=R-l,K=R-c;return l===void 0||G>=e||G<0||f&&K>=n}function I(){var R=Bc();if(C(R))return D(R);a=setTimeout(I,P(R))}function D(R){return a=void 0,y&&r?v(R):(r=s=void 0,o)}function q(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function M(){return a===void 0?o:D(Bc())}function H(){var R=Bc(),G=C(R);if(r=arguments,s=this,l=R,G){if(a===void 0)return x(l);if(f)return clearTimeout(a),a=setTimeout(I,e),v(l)}return a===void 0&&(a=setTimeout(I,e)),o}return H.cancel=q,H.flush=M,H}mf.exports=pw});var vf=_e((TC,gf)=>{var fw=Uc(),mw=Sa(),gw="Expected a function";function vw(i,e,t){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(gw);return mw(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),fw(i,e,{leading:r,maxWait:e,trailing:s})}gf.exports=vw});var Aa=_e((NC,xf)=>{"use strict";xf.exports=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,r=Math.abs(e);if(t&&(r=-r),r===0)return"0 B";let s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(r)/Math.log(1024)),s.length-1),o=Number(r/1024**n),a=s[n];return`${o>=10||o%1===0?Math.round(o):o.toFixed(1)} ${a}`}});var Pf=_e((BC,kf)=>{"use strict";function Af(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}Af.prototype.match=function(i){var e=!0,t=this.parts,r,s=t.length,n;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(n=(i||"").split(this.separator),r=0;e&&r<s;r++)t[r]!=="*"&&(r<n.length?e=t[r]===n[r]:e=!1);e=e&&n}else if(typeof i.splice=="function")for(e=[],r=i.length;r--;)this.match(i[r])&&(e[e.length]=i[r]);else if(typeof i=="object"){e={};for(var o in i)this.match(o)&&(e[o]=i[o])}return e};kf.exports=function(i,e,t){var r=new Af(i,t||/[\/\.]/);return typeof e<"u"?r.match(e):r}});var Ff=_e((UC,Cf)=>{var Tw=Pf(),xw=/[\/\+\.]/;Cf.exports=function(i,e){function t(r){var s=Tw(r,i,xw);return s&&s.length>=2}return e?t(e.split(";")[0]):t}});var bt=_e((v2,Ia)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var s="",n=0;n<arguments.length;n++){var o=arguments[n];o&&(s=r(s,t(o)))}return s}function t(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return e.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var n="";for(var o in s)i.call(s,o)&&s[o]&&(n=r(n,o));return n}function r(s,n){return n?s?s+" "+n:s+n:s}typeof Ia<"u"&&Ia.exports?(e.default=e,Ia.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Ym=_e((h_,ju)=>{"use strict";var Q1=Object.prototype.hasOwnProperty,wt="~";function so(){}Object.create&&(so.prototype=Object.create(null),new so().__proto__||(wt=!1));function J1(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function Xm(i,e,t,r,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new J1(t,r||i,s),o=wt?wt+e:e;return i._events[o]?i._events[o].fn?i._events[o]=[i._events[o],n]:i._events[o].push(n):(i._events[o]=n,i._eventsCount++),i}function el(i,e){--i._eventsCount===0?i._events=new so:delete i._events[e]}function dt(){this._events=new so,this._eventsCount=0}dt.prototype.eventNames=function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)Q1.call(t,r)&&e.push(wt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};dt.prototype.listeners=function(e){var t=wt?wt+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,o=new Array(n);s<n;s++)o[s]=r[s].fn;return o};dt.prototype.listenerCount=function(e){var t=wt?wt+e:e,r=this._events[t];return r?r.fn?1:r.length:0};dt.prototype.emit=function(e,t,r,s,n,o){var a=wt?wt+e:e;if(!this._events[a])return!1;var l=this._events[a],c=arguments.length,d,f;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,s),!0;case 5:return l.fn.call(l.context,t,r,s,n),!0;case 6:return l.fn.call(l.context,t,r,s,n,o),!0}for(f=1,d=new Array(c-1);f<c;f++)d[f-1]=arguments[f];l.fn.apply(l.context,d)}else{var y=l.length,v;for(f=0;f<y;f++)switch(l[f].once&&this.removeListener(e,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,t);break;case 3:l[f].fn.call(l[f].context,t,r);break;case 4:l[f].fn.call(l[f].context,t,r,s);break;default:if(!d)for(v=1,d=new Array(c-1);v<c;v++)d[v-1]=arguments[v];l[f].fn.apply(l[f].context,d)}}return!0};dt.prototype.on=function(e,t,r){return Xm(this,e,t,r,!1)};dt.prototype.once=function(e,t,r){return Xm(this,e,t,r,!0)};dt.prototype.removeListener=function(e,t,r,s){var n=wt?wt+e:e;if(!this._events[n])return this;if(!t)return el(this,n),this;var o=this._events[n];if(o.fn)o.fn===t&&(!s||o.once)&&(!r||o.context===r)&&el(this,n);else{for(var a=0,l=[],c=o.length;a<c;a++)(o[a].fn!==t||s&&!o[a].once||r&&o[a].context!==r)&&l.push(o[a]);l.length?this._events[n]=l.length===1?l[0]:l:el(this,n)}return this};dt.prototype.removeAllListeners=function(e){var t;return e?(t=wt?wt+e:e,this._events[t]&&el(this,t)):(this._events=new so,this._eventsCount=0),this};dt.prototype.off=dt.prototype.removeListener;dt.prototype.addListener=dt.prototype.on;dt.prefixed=wt;dt.EventEmitter=dt;typeof ju<"u"&&(ju.exports=dt)});var Dg=_e((Eh,Th)=>{(function(i,e){typeof Eh=="object"&&typeof Th<"u"?Th.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Cropper=e())})(Eh,function(){"use strict";function i(g,h){var m=Object.keys(g);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(g);h&&(p=p.filter(function(E){return Object.getOwnPropertyDescriptor(g,E).enumerable})),m.push.apply(m,p)}return m}function e(g){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?i(Object(m),!0).forEach(function(p){l(g,p,m[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(m)):i(Object(m)).forEach(function(p){Object.defineProperty(g,p,Object.getOwnPropertyDescriptor(m,p))})}return g}function t(g,h){if(typeof g!="object"||!g)return g;var m=g[Symbol.toPrimitive];if(m!==void 0){var p=m.call(g,h||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(g)}function r(g){var h=t(g,"string");return typeof h=="symbol"?h:h+""}function s(g){"@babel/helpers - typeof";return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},s(g)}function n(g,h){if(!(g instanceof h))throw new TypeError("Cannot call a class as a function")}function o(g,h){for(var m=0;m<h.length;m++){var p=h[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(g,r(p.key),p)}}function a(g,h,m){return h&&o(g.prototype,h),m&&o(g,m),Object.defineProperty(g,"prototype",{writable:!1}),g}function l(g,h,m){return h=r(h),h in g?Object.defineProperty(g,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):g[h]=m,g}function c(g){return d(g)||f(g)||y(g)||x()}function d(g){if(Array.isArray(g))return v(g)}function f(g){if(typeof Symbol<"u"&&g[Symbol.iterator]!=null||g["@@iterator"]!=null)return Array.from(g)}function y(g,h){if(g){if(typeof g=="string")return v(g,h);var m=Object.prototype.toString.call(g).slice(8,-1);if(m==="Object"&&g.constructor&&(m=g.constructor.name),m==="Map"||m==="Set")return Array.from(g);if(m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m))return v(g,h)}}function v(g,h){(h==null||h>g.length)&&(h=g.length);for(var m=0,p=new Array(h);m<h;m++)p[m]=g[m];return p}function x(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var P=typeof window<"u"&&typeof window.document<"u",C=P?window:{},I=P&&C.document.documentElement?"ontouchstart"in C.document.documentElement:!1,D=P?"PointerEvent"in C:!1,q="cropper",M="all",H="crop",R="move",G="zoom",K="e",Y="w",ie="s",Q="n",oe="ne",le="nw",Ae="se",We="sw",T="".concat(q,"-crop"),A="".concat(q,"-disabled"),k="".concat(q,"-hidden"),$="".concat(q,"-hide"),j="".concat(q,"-invisible"),z="".concat(q,"-modal"),J="".concat(q,"-move"),ee="".concat(q,"Action"),ke="".concat(q,"Preview"),se="crop",ce="move",Me="none",Ne="crop",He="cropend",fi="cropmove",mi="cropstart",Yt="dblclick",er=I?"touchstart":"mousedown",Zt=I?"touchmove":"mousemove",br=I?"touchend touchcancel":"mouseup",ki=D?"pointerdown":er,Ut=D?"pointermove":Zt,Pi=D?"pointerup pointercancel":br,Ci="ready",Ct="resize",gi="wheel",tr="zoom",Fi="image/jpeg",Qt=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Jt=/^data:/,ei=/^data:image\/jpeg;base64,/,yr=/^img|canvas$/i,ir=200,en=100,fs={viewMode:0,dragMode:se,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:ir,minContainerHeight:en,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Lo='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',ms=Number.isNaN||C.isNaN;function re(g){return typeof g=="number"&&!ms(g)}var zt=function(h){return h>0&&h<1/0};function vi(g){return typeof g>"u"}function ti(g){return s(g)==="object"&&g!==null}var tn=Object.prototype.hasOwnProperty;function rr(g){if(!ti(g))return!1;try{var h=g.constructor,m=h.prototype;return h&&m&&tn.call(m,"isPrototypeOf")}catch{return!1}}function Ge(g){return typeof g=="function"}var gs=Array.prototype.slice;function Mo(g){return Array.from?Array.from(g):gs.call(g)}function ye(g,h){return g&&Ge(h)&&(Array.isArray(g)||re(g.length)?Mo(g).forEach(function(m,p){h.call(g,m,p,g)}):ti(g)&&Object.keys(g).forEach(function(m){h.call(g,g[m],m,g)})),g}var we=Object.assign||function(h){for(var m=arguments.length,p=new Array(m>1?m-1:0),E=1;E<m;E++)p[E-1]=arguments[E];return ti(h)&&p.length>0&&p.forEach(function(b){ti(b)&&Object.keys(b).forEach(function(S){h[S]=b[S]})}),h},Fl=/\.\d*(?:0|9){12}\d*$/;function Te(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Fl.test(g)?Math.round(g*h)/h:g}var sr=/^width|height|left|top|marginLeft|marginTop$/;function bi(g,h){var m=g.style;ye(h,function(p,E){sr.test(E)&&re(p)&&(p="".concat(p,"px")),m[E]=p})}function Io(g,h){return g.classList?g.classList.contains(h):g.className.indexOf(h)>-1}function Ie(g,h){if(h){if(re(g.length)){ye(g,function(p){Ie(p,h)});return}if(g.classList){g.classList.add(h);return}var m=g.className.trim();m?m.indexOf(h)<0&&(g.className="".concat(m," ").concat(h)):g.className=h}}function Ft(g,h){if(h){if(re(g.length)){ye(g,function(m){Ft(m,h)});return}if(g.classList){g.classList.remove(h);return}g.className.indexOf(h)>=0&&(g.className=g.className.replace(h,""))}}function _i(g,h,m){if(h){if(re(g.length)){ye(g,function(p){_i(p,h,m)});return}m?Ie(g,h):Ft(g,h)}}var _l=/([a-z\d])([A-Z])/g;function xt(g){return g.replace(_l,"$1-$2").toLowerCase()}function nr(g,h){return ti(g[h])?g[h]:g.dataset?g.dataset[h]:g.getAttribute("data-".concat(xt(h)))}function or(g,h,m){ti(m)?g[h]=m:g.dataset?g.dataset[h]=m:g.setAttribute("data-".concat(xt(h)),m)}function Do(g,h){if(ti(g[h]))try{delete g[h]}catch{g[h]=void 0}else if(g.dataset)try{delete g.dataset[h]}catch{g.dataset[h]=void 0}else g.removeAttribute("data-".concat(xt(h)))}var rn=/\s\s*/,sn=function(){var g=!1;if(P){var h=!1,m=function(){},p=Object.defineProperty({},"once",{get:function(){return g=!0,h},set:function(b){h=b}});C.addEventListener("test",m,p),C.removeEventListener("test",m,p)}return g}();function Be(g,h,m){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},E=m;h.trim().split(rn).forEach(function(b){if(!sn){var S=g.listeners;S&&S[b]&&S[b][m]&&(E=S[b][m],delete S[b][m],Object.keys(S[b]).length===0&&delete S[b],Object.keys(S).length===0&&delete g.listeners)}g.removeEventListener(b,E,p)})}function pt(g,h,m){var p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},E=m;h.trim().split(rn).forEach(function(b){if(p.once&&!sn){var S=g.listeners,F=S===void 0?{}:S;E=function(){delete F[b][m],g.removeEventListener(b,E,p);for(var L=arguments.length,_=new Array(L),O=0;O<L;O++)_[O]=arguments[O];m.apply(g,_)},F[b]||(F[b]={}),F[b][m]&&g.removeEventListener(b,F[b][m],p),F[b][m]=E,g.listeners=F}g.addEventListener(b,E,p)})}function Oi(g,h,m){var p;return Ge(Event)&&Ge(CustomEvent)?p=new CustomEvent(h,{detail:m,bubbles:!0,cancelable:!0}):(p=document.createEvent("CustomEvent"),p.initCustomEvent(h,!0,!0,m)),g.dispatchEvent(p)}function nn(g){var h=g.getBoundingClientRect();return{left:h.left+(window.pageXOffset-document.documentElement.clientLeft),top:h.top+(window.pageYOffset-document.documentElement.clientTop)}}var vs=C.location,Ol=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Z(g){var h=g.match(Ol);return h!==null&&(h[1]!==vs.protocol||h[2]!==vs.hostname||h[3]!==vs.port)}function w(g){var h="timestamp=".concat(new Date().getTime());return g+(g.indexOf("?")===-1?"?":"&")+h}function B(g){var h=g.rotate,m=g.scaleX,p=g.scaleY,E=g.translateX,b=g.translateY,S=[];re(E)&&E!==0&&S.push("translateX(".concat(E,"px)")),re(b)&&b!==0&&S.push("translateY(".concat(b,"px)")),re(h)&&h!==0&&S.push("rotate(".concat(h,"deg)")),re(m)&&m!==1&&S.push("scaleX(".concat(m,")")),re(p)&&p!==1&&S.push("scaleY(".concat(p,")"));var F=S.length?S.join(" "):"none";return{WebkitTransform:F,msTransform:F,transform:F}}function X(g){var h=e({},g),m=0;return ye(g,function(p,E){delete h[E],ye(h,function(b){var S=Math.abs(p.startX-b.startX),F=Math.abs(p.startY-b.startY),U=Math.abs(p.endX-b.endX),L=Math.abs(p.endY-b.endY),_=Math.sqrt(S*S+F*F),O=Math.sqrt(U*U+L*L),N=(O-_)/_;Math.abs(N)>Math.abs(m)&&(m=N)})}),m}function ve(g,h){var m=g.pageX,p=g.pageY,E={endX:m,endY:p};return h?E:e({startX:m,startY:p},E)}function Qe(g){var h=0,m=0,p=0;return ye(g,function(E){var b=E.startX,S=E.startY;h+=b,m+=S,p+=1}),h/=p,m/=p,{pageX:h,pageY:m}}function Se(g){var h=g.aspectRatio,m=g.height,p=g.width,E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",b=zt(p),S=zt(m);if(b&&S){var F=m*h;E==="contain"&&F>p||E==="cover"&&F<p?m=p/h:p=m*h}else b?m=p/h:S&&(p=m*h);return{width:p,height:m}}function ut(g){var h=g.width,m=g.height,p=g.degree;if(p=Math.abs(p)%180,p===90)return{width:m,height:h};var E=p%90*Math.PI/180,b=Math.sin(E),S=Math.cos(E),F=h*S+m*b,U=h*b+m*S;return p>90?{width:U,height:F}:{width:F,height:U}}function Ht(g,h,m,p){var E=h.aspectRatio,b=h.naturalWidth,S=h.naturalHeight,F=h.rotate,U=F===void 0?0:F,L=h.scaleX,_=L===void 0?1:L,O=h.scaleY,N=O===void 0?1:O,he=m.aspectRatio,ue=m.naturalWidth,Pe=m.naturalHeight,pe=p.fillColor,Ke=pe===void 0?"transparent":pe,Je=p.imageSmoothingEnabled,$e=Je===void 0?!0:Je,Ri=p.imageSmoothingQuality,_t=Ri===void 0?"low":Ri,V=p.maxWidth,fe=V===void 0?1/0:V,Xe=p.maxHeight,$t=Xe===void 0?1/0:Xe,Li=p.minWidth,wr=Li===void 0?0:Li,Sr=p.minHeight,lr=Sr===void 0?0:Sr,yi=document.createElement("canvas"),At=yi.getContext("2d"),Er=Se({aspectRatio:he,width:fe,height:$t}),Uo=Se({aspectRatio:he,width:wr,height:lr},"cover"),Rl=Math.min(Er.width,Math.max(Uo.width,ue)),Ll=Math.min(Er.height,Math.max(Uo.height,Pe)),gd=Se({aspectRatio:E,width:fe,height:$t}),vd=Se({aspectRatio:E,width:wr,height:lr},"cover"),bd=Math.min(gd.width,Math.max(vd.width,b)),yd=Math.min(gd.height,Math.max(vd.height,S)),Mv=[-bd/2,-yd/2,bd,yd];return yi.width=Te(Rl),yi.height=Te(Ll),At.fillStyle=Ke,At.fillRect(0,0,Rl,Ll),At.save(),At.translate(Rl/2,Ll/2),At.rotate(U*Math.PI/180),At.scale(_,N),At.imageSmoothingEnabled=$e,At.imageSmoothingQuality=_t,At.drawImage.apply(At,[g].concat(c(Mv.map(function(Iv){return Math.floor(Te(Iv))})))),At.restore(),yi}var ar=String.fromCharCode;function st(g,h,m){var p="";m+=h;for(var E=h;E<m;E+=1)p+=ar(g.getUint8(E));return p}var No=/^data:.*,/;function Bo(g){var h=g.replace(No,""),m=atob(h),p=new ArrayBuffer(m.length),E=new Uint8Array(p);return ye(E,function(b,S){E[S]=m.charCodeAt(S)}),p}function xv(g,h){for(var m=[],p=8192,E=new Uint8Array(g);E.length>0;)m.push(ar.apply(null,Mo(E.subarray(0,p)))),E=E.subarray(p);return"data:".concat(h,";base64,").concat(btoa(m.join("")))}function Av(g){var h=new DataView(g),m;try{var p,E,b;if(h.getUint8(0)===255&&h.getUint8(1)===216)for(var S=h.byteLength,F=2;F+1<S;){if(h.getUint8(F)===255&&h.getUint8(F+1)===225){E=F;break}F+=1}if(E){var U=E+4,L=E+10;if(st(h,U,4)==="Exif"){var _=h.getUint16(L);if(p=_===18761,(p||_===19789)&&h.getUint16(L+2,p)===42){var O=h.getUint32(L+4,p);O>=8&&(b=L+O)}}}if(b){var N=h.getUint16(b,p),he,ue;for(ue=0;ue<N;ue+=1)if(he=b+ue*12+2,h.getUint16(he,p)===274){he+=8,m=h.getUint16(he,p),h.setUint16(he,1,p);break}}}catch{m=1}return m}function kv(g){var h=0,m=1,p=1;switch(g){case 2:m=-1;break;case 3:h=-180;break;case 4:p=-1;break;case 5:h=90,p=-1;break;case 6:h=90;break;case 7:h=90,m=-1;break;case 8:h=-90;break}return{rotate:h,scaleX:m,scaleY:p}}var Pv={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var h=this.element,m=this.options,p=this.container,E=this.cropper,b=Number(m.minContainerWidth),S=Number(m.minContainerHeight);Ie(E,k),Ft(h,k);var F={width:Math.max(p.offsetWidth,b>=0?b:ir),height:Math.max(p.offsetHeight,S>=0?S:en)};this.containerData=F,bi(E,{width:F.width,height:F.height}),Ie(h,k),Ft(E,k)},initCanvas:function(){var h=this.containerData,m=this.imageData,p=this.options.viewMode,E=Math.abs(m.rotate)%180===90,b=E?m.naturalHeight:m.naturalWidth,S=E?m.naturalWidth:m.naturalHeight,F=b/S,U=h.width,L=h.height;h.height*F>h.width?p===3?U=h.height*F:L=h.width/F:p===3?L=h.width/F:U=h.height*F;var _={aspectRatio:F,naturalWidth:b,naturalHeight:S,width:U,height:L};this.canvasData=_,this.limited=p===1||p===2,this.limitCanvas(!0,!0),_.width=Math.min(Math.max(_.width,_.minWidth),_.maxWidth),_.height=Math.min(Math.max(_.height,_.minHeight),_.maxHeight),_.left=(h.width-_.width)/2,_.top=(h.height-_.height)/2,_.oldLeft=_.left,_.oldTop=_.top,this.initialCanvasData=we({},_)},limitCanvas:function(h,m){var p=this.options,E=this.containerData,b=this.canvasData,S=this.cropBoxData,F=p.viewMode,U=b.aspectRatio,L=this.cropped&&S;if(h){var _=Number(p.minCanvasWidth)||0,O=Number(p.minCanvasHeight)||0;F>1?(_=Math.max(_,E.width),O=Math.max(O,E.height),F===3&&(O*U>_?_=O*U:O=_/U)):F>0&&(_?_=Math.max(_,L?S.width:0):O?O=Math.max(O,L?S.height:0):L&&(_=S.width,O=S.height,O*U>_?_=O*U:O=_/U));var N=Se({aspectRatio:U,width:_,height:O});_=N.width,O=N.height,b.minWidth=_,b.minHeight=O,b.maxWidth=1/0,b.maxHeight=1/0}if(m)if(F>(L?0:1)){var he=E.width-b.width,ue=E.height-b.height;b.minLeft=Math.min(0,he),b.minTop=Math.min(0,ue),b.maxLeft=Math.max(0,he),b.maxTop=Math.max(0,ue),L&&this.limited&&(b.minLeft=Math.min(S.left,S.left+(S.width-b.width)),b.minTop=Math.min(S.top,S.top+(S.height-b.height)),b.maxLeft=S.left,b.maxTop=S.top,F===2&&(b.width>=E.width&&(b.minLeft=Math.min(0,he),b.maxLeft=Math.max(0,he)),b.height>=E.height&&(b.minTop=Math.min(0,ue),b.maxTop=Math.max(0,ue))))}else b.minLeft=-b.width,b.minTop=-b.height,b.maxLeft=E.width,b.maxTop=E.height},renderCanvas:function(h,m){var p=this.canvasData,E=this.imageData;if(m){var b=ut({width:E.naturalWidth*Math.abs(E.scaleX||1),height:E.naturalHeight*Math.abs(E.scaleY||1),degree:E.rotate||0}),S=b.width,F=b.height,U=p.width*(S/p.naturalWidth),L=p.height*(F/p.naturalHeight);p.left-=(U-p.width)/2,p.top-=(L-p.height)/2,p.width=U,p.height=L,p.aspectRatio=S/F,p.naturalWidth=S,p.naturalHeight=F,this.limitCanvas(!0,!1)}(p.width>p.maxWidth||p.width<p.minWidth)&&(p.left=p.oldLeft),(p.height>p.maxHeight||p.height<p.minHeight)&&(p.top=p.oldTop),p.width=Math.min(Math.max(p.width,p.minWidth),p.maxWidth),p.height=Math.min(Math.max(p.height,p.minHeight),p.maxHeight),this.limitCanvas(!1,!0),p.left=Math.min(Math.max(p.left,p.minLeft),p.maxLeft),p.top=Math.min(Math.max(p.top,p.minTop),p.maxTop),p.oldLeft=p.left,p.oldTop=p.top,bi(this.canvas,we({width:p.width,height:p.height},B({translateX:p.left,translateY:p.top}))),this.renderImage(h),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(h){var m=this.canvasData,p=this.imageData,E=p.naturalWidth*(m.width/m.naturalWidth),b=p.naturalHeight*(m.height/m.naturalHeight);we(p,{width:E,height:b,left:(m.width-E)/2,top:(m.height-b)/2}),bi(this.image,we({width:p.width,height:p.height},B(we({translateX:p.left,translateY:p.top},p)))),h&&this.output()},initCropBox:function(){var h=this.options,m=this.canvasData,p=h.aspectRatio||h.initialAspectRatio,E=Number(h.autoCropArea)||.8,b={width:m.width,height:m.height};p&&(m.height*p>m.width?b.height=b.width/p:b.width=b.height*p),this.cropBoxData=b,this.limitCropBox(!0,!0),b.width=Math.min(Math.max(b.width,b.minWidth),b.maxWidth),b.height=Math.min(Math.max(b.height,b.minHeight),b.maxHeight),b.width=Math.max(b.minWidth,b.width*E),b.height=Math.max(b.minHeight,b.height*E),b.left=m.left+(m.width-b.width)/2,b.top=m.top+(m.height-b.height)/2,b.oldLeft=b.left,b.oldTop=b.top,this.initialCropBoxData=we({},b)},limitCropBox:function(h,m){var p=this.options,E=this.containerData,b=this.canvasData,S=this.cropBoxData,F=this.limited,U=p.aspectRatio;if(h){var L=Number(p.minCropBoxWidth)||0,_=Number(p.minCropBoxHeight)||0,O=F?Math.min(E.width,b.width,b.width+b.left,E.width-b.left):E.width,N=F?Math.min(E.height,b.height,b.height+b.top,E.height-b.top):E.height;L=Math.min(L,E.width),_=Math.min(_,E.height),U&&(L&&_?_*U>L?_=L/U:L=_*U:L?_=L/U:_&&(L=_*U),N*U>O?N=O/U:O=N*U),S.minWidth=Math.min(L,O),S.minHeight=Math.min(_,N),S.maxWidth=O,S.maxHeight=N}m&&(F?(S.minLeft=Math.max(0,b.left),S.minTop=Math.max(0,b.top),S.maxLeft=Math.min(E.width,b.left+b.width)-S.width,S.maxTop=Math.min(E.height,b.top+b.height)-S.height):(S.minLeft=0,S.minTop=0,S.maxLeft=E.width-S.width,S.maxTop=E.height-S.height))},renderCropBox:function(){var h=this.options,m=this.containerData,p=this.cropBoxData;(p.width>p.maxWidth||p.width<p.minWidth)&&(p.left=p.oldLeft),(p.height>p.maxHeight||p.height<p.minHeight)&&(p.top=p.oldTop),p.width=Math.min(Math.max(p.width,p.minWidth),p.maxWidth),p.height=Math.min(Math.max(p.height,p.minHeight),p.maxHeight),this.limitCropBox(!1,!0),p.left=Math.min(Math.max(p.left,p.minLeft),p.maxLeft),p.top=Math.min(Math.max(p.top,p.minTop),p.maxTop),p.oldLeft=p.left,p.oldTop=p.top,h.movable&&h.cropBoxMovable&&or(this.face,ee,p.width>=m.width&&p.height>=m.height?R:M),bi(this.cropBox,we({width:p.width,height:p.height},B({translateX:p.left,translateY:p.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Oi(this.element,Ne,this.getData())}},Cv={initPreview:function(){var h=this.element,m=this.crossOrigin,p=this.options.preview,E=m?this.crossOriginUrl:this.url,b=h.alt||"The image to preview",S=document.createElement("img");if(m&&(S.crossOrigin=m),S.src=E,S.alt=b,this.viewBox.appendChild(S),this.viewBoxImage=S,!!p){var F=p;typeof p=="string"?F=h.ownerDocument.querySelectorAll(p):p.querySelector&&(F=[p]),this.previews=F,ye(F,function(U){var L=document.createElement("img");or(U,ke,{width:U.offsetWidth,height:U.offsetHeight,html:U.innerHTML}),m&&(L.crossOrigin=m),L.src=E,L.alt=b,L.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',U.innerHTML="",U.appendChild(L)})}},resetPreview:function(){ye(this.previews,function(h){var m=nr(h,ke);bi(h,{width:m.width,height:m.height}),h.innerHTML=m.html,Do(h,ke)})},preview:function(){var h=this.imageData,m=this.canvasData,p=this.cropBoxData,E=p.width,b=p.height,S=h.width,F=h.height,U=p.left-m.left-h.left,L=p.top-m.top-h.top;!this.cropped||this.disabled||(bi(this.viewBoxImage,we({width:S,height:F},B(we({translateX:-U,translateY:-L},h)))),ye(this.previews,function(_){var O=nr(_,ke),N=O.width,he=O.height,ue=N,Pe=he,pe=1;E&&(pe=N/E,Pe=b*pe),b&&Pe>he&&(pe=he/b,ue=E*pe,Pe=he),bi(_,{width:ue,height:Pe}),bi(_.getElementsByTagName("img")[0],we({width:S*pe,height:F*pe},B(we({translateX:-U*pe,translateY:-L*pe},h))))}))}},Fv={bind:function(){var h=this.element,m=this.options,p=this.cropper;Ge(m.cropstart)&&pt(h,mi,m.cropstart),Ge(m.cropmove)&&pt(h,fi,m.cropmove),Ge(m.cropend)&&pt(h,He,m.cropend),Ge(m.crop)&&pt(h,Ne,m.crop),Ge(m.zoom)&&pt(h,tr,m.zoom),pt(p,ki,this.onCropStart=this.cropStart.bind(this)),m.zoomable&&m.zoomOnWheel&&pt(p,gi,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&pt(p,Yt,this.onDblclick=this.dblclick.bind(this)),pt(h.ownerDocument,Ut,this.onCropMove=this.cropMove.bind(this)),pt(h.ownerDocument,Pi,this.onCropEnd=this.cropEnd.bind(this)),m.responsive&&pt(window,Ct,this.onResize=this.resize.bind(this))},unbind:function(){var h=this.element,m=this.options,p=this.cropper;Ge(m.cropstart)&&Be(h,mi,m.cropstart),Ge(m.cropmove)&&Be(h,fi,m.cropmove),Ge(m.cropend)&&Be(h,He,m.cropend),Ge(m.crop)&&Be(h,Ne,m.crop),Ge(m.zoom)&&Be(h,tr,m.zoom),Be(p,ki,this.onCropStart),m.zoomable&&m.zoomOnWheel&&Be(p,gi,this.onWheel,{passive:!1,capture:!0}),m.toggleDragModeOnDblclick&&Be(p,Yt,this.onDblclick),Be(h.ownerDocument,Ut,this.onCropMove),Be(h.ownerDocument,Pi,this.onCropEnd),m.responsive&&Be(window,Ct,this.onResize)}},_v={resize:function(){if(!this.disabled){var h=this.options,m=this.container,p=this.containerData,E=m.offsetWidth/p.width,b=m.offsetHeight/p.height,S=Math.abs(E-1)>Math.abs(b-1)?E:b;if(S!==1){var F,U;h.restore&&(F=this.getCanvasData(),U=this.getCropBoxData()),this.render(),h.restore&&(this.setCanvasData(ye(F,function(L,_){F[_]=L*S})),this.setCropBoxData(ye(U,function(L,_){U[_]=L*S})))}}},dblclick:function(){this.disabled||this.options.dragMode===Me||this.setDragMode(Io(this.dragBox,T)?ce:se)},wheel:function(h){var m=this,p=Number(this.options.wheelZoomRatio)||.1,E=1;this.disabled||(h.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){m.wheeling=!1},50),h.deltaY?E=h.deltaY>0?1:-1:h.wheelDelta?E=-h.wheelDelta/120:h.detail&&(E=h.detail>0?1:-1),this.zoom(-E*p,h)))},cropStart:function(h){var m=h.buttons,p=h.button;if(!(this.disabled||(h.type==="mousedown"||h.type==="pointerdown"&&h.pointerType==="mouse")&&(re(m)&&m!==1||re(p)&&p!==0||h.ctrlKey))){var E=this.options,b=this.pointers,S;h.changedTouches?ye(h.changedTouches,function(F){b[F.identifier]=ve(F)}):b[h.pointerId||0]=ve(h),Object.keys(b).length>1&&E.zoomable&&E.zoomOnTouch?S=G:S=nr(h.target,ee),Qt.test(S)&&Oi(this.element,mi,{originalEvent:h,action:S})!==!1&&(h.preventDefault(),this.action=S,this.cropping=!1,S===H&&(this.cropping=!0,Ie(this.dragBox,z)))}},cropMove:function(h){var m=this.action;if(!(this.disabled||!m)){var p=this.pointers;h.preventDefault(),Oi(this.element,fi,{originalEvent:h,action:m})!==!1&&(h.changedTouches?ye(h.changedTouches,function(E){we(p[E.identifier]||{},ve(E,!0))}):we(p[h.pointerId||0]||{},ve(h,!0)),this.change(h))}},cropEnd:function(h){if(!this.disabled){var m=this.action,p=this.pointers;h.changedTouches?ye(h.changedTouches,function(E){delete p[E.identifier]}):delete p[h.pointerId||0],m&&(h.preventDefault(),Object.keys(p).length||(this.action=""),this.cropping&&(this.cropping=!1,_i(this.dragBox,z,this.cropped&&this.options.modal)),Oi(this.element,He,{originalEvent:h,action:m}))}}},Ov={change:function(h){var m=this.options,p=this.canvasData,E=this.containerData,b=this.cropBoxData,S=this.pointers,F=this.action,U=m.aspectRatio,L=b.left,_=b.top,O=b.width,N=b.height,he=L+O,ue=_+N,Pe=0,pe=0,Ke=E.width,Je=E.height,$e=!0,Ri;!U&&h.shiftKey&&(U=O&&N?O/N:1),this.limited&&(Pe=b.minLeft,pe=b.minTop,Ke=Pe+Math.min(E.width,p.width,p.left+p.width),Je=pe+Math.min(E.height,p.height,p.top+p.height));var _t=S[Object.keys(S)[0]],V={x:_t.endX-_t.startX,y:_t.endY-_t.startY},fe=function($t){switch($t){case K:he+V.x>Ke&&(V.x=Ke-he);break;case Y:L+V.x<Pe&&(V.x=Pe-L);break;case Q:_+V.y<pe&&(V.y=pe-_);break;case ie:ue+V.y>Je&&(V.y=Je-ue);break}};switch(F){case M:L+=V.x,_+=V.y;break;case K:if(V.x>=0&&(he>=Ke||U&&(_<=pe||ue>=Je))){$e=!1;break}fe(K),O+=V.x,O<0&&(F=Y,O=-O,L-=O),U&&(N=O/U,_+=(b.height-N)/2);break;case Q:if(V.y<=0&&(_<=pe||U&&(L<=Pe||he>=Ke))){$e=!1;break}fe(Q),N-=V.y,_+=V.y,N<0&&(F=ie,N=-N,_-=N),U&&(O=N*U,L+=(b.width-O)/2);break;case Y:if(V.x<=0&&(L<=Pe||U&&(_<=pe||ue>=Je))){$e=!1;break}fe(Y),O-=V.x,L+=V.x,O<0&&(F=K,O=-O,L-=O),U&&(N=O/U,_+=(b.height-N)/2);break;case ie:if(V.y>=0&&(ue>=Je||U&&(L<=Pe||he>=Ke))){$e=!1;break}fe(ie),N+=V.y,N<0&&(F=Q,N=-N,_-=N),U&&(O=N*U,L+=(b.width-O)/2);break;case oe:if(U){if(V.y<=0&&(_<=pe||he>=Ke)){$e=!1;break}fe(Q),N-=V.y,_+=V.y,O=N*U}else fe(Q),fe(K),V.x>=0?he<Ke?O+=V.x:V.y<=0&&_<=pe&&($e=!1):O+=V.x,V.y<=0?_>pe&&(N-=V.y,_+=V.y):(N-=V.y,_+=V.y);O<0&&N<0?(F=We,N=-N,O=-O,_-=N,L-=O):O<0?(F=le,O=-O,L-=O):N<0&&(F=Ae,N=-N,_-=N);break;case le:if(U){if(V.y<=0&&(_<=pe||L<=Pe)){$e=!1;break}fe(Q),N-=V.y,_+=V.y,O=N*U,L+=b.width-O}else fe(Q),fe(Y),V.x<=0?L>Pe?(O-=V.x,L+=V.x):V.y<=0&&_<=pe&&($e=!1):(O-=V.x,L+=V.x),V.y<=0?_>pe&&(N-=V.y,_+=V.y):(N-=V.y,_+=V.y);O<0&&N<0?(F=Ae,N=-N,O=-O,_-=N,L-=O):O<0?(F=oe,O=-O,L-=O):N<0&&(F=We,N=-N,_-=N);break;case We:if(U){if(V.x<=0&&(L<=Pe||ue>=Je)){$e=!1;break}fe(Y),O-=V.x,L+=V.x,N=O/U}else fe(ie),fe(Y),V.x<=0?L>Pe?(O-=V.x,L+=V.x):V.y>=0&&ue>=Je&&($e=!1):(O-=V.x,L+=V.x),V.y>=0?ue<Je&&(N+=V.y):N+=V.y;O<0&&N<0?(F=oe,N=-N,O=-O,_-=N,L-=O):O<0?(F=Ae,O=-O,L-=O):N<0&&(F=le,N=-N,_-=N);break;case Ae:if(U){if(V.x>=0&&(he>=Ke||ue>=Je)){$e=!1;break}fe(K),O+=V.x,N=O/U}else fe(ie),fe(K),V.x>=0?he<Ke?O+=V.x:V.y>=0&&ue>=Je&&($e=!1):O+=V.x,V.y>=0?ue<Je&&(N+=V.y):N+=V.y;O<0&&N<0?(F=le,N=-N,O=-O,_-=N,L-=O):O<0?(F=We,O=-O,L-=O):N<0&&(F=oe,N=-N,_-=N);break;case R:this.move(V.x,V.y),$e=!1;break;case G:this.zoom(X(S),h),$e=!1;break;case H:if(!V.x||!V.y){$e=!1;break}Ri=nn(this.cropper),L=_t.startX-Ri.left,_=_t.startY-Ri.top,O=b.minWidth,N=b.minHeight,V.x>0?F=V.y>0?Ae:oe:V.x<0&&(L-=O,F=V.y>0?We:le),V.y<0&&(_-=N),this.cropped||(Ft(this.cropBox,k),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}$e&&(b.width=O,b.height=N,b.left=L,b.top=_,this.action=F,this.renderCropBox()),ye(S,function(Xe){Xe.startX=Xe.endX,Xe.startY=Xe.endY})}},Rv={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Ie(this.dragBox,z),Ft(this.cropBox,k),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=we({},this.initialImageData),this.canvasData=we({},this.initialCanvasData),this.cropBoxData=we({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(we(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Ft(this.dragBox,z),Ie(this.cropBox,k)),this},replace:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&h&&(this.isImg&&(this.element.src=h),m?(this.url=h,this.image.src=h,this.ready&&(this.viewBoxImage.src=h,ye(this.previews,function(p){p.getElementsByTagName("img")[0].src=h}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(h))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Ft(this.cropper,A)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,Ie(this.cropper,A)),this},destroy:function(){var h=this.element;return h[q]?(h[q]=void 0,this.isImg&&this.replaced&&(h.src=this.originalUrl),this.uncreate(),this):this},move:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,p=this.canvasData,E=p.left,b=p.top;return this.moveTo(vi(h)?h:E+Number(h),vi(m)?m:b+Number(m))},moveTo:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,p=this.canvasData,E=!1;return h=Number(h),m=Number(m),this.ready&&!this.disabled&&this.options.movable&&(re(h)&&(p.left=h,E=!0),re(m)&&(p.top=m,E=!0),E&&this.renderCanvas(!0)),this},zoom:function(h,m){var p=this.canvasData;return h=Number(h),h<0?h=1/(1-h):h=1+h,this.zoomTo(p.width*h/p.naturalWidth,null,m)},zoomTo:function(h,m,p){var E=this.options,b=this.canvasData,S=b.width,F=b.height,U=b.naturalWidth,L=b.naturalHeight;if(h=Number(h),h>=0&&this.ready&&!this.disabled&&E.zoomable){var _=U*h,O=L*h;if(Oi(this.element,tr,{ratio:h,oldRatio:S/U,originalEvent:p})===!1)return this;if(p){var N=this.pointers,he=nn(this.cropper),ue=N&&Object.keys(N).length?Qe(N):{pageX:p.pageX,pageY:p.pageY};b.left-=(_-S)*((ue.pageX-he.left-b.left)/S),b.top-=(O-F)*((ue.pageY-he.top-b.top)/F)}else rr(m)&&re(m.x)&&re(m.y)?(b.left-=(_-S)*((m.x-b.left)/S),b.top-=(O-F)*((m.y-b.top)/F)):(b.left-=(_-S)/2,b.top-=(O-F)/2);b.width=_,b.height=O,this.renderCanvas(!0)}return this},rotate:function(h){return this.rotateTo((this.imageData.rotate||0)+Number(h))},rotateTo:function(h){return h=Number(h),re(h)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=h%360,this.renderCanvas(!0,!0)),this},scaleX:function(h){var m=this.imageData.scaleY;return this.scale(h,re(m)?m:1)},scaleY:function(h){var m=this.imageData.scaleX;return this.scale(re(m)?m:1,h)},scale:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,p=this.imageData,E=!1;return h=Number(h),m=Number(m),this.ready&&!this.disabled&&this.options.scalable&&(re(h)&&(p.scaleX=h,E=!0),re(m)&&(p.scaleY=m,E=!0),E&&this.renderCanvas(!0,!0)),this},getData:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,m=this.options,p=this.imageData,E=this.canvasData,b=this.cropBoxData,S;if(this.ready&&this.cropped){S={x:b.left-E.left,y:b.top-E.top,width:b.width,height:b.height};var F=p.width/p.naturalWidth;if(ye(S,function(_,O){S[O]=_/F}),h){var U=Math.round(S.y+S.height),L=Math.round(S.x+S.width);S.x=Math.round(S.x),S.y=Math.round(S.y),S.width=L-S.x,S.height=U-S.y}}else S={x:0,y:0,width:0,height:0};return m.rotatable&&(S.rotate=p.rotate||0),m.scalable&&(S.scaleX=p.scaleX||1,S.scaleY=p.scaleY||1),S},setData:function(h){var m=this.options,p=this.imageData,E=this.canvasData,b={};if(this.ready&&!this.disabled&&rr(h)){var S=!1;m.rotatable&&re(h.rotate)&&h.rotate!==p.rotate&&(p.rotate=h.rotate,S=!0),m.scalable&&(re(h.scaleX)&&h.scaleX!==p.scaleX&&(p.scaleX=h.scaleX,S=!0),re(h.scaleY)&&h.scaleY!==p.scaleY&&(p.scaleY=h.scaleY,S=!0)),S&&this.renderCanvas(!0,!0);var F=p.width/p.naturalWidth;re(h.x)&&(b.left=h.x*F+E.left),re(h.y)&&(b.top=h.y*F+E.top),re(h.width)&&(b.width=h.width*F),re(h.height)&&(b.height=h.height*F),this.setCropBoxData(b)}return this},getContainerData:function(){return this.ready?we({},this.containerData):{}},getImageData:function(){return this.sized?we({},this.imageData):{}},getCanvasData:function(){var h=this.canvasData,m={};return this.ready&&ye(["left","top","width","height","naturalWidth","naturalHeight"],function(p){m[p]=h[p]}),m},setCanvasData:function(h){var m=this.canvasData,p=m.aspectRatio;return this.ready&&!this.disabled&&rr(h)&&(re(h.left)&&(m.left=h.left),re(h.top)&&(m.top=h.top),re(h.width)?(m.width=h.width,m.height=h.width/p):re(h.height)&&(m.height=h.height,m.width=h.height*p),this.renderCanvas(!0)),this},getCropBoxData:function(){var h=this.cropBoxData,m;return this.ready&&this.cropped&&(m={left:h.left,top:h.top,width:h.width,height:h.height}),m||{}},setCropBoxData:function(h){var m=this.cropBoxData,p=this.options.aspectRatio,E,b;return this.ready&&this.cropped&&!this.disabled&&rr(h)&&(re(h.left)&&(m.left=h.left),re(h.top)&&(m.top=h.top),re(h.width)&&h.width!==m.width&&(E=!0,m.width=h.width),re(h.height)&&h.height!==m.height&&(b=!0,m.height=h.height),p&&(E?m.height=m.width/p:b&&(m.width=m.height*p)),this.renderCropBox()),this},getCroppedCanvas:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var m=this.canvasData,p=Ht(this.image,this.imageData,m,h);if(!this.cropped)return p;var E=this.getData(h.rounded),b=E.x,S=E.y,F=E.width,U=E.height,L=p.width/Math.floor(m.naturalWidth);L!==1&&(b*=L,S*=L,F*=L,U*=L);var _=F/U,O=Se({aspectRatio:_,width:h.maxWidth||1/0,height:h.maxHeight||1/0}),N=Se({aspectRatio:_,width:h.minWidth||0,height:h.minHeight||0},"cover"),he=Se({aspectRatio:_,width:h.width||(L!==1?p.width:F),height:h.height||(L!==1?p.height:U)}),ue=he.width,Pe=he.height;ue=Math.min(O.width,Math.max(N.width,ue)),Pe=Math.min(O.height,Math.max(N.height,Pe));var pe=document.createElement("canvas"),Ke=pe.getContext("2d");pe.width=Te(ue),pe.height=Te(Pe),Ke.fillStyle=h.fillColor||"transparent",Ke.fillRect(0,0,ue,Pe);var Je=h.imageSmoothingEnabled,$e=Je===void 0?!0:Je,Ri=h.imageSmoothingQuality;Ke.imageSmoothingEnabled=$e,Ri&&(Ke.imageSmoothingQuality=Ri);var _t=p.width,V=p.height,fe=b,Xe=S,$t,Li,wr,Sr,lr,yi;fe<=-F||fe>_t?(fe=0,$t=0,wr=0,lr=0):fe<=0?(wr=-fe,fe=0,$t=Math.min(_t,F+fe),lr=$t):fe<=_t&&(wr=0,$t=Math.min(F,_t-fe),lr=$t),$t<=0||Xe<=-U||Xe>V?(Xe=0,Li=0,Sr=0,yi=0):Xe<=0?(Sr=-Xe,Xe=0,Li=Math.min(V,U+Xe),yi=Li):Xe<=V&&(Sr=0,Li=Math.min(U,V-Xe),yi=Li);var At=[fe,Xe,$t,Li];if(lr>0&&yi>0){var Er=ue/F;At.push(wr*Er,Sr*Er,lr*Er,yi*Er)}return Ke.drawImage.apply(Ke,[p].concat(c(At.map(function(Uo){return Math.floor(Te(Uo))})))),pe},setAspectRatio:function(h){var m=this.options;return!this.disabled&&!vi(h)&&(m.aspectRatio=Math.max(0,h)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(h){var m=this.options,p=this.dragBox,E=this.face;if(this.ready&&!this.disabled){var b=h===se,S=m.movable&&h===ce;h=b||S?h:Me,m.dragMode=h,or(p,ee,h),_i(p,T,b),_i(p,J,S),m.cropBoxMovable||(or(E,ee,h),_i(E,T,b),_i(E,J,S))}return this}},Lv=C.Cropper,md=function(){function g(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n(this,g),!h||!yr.test(h.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=h,this.options=we({},fs,rr(m)&&m),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return a(g,[{key:"init",value:function(){var m=this.element,p=m.tagName.toLowerCase(),E;if(!m[q]){if(m[q]=this,p==="img"){if(this.isImg=!0,E=m.getAttribute("src")||"",this.originalUrl=E,!E)return;E=m.src}else p==="canvas"&&window.HTMLCanvasElement&&(E=m.toDataURL());this.load(E)}}},{key:"load",value:function(m){var p=this;if(m){this.url=m,this.imageData={};var E=this.element,b=this.options;if(!b.rotatable&&!b.scalable&&(b.checkOrientation=!1),!b.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Jt.test(m)){ei.test(m)?this.read(Bo(m)):this.clone();return}var S=new XMLHttpRequest,F=this.clone.bind(this);this.reloading=!0,this.xhr=S,S.onabort=F,S.onerror=F,S.ontimeout=F,S.onprogress=function(){S.getResponseHeader("content-type")!==Fi&&S.abort()},S.onload=function(){p.read(S.response)},S.onloadend=function(){p.reloading=!1,p.xhr=null},b.checkCrossOrigin&&Z(m)&&E.crossOrigin&&(m=w(m)),S.open("GET",m,!0),S.responseType="arraybuffer",S.withCredentials=E.crossOrigin==="use-credentials",S.send()}}},{key:"read",value:function(m){var p=this.options,E=this.imageData,b=Av(m),S=0,F=1,U=1;if(b>1){this.url=xv(m,Fi);var L=kv(b);S=L.rotate,F=L.scaleX,U=L.scaleY}p.rotatable&&(E.rotate=S),p.scalable&&(E.scaleX=F,E.scaleY=U),this.clone()}},{key:"clone",value:function(){var m=this.element,p=this.url,E=m.crossOrigin,b=p;this.options.checkCrossOrigin&&Z(p)&&(E||(E="anonymous"),b=w(p)),this.crossOrigin=E,this.crossOriginUrl=b;var S=document.createElement("img");E&&(S.crossOrigin=E),S.src=b||p,S.alt=m.alt||"The image to crop",this.image=S,S.onload=this.start.bind(this),S.onerror=this.stop.bind(this),Ie(S,$),m.parentNode.insertBefore(S,m.nextSibling)}},{key:"start",value:function(){var m=this,p=this.image;p.onload=null,p.onerror=null,this.sizing=!0;var E=C.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(C.navigator.userAgent),b=function(L,_){we(m.imageData,{naturalWidth:L,naturalHeight:_,aspectRatio:L/_}),m.initialImageData=we({},m.imageData),m.sizing=!1,m.sized=!0,m.build()};if(p.naturalWidth&&!E){b(p.naturalWidth,p.naturalHeight);return}var S=document.createElement("img"),F=document.body||document.documentElement;this.sizingImage=S,S.onload=function(){b(S.width,S.height),E||F.removeChild(S)},S.src=p.src,E||(S.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",F.appendChild(S))}},{key:"stop",value:function(){var m=this.image;m.onload=null,m.onerror=null,m.parentNode.removeChild(m),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var m=this.element,p=this.options,E=this.image,b=m.parentNode,S=document.createElement("div");S.innerHTML=Lo;var F=S.querySelector(".".concat(q,"-container")),U=F.querySelector(".".concat(q,"-canvas")),L=F.querySelector(".".concat(q,"-drag-box")),_=F.querySelector(".".concat(q,"-crop-box")),O=_.querySelector(".".concat(q,"-face"));this.container=b,this.cropper=F,this.canvas=U,this.dragBox=L,this.cropBox=_,this.viewBox=F.querySelector(".".concat(q,"-view-box")),this.face=O,U.appendChild(E),Ie(m,k),b.insertBefore(F,m.nextSibling),Ft(E,$),this.initPreview(),this.bind(),p.initialAspectRatio=Math.max(0,p.initialAspectRatio)||NaN,p.aspectRatio=Math.max(0,p.aspectRatio)||NaN,p.viewMode=Math.max(0,Math.min(3,Math.round(p.viewMode)))||0,Ie(_,k),p.guides||Ie(_.getElementsByClassName("".concat(q,"-dashed")),k),p.center||Ie(_.getElementsByClassName("".concat(q,"-center")),k),p.background&&Ie(F,"".concat(q,"-bg")),p.highlight||Ie(O,j),p.cropBoxMovable&&(Ie(O,J),or(O,ee,M)),p.cropBoxResizable||(Ie(_.getElementsByClassName("".concat(q,"-line")),k),Ie(_.getElementsByClassName("".concat(q,"-point")),k)),this.render(),this.ready=!0,this.setDragMode(p.dragMode),p.autoCrop&&this.crop(),this.setData(p.data),Ge(p.ready)&&pt(m,Ci,p.ready,{once:!0}),Oi(m,Ci)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var m=this.cropper.parentNode;m&&m.removeChild(this.cropper),Ft(this.element,k)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=Lv,g}},{key:"setDefaults",value:function(m){we(fs,rr(m)&&m)}}])}();return we(md.prototype,Pv,Cv,Fv,_v,Ov,Rv),md})});var Ml=class{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let t=$v(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,s=t.index;return r<s?-1:r>s?1:0})}};function $v(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:e}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var Il=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:r,eventOptions:s}=e,n=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,s);n.delete(o),n.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:s}=e;return this.fetchEventListener(t,r,s)}fetchEventListener(e,t,r){let s=this.fetchEventListenerMapForEventTarget(e),n=this.cacheKey(t,r),o=s.get(n);return o||(o=this.createEventListener(e,t,r),s.set(n,o)),o}createEventListener(e,t,r){let s=new Ml(e,t,r);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(s=>{r.push(`${t[s]?"":"!"}${s}`)}),r.join(":")}},qv={stop({event:i,value:e}){return e&&i.stopPropagation(),!0},prevent({event:i,value:e}){return e&&i.preventDefault(),!0},self({event:i,value:e,element:t}){return e?t===i.target:!0}},Vv=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function jv(i){let t=i.trim().match(Vv)||[],r=t[2],s=t[3];return s&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${s}`,s=""),{eventTarget:Wv(t[4]),eventName:r,eventOptions:t[7]?Gv(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||s}}function Wv(i){if(i=="window")return window;if(i=="document")return document}function Gv(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function Kv(i){if(i==window)return"window";if(i==document)return"document"}function rc(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function Dl(i){return rc(i.replace(/--/g,"-").replace(/__/g,"_"))}function an(i){return i.charAt(0).toUpperCase()+i.slice(1)}function _d(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Xv(i){return i.match(/[^\s]+/g)||[]}function Sd(i){return i!=null}function Nl(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var Ed=["meta","ctrl","alt","shift"],Bl=class{constructor(e,t,r,s){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||Yv(e)||zo("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||zo("missing identifier"),this.methodName=r.methodName||zo("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=s}static forToken(e,t){return new this(e.element,e.index,jv(e.content),t)}toString(){let e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let r=t.filter(s=>!Ed.includes(s))[0];return r?(Nl(this.keyMappings,r)||zo(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:r,value:s}of Array.from(this.element.attributes)){let n=r.match(t),o=n&&n[1];o&&(e[rc(o)]=Zv(s))}return e}get eventTargetName(){return Kv(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,s,n,o]=Ed.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==s||e.altKey!==n||e.shiftKey!==o}},Td={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Yv(i){let e=i.tagName.toLowerCase();if(e in Td)return Td[e](i)}function zo(i){throw new Error(i)}function Zv(i){try{return JSON.parse(i)}catch{return i}}var Ul=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:s}=this.context,n=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let l=r[o];n=n&&l({name:o,value:a,event:e,element:t,controller:s})}else continue;return n}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(s){let{identifier:n,controller:o,element:a,index:l}=this,c={identifier:n,controller:o,element:a,index:l,event:e};this.context.handleError(s,`invoking action "${this.action}"`,c)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0:t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},Ho=class{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.processTree(r,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}},$o=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new Ho(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}};function Qv(i,e,t){Od(i,e).add(t)}function Jv(i,e,t){Od(i,e).delete(t),eb(i,e)}function Od(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function eb(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var Mi=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t.concat(Array.from(r)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t+r.size,0)}add(e,t){Qv(this.valuesByKey,e,t)}delete(e,t){Jv(this.valuesByKey,e,t)}has(e,t){let r=this.valuesByKey.get(e);return r!=null&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(r=>r.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([t,r])=>t)}};var zl=class{constructor(e,t,r,s){this._selector=t,this.details=s,this.elementObserver=new Ho(e,this),this.delegate=r,this.matchesByElement=new Mi}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){let{selector:t}=this;if(t){let r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let r=this.matchElement(e)?[e]:[],s=Array.from(e.querySelectorAll(t)).filter(n=>this.matchElement(n));return r.concat(s)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){let{selector:r}=this;if(r){let s=this.matchElement(e),n=this.matchesByElement.has(r,e);s&&!n?this.selectorMatched(e,r):!s&&n&&this.selectorUnmatched(e,r)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}},Hl=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);let s=this.element.getAttribute(e);if(this.stringMap.get(e)!=s&&this.stringMapValueChanged(s,r,t),s==null){let n=this.stringMap.get(e);this.stringMap.delete(e),n&&this.stringMapKeyRemoved(r,e,n)}else this.stringMap.set(e,s)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}},qo=class{constructor(e,t,r){this.attributeObserver=new $o(e,t,this),this.delegate=r,this.tokensByElement=new Mi}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),s=ib(t,r).findIndex(([n,o])=>!rb(n,o));return s==-1?[[],[]]:[t.slice(s),r.slice(s)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return tb(r,e,t)}};function tb(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,s)=>({element:e,attributeName:t,content:r,index:s}))}function ib(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,s)=>[i[s],e[s]])}function rb(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var Vo=class{constructor(e,t,r){this.tokenListObserver=new qo(e,t,this),this.delegate=r,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(t){return{error:t}}}},$l=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new Vo(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){let t=new Ul(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){let t=Bl.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},ql=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new Hl(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){let r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){let s=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=s.writer(s.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let s=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,s.writer(this.receiver[e]),r):this.invokeChangedCallback(e,s.writer(s.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:s}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,s(r),void 0)}invokeChangedCallback(e,t,r){let s=`${e}Changed`,n=this.receiver[s];if(typeof n=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(t),l=r;r&&(l=o.reader(r)),n.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let r=this.valueDescriptorMap[t];e[r.name]=r}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],r=`has${an(t.name)}`;return this.receiver[r]}},Vl=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Mi}start(){this.tokenListObserver||(this.tokenListObserver=new qo(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}};function ln(i,e){let t=Rd(i);return Array.from(t.reduce((r,s)=>(nb(s,e).forEach(n=>r.add(n)),r),new Set))}function sb(i,e){return Rd(i).reduce((r,s)=>(r.push(...ob(s,e)),r),[])}function Rd(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function nb(i,e){let t=i[e];return Array.isArray(t)?t:[]}function ob(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var jl=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Mi,this.outletElementsByName=new Mi,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:r}){let s=this.getOutlet(e,r);s&&this.connectOutlet(s,e,r)}selectorUnmatched(e,t,{outletName:r}){let s=this.getOutletFromMap(e,r);s&&this.disconnectOutlet(s,e,r)}selectorMatchElement(e,{outletName:t}){let r=this.selector(t),s=this.hasOutlet(e,t),n=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return r?s&&n&&e.matches(r):!1}elementMatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var s;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),(s=this.selectorObserverMap.get(r))===null||s===void 0||s.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var s;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),(s=this.selectorObserverMap.get(r))===null||s===void 0||s.pause(()=>this.delegate.outletDisconnected(e,t,r)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),r=new zl(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new $o(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){let e=new Mi;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;ln(r,"outlets").forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(r=>r.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}},Wl=class{constructor(e,t){this.logDebugActivity=(r,s={})=>{let{identifier:n,controller:o,element:a}=this;s=Object.assign({identifier:n,controller:o,element:a},s),this.application.logDebugActivity(this.identifier,r,s)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new $l(this,this.dispatcher),this.valueObserver=new ql(this,this.controller),this.targetObserver=new Vl(this,this),this.outletObserver=new jl(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(r){this.handleError(r,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,r={}){let{identifier:s,controller:n,element:o}=this;r=Object.assign({identifier:s,controller:n,element:o},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${Dl(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${Dl(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function ab(i){return lb(i,cb(i))}function lb(i,e){let t=pb(i),r=ub(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function cb(i){return ln(i,"blessings").reduce((t,r)=>{let s=r(i);for(let n in s){let o=t[n]||{};t[n]=Object.assign(o,s[n])}return t},{})}function ub(i,e){return db(e).reduce((t,r)=>{let s=hb(i,e,r);return s&&Object.assign(t,{[r]:s}),t},{})}function hb(i,e,t){let r=Object.getOwnPropertyDescriptor(i,t);if(!(r&&"value"in r)){let n=Object.getOwnPropertyDescriptor(e,t).value;return r&&(n.get=r.get||n.get,n.set=r.set||n.set),n}}var db=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,pb=(()=>{function i(t){function r(){return Reflect.construct(t,arguments,new.target)}return r.prototype=Object.create(t.prototype,{constructor:{value:r}}),Reflect.setPrototypeOf(r,t),r}function e(){let r=i(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return e(),i}catch{return r=>class extends r{}}})();function fb(i){return{identifier:i.identifier,controllerConstructor:ab(i.controllerConstructor)}}var Gl=class{constructor(e,t){this.application=e,this.definition=fb(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Wl(this,e),this.contextsByScope.set(e,t)),t}},Kl=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return Xv(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Xl=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${_d(e)}`}},Yl=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let s=this.warnedKeysByObject.get(e);s||(s=new Set,this.warnedKeysByObject.set(e,s)),s.has(t)||(s.add(t),this.logger.warn(r,e))}};function Zl(i,e){return`[${i}~="${e}"]`}var Ql=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findTarget(r)||this.findLegacyTarget(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllTargets(r),...this.findAllLegacyTargets(r)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return Zl(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(r=>this.deprecate(r,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return Zl(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,s=this.schema.targetAttribute,n=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${s}="${r}.${t}" with ${n}="${t}". The ${s} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},Jl=class{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findOutlet(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllOutlets(r)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(s=>this.matchesElement(s,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(s=>this.matchesElement(s,e,t))}matchesElement(e,t,r){let s=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&s.split(" ").includes(r)}},ec=class i{constructor(e,t,r,s){this.targets=new Ql(this),this.classes=new Kl(this),this.data=new Xl(this),this.containsElement=n=>n.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new Yl(s),this.outlets=new Jl(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return Zl(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(this.schema,document.documentElement,this.identifier,this.guide.logger)}},tc=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new Vo(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){let{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){let r=this.fetchScopesByIdentifierForElement(e),s=r.get(t);return s||(s=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,s)),s}elementMatchedValue(e,t){let r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),r==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),r==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},ic=class{constructor(e){this.application=e,this.scopeObserver=new tc(this.element,this.schema,this),this.scopesByIdentifier=new Mi,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let t=new Gl(this.application,e);this.connectModule(t);let r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(s=>s.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new ec(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.connectContextForScope(r))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.disconnectContextForScope(r))}},mb={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:i=>`data-${i}-target`,outletAttributeForScope:(i,e)=>`data-${i}-${e}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},xd("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),xd("0123456789".split("").map(i=>[i,i])))};function xd(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var jo=class{constructor(e=document.documentElement,t=mb){this.logger=console,this.debug=!1,this.logDebugActivity=(r,s,n={})=>{this.debug&&this.logFormattedMessage(r,s,n)},this.element=e,this.schema=t,this.dispatcher=new Il(this),this.router=new ic(this),this.actionDescriptorFilters=Object.assign({},qv)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await gb(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(s=>{s.controllerConstructor.shouldLoad&&this.router.loadDefinition(s)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(s=>this.router.unloadIdentifier(s))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var s;this.logger.error(`%s
2
3
 
3
4
  %o
4
5
 
5
- %o`,t,e,r),(n=window.onerror)===null||n===void 0||n.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}};function pc(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function fc(i){return Ei(i,"classes").reduce((t,r)=>Object.assign(t,mc(r)),{})}function mc(i){return{[`${i}Class`]:{get(){let{classes:e}=this;if(e.has(i))return e.get(i);{let t=e.getAttributeName(i);throw new Error(`Missing attribute "${t}"`)}}},[`${i}Classes`]:{get(){return this.classes.getAll(i)}},[`has${wi(i)}Class`]:{get(){return this.classes.has(i)}}}}function gc(i){return Ei(i,"outlets").reduce((t,r)=>Object.assign(t,vc(r)),{})}function Io(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function Oo(i,e,t){let r=Io(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Io(i,e,t),r))return r}function vc(i){let e=Tn(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let n=Oo(this,t,i);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(i);return t.length>0?t.map(r=>{let n=Oo(this,r,i);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`,r)}).filter(r=>r):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t)return t;throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(i)}},[`has${wi(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function bc(i){return Ei(i,"targets").reduce((t,r)=>Object.assign(t,yc(r)),{})}function yc(i){return{[`${i}Target`]:{get(){let e=this.targets.find(i);if(e)return e;throw new Error(`Missing target element "${i}" for "${this.identifier}" controller`)}},[`${i}Targets`]:{get(){return this.targets.findAll(i)}},[`has${wi(i)}Target`]:{get(){return this.targets.has(i)}}}}function wc(i){let e=tc(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,n)=>{let s=No(n,this.identifier),o=this.data.getAttributeNameForKey(s.key);return Object.assign(r,{[o]:s})},{})}}};return e.reduce((r,n)=>Object.assign(r,Ec(n)),t)}function Ec(i,e){let t=No(i,e),{key:r,name:n,reader:s,writer:o}=t;return{[n]:{get(){let a=this.data.get(r);return a!==null?s(a):t.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${wi(n)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function No([i,e],t){return Tc({controller:t,token:i,typeDefinition:e})}function rr(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function yi(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(i))return"array";if(Object.prototype.toString.call(i)==="[object Object]")return"object"}function _c(i){let{controller:e,token:t,typeObject:r}=i,n=ko(r.type),s=ko(r.default),o=n&&s,a=n&&!s,l=!n&&s,d=rr(r.type),p=yi(i.typeObject.default);if(a)return d;if(l)return p;if(d!==p){let m=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${m}" must match the defined type "${d}". The provided default value of "${r.default}" is of type "${p}".`)}if(o)return d}function Ac(i){let{controller:e,token:t,typeDefinition:r}=i,s=_c({controller:e,token:t,typeObject:r}),o=yi(r),a=rr(r),l=s||o||a;if(l)return l;let d=e?`${e}.${r}`:t;throw new Error(`Unknown value type "${d}" for "${t}" value`)}function Sc(i){let e=rr(i);if(e)return Ro[e];let t=kn(i,"default"),r=kn(i,"type"),n=i;if(t)return n.default;if(r){let{type:s}=n,o=rr(s);if(o)return Ro[o]}return i}function Tc(i){let{token:e,typeDefinition:t}=i,r=`${Do(e)}-value`,n=Ac(i);return{type:n,key:r,name:Wn(r),get defaultValue(){return Sc(t)},get hasCustomDefaultValue(){return yi(t)!==void 0},reader:kc[n],writer:Mo[n]||Mo.default}}var Ro={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},kc={array(i){let e=JSON.parse(i);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${i}" of type "${yi(e)}"`);return e},boolean(i){return!(i=="0"||String(i).toLowerCase()=="false")},number(i){return Number(i.replace(/_/g,""))},object(i){let e=JSON.parse(i);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${i}" of type "${yi(e)}"`);return e},string(i){return i}},Mo={default:xc,array:Po,object:Po};function Po(i){return JSON.stringify(i)}function xc(i){return`${i}`}var T=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:n=this.identifier,bubbles:s=!0,cancelable:o=!0}={}){let a=n?`${n}:${e}`:e,l=new CustomEvent(a,{detail:r,bubbles:s,cancelable:o});return t.dispatchEvent(l),l}};T.blessings=[fc,bc,wc,gc];T.targets=[];T.outlets=[];T.values={};var nr=class extends T{connect(){console.log(`resource-layout connected: ${this.element}`)}};var sr=class extends T{connect(){console.log(`nav-grid-menu-item connected: ${this.element}`)}};var or=class extends T{connect(){console.log(`nav-grid-menu connected: ${this.element}`)}};var ar=class extends T{connect(){console.log(`nav-user-section connected: ${this.element}`)}};var lr=class extends T{connect(){console.log(`nav-user-link connected: ${this.element}`)}};var cr=class extends T{connect(){console.log(`nav-user connected: ${this.element}`)}};var ur=class extends T{static targets=["openIcon","closeIcon"];static outlets=["sidebar"];static values={placement:{type:String,default:"left"},bodyScrolling:{type:Boolean,default:!1},backdrop:{type:Boolean,default:!0},edge:{type:Boolean,default:!1},edgeOffset:{type:String,default:"bottom-[60px]"}};static classes={backdrop:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30"};initialize(){this.visible=!1,this.handleEscapeKey=this.handleEscapeKey.bind(this)}connect(){document.addEventListener("keydown",this.handleEscapeKey)}sidebarOutletConnected(){this.#e(this.sidebarOutlet.element)}disconnect(){this.#i(),document.removeEventListener("keydown",this.handleEscapeKey),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden")}#e(i){i.setAttribute("aria-hidden","true"),i.classList.add("transition-transform"),this.#n(this.placementValue).base.forEach(e=>{i.classList.add(e)})}toggleDrawer(){this.visible?this.hideDrawer():this.showDrawer()}showDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!0):this.#s(this.placementValue,!0),this.openIconTarget.classList.add("hidden"),this.openIconTarget.setAttribute("aria-hidden","true"),this.closeIconTarget.classList.remove("hidden"),this.closeIconTarget.setAttribute("aria-hidden","false"),this.sidebarOutlet.element.setAttribute("aria-modal","true"),this.sidebarOutlet.element.setAttribute("role","dialog"),this.sidebarOutlet.element.removeAttribute("aria-hidden"),this.bodyScrollingValue||document.body.classList.add("overflow-hidden"),this.backdropValue&&this.#t(),this.visible=!0,this.dispatch("show")}hideDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!1):this.#s(this.placementValue,!1),this.openIconTarget.classList.remove("hidden"),this.openIconTarget.setAttribute("aria-hidden","false"),this.closeIconTarget.classList.add("hidden"),this.closeIconTarget.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.removeAttribute("aria-modal"),this.sidebarOutlet.element.removeAttribute("role"),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden"),this.backdropValue&&this.#i(),this.visible=!1,this.dispatch("hide")}handleEscapeKey(i){i.key==="Escape"&&this.visible&&this.hideDrawer()}#t(){if(!this.visible){let i=document.createElement("div");i.setAttribute("data-drawer-backdrop",""),i.classList.add(...this.constructor.classes.backdrop.split(" ")),i.addEventListener("click",()=>this.hideDrawer()),document.body.appendChild(i)}}#i(){let i=document.querySelector("[data-drawer-backdrop]");i&&i.remove()}#n(i){let e={top:{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]},right:{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]},bottom:{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]},left:{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]},"bottom-edge":{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this.edgeOffsetValue]}};return e[i]||e.left}#s(i,e){let t=this.#n(i);e?(t.active.forEach(r=>this.sidebarOutlet.element.classList.add(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.remove(r))):(t.active.forEach(r=>this.sidebarOutlet.element.classList.remove(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.add(r)))}#r(i,e){this.#s(i,e)}};var hr=class extends T{connect(){console.log(`sidebar-menu-item connected: ${this.element}`)}};var dr=class extends T{connect(){console.log(`sidebar-menu connected: ${this.element}`)}};var pr=class extends T{connect(){console.log(`sidebar connected: ${this.element}`)}};var fr=class extends T{connect(){console.log(`has-many-panel connected: ${this.element}`)}};var mr=class extends T{static targets=["target","template","addButton"];static values={wrapperSelector:{type:String,default:".nested-resource-form-fields"},limit:Number};connect(){this.updateState()}add(i){i.preventDefault();let e=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,new Date().getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",e);let t=new CustomEvent("nested-resource-form-fields:add",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}remove(i){i.preventDefault();let e=i.target.closest(this.wrapperSelectorValue);if(e.dataset.newRecord!==void 0)e.remove();else{e.style.display="none",e.classList.remove(...e.classList);let r=e.querySelector("input[name*='_destroy']");r.value="1"}let t=new CustomEvent("nested-resource-form-fields:remove",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}updateState(){!this.hasAddButtonTarget||this.limitValue==0||(this.childCount>=this.limitValue?this.addButtonTarget.style.display="none":this.addButtonTarget.style.display="initial")}get childCount(){return this.element.querySelectorAll(this.wrapperSelectorValue).length}};var gr=class extends T{connect(){console.log(`toolbar connected: ${this.element}`)}};var vr=class extends T{connect(){console.log(`table-search-input connected: ${this.element}`)}};var br=class extends T{connect(){console.log(`table-toolbar connected: ${this.element}`)}};var yr=class extends T{connect(){console.log(`table connected: ${this.element}`)}};var ef=Nl(Vo(),1),wr=class extends T{connect(){console.log(`form connected: ${this.element}`)}submit(){this.element.requestSubmit()}};var Uc=function(){function i(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return i.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},i}(),$o=Uc;var Wc=function(){function i(){this._instances={Accordion:{},Carousel:{},Collapse:{},Dial:{},Dismiss:{},Drawer:{},Dropdown:{},Modal:{},Popover:{},Tabs:{},Tooltip:{},InputCounter:{},CopyClipboard:{}}}return i.prototype.addInstance=function(e,t,r,n){if(n===void 0&&(n=!1),!this._instances[e])return console.warn("Flowbite: Component ".concat(e," does not exist.")),!1;if(this._instances[e][r]&&!n){console.warn("Flowbite: Instance with ID ".concat(r," already exists."));return}n&&this._instances[e][r]&&this._instances[e][r].destroyAndRemoveInstance(),this._instances[e][r||this._generateRandomId()]=t},i.prototype.getAllInstances=function(){return this._instances},i.prototype.getInstances=function(e){return this._instances[e]?this._instances[e]:(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i.prototype.getInstance=function(e,t){if(this._componentAndInstanceCheck(e,t)){if(!this._instances[e][t]){console.warn("Flowbite: Instance with ID ".concat(t," does not exist."));return}return this._instances[e][t]}},i.prototype.destroyAndRemoveInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&(this.destroyInstanceObject(e,t),this.removeInstance(e,t))},i.prototype.removeInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&delete this._instances[e][t]},i.prototype.destroyInstanceObject=function(e,t){this._componentAndInstanceCheck(e,t)&&this._instances[e][t].destroy()},i.prototype.instanceExists=function(e,t){return!(!this._instances[e]||!this._instances[e][t])},i.prototype._generateRandomId=function(){return Math.random().toString(36).substr(2,9)},i.prototype._componentAndInstanceCheck=function(e,t){return this._instances[e]?this._instances[e][t]?!0:(console.warn("Flowbite: Instance with ID ".concat(t," does not exist.")),!1):(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i}(),jo=new Wc,I=jo;typeof window<"u"&&(window.FlowbiteInstances=jo);var Er=function(){return Er=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Er.apply(this,arguments)},_r={alwaysOpen:!1,activeClasses:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",inactiveClasses:"text-gray-500 dark:text-gray-400",onOpen:function(){},onClose:function(){},onToggle:function(){}},Kc={id:null,override:!0},Uo=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=_r),n===void 0&&(n=Kc),this._instanceId=n.id?n.id:e.id,this._accordionEl=e,this._items=t,this._options=Er(Er({},_r),r),this._initialized=!1,this.init(),I.addInstance("Accordion",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.forEach(function(t){t.active&&e.open(t.id);var r=function(){e.toggle(t.id)};t.triggerEl.addEventListener("click",r),t.clickHandler=r}),this._initialized=!0)},i.prototype.destroy=function(){this._items.length&&this._initialized&&(this._items.forEach(function(e){e.triggerEl.removeEventListener("click",e.clickHandler),delete e.clickHandler}),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Accordion",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.open=function(e){var t,r,n=this,s=this.getItem(e);this._options.alwaysOpen||this._items.map(function(o){var a,l;o!==s&&((a=o.triggerEl.classList).remove.apply(a,n._options.activeClasses.split(" ")),(l=o.triggerEl.classList).add.apply(l,n._options.inactiveClasses.split(" ")),o.targetEl.classList.add("hidden"),o.triggerEl.setAttribute("aria-expanded","false"),o.active=!1,o.iconEl&&o.iconEl.classList.add("rotate-180"))}),(t=s.triggerEl.classList).add.apply(t,this._options.activeClasses.split(" ")),(r=s.triggerEl.classList).remove.apply(r,this._options.inactiveClasses.split(" ")),s.triggerEl.setAttribute("aria-expanded","true"),s.targetEl.classList.remove("hidden"),s.active=!0,s.iconEl&&s.iconEl.classList.remove("rotate-180"),this._options.onOpen(this,s)},i.prototype.toggle=function(e){var t=this.getItem(e);t.active?this.close(e):this.open(e),this._options.onToggle(this,t)},i.prototype.close=function(e){var t,r,n=this.getItem(e);(t=n.triggerEl.classList).remove.apply(t,this._options.activeClasses.split(" ")),(r=n.triggerEl.classList).add.apply(r,this._options.inactiveClasses.split(" ")),n.targetEl.classList.add("hidden"),n.triggerEl.setAttribute("aria-expanded","false"),n.active=!1,n.iconEl&&n.iconEl.classList.add("rotate-180"),this._options.onClose(this,n)},i.prototype.updateOnOpen=function(e){this._options.onOpen=e},i.prototype.updateOnClose=function(e){this._options.onClose=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Nt(){document.querySelectorAll("[data-accordion]").forEach(function(i){var e=i.getAttribute("data-accordion"),t=i.getAttribute("data-active-classes"),r=i.getAttribute("data-inactive-classes"),n=[];i.querySelectorAll("[data-accordion-target]").forEach(function(s){if(s.closest("[data-accordion]")===i){var o={id:s.getAttribute("data-accordion-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-accordion-target")),iconEl:s.querySelector("[data-accordion-icon]"),active:s.getAttribute("aria-expanded")==="true"};n.push(o)}}),new Uo(i,n,{alwaysOpen:e==="open",activeClasses:t||_r.activeClasses,inactiveClasses:r||_r.inactiveClasses})})}typeof window<"u"&&(window.Accordion=Uo,window.initAccordions=Nt);var Ar=function(){return Ar=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Ar.apply(this,arguments)},Wo={onCollapse:function(){},onExpand:function(){},onToggle:function(){}},Gc={id:null,override:!0},Xn=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Wo),n===void 0&&(n=Gc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Ar(Ar({},Wo),r),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Collapse",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._triggerEl.hasAttribute("aria-expanded")?this._visible=this._triggerEl.getAttribute("aria-expanded")==="true":this._visible=!this._targetEl.classList.contains("hidden"),this._clickHandler=function(){e.toggle()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Collapse",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.collapse=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onCollapse(this)},i.prototype.expand=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onExpand(this)},i.prototype.toggle=function(){this._visible?this.collapse():this.expand(),this._options.onToggle(this)},i.prototype.updateOnCollapse=function(e){this._options.onCollapse=e},i.prototype.updateOnExpand=function(e){this._options.onExpand=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Ht(){document.querySelectorAll("[data-collapse-toggle]").forEach(function(i){var e=i.getAttribute("data-collapse-toggle"),t=document.getElementById(e);t?I.instanceExists("Collapse",t.getAttribute("id"))?new Xn(t,i,{},{id:t.getAttribute("id")+"_"+I._generateRandomId()}):new Xn(t,i):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-collapse-toggle attribute.'))})}typeof window<"u"&&(window.Collapse=Xn,window.initCollapses=Ht);var ut=function(){return ut=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},ut.apply(this,arguments)},Sr={defaultPosition:0,indicators:{items:[],activeClasses:"bg-white dark:bg-gray-800",inactiveClasses:"bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800"},interval:3e3,onNext:function(){},onPrev:function(){},onChange:function(){}},Xc={id:null,override:!0},Ko=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Sr),n===void 0&&(n=Xc),this._instanceId=n.id?n.id:e.id,this._carouselEl=e,this._items=t,this._options=ut(ut(ut({},Sr),r),{indicators:ut(ut({},Sr.indicators),r.indicators)}),this._activeItem=this.getItem(this._options.defaultPosition),this._indicators=this._options.indicators.items,this._intervalDuration=this._options.interval,this._intervalInstance=null,this._initialized=!1,this.init(),I.addInstance("Carousel",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.map(function(t){t.el.classList.add("absolute","inset-0","transition-transform","transform")}),this.getActiveItem()?this.slideTo(this.getActiveItem().position):this.slideTo(0),this._indicators.map(function(t,r){t.el.addEventListener("click",function(){e.slideTo(r)})}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Carousel",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items[e]},i.prototype.slideTo=function(e){var t=this._items[e],r={left:t.position===0?this._items[this._items.length-1]:this._items[t.position-1],middle:t,right:t.position===this._items.length-1?this._items[0]:this._items[t.position+1]};this._rotate(r),this._setActiveItem(t),this._intervalInstance&&(this.pause(),this.cycle()),this._options.onChange(this)},i.prototype.next=function(){var e=this.getActiveItem(),t=null;e.position===this._items.length-1?t=this._items[0]:t=this._items[e.position+1],this.slideTo(t.position),this._options.onNext(this)},i.prototype.prev=function(){var e=this.getActiveItem(),t=null;e.position===0?t=this._items[this._items.length-1]:t=this._items[e.position-1],this.slideTo(t.position),this._options.onPrev(this)},i.prototype._rotate=function(e){if(this._items.map(function(t){t.el.classList.add("hidden")}),this._items.length===1){e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-20");return}e.left.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-20"),e.left.el.classList.add("-translate-x-full","z-10"),e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-30"),e.right.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-30"),e.right.el.classList.add("translate-x-full","z-20")},i.prototype.cycle=function(){var e=this;typeof window<"u"&&(this._intervalInstance=window.setInterval(function(){e.next()},this._intervalDuration))},i.prototype.pause=function(){clearInterval(this._intervalInstance)},i.prototype.getActiveItem=function(){return this._activeItem},i.prototype._setActiveItem=function(e){var t,r,n=this;this._activeItem=e;var s=e.position;this._indicators.length&&(this._indicators.map(function(o){var a,l;o.el.setAttribute("aria-current","false"),(a=o.el.classList).remove.apply(a,n._options.indicators.activeClasses.split(" ")),(l=o.el.classList).add.apply(l,n._options.indicators.inactiveClasses.split(" "))}),(t=this._indicators[s].el.classList).add.apply(t,this._options.indicators.activeClasses.split(" ")),(r=this._indicators[s].el.classList).remove.apply(r,this._options.indicators.inactiveClasses.split(" ")),this._indicators[s].el.setAttribute("aria-current","true"))},i.prototype.updateOnNext=function(e){this._options.onNext=e},i.prototype.updateOnPrev=function(e){this._options.onPrev=e},i.prototype.updateOnChange=function(e){this._options.onChange=e},i}();function qt(){document.querySelectorAll("[data-carousel]").forEach(function(i){var e=i.getAttribute("data-carousel-interval"),t=i.getAttribute("data-carousel")==="slide",r=[],n=0;i.querySelectorAll("[data-carousel-item]").length&&Array.from(i.querySelectorAll("[data-carousel-item]")).map(function(d,p){r.push({position:p,el:d}),d.getAttribute("data-carousel-item")==="active"&&(n=p)});var s=[];i.querySelectorAll("[data-carousel-slide-to]").length&&Array.from(i.querySelectorAll("[data-carousel-slide-to]")).map(function(d){s.push({position:parseInt(d.getAttribute("data-carousel-slide-to")),el:d})});var o=new Ko(i,r,{defaultPosition:n,indicators:{items:s},interval:e||Sr.interval});t&&o.cycle();var a=i.querySelector("[data-carousel-next]"),l=i.querySelector("[data-carousel-prev]");a&&a.addEventListener("click",function(){o.next()}),l&&l.addEventListener("click",function(){o.prev()})})}typeof window<"u"&&(window.Carousel=Ko,window.initCarousels=qt);var Tr=function(){return Tr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Tr.apply(this,arguments)},Go={transition:"transition-opacity",duration:300,timing:"ease-out",onHide:function(){}},Yc={id:null,override:!0},Xo=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Go),n===void 0&&(n=Yc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Tr(Tr({},Go),r),this._initialized=!1,this.init(),I.addInstance("Dismiss",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._clickHandler=function(){e.hide()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Dismiss",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._targetEl.classList.add(this._options.transition,"duration-".concat(this._options.duration),this._options.timing,"opacity-0"),setTimeout(function(){e._targetEl.classList.add("hidden")},this._options.duration),this._options.onHide(this,this._targetEl)},i.prototype.updateOnHide=function(e){this._options.onHide=e},i}();function zt(){document.querySelectorAll("[data-dismiss-target]").forEach(function(i){var e=i.getAttribute("data-dismiss-target"),t=document.querySelector(e);t?new Xo(t,i):console.error('The dismiss element with id "'.concat(e,'" does not exist. Please check the data-dismiss-target attribute.'))})}typeof window<"u"&&(window.Dismiss=Xo,window.initDismisses=zt);var J="top",ie="bottom",te="right",ee="left",kr="auto",et=[J,ie,te,ee],Xe="start",ht="end",Yo="clippingParents",xr="viewport",Vt="popper",Zo="reference",Yn=et.reduce(function(i,e){return i.concat([e+"-"+Xe,e+"-"+ht])},[]),Lr=[].concat(et,[kr]).reduce(function(i,e){return i.concat([e,e+"-"+Xe,e+"-"+ht])},[]),Zc="beforeRead",Qc="read",Jc="afterRead",eu="beforeMain",tu="main",iu="afterMain",ru="beforeWrite",nu="write",su="afterWrite",Qo=[Zc,Qc,Jc,eu,tu,iu,ru,nu,su];function oe(i){return i?(i.nodeName||"").toLowerCase():null}function G(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function _e(i){var e=G(i).Element;return i instanceof e||i instanceof Element}function re(i){var e=G(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function $t(i){if(typeof ShadowRoot>"u")return!1;var e=G(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function ou(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!re(s)||!oe(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function au(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,d){return l[d]="",l},{});!re(n)||!oe(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var Jo={name:"applyStyles",enabled:!0,phase:"write",fn:ou,effect:au,requires:["computeStyles"]};function ae(i){return i.split("-")[0]}var Ce=Math.max,dt=Math.min,Ye=Math.round;function jt(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function _i(){return!/^((?!chrome|android).)*safari/i.test(jt())}function Ae(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),n=1,s=1;e&&re(i)&&(n=i.offsetWidth>0&&Ye(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&Ye(r.height)/i.offsetHeight||1);var o=_e(i)?G(i):window,a=o.visualViewport,l=!_i()&&t,d=(r.left+(l&&a?a.offsetLeft:0))/n,p=(r.top+(l&&a?a.offsetTop:0))/s,m=r.width/n,E=r.height/s;return{width:m,height:E,top:p,right:d+m,bottom:p+E,left:d,x:d,y:p}}function pt(i){var e=Ae(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function Ai(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&$t(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(i){return G(i).getComputedStyle(i)}function Zn(i){return["table","td","th"].indexOf(oe(i))>=0}function he(i){return((_e(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ze(i){return oe(i)==="html"?i:i.assignedSlot||i.parentNode||($t(i)?i.host:null)||he(i)}function ea(i){return!re(i)||me(i).position==="fixed"?null:i.offsetParent}function lu(i){var e=/firefox/i.test(jt()),t=/Trident/i.test(jt());if(t&&re(i)){var r=me(i);if(r.position==="fixed")return null}var n=Ze(i);for($t(n)&&(n=n.host);re(n)&&["html","body"].indexOf(oe(n))<0;){var s=me(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function Ie(i){for(var e=G(i),t=ea(i);t&&Zn(t)&&me(t).position==="static";)t=ea(t);return t&&(oe(t)==="html"||oe(t)==="body"&&me(t).position==="static")?e:t||lu(i)||e}function ft(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function mt(i,e,t){return Ce(i,dt(e,t))}function ta(i,e,t){var r=mt(i,e,t);return r>t?t:r}function Si(){return{top:0,right:0,bottom:0,left:0}}function Ti(i){return Object.assign({},Si(),i)}function ki(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var cu=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Ti(typeof e!="number"?e:ki(e,et))};function uu(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ae(t.placement),l=ft(a),d=[ee,te].indexOf(a)>=0,p=d?"height":"width";if(!(!s||!o)){var m=cu(n.padding,t),E=pt(s),v=l==="y"?J:ee,C=l==="y"?ie:te,_=t.rects.reference[p]+t.rects.reference[l]-o[l]-t.rects.popper[p],k=o[l]-t.rects.reference[l],D=Ie(s),q=D?l==="y"?D.clientHeight||0:D.clientWidth||0:0,B=_/2-k/2,S=m[v],R=q-E[p]-m[C],x=q/2-E[p]/2+B,P=mt(S,x,R),N=l;t.modifiersData[r]=(e={},e[N]=P,e.centerOffset=P-x,e)}}function hu(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Ai(e.elements.popper,n)&&(e.elements.arrow=n))}var ia={name:"arrow",enabled:!0,phase:"main",fn:uu,effect:hu,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Se(i){return i.split("-")[1]}var du={top:"auto",right:"auto",bottom:"auto",left:"auto"};function pu(i,e){var t=i.x,r=i.y,n=e.devicePixelRatio||1;return{x:Ye(t*n)/n||0,y:Ye(r*n)/n||0}}function ra(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,d=i.adaptive,p=i.roundOffsets,m=i.isFixed,E=o.x,v=E===void 0?0:E,C=o.y,_=C===void 0?0:C,k=typeof p=="function"?p({x:v,y:_}):{x:v,y:_};v=k.x,_=k.y;var D=o.hasOwnProperty("x"),q=o.hasOwnProperty("y"),B=ee,S=J,R=window;if(d){var x=Ie(t),P="clientHeight",N="clientWidth";if(x===G(t)&&(x=he(t),me(x).position!=="static"&&a==="absolute"&&(P="scrollHeight",N="scrollWidth")),x=x,n===J||(n===ee||n===te)&&s===ht){S=ie;var U=m&&x===R&&R.visualViewport?R.visualViewport.height:x[P];_-=U-r.height,_*=l?1:-1}if(n===ee||(n===J||n===ie)&&s===ht){B=te;var X=m&&x===R&&R.visualViewport?R.visualViewport.width:x[N];v-=X-r.width,v*=l?1:-1}}var z=Object.assign({position:a},d&&du),Y=p===!0?pu({x:v,y:_},G(t)):{x:v,y:_};if(v=Y.x,_=Y.y,l){var W;return Object.assign({},z,(W={},W[S]=q?"0":"",W[B]=D?"0":"",W.transform=(R.devicePixelRatio||1)<=1?"translate("+v+"px, "+_+"px)":"translate3d("+v+"px, "+_+"px, 0)",W))}return Object.assign({},z,(e={},e[S]=q?_+"px":"",e[B]=D?v+"px":"",e.transform="",e))}function fu(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,d={placement:ae(e.placement),variation:Se(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ra(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ra(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var na={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fu,data:{}};var Cr={passive:!0};function mu(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=G(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&d.forEach(function(p){p.addEventListener("scroll",t.update,Cr)}),a&&l.addEventListener("resize",t.update,Cr),function(){s&&d.forEach(function(p){p.removeEventListener("scroll",t.update,Cr)}),a&&l.removeEventListener("resize",t.update,Cr)}}var sa={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:mu,data:{}};var gu={left:"right",right:"left",bottom:"top",top:"bottom"};function Ut(i){return i.replace(/left|right|bottom|top/g,function(e){return gu[e]})}var vu={start:"end",end:"start"};function Ir(i){return i.replace(/start|end/g,function(e){return vu[e]})}function gt(i){var e=G(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function vt(i){return Ae(he(i)).left+gt(i).scrollLeft}function Qn(i,e){var t=G(i),r=he(i),n=t.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var d=_i();(d||!d&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+vt(i),y:l}}function Jn(i){var e,t=he(i),r=gt(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=Ce(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=Ce(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+vt(i),l=-r.scrollTop;return me(n||t).direction==="rtl"&&(a+=Ce(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function bt(i){var e=me(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function Or(i){return["html","body","#document"].indexOf(oe(i))>=0?i.ownerDocument.body:re(i)&&bt(i)?i:Or(Ze(i))}function tt(i,e){var t;e===void 0&&(e=[]);var r=Or(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=G(r),o=n?[s].concat(s.visualViewport||[],bt(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(tt(Ze(o)))}function Wt(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function bu(i,e){var t=Ae(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function oa(i,e,t){return e===xr?Wt(Qn(i,t)):_e(e)?bu(e,t):Wt(Jn(he(i)))}function yu(i){var e=tt(Ze(i)),t=["absolute","fixed"].indexOf(me(i).position)>=0,r=t&&re(i)?Ie(i):i;return _e(r)?e.filter(function(n){return _e(n)&&Ai(n,r)&&oe(n)!=="body"}):[]}function es(i,e,t,r){var n=e==="clippingParents"?yu(i):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(l,d){var p=oa(i,d,r);return l.top=Ce(p.top,l.top),l.right=dt(p.right,l.right),l.bottom=dt(p.bottom,l.bottom),l.left=Ce(p.left,l.left),l},oa(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function xi(i){var e=i.reference,t=i.element,r=i.placement,n=r?ae(r):null,s=r?Se(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case J:l={x:o,y:e.y-t.height};break;case ie:l={x:o,y:e.y+e.height};break;case te:l={x:e.x+e.width,y:a};break;case ee:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var d=n?ft(n):null;if(d!=null){var p=d==="y"?"height":"width";switch(s){case Xe:l[d]=l[d]-(e[p]/2-t[p]/2);break;case ht:l[d]=l[d]+(e[p]/2-t[p]/2);break;default:}}return l}function Oe(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.strategy,o=s===void 0?i.strategy:s,a=t.boundary,l=a===void 0?Yo:a,d=t.rootBoundary,p=d===void 0?xr:d,m=t.elementContext,E=m===void 0?Vt:m,v=t.altBoundary,C=v===void 0?!1:v,_=t.padding,k=_===void 0?0:_,D=Ti(typeof k!="number"?k:ki(k,et)),q=E===Vt?Zo:Vt,B=i.rects.popper,S=i.elements[C?q:E],R=es(_e(S)?S:S.contextElement||he(i.elements.popper),l,p,o),x=Ae(i.elements.reference),P=xi({reference:x,element:B,strategy:"absolute",placement:n}),N=Wt(Object.assign({},B,P)),U=E===Vt?N:x,X={top:R.top-U.top+D.top,bottom:U.bottom-R.bottom+D.bottom,left:R.left-U.left+D.left,right:U.right-R.right+D.right},z=i.modifiersData.offset;if(E===Vt&&z){var Y=z[n];Object.keys(X).forEach(function(W){var ye=[te,ie].indexOf(W)>=0?1:-1,xe=[J,ie].indexOf(W)>=0?"y":"x";X[W]+=Y[xe]*ye})}return X}function ts(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,d=l===void 0?Lr:l,p=Se(r),m=p?a?Yn:Yn.filter(function(C){return Se(C)===p}):et,E=m.filter(function(C){return d.indexOf(C)>=0});E.length===0&&(E=m);var v=E.reduce(function(C,_){return C[_]=Oe(i,{placement:_,boundary:n,rootBoundary:s,padding:o})[ae(_)],C},{});return Object.keys(v).sort(function(C,_){return v[C]-v[_]})}function wu(i){if(ae(i)===kr)return[];var e=Ut(i);return[Ir(i),e,Ir(e)]}function Eu(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,d=t.padding,p=t.boundary,m=t.rootBoundary,E=t.altBoundary,v=t.flipVariations,C=v===void 0?!0:v,_=t.allowedAutoPlacements,k=e.options.placement,D=ae(k),q=D===k,B=l||(q||!C?[Ut(k)]:wu(k)),S=[k].concat(B).reduce(function(ce,H){return ce.concat(ae(H)===kr?ts(e,{placement:H,boundary:p,rootBoundary:m,padding:d,flipVariations:C,allowedAutoPlacements:_}):H)},[]),R=e.rects.reference,x=e.rects.popper,P=new Map,N=!0,U=S[0],X=0;X<S.length;X++){var z=S[X],Y=ae(z),W=Se(z)===Xe,ye=[J,ie].indexOf(Y)>=0,xe=ye?"width":"height",u=Oe(e,{placement:z,boundary:p,rootBoundary:m,altBoundary:E,padding:d}),h=ye?W?te:ee:W?ie:J;R[xe]>x[xe]&&(h=Ut(h));var f=Ut(h),y=[];if(s&&y.push(u[Y]<=0),a&&y.push(u[h]<=0,u[f]<=0),y.every(function(ce){return ce})){U=z,N=!1;break}P.set(z,y)}if(N)for(var w=C?3:1,b=function(H){var V=S.find(function(ne){var de=P.get(ne);if(de)return de.slice(0,H).every(function(Le){return Le})});if(V)return U=V,"break"},O=w;O>0;O--){var M=b(O);if(M==="break")break}e.placement!==U&&(e.modifiersData[r]._skip=!0,e.placement=U,e.reset=!0)}}var aa={name:"flip",enabled:!0,phase:"main",fn:Eu,requiresIfExists:["offset"],data:{_skip:!1}};function la(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function ca(i){return[J,te,ie,ee].some(function(e){return i[e]>=0})}function _u(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Oe(e,{elementContext:"reference"}),a=Oe(e,{altBoundary:!0}),l=la(o,r),d=la(a,n,s),p=ca(l),m=ca(d);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:p,hasPopperEscaped:m},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":m})}var ua={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:_u};function Au(i,e,t){var r=ae(i),n=[ee,J].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[ee,te].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Su(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=Lr.reduce(function(p,m){return p[m]=Au(m,e.rects,s),p},{}),a=o[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=o}var ha={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Su};function Tu(i){var e=i.state,t=i.name;e.modifiersData[t]=xi({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var da={name:"popperOffsets",enabled:!0,phase:"read",fn:Tu,data:{}};function is(i){return i==="x"?"y":"x"}function ku(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,d=t.rootBoundary,p=t.altBoundary,m=t.padding,E=t.tether,v=E===void 0?!0:E,C=t.tetherOffset,_=C===void 0?0:C,k=Oe(e,{boundary:l,rootBoundary:d,padding:m,altBoundary:p}),D=ae(e.placement),q=Se(e.placement),B=!q,S=ft(D),R=is(S),x=e.modifiersData.popperOffsets,P=e.rects.reference,N=e.rects.popper,U=typeof _=="function"?_(Object.assign({},e.rects,{placement:e.placement})):_,X=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Y={x:0,y:0};if(x){if(s){var W,ye=S==="y"?J:ee,xe=S==="y"?ie:te,u=S==="y"?"height":"width",h=x[S],f=h+k[ye],y=h-k[xe],w=v?-N[u]/2:0,b=q===Xe?P[u]:N[u],O=q===Xe?-N[u]:-P[u],M=e.elements.arrow,ce=v&&M?pt(M):{width:0,height:0},H=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Si(),V=H[ye],ne=H[xe],de=mt(0,P[u],ce[u]),Le=B?P[u]/2-w-de-V-X.mainAxis:b-de-V-X.mainAxis,Ct=B?-P[u]/2+w+de+ne+X.mainAxis:O+de+ne+X.mainAxis,It=e.elements.arrow&&Ie(e.elements.arrow),Je=It?S==="y"?It.clientTop||0:It.clientLeft||0:0,Ot=(W=z?.[S])!=null?W:0,ze=h+Le-Ot-Je,fi=h+Ct-Ot,Rt=mt(v?dt(f,ze):f,h,v?Ce(y,fi):y);x[S]=Rt,Y[S]=Rt-h}if(a){var Ve,Mt=S==="x"?J:ee,Pt=S==="x"?ie:te,Fe=x[R],ct=R==="y"?"height":"width",Ui=Fe+k[Mt],Dt=Fe-k[Pt],$e=[J,ee].indexOf(D)!==-1,je=(Ve=z?.[R])!=null?Ve:0,Ue=$e?Ui:Fe-P[ct]-N[ct]-je+X.altAxis,mi=$e?Fe+P[ct]+N[ct]-je-X.altAxis:Dt,gi=v&&$e?ta(Ue,Fe,mi):mt(v?Ue:Ui,Fe,v?mi:Dt);x[R]=gi,Y[R]=gi-Fe}e.modifiersData[r]=Y}}var pa={name:"preventOverflow",enabled:!0,phase:"main",fn:ku,requiresIfExists:["offset"]};function rs(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function ns(i){return i===G(i)||!re(i)?gt(i):rs(i)}function xu(i){var e=i.getBoundingClientRect(),t=Ye(e.width)/i.offsetWidth||1,r=Ye(e.height)/i.offsetHeight||1;return t!==1||r!==1}function ss(i,e,t){t===void 0&&(t=!1);var r=re(e),n=re(e)&&xu(e),s=he(e),o=Ae(i,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((oe(e)!=="body"||bt(s))&&(a=ns(e)),re(e)?(l=Ae(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=vt(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Lu(i){var e=new Map,t=new Set,r=[];i.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function os(i){var e=Lu(i);return Qo.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function as(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function ls(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var fa={placement:"bottom",modifiers:[],strategy:"absolute"};function ma(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function ga(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?fa:n;return function(a,l,d){d===void 0&&(d=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},fa,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},m=[],E=!1,v={state:p,setOptions:function(D){var q=typeof D=="function"?D(p.options):D;_(),p.options=Object.assign({},s,p.options,q),p.scrollParents={reference:_e(a)?tt(a):a.contextElement?tt(a.contextElement):[],popper:tt(l)};var B=os(ls([].concat(r,p.options.modifiers)));return p.orderedModifiers=B.filter(function(S){return S.enabled}),C(),v.update()},forceUpdate:function(){if(!E){var D=p.elements,q=D.reference,B=D.popper;if(ma(q,B)){p.rects={reference:ss(q,Ie(B),p.options.strategy==="fixed"),popper:pt(B)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(X){return p.modifiersData[X.name]=Object.assign({},X.data)});for(var S=0;S<p.orderedModifiers.length;S++){if(p.reset===!0){p.reset=!1,S=-1;continue}var R=p.orderedModifiers[S],x=R.fn,P=R.options,N=P===void 0?{}:P,U=R.name;typeof x=="function"&&(p=x({state:p,options:N,name:U,instance:v})||p)}}}},update:as(function(){return new Promise(function(k){v.forceUpdate(),k(p)})}),destroy:function(){_(),E=!0}};if(!ma(a,l))return v;v.setOptions(d).then(function(k){!E&&d.onFirstUpdate&&d.onFirstUpdate(k)});function C(){p.orderedModifiers.forEach(function(k){var D=k.name,q=k.options,B=q===void 0?{}:q,S=k.effect;if(typeof S=="function"){var R=S({state:p,name:D,instance:v,options:B}),x=function(){};m.push(R||x)}})}function _(){m.forEach(function(k){return k()}),m=[]}return v}}var Cu=[sa,da,na,Jo,ha,aa,pa,ia,ua],yt=ga({defaultModifiers:Cu});var it=function(){return it=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},it.apply(this,arguments)},Rr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},rt={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1,onShow:function(){},onHide:function(){},onToggle:function(){}},Iu={id:null,override:!0},cs=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=rt),n===void 0&&(n=Iu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=it(it({},rt),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dropdown",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._popperInstance=this._createPopperInstance(),this._setupEventListeners(),this._initialized=!0)},i.prototype.destroy=function(){var e=this,t=this._getTriggerEvents();this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._clickHandler)}),this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.removeEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverHideHandler),e._targetEl.removeEventListener(r,e._hoverHideHandler)})),this._popperInstance.destroy(),this._initialized=!1},i.prototype.removeInstance=function(){I.removeInstance("Dropdown",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._clickHandler=function(){e.toggle()},this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._clickHandler)}),this._hoverShowTriggerElHandler=function(r){r.type==="click"?e.toggle():setTimeout(function(){e.show()},e._options.delay)},this._hoverShowTargetElHandler=function(){e.show()},this._hoverHideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},e._options.delay)},this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.addEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverHideHandler),e._targetEl.addEventListener(r,e._hoverHideHandler)}))},i.prototype._createPopperInstance=function(){return yt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[this._options.offsetSkidding,this._options.offsetDistance]}}]})},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target,n=this._options.ignoreClickOutsideClass,s=!1;if(n){var o=document.querySelectorAll(".".concat(n));o.forEach(function(a){if(a.contains(r)){s=!0;return}})}r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&!s&&this.isVisible()&&this.hide()},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","click"],hideEvents:["mouseleave"]};case"click":return{showEvents:["click"],hideEvents:[]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["click"],hideEvents:[]}}},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.isVisible=function(){return this._visible},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._targetEl.classList.add("block"),this._popperInstance.setOptions(function(e){return it(it({},e),{modifiers:Rr(Rr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("block"),this._targetEl.classList.add("hidden"),this._popperInstance.setOptions(function(e){return it(it({},e),{modifiers:Rr(Rr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._visible=!1,this._removeClickOutsideListener(),this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Kt(){document.querySelectorAll("[data-dropdown-toggle]").forEach(function(i){var e=i.getAttribute("data-dropdown-toggle"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-dropdown-placement"),n=i.getAttribute("data-dropdown-offset-skidding"),s=i.getAttribute("data-dropdown-offset-distance"),o=i.getAttribute("data-dropdown-trigger"),a=i.getAttribute("data-dropdown-delay"),l=i.getAttribute("data-dropdown-ignore-click-outside-class");new cs(t,i,{placement:r||rt.placement,triggerType:o||rt.triggerType,offsetSkidding:n?parseInt(n):rt.offsetSkidding,offsetDistance:s?parseInt(s):rt.offsetDistance,delay:a?parseInt(a):rt.delay,ignoreClickOutsideClass:l||rt.ignoreClickOutsideClass})}else console.error('The dropdown element with id "'.concat(e,'" does not exist. Please check the data-dropdown-toggle attribute.'))})}typeof window<"u"&&(window.Dropdown=cs,window.initDropdowns=Kt);var us=cs;var Mr=function(){return Mr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Mr.apply(this,arguments)},Pr={placement:"center",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-40",backdrop:"dynamic",closable:!0,onHide:function(){},onShow:function(){},onToggle:function(){}},Ou={id:null,override:!0},va=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=Pr),r===void 0&&(r=Ou),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Mr(Mr({},Pr),t),this._isHidden=!0,this._backdropEl=null,this._initialized=!1,this.init(),I.addInstance("Modal",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._getPlacementClasses().map(function(t){e._targetEl.classList.add(t)}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Modal",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._createBackdrop=function(){var e;if(this._isHidden){var t=document.createElement("div");t.setAttribute("modal-backdrop",""),(e=t.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(t),this._backdropEl=t}},i.prototype._destroyBackdropEl=function(){this._isHidden||document.querySelector("[modal-backdrop]").remove()},i.prototype._setupModalCloseEventListeners=function(){var e=this;this._options.backdrop==="dynamic"&&(this._clickOutsideEventListener=function(t){e._handleOutsideClick(t.target)},this._targetEl.addEventListener("click",this._clickOutsideEventListener,!0)),this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeModalCloseEventListeners=function(){this._options.backdrop==="dynamic"&&this._targetEl.removeEventListener("click",this._clickOutsideEventListener,!0),document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._handleOutsideClick=function(e){(e===this._targetEl||e===this._backdropEl&&this.isVisible())&&this.hide()},i.prototype._getPlacementClasses=function(){switch(this._options.placement){case"top-left":return["justify-start","items-start"];case"top-center":return["justify-center","items-start"];case"top-right":return["justify-end","items-start"];case"center-left":return["justify-start","items-center"];case"center":return["justify-center","items-center"];case"center-right":return["justify-end","items-center"];case"bottom-left":return["justify-start","items-end"];case"bottom-center":return["justify-center","items-end"];case"bottom-right":return["justify-end","items-end"];default:return["justify-center","items-center"]}},i.prototype.toggle=function(){this._isHidden?this.show():this.hide(),this._options.onToggle(this)},i.prototype.show=function(){this.isHidden&&(this._targetEl.classList.add("flex"),this._targetEl.classList.remove("hidden"),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._createBackdrop(),this._isHidden=!1,this._options.closable&&this._setupModalCloseEventListeners(),document.body.classList.add("overflow-hidden"),this._options.onShow(this))},i.prototype.hide=function(){this.isVisible&&(this._targetEl.classList.add("hidden"),this._targetEl.classList.remove("flex"),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._destroyBackdropEl(),this._isHidden=!0,document.body.classList.remove("overflow-hidden"),this._options.closable&&this._removeModalCloseEventListeners(),this._options.onHide(this))},i.prototype.isVisible=function(){return!this._isHidden},i.prototype.isHidden=function(){return this._isHidden},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Gt(){document.querySelectorAll("[data-modal-target]").forEach(function(i){var e=i.getAttribute("data-modal-target"),t=document.getElementById(e);if(t){var r=t.getAttribute("data-modal-placement"),n=t.getAttribute("data-modal-backdrop");new va(t,{placement:r||Pr.placement,backdrop:n||Pr.backdrop})}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?."))}),document.querySelectorAll("[data-modal-toggle]").forEach(function(i){var e=i.getAttribute("data-modal-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-show]").forEach(function(i){var e=i.getAttribute("data-modal-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-hide]").forEach(function(i){var e=i.getAttribute("data-modal-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?"))})}typeof window<"u"&&(window.Modal=va,window.initModals=Gt);var Dr=function(){return Dr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Dr.apply(this,arguments)},wt={placement:"left",bodyScrolling:!1,backdrop:!0,edge:!1,edgeOffset:"bottom-[60px]",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30",onShow:function(){},onHide:function(){},onToggle:function(){}},Ru={id:null,override:!0},ba=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=wt),r===void 0&&(r=Ru),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Dr(Dr({},wt),t),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Drawer",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.classList.add("transition-transform"),this._getPlacementClasses(this._options.placement).base.map(function(t){e._targetEl.classList.add(t)}),this._handleEscapeKey=function(t){t.key==="Escape"&&e.isVisible()&&e.hide()},document.addEventListener("keydown",this._handleEscapeKey),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),document.removeEventListener("keydown",this._handleEscapeKey),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Drawer",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.add(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.add(t)})),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._options.bodyScrolling||document.body.classList.remove("overflow-hidden"),this._options.backdrop&&this._destroyBackdropEl(),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.remove(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.remove(t)})),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._options.bodyScrolling||document.body.classList.add("overflow-hidden"),this._options.backdrop&&this._createBackdrop(),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype._createBackdrop=function(){var e,t=this;if(!this._visible){var r=document.createElement("div");r.setAttribute("drawer-backdrop",""),(e=r.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(r),r.addEventListener("click",function(){t.hide()})}},i.prototype._destroyBackdropEl=function(){this._visible&&document.querySelector("[drawer-backdrop]")!==null&&document.querySelector("[drawer-backdrop]").remove()},i.prototype._getPlacementClasses=function(e){switch(e){case"top":return{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]};case"right":return{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]};case"bottom":return{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]};case"left":return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]};case"bottom-edge":return{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this._options.edgeOffset]};default:return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]}}},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Xt(){document.querySelectorAll("[data-drawer-target]").forEach(function(i){var e=i.getAttribute("data-drawer-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-drawer-placement"),n=i.getAttribute("data-drawer-body-scrolling"),s=i.getAttribute("data-drawer-backdrop"),o=i.getAttribute("data-drawer-edge"),a=i.getAttribute("data-drawer-edge-offset");new ba(t,{placement:r||wt.placement,bodyScrolling:n?n==="true":wt.bodyScrolling,backdrop:s?s==="true":wt.backdrop,edge:o?o==="true":wt.edge,edgeOffset:a||wt.edgeOffset})}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-toggle]").forEach(function(i){var e=i.getAttribute("data-drawer-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-dismiss], [data-drawer-hide]").forEach(function(i){var e=i.getAttribute("data-drawer-dismiss")?i.getAttribute("data-drawer-dismiss"):i.getAttribute("data-drawer-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id"))}),document.querySelectorAll("[data-drawer-show]").forEach(function(i){var e=i.getAttribute("data-drawer-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))})}typeof window<"u"&&(window.Drawer=ba,window.initDrawers=Xt);var Fr=function(){return Fr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Fr.apply(this,arguments)},Br={defaultTabId:null,activeClasses:"text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500",inactiveClasses:"dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300",onShow:function(){}},Mu={id:null,override:!0},ya=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Br),n===void 0&&(n=Mu),this._instanceId=n.id?n.id:e.id,this._tabsEl=e,this._items=t,this._activeTab=r?this.getTab(r.defaultTabId):null,this._options=Fr(Fr({},Br),r),this._initialized=!1,this.init(),I.addInstance("Tabs",this,this._tabsEl.id,!0),I.addInstance("Tabs",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._activeTab||this.setActiveTab(this._items[0]),this.show(this._activeTab.id,!0),this._items.map(function(t){t.triggerEl.addEventListener("click",function(r){r.preventDefault(),e.show(t.id)})}))},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){this.destroy(),I.removeInstance("Tabs",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getActiveTab=function(){return this._activeTab},i.prototype.setActiveTab=function(e){this._activeTab=e},i.prototype.getTab=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.show=function(e,t){var r,n,s=this;t===void 0&&(t=!1);var o=this.getTab(e);o===this._activeTab&&!t||(this._items.map(function(a){var l,d;a!==o&&((l=a.triggerEl.classList).remove.apply(l,s._options.activeClasses.split(" ")),(d=a.triggerEl.classList).add.apply(d,s._options.inactiveClasses.split(" ")),a.targetEl.classList.add("hidden"),a.triggerEl.setAttribute("aria-selected","false"))}),(r=o.triggerEl.classList).add.apply(r,this._options.activeClasses.split(" ")),(n=o.triggerEl.classList).remove.apply(n,this._options.inactiveClasses.split(" ")),o.triggerEl.setAttribute("aria-selected","true"),o.targetEl.classList.remove("hidden"),this.setActiveTab(o),this._options.onShow(this,o))},i.prototype.updateOnShow=function(e){this._options.onShow=e},i}();function Yt(){document.querySelectorAll("[data-tabs-toggle]").forEach(function(i){var e=[],t=i.getAttribute("data-tabs-active-classes"),r=i.getAttribute("data-tabs-inactive-classes"),n=null;i.querySelectorAll('[role="tab"]').forEach(function(s){var o=s.getAttribute("aria-selected")==="true",a={id:s.getAttribute("data-tabs-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-tabs-target"))};e.push(a),o&&(n=a.id)}),new ya(i,e,{defaultTabId:n,activeClasses:t||Br.activeClasses,inactiveClasses:r||Br.inactiveClasses})})}typeof window<"u"&&(window.Tabs=ya,window.initTabs=Yt);var nt=function(){return nt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},nt.apply(this,arguments)},Nr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},Hr={placement:"top",triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Pu={id:null,override:!0},wa=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Hr),n===void 0&&(n=Pu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=nt(nt({},Hr),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Tooltip",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Tooltip",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){e.hide()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return yt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:Nr(Nr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:Nr(Nr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Zt(){document.querySelectorAll("[data-tooltip-target]").forEach(function(i){var e=i.getAttribute("data-tooltip-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-tooltip-trigger"),n=i.getAttribute("data-tooltip-placement");new wa(t,i,{placement:n||Hr.placement,triggerType:r||Hr.triggerType})}else console.error('The tooltip element with id "'.concat(e,'" does not exist. Please check the data-tooltip-target attribute.'))})}typeof window<"u"&&(window.Tooltip=wa,window.initTooltips=Zt);var st=function(){return st=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},st.apply(this,arguments)},qr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},Li={placement:"top",offset:10,triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Du={id:null,override:!0},Ea=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Li),n===void 0&&(n=Du),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=st(st({},Li),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Popover",this,n.id?n.id:this._targetEl.id,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler),e._targetEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler),e._targetEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Popover",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},100)},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler),e._targetEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler),e._targetEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return yt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,this._options.offset]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return st(st({},e),{modifiers:qr(qr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return st(st({},e),{modifiers:qr(qr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Qt(){document.querySelectorAll("[data-popover-target]").forEach(function(i){var e=i.getAttribute("data-popover-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-popover-trigger"),n=i.getAttribute("data-popover-placement"),s=i.getAttribute("data-popover-offset");new Ea(t,i,{placement:n||Li.placement,offset:s?parseInt(s):Li.offset,triggerType:r||Li.triggerType})}else console.error('The popover element with id "'.concat(e,'" does not exist. Please check the data-popover-target attribute.'))})}typeof window<"u"&&(window.Popover=Ea,window.initPopovers=Qt);var zr=function(){return zr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},zr.apply(this,arguments)},hs={triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Fu={id:null,override:!0},_a=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=hs),s===void 0&&(s=Fu),this._instanceId=s.id?s.id:r.id,this._parentEl=e,this._triggerEl=t,this._targetEl=r,this._options=zr(zr({},hs),n),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dial",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;if(this._triggerEl&&this._targetEl&&!this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);this._showEventHandler=function(){e.show()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showEventHandler),e._targetEl.addEventListener(r,e._showEventHandler)}),this._hideEventHandler=function(){e._parentEl.matches(":hover")||e.hide()},t.hideEvents.forEach(function(r){e._parentEl.addEventListener(r,e._hideEventHandler)}),this._initialized=!0}},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showEventHandler),e._targetEl.removeEventListener(r,e._showEventHandler)}),t.hideEvents.forEach(function(r){e._parentEl.removeEventListener(r,e._hideEventHandler)}),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Dial",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this._visible?this.hide():this.show()},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype._getTriggerEventTypes=function(e){switch(e){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Jt(){document.querySelectorAll("[data-dial-init]").forEach(function(i){var e=i.querySelector("[data-dial-toggle]");if(e){var t=e.getAttribute("data-dial-toggle"),r=document.getElementById(t);if(r){var n=e.getAttribute("data-dial-trigger");new _a(i,e,r,{triggerType:n||hs.triggerType})}else console.error("Dial with id ".concat(t," does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"))}else console.error("Dial with id ".concat(i.id," does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"))})}typeof window<"u"&&(window.Dial=_a,window.initDials=Jt);var Vr=function(){return Vr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Vr.apply(this,arguments)},Aa={minValue:null,maxValue:null,onIncrement:function(){},onDecrement:function(){}},Bu={id:null,override:!0},Sa=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=Aa),s===void 0&&(s=Bu),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._incrementEl=t,this._decrementEl=r,this._options=Vr(Vr({},Aa),n),this._initialized=!1,this.init(),I.addInstance("InputCounter",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._inputHandler=function(t){{var r=t.target;/^\d*$/.test(r.value)||(r.value=r.value.replace(/[^\d]/g,"")),e._options.maxValue!==null&&parseInt(r.value)>e._options.maxValue&&(r.value=e._options.maxValue.toString()),e._options.minValue!==null&&parseInt(r.value)<e._options.minValue&&(r.value=e._options.minValue.toString())}},this._incrementClickHandler=function(){e.increment()},this._decrementClickHandler=function(){e.decrement()},this._targetEl.addEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.addEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.addEventListener("click",this._decrementClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._targetEl&&this._initialized&&(this._targetEl.removeEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.removeEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.removeEventListener("click",this._decrementClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("InputCounter",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getCurrentValue=function(){return parseInt(this._targetEl.value)||0},i.prototype.increment=function(){this._options.maxValue!==null&&this.getCurrentValue()>=this._options.maxValue||(this._targetEl.value=(this.getCurrentValue()+1).toString(),this._options.onIncrement(this))},i.prototype.decrement=function(){this._options.minValue!==null&&this.getCurrentValue()<=this._options.minValue||(this._targetEl.value=(this.getCurrentValue()-1).toString(),this._options.onDecrement(this))},i.prototype.updateOnIncrement=function(e){this._options.onIncrement=e},i.prototype.updateOnDecrement=function(e){this._options.onDecrement=e},i}();function ei(){document.querySelectorAll("[data-input-counter]").forEach(function(i){var e=i.id,t=document.querySelector('[data-input-counter-increment="'+e+'"]'),r=document.querySelector('[data-input-counter-decrement="'+e+'"]'),n=i.getAttribute("data-input-counter-min"),s=i.getAttribute("data-input-counter-max");i?I.instanceExists("InputCounter",i.getAttribute("id"))||new Sa(i,t||null,r||null,{minValue:n?parseInt(n):null,maxValue:s?parseInt(s):null}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-input-counter attribute.'))})}typeof window<"u"&&(window.InputCounter=Sa,window.initInputCounters=ei);var $r=function(){return $r=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},$r.apply(this,arguments)},jr={htmlEntities:!1,contentType:"input",onCopy:function(){}},Nu={id:null,override:!0},Ta=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=jr),n===void 0&&(n=Nu),this._instanceId=n.id?n.id:t.id,this._triggerEl=e,this._targetEl=t,this._options=$r($r({},jr),r),this._initialized=!1,this.init(),I.addInstance("CopyClipboard",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._targetEl&&this._triggerEl&&!this._initialized&&(this._triggerElClickHandler=function(){e.copy()},this._triggerEl&&this._triggerEl.addEventListener("click",this._triggerElClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._targetEl&&this._initialized&&(this._triggerEl&&this._triggerEl.removeEventListener("click",this._triggerElClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("CopyClipboard",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getTargetValue=function(){if(this._options.contentType==="input")return this._targetEl.value;if(this._options.contentType==="innerHTML")return this._targetEl.innerHTML;if(this._options.contentType==="textContent")return this._targetEl.textContent.replace(/\s+/g," ").trim()},i.prototype.copy=function(){var e=this.getTargetValue();this._options.htmlEntities&&(e=this.decodeHTML(e));var t=document.createElement("textarea");return t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),this._options.onCopy(this),e},i.prototype.decodeHTML=function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.textContent},i.prototype.updateOnCopyCallback=function(e){this._options.onCopy=e},i}();function ti(){document.querySelectorAll("[data-copy-to-clipboard-target]").forEach(function(i){var e=i.getAttribute("data-copy-to-clipboard-target"),t=document.getElementById(e),r=i.getAttribute("data-copy-to-clipboard-content-type"),n=i.getAttribute("data-copy-to-clipboard-html-entities");t?I.instanceExists("CopyClipboard",t.getAttribute("id"))||new Ta(i,t,{htmlEntities:n&&n==="true"?!0:jr.htmlEntities,contentType:r||jr.contentType}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-copy-to-clipboard-target attribute.'))})}typeof window<"u"&&(window.CopyClipboard=Ta,window.initClipboards=ti);function ka(){Nt(),Ht(),qt(),zt(),Kt(),Gt(),Xt(),Yt(),Zt(),Qt(),Jt(),ei(),ti()}typeof window<"u"&&(window.initFlowbite=ka);var Hu=new $o("load",[Nt,Ht,qt,zt,Kt,Gt,Xt,Yt,Zt,Qt,Jt,ei,ti]);Hu.init();var Ur=class extends T{static targets=["trigger","menu"];connect(){console.log(`resource-drop-down connected: ${this.element}`),this.dropdown=new us(this.menuTarget,this.triggerTarget)}disconnect(){this.dropdown=null}toggle(){this.dropdown.toggle()}show(){this.dropdown.show()}hide(){this.dropdown.hide()}};var Wr=class extends T{static targets=["trigger","menu"];connect(){console.log(`resource-collapse connected: ${this.element}`),this.element.hasAttribute("data-visible")||this.element.setAttribute("data-visible","false"),this.#e()}toggle(){let i=this.element.getAttribute("data-visible")==="true";this.element.setAttribute("data-visible",(!i).toString()),this.#e()}#e(){this.element.getAttribute("data-visible")==="true"?(this.menuTarget.classList.remove("hidden"),this.triggerTarget.setAttribute("aria-expanded","true"),this.dispatch("expand")):(this.menuTarget.classList.add("hidden"),this.triggerTarget.setAttribute("aria-expanded","false"),this.dispatch("collapse"))}};var Kr=class extends T{static values={after:Number};connect(){console.log(`resource-dismiss connected: ${this.element}`),this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.dismiss(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.autoDismissTimeout=null}dismiss(){this.element.remove()}};var Gr=class extends T{static targets=["frame","refreshButton","backButton","homeButton"];connect(){console.log(`frame-navigator connected: ${this.element}`),this.#e(),this.srcHistory=[],this.originalFrameSrc=this.frameTarget.src,this.hasRefreshButtonTarget&&(this.refreshButtonTarget.style.display="",this.refreshButtonClicked=this.refreshButtonClicked.bind(this),this.refreshButtonTarget.addEventListener("click",this.refreshButtonClicked)),this.hasBackButtonTarget&&(this.backButtonClicked=this.backButtonClicked.bind(this),this.backButtonTarget.addEventListener("click",this.backButtonClicked)),this.hasHomeButtonTarget&&(this.homeButtonClicked=this.homeButtonClicked.bind(this),this.homeButtonTarget.addEventListener("click",this.homeButtonClicked)),this.frameLoaded=this.frameLoaded.bind(this),this.frameTarget.addEventListener("turbo:frame-load",this.frameLoaded),this.frameLoading=this.frameLoading.bind(this),this.frameTarget.addEventListener("turbo:click",this.frameLoading),this.frameTarget.addEventListener("turbo:submit-start",this.frameLoading),this.frameFailed=this.frameFailed.bind(this),this.frameTarget.addEventListener("turbo:fetch-request-error",this.frameFailed)}disconnect(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.removeEventListener("click",this.refreshButtonClicked),this.hasBackButtonTarget&&this.backButtonTarget.removeEventListener("click",this.backButtonClicked),this.hasHomeButtonTarget&&this.homeButtonTarget.removeEventListener("click",this.homeButtonClicked),this.frameTarget.removeEventListener("turbo:frame-load",this.frameLoaded),this.frameTarget.removeEventListener("turbo:click",this.frameLoading),this.frameTarget.removeEventListener("turbo:submit-start",this.frameLoading),this.frameTarget.removeEventListener("turbo:fetch-request-error",this.frameFailed)}frameLoading(i){this.#e()}frameFailed(i){this.#t()}frameLoaded(i){this.#t();let e=i.target.src;e==this.currentSrc||(e==this.originalFrameSrc?this.srcHistory=[e]:this.srcHistory.push(e)),this.#i()}refreshButtonClicked(i){this.frameLoading(null),this.frameTarget.reload()}backButtonClicked(i){this.frameLoading(null),this.srcHistory.pop(),this.frameTarget.src=this.currentSrc}homeButtonClicked(i){this.frameLoading(null),this.frameTarget.src=this.originalFrameSrc}get currentSrc(){return this.srcHistory[this.srcHistory.length-1]}#e(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.add("motion-safe:animate-spin"),this.frameTarget.classList.add("motion-safe:animate-pulse")}#t(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.remove("motion-safe:animate-spin"),this.frameTarget.classList.remove("motion-safe:animate-pulse")}#i(){this.hasHomeButtonTarget&&(this.homeButtonTarget.style.display=this.srcHistory.length>2?"":"none"),this.hasBackButtonTarget&&(this.backButtonTarget.style.display=this.srcHistory.length>1?"":"none")}};var Xr=class extends T{connect(){console.log(`color-mode connected: ${this.element}`),this.updateColorMode()}disconnect(){}updateColorMode(){localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}setLightColorMode(){localStorage.theme="light",this.updateColorMode()}setDarkColorMode(){localStorage.theme="dark",this.updateColorMode()}setSystemColorMode(){localStorage.removeItem("theme"),this.updateColorMode()}};var{entries:Fa,setPrototypeOf:xa,isFrozen:qu,getPrototypeOf:zu,getOwnPropertyDescriptor:Vu}=Object,{freeze:ve,seal:Te,create:Ba}=Object,{apply:vs,construct:bs}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e});Te||(Te=function(e){return e});vs||(vs=function(e,t,r){return e.apply(t,r)});bs||(bs=function(e,t){return new e(...t)});var Yr=Ee(Array.prototype.forEach),La=Ee(Array.prototype.pop),Ci=Ee(Array.prototype.push),Qr=Ee(String.prototype.toLowerCase),ds=Ee(String.prototype.toString),Ca=Ee(String.prototype.match),Ii=Ee(String.prototype.replace),$u=Ee(String.prototype.indexOf),ju=Ee(String.prototype.trim),Re=Ee(Object.prototype.hasOwnProperty),ge=Ee(RegExp.prototype.test),Oi=Uu(TypeError);function Ee(i){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return vs(i,e,r)}}function Uu(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return bs(i,t)}}function F(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qr;xa&&xa(i,null);let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let s=t(n);s!==n&&(qu(e)||(e[r]=s),n=s)}i[n]=!0}return i}function Wu(i){for(let e=0;e<i.length;e++)Re(i,e)||(i[e]=null);return i}function Et(i){let e=Ba(null);for(let[t,r]of Fa(i))Re(i,t)&&(Array.isArray(r)?e[t]=Wu(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Et(r):e[t]=r);return e}function Ri(i,e){for(;i!==null;){let r=Vu(i,e);if(r){if(r.get)return Ee(r.get);if(typeof r.value=="function")return Ee(r.value)}i=zu(i)}function t(){return null}return t}var Ia=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ps=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fs=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ku=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ms=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Gu=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Oa=ve(["#text"]),Ra=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),gs=ve(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ma=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zr=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Xu=Te(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Yu=Te(/<%[\w\W]*|[\w\W]*%>/gm),Zu=Te(/\${[\w\W]*}/gm),Qu=Te(/^data-[\-\w.\u00B7-\uFFFF]/),Ju=Te(/^aria-[\-\w]+$/),Na=Te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eh=Te(/^(?:\w+script|data):/i),th=Te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ha=Te(/^html$/i),ih=Te(/^[a-z][.\w]*(-[.\w]+)+$/i),Pa=Object.freeze({__proto__:null,ARIA_ATTR:Ju,ATTR_WHITESPACE:th,CUSTOM_ELEMENT:ih,DATA_ATTR:Qu,DOCTYPE_NAME:Ha,ERB_EXPR:Yu,IS_ALLOWED_URI:Na,IS_SCRIPT_OR_DATA:eh,MUSTACHE_EXPR:Xu,TMPLIT_EXPR:Zu}),Mi={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rh=function(){return typeof window>"u"?null:window},nh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Da=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function qa(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rh(),e=L=>qa(L);if(e.version="3.2.2",e.removed=[],!i||!i.document||i.document.nodeType!==Mi.document)return e.isSupported=!1,e;let{document:t}=i,r=t,n=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:d,NamedNodeMap:p=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:m,DOMParser:E,trustedTypes:v}=i,C=l.prototype,_=Ri(C,"cloneNode"),k=Ri(C,"remove"),D=Ri(C,"nextSibling"),q=Ri(C,"childNodes"),B=Ri(C,"parentNode");if(typeof o=="function"){let L=t.createElement("template");L.content&&L.content.ownerDocument&&(t=L.content.ownerDocument)}let S,R="",{implementation:x,createNodeIterator:P,createDocumentFragment:N,getElementsByTagName:U}=t,{importNode:X}=r,z=Da();e.isSupported=typeof Fa=="function"&&typeof B=="function"&&x&&x.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Y,ERB_EXPR:W,TMPLIT_EXPR:ye,DATA_ATTR:xe,ARIA_ATTR:u,IS_SCRIPT_OR_DATA:h,ATTR_WHITESPACE:f,CUSTOM_ELEMENT:y}=Pa,{IS_ALLOWED_URI:w}=Pa,b=null,O=F({},[...Ia,...ps,...fs,...ms,...Oa]),M=null,ce=F({},[...Ra,...gs,...Ma,...Zr]),H=Object.seal(Ba(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,ne=null,de=!0,Le=!0,Ct=!1,It=!0,Je=!1,Ot=!0,ze=!1,fi=!1,Rt=!1,Ve=!1,Mt=!1,Pt=!1,Fe=!0,ct=!1,Ui="user-content-",Dt=!0,$e=!1,je={},Ue=null,mi=F({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),gi=null,co=F({},["audio","video","img","source","image","track"]),yn=null,uo=F({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wi="http://www.w3.org/1998/Math/MathML",Ki="http://www.w3.org/2000/svg",We="http://www.w3.org/1999/xhtml",Ft=We,wn=!1,En=null,Sl=F({},[Wi,Ki,We],ds),Gi=F({},["mi","mo","mn","ms","mtext"]),Xi=F({},["annotation-xml"]),Tl=F({},["title","style","font","a","script"]),vi=null,kl=["application/xhtml+xml","text/html"],xl="text/html",se=null,Bt=null,Ll=t.createElement("form"),ho=function(c){return c instanceof RegExp||c instanceof Function},_n=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Bt&&Bt===c)){if((!c||typeof c!="object")&&(c={}),c=Et(c),vi=kl.indexOf(c.PARSER_MEDIA_TYPE)===-1?xl:c.PARSER_MEDIA_TYPE,se=vi==="application/xhtml+xml"?ds:Qr,b=Re(c,"ALLOWED_TAGS")?F({},c.ALLOWED_TAGS,se):O,M=Re(c,"ALLOWED_ATTR")?F({},c.ALLOWED_ATTR,se):ce,En=Re(c,"ALLOWED_NAMESPACES")?F({},c.ALLOWED_NAMESPACES,ds):Sl,yn=Re(c,"ADD_URI_SAFE_ATTR")?F(Et(uo),c.ADD_URI_SAFE_ATTR,se):uo,gi=Re(c,"ADD_DATA_URI_TAGS")?F(Et(co),c.ADD_DATA_URI_TAGS,se):co,Ue=Re(c,"FORBID_CONTENTS")?F({},c.FORBID_CONTENTS,se):mi,V=Re(c,"FORBID_TAGS")?F({},c.FORBID_TAGS,se):{},ne=Re(c,"FORBID_ATTR")?F({},c.FORBID_ATTR,se):{},je=Re(c,"USE_PROFILES")?c.USE_PROFILES:!1,de=c.ALLOW_ARIA_ATTR!==!1,Le=c.ALLOW_DATA_ATTR!==!1,Ct=c.ALLOW_UNKNOWN_PROTOCOLS||!1,It=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Je=c.SAFE_FOR_TEMPLATES||!1,Ot=c.SAFE_FOR_XML!==!1,ze=c.WHOLE_DOCUMENT||!1,Ve=c.RETURN_DOM||!1,Mt=c.RETURN_DOM_FRAGMENT||!1,Pt=c.RETURN_TRUSTED_TYPE||!1,Rt=c.FORCE_BODY||!1,Fe=c.SANITIZE_DOM!==!1,ct=c.SANITIZE_NAMED_PROPS||!1,Dt=c.KEEP_CONTENT!==!1,$e=c.IN_PLACE||!1,w=c.ALLOWED_URI_REGEXP||Na,Ft=c.NAMESPACE||We,Gi=c.MATHML_TEXT_INTEGRATION_POINTS||Gi,Xi=c.HTML_INTEGRATION_POINTS||Xi,H=c.CUSTOM_ELEMENT_HANDLING||{},c.CUSTOM_ELEMENT_HANDLING&&ho(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=c.CUSTOM_ELEMENT_HANDLING.tagNameCheck),c.CUSTOM_ELEMENT_HANDLING&&ho(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(H.allowCustomizedBuiltInElements=c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Je&&(Le=!1),Mt&&(Ve=!0),je&&(b=F({},Oa),M=[],je.html===!0&&(F(b,Ia),F(M,Ra)),je.svg===!0&&(F(b,ps),F(M,gs),F(M,Zr)),je.svgFilters===!0&&(F(b,fs),F(M,gs),F(M,Zr)),je.mathMl===!0&&(F(b,ms),F(M,Ma),F(M,Zr))),c.ADD_TAGS&&(b===O&&(b=Et(b)),F(b,c.ADD_TAGS,se)),c.ADD_ATTR&&(M===ce&&(M=Et(M)),F(M,c.ADD_ATTR,se)),c.ADD_URI_SAFE_ATTR&&F(yn,c.ADD_URI_SAFE_ATTR,se),c.FORBID_CONTENTS&&(Ue===mi&&(Ue=Et(Ue)),F(Ue,c.FORBID_CONTENTS,se)),Dt&&(b["#text"]=!0),ze&&F(b,["html","head","body"]),b.table&&(F(b,["tbody"]),delete V.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw Oi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Oi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=c.TRUSTED_TYPES_POLICY,R=S.createHTML("")}else S===void 0&&(S=nh(v,n)),S!==null&&typeof R=="string"&&(R=S.createHTML(""));ve&&ve(c),Bt=c}},po=F({},[...ps,...fs,...Ku]),fo=F({},[...ms,...Gu]),Cl=function(c){let g=B(c);(!g||!g.tagName)&&(g={namespaceURI:Ft,tagName:"template"});let A=Qr(c.tagName),K=Qr(g.tagName);return En[c.namespaceURI]?c.namespaceURI===Ki?g.namespaceURI===We?A==="svg":g.namespaceURI===Wi?A==="svg"&&(K==="annotation-xml"||Gi[K]):!!po[A]:c.namespaceURI===Wi?g.namespaceURI===We?A==="math":g.namespaceURI===Ki?A==="math"&&Xi[K]:!!fo[A]:c.namespaceURI===We?g.namespaceURI===Ki&&!Xi[K]||g.namespaceURI===Wi&&!Gi[K]?!1:!fo[A]&&(Tl[A]||!po[A]):!!(vi==="application/xhtml+xml"&&En[c.namespaceURI]):!1},Be=function(c){Ci(e.removed,{element:c});try{B(c).removeChild(c)}catch{k(c)}},Yi=function(c,g){try{Ci(e.removed,{attribute:g.getAttributeNode(c),from:g})}catch{Ci(e.removed,{attribute:null,from:g})}if(g.removeAttribute(c),c==="is")if(Ve||Mt)try{Be(g)}catch{}else try{g.setAttribute(c,"")}catch{}},mo=function(c){let g=null,A=null;if(Rt)c="<remove></remove>"+c;else{let ue=Ca(c,/^[\r\n\t ]+/);A=ue&&ue[0]}vi==="application/xhtml+xml"&&Ft===We&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");let K=S?S.createHTML(c):c;if(Ft===We)try{g=new E().parseFromString(K,vi)}catch{}if(!g||!g.documentElement){g=x.createDocument(Ft,"template",null);try{g.documentElement.innerHTML=wn?R:K}catch{}}let pe=g.body||g.documentElement;return c&&A&&pe.insertBefore(t.createTextNode(A),pe.childNodes[0]||null),Ft===We?U.call(g,ze?"html":"body")[0]:ze?g.documentElement:pe},go=function(c){return P.call(c.ownerDocument||c,c,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},vo=function(c){return c instanceof m&&(typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||!(c.attributes instanceof p)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function")},bo=function(c){return typeof a=="function"&&c instanceof a};function Ke(L,c,g){Yr(L,A=>{A.call(e,c,g,Bt)})}let yo=function(c){let g=null;if(Ke(z.beforeSanitizeElements,c,null),vo(c))return Be(c),!0;let A=se(c.nodeName);if(Ke(z.uponSanitizeElement,c,{tagName:A,allowedTags:b}),c.hasChildNodes()&&!bo(c.firstElementChild)&&ge(/<[/\w]/g,c.innerHTML)&&ge(/<[/\w]/g,c.textContent)||c.nodeType===Mi.progressingInstruction||Ot&&c.nodeType===Mi.comment&&ge(/<[/\w]/g,c.data))return Be(c),!0;if(!b[A]||V[A]){if(!V[A]&&Eo(A)&&(H.tagNameCheck instanceof RegExp&&ge(H.tagNameCheck,A)||H.tagNameCheck instanceof Function&&H.tagNameCheck(A)))return!1;if(Dt&&!Ue[A]){let K=B(c)||c.parentNode,pe=q(c)||c.childNodes;if(pe&&K){let ue=pe.length;for(let we=ue-1;we>=0;--we){let Ne=_(pe[we],!0);Ne.__removalCount=(c.__removalCount||0)+1,K.insertBefore(Ne,D(c))}}}return Be(c),!0}return c instanceof l&&!Cl(c)||(A==="noscript"||A==="noembed"||A==="noframes")&&ge(/<\/no(script|embed|frames)/i,c.innerHTML)?(Be(c),!0):(Je&&c.nodeType===Mi.text&&(g=c.textContent,Yr([Y,W,ye],K=>{g=Ii(g,K," ")}),c.textContent!==g&&(Ci(e.removed,{element:c.cloneNode()}),c.textContent=g)),Ke(z.afterSanitizeElements,c,null),!1)},wo=function(c,g,A){if(Fe&&(g==="id"||g==="name")&&(A in t||A in Ll))return!1;if(!(Le&&!ne[g]&&ge(xe,g))){if(!(de&&ge(u,g))){if(!M[g]||ne[g]){if(!(Eo(c)&&(H.tagNameCheck instanceof RegExp&&ge(H.tagNameCheck,c)||H.tagNameCheck instanceof Function&&H.tagNameCheck(c))&&(H.attributeNameCheck instanceof RegExp&&ge(H.attributeNameCheck,g)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(g))||g==="is"&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&ge(H.tagNameCheck,A)||H.tagNameCheck instanceof Function&&H.tagNameCheck(A))))return!1}else if(!yn[g]){if(!ge(w,Ii(A,f,""))){if(!((g==="src"||g==="xlink:href"||g==="href")&&c!=="script"&&$u(A,"data:")===0&&gi[c])){if(!(Ct&&!ge(h,Ii(A,f,"")))){if(A)return!1}}}}}}return!0},Eo=function(c){return c!=="annotation-xml"&&Ca(c,y)},_o=function(c){Ke(z.beforeSanitizeAttributes,c,null);let{attributes:g}=c;if(!g)return;let A={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},K=g.length;for(;K--;){let pe=g[K],{name:ue,namespaceURI:we,value:Ne}=pe,bi=se(ue),fe=ue==="value"?Ne:ju(Ne);if(A.attrName=bi,A.attrValue=fe,A.keepAttr=!0,A.forceKeepAttr=void 0,Ke(z.uponSanitizeAttribute,c,A),fe=A.attrValue,ct&&(bi==="id"||bi==="name")&&(Yi(ue,c),fe=Ui+fe),Ot&&ge(/((--!?|])>)|<\/(style|title)/i,fe)){Yi(ue,c);continue}if(A.forceKeepAttr||(Yi(ue,c),!A.keepAttr))continue;if(!It&&ge(/\/>/i,fe)){Yi(ue,c);continue}Je&&Yr([Y,W,ye],So=>{fe=Ii(fe,So," ")});let Ao=se(c.nodeName);if(wo(Ao,bi,fe)){if(S&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!we)switch(v.getAttributeType(Ao,bi)){case"TrustedHTML":{fe=S.createHTML(fe);break}case"TrustedScriptURL":{fe=S.createScriptURL(fe);break}}try{we?c.setAttributeNS(we,ue,fe):c.setAttribute(ue,fe),vo(c)?Be(c):La(e.removed)}catch{}}}Ke(z.afterSanitizeAttributes,c,null)},Il=function L(c){let g=null,A=go(c);for(Ke(z.beforeSanitizeShadowDOM,c,null);g=A.nextNode();)Ke(z.uponSanitizeShadowNode,g,null),!yo(g)&&(g.content instanceof s&&L(g.content),_o(g));Ke(z.afterSanitizeShadowDOM,c,null)};return e.sanitize=function(L){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=null,A=null,K=null,pe=null;if(wn=!L,wn&&(L="<!-->"),typeof L!="string"&&!bo(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw Oi("dirty is not a string, aborting")}else throw Oi("toString is not a function");if(!e.isSupported)return L;if(fi||_n(c),e.removed=[],typeof L=="string"&&($e=!1),$e){if(L.nodeName){let Ne=se(L.nodeName);if(!b[Ne]||V[Ne])throw Oi("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof a)g=mo("<!---->"),A=g.ownerDocument.importNode(L,!0),A.nodeType===Mi.element&&A.nodeName==="BODY"||A.nodeName==="HTML"?g=A:g.appendChild(A);else{if(!Ve&&!Je&&!ze&&L.indexOf("<")===-1)return S&&Pt?S.createHTML(L):L;if(g=mo(L),!g)return Ve?null:Pt?R:""}g&&Rt&&Be(g.firstChild);let ue=go($e?L:g);for(;K=ue.nextNode();)yo(K)||(K.content instanceof s&&Il(K.content),_o(K));if($e)return L;if(Ve){if(Mt)for(pe=N.call(g.ownerDocument);g.firstChild;)pe.appendChild(g.firstChild);else pe=g;return(M.shadowroot||M.shadowrootmode)&&(pe=X.call(r,pe,!0)),pe}let we=ze?g.outerHTML:g.innerHTML;return ze&&b["!doctype"]&&g.ownerDocument&&g.ownerDocument.doctype&&g.ownerDocument.doctype.name&&ge(Ha,g.ownerDocument.doctype.name)&&(we="<!DOCTYPE "+g.ownerDocument.doctype.name+`>
6
- `+we),Je&&Yr([Y,W,ye],Ne=>{we=Ii(we,Ne," ")}),S&&Pt?S.createHTML(we):we},e.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n(L),fi=!0},e.clearConfig=function(){Bt=null,fi=!1},e.isValidAttribute=function(L,c,g){Bt||_n({});let A=se(L),K=se(c);return wo(A,K,g)},e.addHook=function(L,c){typeof c=="function"&&Ci(z[L],c)},e.removeHook=function(L){return La(z[L])},e.removeHooks=function(L){z[L]=[]},e.removeAllHooks=function(){z=Da()},e}var ys=qa();function _s(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var At=_s();function Wa(i){At=i}var Fi={exec:()=>null};function j(i,e=""){let t=typeof i=="string"?i:i.source,r={replace:(n,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(be.caret,"$1"),t=t.replace(n,o),r},getRegex:()=>new RegExp(t,e)};return r}var be={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},sh=/^(?:[ \t]*(?:\n|$))+/,oh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ah=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ni=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ka=/(?:[*+-]|\d{1,9}[.)])/,Ga=j(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ka).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),As=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ch=/^[^\n]+/,Ss=/(?!\s*\])(?:\\.|[^\[\]\\])+/,uh=j(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ss).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),hh=j(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ka).getRegex(),tn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ts=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dh=j("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ts).replace("tag",tn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xa=j(As).replace("hr",Ni).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tn).getRegex(),ph=j(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xa).getRegex(),ks={blockquote:ph,code:oh,def:uh,fences:ah,heading:lh,hr:Ni,html:dh,lheading:Ga,list:hh,newline:sh,paragraph:Xa,table:Fi,text:ch},za=j("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ni).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tn).getRegex(),fh={...ks,table:za,paragraph:j(As).replace("hr",Ni).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",za).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tn).getRegex()},mh={...ks,html:j(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ts).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:j(As).replace("hr",Ni).replace("heading",` *#{1,6} *[^
7
- ]`).replace("lheading",Ga).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ya=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Za=/^( {2,}|\\)\n(?!\s*$)/,vh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,rn=/[\p{P}\p{S}]/u,xs=/[\s\p{P}\p{S}]/u,Qa=/[^\s\p{P}\p{S}]/u,bh=j(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xs).getRegex(),yh=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,wh=j(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,"u").replace(/punct/g,rn).getRegex(),Eh=j("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Qa).replace(/punctSpace/g,xs).replace(/punct/g,rn).getRegex(),_h=j("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qa).replace(/punctSpace/g,xs).replace(/punct/g,rn).getRegex(),Ah=j(/\\(punct)/,"gu").replace(/punct/g,rn).getRegex(),Sh=j(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Th=j(Ts).replace("(?:-->|$)","-->").getRegex(),kh=j("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Th).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),en=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xh=j(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",en).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ja=j(/^!?\[(label)\]\[(ref)\]/).replace("label",en).replace("ref",Ss).getRegex(),el=j(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ss).getRegex(),Lh=j("reflink|nolink(?!\\()","g").replace("reflink",Ja).replace("nolink",el).getRegex(),Ls={_backpedal:Fi,anyPunctuation:Ah,autolink:Sh,blockSkip:yh,br:Za,code:gh,del:Fi,emStrongLDelim:wh,emStrongRDelimAst:Eh,emStrongRDelimUnd:_h,escape:Ya,link:xh,nolink:el,punctuation:bh,reflink:Ja,reflinkSearch:Lh,tag:kh,text:vh,url:Fi},Ch={...Ls,link:j(/^!?\[(label)\]\((.*?)\)/).replace("label",en).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",en).getRegex()},ws={...Ls,escape:j(Ya).replace("])","~|])").getRegex(),url:j(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ih={...ws,br:j(Za).replace("{2,}","*").getRegex(),text:j(ws.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Jr={normal:ks,gfm:fh,pedantic:mh},Pi={normal:Ls,gfm:ws,breaks:Ih,pedantic:Ch},Oh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Va=i=>Oh[i];function He(i,e){if(e){if(be.escapeTest.test(i))return i.replace(be.escapeReplace,Va)}else if(be.escapeTestNoEncode.test(i))return i.replace(be.escapeReplaceNoEncode,Va);return i}function $a(i){try{i=encodeURI(i).replace(be.percentDecode,"%")}catch{return null}return i}function ja(i,e){let t=i.replace(be.findPipe,(s,o,a)=>{let l=!1,d=o;for(;--d>=0&&a[d]==="\\";)l=!l;return l?"|":" |"}),r=t.split(be.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(be.slashPipe,"|");return r}function Di(i,e,t){let r=i.length;if(r===0)return"";let n=0;for(;n<r;){let s=i.charAt(r-n-1);if(s===e&&!t)n++;else if(s!==e&&t)n++;else break}return i.slice(0,r-n)}function Rh(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===e[0])t++;else if(i[r]===e[1]&&(t--,t<0))return r;return-1}function Ua(i,e,t,r,n){let s=e.href,o=e.title||null,a=i[1].replace(n.other.outputLinkReplace,"$1");if(i[0].charAt(0)!=="!"){r.state.inLink=!0;let l={type:"link",raw:t,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:t,href:s,title:o,text:a}}function Mh(i,e,t){let r=i.match(t.other.indentCodeCompensation);if(r===null)return e;let n=r[1];return e.split(`
8
- `).map(s=>{let o=s.match(t.other.beginningSpace);if(o===null)return s;let[a]=o;return a.length>=n.length?s.slice(n.length):s}).join(`
9
- `)}var ri=class{options;rules;lexer;constructor(e){this.options=e||At}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Di(r,`
10
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=Mh(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let n=Di(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Di(t[0],`
11
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=Di(t[0],`
6
+ %o`,t,e,r),(s=window.onerror)===null||s===void 0||s.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}};function gb(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function vb(i){return ln(i,"classes").reduce((t,r)=>Object.assign(t,bb(r)),{})}function bb(i){return{[`${i}Class`]:{get(){let{classes:e}=this;if(e.has(i))return e.get(i);{let t=e.getAttributeName(i);throw new Error(`Missing attribute "${t}"`)}}},[`${i}Classes`]:{get(){return this.classes.getAll(i)}},[`has${an(i)}Class`]:{get(){return this.classes.has(i)}}}}function yb(i){return ln(i,"outlets").reduce((t,r)=>Object.assign(t,wb(r)),{})}function Ad(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function kd(i,e,t){let r=Ad(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Ad(i,e,t),r))return r}function wb(i){let e=Dl(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let s=kd(this,t,i);if(s)return s;throw new Error(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(i);return t.length>0?t.map(r=>{let s=kd(this,r,i);if(s)return s;console.warn(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`,r)}).filter(r=>r):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t)return t;throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(i)}},[`has${an(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function Sb(i){return ln(i,"targets").reduce((t,r)=>Object.assign(t,Eb(r)),{})}function Eb(i){return{[`${i}Target`]:{get(){let e=this.targets.find(i);if(e)return e;throw new Error(`Missing target element "${i}" for "${this.identifier}" controller`)}},[`${i}Targets`]:{get(){return this.targets.findAll(i)}},[`has${an(i)}Target`]:{get(){return this.targets.has(i)}}}}function Tb(i){let e=sb(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,s)=>{let n=Ld(s,this.identifier),o=this.data.getAttributeNameForKey(n.key);return Object.assign(r,{[o]:n})},{})}}};return e.reduce((r,s)=>Object.assign(r,xb(s)),t)}function xb(i,e){let t=Ld(i,e),{key:r,name:s,reader:n,writer:o}=t;return{[s]:{get(){let a=this.data.get(r);return a!==null?n(a):t.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${an(s)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function Ld([i,e],t){return Cb({controller:t,token:i,typeDefinition:e})}function Wo(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function on(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(i))return"array";if(Object.prototype.toString.call(i)==="[object Object]")return"object"}function Ab(i){let{controller:e,token:t,typeObject:r}=i,s=Sd(r.type),n=Sd(r.default),o=s&&n,a=s&&!n,l=!s&&n,c=Wo(r.type),d=on(i.typeObject.default);if(a)return c;if(l)return d;if(c!==d){let f=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${f}" must match the defined type "${c}". The provided default value of "${r.default}" is of type "${d}".`)}if(o)return c}function kb(i){let{controller:e,token:t,typeDefinition:r}=i,n=Ab({controller:e,token:t,typeObject:r}),o=on(r),a=Wo(r),l=n||o||a;if(l)return l;let c=e?`${e}.${r}`:t;throw new Error(`Unknown value type "${c}" for "${t}" value`)}function Pb(i){let e=Wo(i);if(e)return Pd[e];let t=Nl(i,"default"),r=Nl(i,"type"),s=i;if(t)return s.default;if(r){let{type:n}=s,o=Wo(n);if(o)return Pd[o]}return i}function Cb(i){let{token:e,typeDefinition:t}=i,r=`${_d(e)}-value`,s=kb(i);return{type:s,key:r,name:rc(r),get defaultValue(){return Pb(t)},get hasCustomDefaultValue(){return on(t)!==void 0},reader:Fb[s],writer:Cd[s]||Cd.default}}var Pd={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Fb={array(i){let e=JSON.parse(i);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${i}" of type "${on(e)}"`);return e},boolean(i){return!(i=="0"||String(i).toLowerCase()=="false")},number(i){return Number(i.replace(/_/g,""))},object(i){let e=JSON.parse(i);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${i}" of type "${on(e)}"`);return e},string(i){return i}},Cd={default:_b,array:Fd,object:Fd};function Fd(i){return JSON.stringify(i)}function _b(i){return`${i}`}var ne=class{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:s=this.identifier,bubbles:n=!0,cancelable:o=!0}={}){let a=s?`${s}:${e}`:e,l=new CustomEvent(a,{detail:r,bubbles:n,cancelable:o});return t.dispatchEvent(l),l}};ne.blessings=[vb,Sb,Tb,yb];ne.targets=[];ne.outlets=[];ne.values={};var Go=class extends ne{static targets=["openIcon","closeIcon"];static outlets=["sidebar"];static values={placement:{type:String,default:"left"},bodyScrolling:{type:Boolean,default:!1},backdrop:{type:Boolean,default:!0},edge:{type:Boolean,default:!1},edgeOffset:{type:String,default:"bottom-[60px]"}};static classes={backdrop:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30"};initialize(){this.visible=!1,this.handleEscapeKey=this.handleEscapeKey.bind(this)}connect(){document.addEventListener("keydown",this.handleEscapeKey)}sidebarOutletConnected(){this.#e(this.sidebarOutlet.element)}disconnect(){this.#i(),document.removeEventListener("keydown",this.handleEscapeKey),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden")}#e(i){i.setAttribute("aria-hidden","true"),i.classList.add("transition-transform"),this.#s(this.placementValue).base.forEach(e=>{i.classList.add(e)})}toggleDrawer(){this.visible?this.hideDrawer():this.showDrawer()}showDrawer(){this.edgeValue?this.#n(`${this.placementValue}-edge`,!0):this.#r(this.placementValue,!0),this.openIconTarget.classList.add("hidden"),this.openIconTarget.setAttribute("aria-hidden","true"),this.closeIconTarget.classList.remove("hidden"),this.closeIconTarget.setAttribute("aria-hidden","false"),this.sidebarOutlet.element.setAttribute("aria-modal","true"),this.sidebarOutlet.element.setAttribute("role","dialog"),this.sidebarOutlet.element.removeAttribute("aria-hidden"),this.bodyScrollingValue||document.body.classList.add("overflow-hidden"),this.backdropValue&&this.#t(),this.visible=!0,this.dispatch("show")}hideDrawer(){this.edgeValue?this.#n(`${this.placementValue}-edge`,!1):this.#r(this.placementValue,!1),this.openIconTarget.classList.remove("hidden"),this.openIconTarget.setAttribute("aria-hidden","false"),this.closeIconTarget.classList.add("hidden"),this.closeIconTarget.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.removeAttribute("aria-modal"),this.sidebarOutlet.element.removeAttribute("role"),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden"),this.backdropValue&&this.#i(),this.visible=!1,this.dispatch("hide")}handleEscapeKey(i){i.key==="Escape"&&this.visible&&this.hideDrawer()}#t(){if(!this.visible){let i=document.createElement("div");i.setAttribute("data-drawer-backdrop",""),i.classList.add(...this.constructor.classes.backdrop.split(" ")),i.addEventListener("click",()=>this.hideDrawer()),document.body.appendChild(i)}}#i(){let i=document.querySelector("[data-drawer-backdrop]");i&&i.remove()}#s(i){let e={top:{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]},right:{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]},bottom:{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]},left:{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]},"bottom-edge":{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this.edgeOffsetValue]}};return e[i]||e.left}#r(i,e){let t=this.#s(i);e?(t.active.forEach(r=>this.sidebarOutlet.element.classList.add(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.remove(r))):(t.active.forEach(r=>this.sidebarOutlet.element.classList.remove(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.add(r)))}#n(i,e){this.#r(i,e)}};var Ko=class extends ne{static targets=["target","template","addButton"];static values={wrapperSelector:{type:String,default:".nested-resource-form-fields"},limit:Number};connect(){this.updateState()}add(i){i.preventDefault();let e=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,new Date().getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",e);let t=new CustomEvent("nested-resource-form-fields:add",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}remove(i){i.preventDefault();let e=i.target.closest(this.wrapperSelectorValue);if(e.dataset.newRecord!==void 0)e.remove();else{e.style.display="none",e.classList.remove(...e.classList);let r=e.querySelector("input[name*='_destroy']");r.value="1"}let t=new CustomEvent("nested-resource-form-fields:remove",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}updateState(){!this.hasAddButtonTarget||this.limitValue==0||(this.childCount>=this.limitValue?this.addButtonTarget.style.display="none":this.addButtonTarget.style.display="initial")}get childCount(){return this.element.querySelectorAll(this.wrapperSelectorValue).length}};var bx=Ce(Nd(),1),Xo=class extends ne{connect(){}submit(){this.element.requestSubmit()}};var De="top",Ye="bottom",qe="right",Ue="left",Yo="auto",cr=[De,Ye,qe,Ue],Ii="start",Tr="end",Bd="clippingParents",Zo="viewport",bs="popper",Ud="reference",oc=cr.reduce(function(i,e){return i.concat([e+"-"+Ii,e+"-"+Tr])},[]),Qo=[].concat(cr,[Yo]).reduce(function(i,e){return i.concat([e,e+"-"+Ii,e+"-"+Tr])},[]),Kb="beforeRead",Xb="read",Yb="afterRead",Zb="beforeMain",Qb="main",Jb="afterMain",ey="beforeWrite",ty="write",iy="afterWrite",zd=[Kb,Xb,Yb,Zb,Qb,Jb,ey,ty,iy];function et(i){return i?(i.nodeName||"").toLowerCase():null}function Fe(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function qt(i){var e=Fe(i).Element;return i instanceof e||i instanceof Element}function Ze(i){var e=Fe(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function ys(i){if(typeof ShadowRoot>"u")return!1;var e=Fe(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function ry(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},s=e.attributes[t]||{},n=e.elements[t];!Ze(n)||!et(n)||(Object.assign(n.style,r),Object.keys(s).forEach(function(o){var a=s[o];a===!1?n.removeAttribute(o):n.setAttribute(o,a===!0?"":a)}))})}function sy(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var s=e.elements[r],n=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Ze(s)||!et(s)||(Object.assign(s.style,a),Object.keys(n).forEach(function(l){s.removeAttribute(l)}))})}}var Hd={name:"applyStyles",enabled:!0,phase:"write",fn:ry,effect:sy,requires:["computeStyles"]};function tt(i){return i.split("-")[0]}var ii=Math.max,xr=Math.min,Di=Math.round;function ws(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function cn(){return!/^((?!chrome|android).)*safari/i.test(ws())}function Vt(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),s=1,n=1;e&&Ze(i)&&(s=i.offsetWidth>0&&Di(r.width)/i.offsetWidth||1,n=i.offsetHeight>0&&Di(r.height)/i.offsetHeight||1);var o=qt(i)?Fe(i):window,a=o.visualViewport,l=!cn()&&t,c=(r.left+(l&&a?a.offsetLeft:0))/s,d=(r.top+(l&&a?a.offsetTop:0))/n,f=r.width/s,y=r.height/n;return{width:f,height:y,top:d,right:c+f,bottom:d+y,left:c,x:c,y:d}}function Ar(i){var e=Vt(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function un(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&ys(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ft(i){return Fe(i).getComputedStyle(i)}function ac(i){return["table","td","th"].indexOf(et(i))>=0}function nt(i){return((qt(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ni(i){return et(i)==="html"?i:i.assignedSlot||i.parentNode||(ys(i)?i.host:null)||nt(i)}function $d(i){return!Ze(i)||ft(i).position==="fixed"?null:i.offsetParent}function ny(i){var e=/firefox/i.test(ws()),t=/Trident/i.test(ws());if(t&&Ze(i)){var r=ft(i);if(r.position==="fixed")return null}var s=Ni(i);for(ys(s)&&(s=s.host);Ze(s)&&["html","body"].indexOf(et(s))<0;){var n=ft(s);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||e&&n.willChange==="filter"||e&&n.filter&&n.filter!=="none")return s;s=s.parentNode}return null}function ri(i){for(var e=Fe(i),t=$d(i);t&&ac(t)&&ft(t).position==="static";)t=$d(t);return t&&(et(t)==="html"||et(t)==="body"&&ft(t).position==="static")?e:t||ny(i)||e}function kr(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function Pr(i,e,t){return ii(i,xr(e,t))}function qd(i,e,t){var r=Pr(i,e,t);return r>t?t:r}function hn(){return{top:0,right:0,bottom:0,left:0}}function dn(i){return Object.assign({},hn(),i)}function pn(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var oy=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,dn(typeof e!="number"?e:pn(e,cr))};function ay(i){var e,t=i.state,r=i.name,s=i.options,n=t.elements.arrow,o=t.modifiersData.popperOffsets,a=tt(t.placement),l=kr(a),c=[Ue,qe].indexOf(a)>=0,d=c?"height":"width";if(!(!n||!o)){var f=oy(s.padding,t),y=Ar(n),v=l==="y"?De:Ue,x=l==="y"?Ye:qe,P=t.rects.reference[d]+t.rects.reference[l]-o[l]-t.rects.popper[d],C=o[l]-t.rects.reference[l],I=ri(n),D=I?l==="y"?I.clientHeight||0:I.clientWidth||0:0,q=P/2-C/2,M=f[v],H=D-y[d]-f[x],R=D/2-y[d]/2+q,G=Pr(M,R,H),K=l;t.modifiersData[r]=(e={},e[K]=G,e.centerOffset=G-R,e)}}function ly(i){var e=i.state,t=i.options,r=t.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||un(e.elements.popper,s)&&(e.elements.arrow=s))}var Vd={name:"arrow",enabled:!0,phase:"main",fn:ay,effect:ly,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function jt(i){return i.split("-")[1]}var cy={top:"auto",right:"auto",bottom:"auto",left:"auto"};function uy(i,e){var t=i.x,r=i.y,s=e.devicePixelRatio||1;return{x:Di(t*s)/s||0,y:Di(r*s)/s||0}}function jd(i){var e,t=i.popper,r=i.popperRect,s=i.placement,n=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,c=i.adaptive,d=i.roundOffsets,f=i.isFixed,y=o.x,v=y===void 0?0:y,x=o.y,P=x===void 0?0:x,C=typeof d=="function"?d({x:v,y:P}):{x:v,y:P};v=C.x,P=C.y;var I=o.hasOwnProperty("x"),D=o.hasOwnProperty("y"),q=Ue,M=De,H=window;if(c){var R=ri(t),G="clientHeight",K="clientWidth";if(R===Fe(t)&&(R=nt(t),ft(R).position!=="static"&&a==="absolute"&&(G="scrollHeight",K="scrollWidth")),R=R,s===De||(s===Ue||s===qe)&&n===Tr){M=Ye;var Y=f&&R===H&&H.visualViewport?H.visualViewport.height:R[G];P-=Y-r.height,P*=l?1:-1}if(s===Ue||(s===De||s===Ye)&&n===Tr){q=qe;var ie=f&&R===H&&H.visualViewport?H.visualViewport.width:R[K];v-=ie-r.width,v*=l?1:-1}}var Q=Object.assign({position:a},c&&cy),oe=d===!0?uy({x:v,y:P},Fe(t)):{x:v,y:P};if(v=oe.x,P=oe.y,l){var le;return Object.assign({},Q,(le={},le[M]=D?"0":"",le[q]=I?"0":"",le.transform=(H.devicePixelRatio||1)<=1?"translate("+v+"px, "+P+"px)":"translate3d("+v+"px, "+P+"px, 0)",le))}return Object.assign({},Q,(e={},e[M]=D?P+"px":"",e[q]=I?v+"px":"",e.transform="",e))}function hy(i){var e=i.state,t=i.options,r=t.gpuAcceleration,s=r===void 0?!0:r,n=t.adaptive,o=n===void 0?!0:n,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:tt(e.placement),variation:jt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,jd(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,jd(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var Wd={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:hy,data:{}};var Jo={passive:!0};function dy(i){var e=i.state,t=i.instance,r=i.options,s=r.scroll,n=s===void 0?!0:s,o=r.resize,a=o===void 0?!0:o,l=Fe(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return n&&c.forEach(function(d){d.addEventListener("scroll",t.update,Jo)}),a&&l.addEventListener("resize",t.update,Jo),function(){n&&c.forEach(function(d){d.removeEventListener("scroll",t.update,Jo)}),a&&l.removeEventListener("resize",t.update,Jo)}}var Gd={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:dy,data:{}};var py={left:"right",right:"left",bottom:"top",top:"bottom"};function Ss(i){return i.replace(/left|right|bottom|top/g,function(e){return py[e]})}var fy={start:"end",end:"start"};function ea(i){return i.replace(/start|end/g,function(e){return fy[e]})}function Cr(i){var e=Fe(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Fr(i){return Vt(nt(i)).left+Cr(i).scrollLeft}function lc(i,e){var t=Fe(i),r=nt(i),s=t.visualViewport,n=r.clientWidth,o=r.clientHeight,a=0,l=0;if(s){n=s.width,o=s.height;var c=cn();(c||!c&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:n,height:o,x:a+Fr(i),y:l}}function cc(i){var e,t=nt(i),r=Cr(i),s=(e=i.ownerDocument)==null?void 0:e.body,n=ii(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=ii(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-r.scrollLeft+Fr(i),l=-r.scrollTop;return ft(s||t).direction==="rtl"&&(a+=ii(t.clientWidth,s?s.clientWidth:0)-n),{width:n,height:o,x:a,y:l}}function _r(i){var e=ft(i),t=e.overflow,r=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+r)}function ta(i){return["html","body","#document"].indexOf(et(i))>=0?i.ownerDocument.body:Ze(i)&&_r(i)?i:ta(Ni(i))}function ur(i,e){var t;e===void 0&&(e=[]);var r=ta(i),s=r===((t=i.ownerDocument)==null?void 0:t.body),n=Fe(r),o=s?[n].concat(n.visualViewport||[],_r(r)?r:[]):r,a=e.concat(o);return s?a:a.concat(ur(Ni(o)))}function Es(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function my(i,e){var t=Vt(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function Kd(i,e,t){return e===Zo?Es(lc(i,t)):qt(e)?my(e,t):Es(cc(nt(i)))}function gy(i){var e=ur(Ni(i)),t=["absolute","fixed"].indexOf(ft(i).position)>=0,r=t&&Ze(i)?ri(i):i;return qt(r)?e.filter(function(s){return qt(s)&&un(s,r)&&et(s)!=="body"}):[]}function uc(i,e,t,r){var s=e==="clippingParents"?gy(i):[].concat(e),n=[].concat(s,[t]),o=n[0],a=n.reduce(function(l,c){var d=Kd(i,c,r);return l.top=ii(d.top,l.top),l.right=xr(d.right,l.right),l.bottom=xr(d.bottom,l.bottom),l.left=ii(d.left,l.left),l},Kd(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function fn(i){var e=i.reference,t=i.element,r=i.placement,s=r?tt(r):null,n=r?jt(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(s){case De:l={x:o,y:e.y-t.height};break;case Ye:l={x:o,y:e.y+e.height};break;case qe:l={x:e.x+e.width,y:a};break;case Ue:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=s?kr(s):null;if(c!=null){var d=c==="y"?"height":"width";switch(n){case Ii:l[c]=l[c]-(e[d]/2-t[d]/2);break;case Tr:l[c]=l[c]+(e[d]/2-t[d]/2);break;default:}}return l}function si(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=r===void 0?i.placement:r,n=t.strategy,o=n===void 0?i.strategy:n,a=t.boundary,l=a===void 0?Bd:a,c=t.rootBoundary,d=c===void 0?Zo:c,f=t.elementContext,y=f===void 0?bs:f,v=t.altBoundary,x=v===void 0?!1:v,P=t.padding,C=P===void 0?0:P,I=dn(typeof C!="number"?C:pn(C,cr)),D=y===bs?Ud:bs,q=i.rects.popper,M=i.elements[x?D:y],H=uc(qt(M)?M:M.contextElement||nt(i.elements.popper),l,d,o),R=Vt(i.elements.reference),G=fn({reference:R,element:q,strategy:"absolute",placement:s}),K=Es(Object.assign({},q,G)),Y=y===bs?K:R,ie={top:H.top-Y.top+I.top,bottom:Y.bottom-H.bottom+I.bottom,left:H.left-Y.left+I.left,right:Y.right-H.right+I.right},Q=i.modifiersData.offset;if(y===bs&&Q){var oe=Q[s];Object.keys(ie).forEach(function(le){var Ae=[qe,Ye].indexOf(le)>=0?1:-1,We=[De,Ye].indexOf(le)>=0?"y":"x";ie[le]+=oe[We]*Ae})}return ie}function hc(i,e){e===void 0&&(e={});var t=e,r=t.placement,s=t.boundary,n=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?Qo:l,d=jt(r),f=d?a?oc:oc.filter(function(x){return jt(x)===d}):cr,y=f.filter(function(x){return c.indexOf(x)>=0});y.length===0&&(y=f);var v=y.reduce(function(x,P){return x[P]=si(i,{placement:P,boundary:s,rootBoundary:n,padding:o})[tt(P)],x},{});return Object.keys(v).sort(function(x,P){return v[x]-v[P]})}function vy(i){if(tt(i)===Yo)return[];var e=Ss(i);return[ea(i),e,ea(e)]}function by(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var s=t.mainAxis,n=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,c=t.padding,d=t.boundary,f=t.rootBoundary,y=t.altBoundary,v=t.flipVariations,x=v===void 0?!0:v,P=t.allowedAutoPlacements,C=e.options.placement,I=tt(C),D=I===C,q=l||(D||!x?[Ss(C)]:vy(C)),M=[C].concat(q).reduce(function(ke,se){return ke.concat(tt(se)===Yo?hc(e,{placement:se,boundary:d,rootBoundary:f,padding:c,flipVariations:x,allowedAutoPlacements:P}):se)},[]),H=e.rects.reference,R=e.rects.popper,G=new Map,K=!0,Y=M[0],ie=0;ie<M.length;ie++){var Q=M[ie],oe=tt(Q),le=jt(Q)===Ii,Ae=[De,Ye].indexOf(oe)>=0,We=Ae?"width":"height",T=si(e,{placement:Q,boundary:d,rootBoundary:f,altBoundary:y,padding:c}),A=Ae?le?qe:Ue:le?Ye:De;H[We]>R[We]&&(A=Ss(A));var k=Ss(A),$=[];if(n&&$.push(T[oe]<=0),a&&$.push(T[A]<=0,T[k]<=0),$.every(function(ke){return ke})){Y=Q,K=!1;break}G.set(Q,$)}if(K)for(var j=x?3:1,z=function(se){var ce=M.find(function(Me){var Ne=G.get(Me);if(Ne)return Ne.slice(0,se).every(function(He){return He})});if(ce)return Y=ce,"break"},J=j;J>0;J--){var ee=z(J);if(ee==="break")break}e.placement!==Y&&(e.modifiersData[r]._skip=!0,e.placement=Y,e.reset=!0)}}var Xd={name:"flip",enabled:!0,phase:"main",fn:by,requiresIfExists:["offset"],data:{_skip:!1}};function Yd(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function Zd(i){return[De,qe,Ye,Ue].some(function(e){return i[e]>=0})}function yy(i){var e=i.state,t=i.name,r=e.rects.reference,s=e.rects.popper,n=e.modifiersData.preventOverflow,o=si(e,{elementContext:"reference"}),a=si(e,{altBoundary:!0}),l=Yd(o,r),c=Yd(a,s,n),d=Zd(l),f=Zd(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}var Qd={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:yy};function wy(i,e,t){var r=tt(i),s=[Ue,De].indexOf(r)>=0?-1:1,n=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=n[0],a=n[1];return o=o||0,a=(a||0)*s,[Ue,qe].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Sy(i){var e=i.state,t=i.options,r=i.name,s=t.offset,n=s===void 0?[0,0]:s,o=Qo.reduce(function(d,f){return d[f]=wy(f,e.rects,n),d},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}var Jd={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Sy};function Ey(i){var e=i.state,t=i.name;e.modifiersData[t]=fn({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var ep={name:"popperOffsets",enabled:!0,phase:"read",fn:Ey,data:{}};function dc(i){return i==="x"?"y":"x"}function Ty(i){var e=i.state,t=i.options,r=i.name,s=t.mainAxis,n=s===void 0?!0:s,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,c=t.rootBoundary,d=t.altBoundary,f=t.padding,y=t.tether,v=y===void 0?!0:y,x=t.tetherOffset,P=x===void 0?0:x,C=si(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:d}),I=tt(e.placement),D=jt(e.placement),q=!D,M=kr(I),H=dc(M),R=e.modifiersData.popperOffsets,G=e.rects.reference,K=e.rects.popper,Y=typeof P=="function"?P(Object.assign({},e.rects,{placement:e.placement})):P,ie=typeof Y=="number"?{mainAxis:Y,altAxis:Y}:Object.assign({mainAxis:0,altAxis:0},Y),Q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,oe={x:0,y:0};if(R){if(n){var le,Ae=M==="y"?De:Ue,We=M==="y"?Ye:qe,T=M==="y"?"height":"width",A=R[M],k=A+C[Ae],$=A-C[We],j=v?-K[T]/2:0,z=D===Ii?G[T]:K[T],J=D===Ii?-K[T]:-G[T],ee=e.elements.arrow,ke=v&&ee?Ar(ee):{width:0,height:0},se=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:hn(),ce=se[Ae],Me=se[We],Ne=Pr(0,G[T],ke[T]),He=q?G[T]/2-j-Ne-ce-ie.mainAxis:z-Ne-ce-ie.mainAxis,fi=q?-G[T]/2+j+Ne+Me+ie.mainAxis:J+Ne+Me+ie.mainAxis,mi=e.elements.arrow&&ri(e.elements.arrow),Yt=mi?M==="y"?mi.clientTop||0:mi.clientLeft||0:0,er=(le=Q?.[M])!=null?le:0,Zt=A+He-er-Yt,br=A+fi-er,ki=Pr(v?xr(k,Zt):k,A,v?ii($,br):$);R[M]=ki,oe[M]=ki-A}if(a){var Ut,Pi=M==="x"?De:Ue,Ci=M==="x"?Ye:qe,Ct=R[H],gi=H==="y"?"height":"width",tr=Ct+C[Pi],Fi=Ct-C[Ci],Qt=[De,Ue].indexOf(I)!==-1,Jt=(Ut=Q?.[H])!=null?Ut:0,ei=Qt?tr:Ct-G[gi]-K[gi]-Jt+ie.altAxis,yr=Qt?Ct+G[gi]+K[gi]-Jt-ie.altAxis:Fi,ir=v&&Qt?qd(ei,Ct,yr):Pr(v?ei:tr,Ct,v?yr:Fi);R[H]=ir,oe[H]=ir-Ct}e.modifiersData[r]=oe}}var tp={name:"preventOverflow",enabled:!0,phase:"main",fn:Ty,requiresIfExists:["offset"]};function pc(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function fc(i){return i===Fe(i)||!Ze(i)?Cr(i):pc(i)}function xy(i){var e=i.getBoundingClientRect(),t=Di(e.width)/i.offsetWidth||1,r=Di(e.height)/i.offsetHeight||1;return t!==1||r!==1}function mc(i,e,t){t===void 0&&(t=!1);var r=Ze(e),s=Ze(e)&&xy(e),n=nt(e),o=Vt(i,s,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((et(e)!=="body"||_r(n))&&(a=fc(e)),Ze(e)?(l=Vt(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):n&&(l.x=Fr(n))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Ay(i){var e=new Map,t=new Set,r=[];i.forEach(function(n){e.set(n.name,n)});function s(n){t.add(n.name);var o=[].concat(n.requires||[],n.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&s(l)}}),r.push(n)}return i.forEach(function(n){t.has(n.name)||s(n)}),r}function gc(i){var e=Ay(i);return zd.reduce(function(t,r){return t.concat(e.filter(function(s){return s.phase===r}))},[])}function vc(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function bc(i){var e=i.reduce(function(t,r){var s=t[r.name];return t[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var ip={placement:"bottom",modifiers:[],strategy:"absolute"};function rp(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function sp(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,s=e.defaultOptions,n=s===void 0?ip:s;return function(a,l,c){c===void 0&&(c=n);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},ip,n),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],y=!1,v={state:d,setOptions:function(I){var D=typeof I=="function"?I(d.options):I;P(),d.options=Object.assign({},n,d.options,D),d.scrollParents={reference:qt(a)?ur(a):a.contextElement?ur(a.contextElement):[],popper:ur(l)};var q=gc(bc([].concat(r,d.options.modifiers)));return d.orderedModifiers=q.filter(function(M){return M.enabled}),x(),v.update()},forceUpdate:function(){if(!y){var I=d.elements,D=I.reference,q=I.popper;if(rp(D,q)){d.rects={reference:mc(D,ri(q),d.options.strategy==="fixed"),popper:Ar(q)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(ie){return d.modifiersData[ie.name]=Object.assign({},ie.data)});for(var M=0;M<d.orderedModifiers.length;M++){if(d.reset===!0){d.reset=!1,M=-1;continue}var H=d.orderedModifiers[M],R=H.fn,G=H.options,K=G===void 0?{}:G,Y=H.name;typeof R=="function"&&(d=R({state:d,options:K,name:Y,instance:v})||d)}}}},update:vc(function(){return new Promise(function(C){v.forceUpdate(),C(d)})}),destroy:function(){P(),y=!0}};if(!rp(a,l))return v;v.setOptions(c).then(function(C){!y&&c.onFirstUpdate&&c.onFirstUpdate(C)});function x(){d.orderedModifiers.forEach(function(C){var I=C.name,D=C.options,q=D===void 0?{}:D,M=C.effect;if(typeof M=="function"){var H=M({state:d,name:I,instance:v,options:q}),R=function(){};f.push(H||R)}})}function P(){f.forEach(function(C){return C()}),f=[]}return v}}var ky=[Gd,ep,Wd,Hd,Jd,Xd,tp,Vd,Qd],yc=sp({defaultModifiers:ky});var ia=class extends ne{static targets=["trigger","menu"];connect(){this.visible=!1,this.initialized=!1,this.options={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1},this.init()}init(){this.triggerTarget&&this.menuTarget&&!this.initialized&&(this.popperInstance=yc(this.triggerTarget,this.menuTarget,{placement:this.options.placement,modifiers:[{name:"offset",options:{offset:[this.options.offsetSkidding,this.options.offsetDistance]}}]}),this.setupEventListeners(),this.initialized=!0)}disconnect(){this.initialized&&(this.options.triggerType==="click"&&this.triggerTarget.removeEventListener("click",this.clickHandler),this.options.triggerType==="hover"&&(this.triggerTarget.removeEventListener("mouseenter",this.hoverShowTriggerHandler),this.menuTarget.removeEventListener("mouseenter",this.hoverShowMenuHandler),this.triggerTarget.removeEventListener("mouseleave",this.hoverHideHandler),this.menuTarget.removeEventListener("mouseleave",this.hoverHideHandler)),this.removeClickOutsideListener(),this.popperInstance.destroy(),this.initialized=!1)}setupEventListeners(){this.clickHandler=this.toggle.bind(this),this.hoverShowTriggerHandler=i=>{i.type==="click"?this.toggle():setTimeout(()=>{this.show()},this.options.delay)},this.hoverShowMenuHandler=()=>{this.show()},this.hoverHideHandler=()=>{setTimeout(()=>{this.menuTarget.matches(":hover")||this.hide()},this.options.delay)},this.options.triggerType==="click"?this.triggerTarget.addEventListener("click",this.clickHandler):this.options.triggerType==="hover"&&(this.triggerTarget.addEventListener("mouseenter",this.hoverShowTriggerHandler),this.menuTarget.addEventListener("mouseenter",this.hoverShowMenuHandler),this.triggerTarget.addEventListener("mouseleave",this.hoverHideHandler),this.menuTarget.addEventListener("mouseleave",this.hoverHideHandler))}setupClickOutsideListener(){this.clickOutsideHandler=i=>{let e=i.target,t=this.options.ignoreClickOutsideClass,r=!1;t&&document.querySelectorAll(`.${t}`).forEach(n=>{if(n.contains(e)){r=!0;return}}),e!==this.menuTarget&&!this.menuTarget.contains(e)&&!this.triggerTarget.contains(e)&&!r&&this.visible&&this.hide()},document.body.addEventListener("click",this.clickOutsideHandler,!0)}removeClickOutsideListener(){this.clickOutsideHandler&&document.body.removeEventListener("click",this.clickOutsideHandler,!0)}toggle(){this.visible?this.hide():this.show()}show(){this.menuTarget.classList.remove("hidden"),this.menuTarget.classList.add("block"),this.menuTarget.removeAttribute("aria-hidden"),this.popperInstance.setOptions(i=>({...i,modifiers:[...i.modifiers,{name:"eventListeners",enabled:!0}]})),this.setupClickOutsideListener(),this.popperInstance.update(),this.visible=!0}hide(){this.menuTarget.classList.remove("block"),this.menuTarget.classList.add("hidden"),this.menuTarget.setAttribute("aria-hidden","true"),this.popperInstance.setOptions(i=>({...i,modifiers:[...i.modifiers,{name:"eventListeners",enabled:!1}]})),this.removeClickOutsideListener(),this.visible=!1}};var ra=class extends ne{static targets=["trigger","menu"];connect(){this.element.hasAttribute("data-visible")||this.element.setAttribute("data-visible","false"),this.#e()}toggle(){let i=this.element.getAttribute("data-visible")==="true";this.element.setAttribute("data-visible",(!i).toString()),this.#e()}#e(){this.element.getAttribute("data-visible")==="true"?(this.menuTarget.classList.remove("hidden"),this.triggerTarget.setAttribute("aria-expanded","true"),this.dispatch("expand")):(this.menuTarget.classList.add("hidden"),this.triggerTarget.setAttribute("aria-expanded","false"),this.dispatch("collapse"))}};var sa=class extends ne{static values={after:Number};connect(){this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.dismiss(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.autoDismissTimeout=null}dismiss(){this.element.remove()}};var na=class extends ne{static targets=["frame","refreshButton","backButton","homeButton","maximizeLink"];connect(){this.#t(),this.srcHistory=[],this.originalFrameSrc=this.frameTarget.src,this.hasRefreshButtonTarget&&(this.refreshButtonTarget.style.display="",this.refreshButtonClicked=this.refreshButtonClicked.bind(this),this.refreshButtonTarget.addEventListener("click",this.refreshButtonClicked)),this.hasBackButtonTarget&&(this.backButtonClicked=this.backButtonClicked.bind(this),this.backButtonTarget.addEventListener("click",this.backButtonClicked)),this.hasHomeButtonTarget&&(this.homeButtonClicked=this.homeButtonClicked.bind(this),this.homeButtonTarget.addEventListener("click",this.homeButtonClicked)),this.frameLoaded=this.frameLoaded.bind(this),this.frameTarget.addEventListener("turbo:frame-load",this.frameLoaded),this.frameLoading=this.frameLoading.bind(this),this.frameTarget.addEventListener("turbo:click",this.frameLoading),this.frameTarget.addEventListener("turbo:submit-start",this.frameLoading),this.frameFailed=this.frameFailed.bind(this),this.frameTarget.addEventListener("turbo:fetch-request-error",this.frameFailed)}disconnect(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.removeEventListener("click",this.refreshButtonClicked),this.hasBackButtonTarget&&this.backButtonTarget.removeEventListener("click",this.backButtonClicked),this.hasHomeButtonTarget&&this.homeButtonTarget.removeEventListener("click",this.homeButtonClicked),this.frameTarget.removeEventListener("turbo:frame-load",this.frameLoaded),this.frameTarget.removeEventListener("turbo:click",this.frameLoading),this.frameTarget.removeEventListener("turbo:submit-start",this.frameLoading),this.frameTarget.removeEventListener("turbo:fetch-request-error",this.frameFailed)}frameLoading(i){this.#t()}frameFailed(i){this.#i()}frameLoaded(i){this.#i();let e=i.target.src;this.#e(e)}refreshButtonClicked(i){this.frameLoading(null),this.frameTarget.reload()}backButtonClicked(i){this.frameLoading(null),this.srcHistory.pop(),this.frameTarget.src=this.currentSrc}homeButtonClicked(i){this.frameLoading(null),this.frameTarget.src=this.originalFrameSrc}get currentSrc(){return this.srcHistory[this.srcHistory.length-1]}#e(i){i==this.currentSrc||(i==this.originalFrameSrc?this.srcHistory=[i]:this.srcHistory.push(i)),this.#s(),this.hasMaximizeLinkTarget&&(this.maximizeLinkTarget.href=i)}#t(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.add("motion-safe:animate-spin"),this.frameTarget.classList.add("motion-safe:animate-pulse")}#i(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.remove("motion-safe:animate-spin"),this.frameTarget.classList.remove("motion-safe:animate-pulse")}#s(){this.hasHomeButtonTarget&&(this.homeButtonTarget.style.display=this.srcHistory.length>2?"":"none"),this.hasBackButtonTarget&&(this.backButtonTarget.style.display=this.srcHistory.length>1?"":"none")}};var oa=class extends ne{connect(){this.updateColorMode()}disconnect(){}updateColorMode(){localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}setLightColorMode(){localStorage.theme="light",this.updateColorMode()}setDarkColorMode(){localStorage.theme="dark",this.updateColorMode()}setSystemColorMode(){localStorage.removeItem("theme"),this.updateColorMode()}};var{entries:fp,setPrototypeOf:np,isFrozen:Py,getPrototypeOf:Cy,getOwnPropertyDescriptor:Fy}=Object,{freeze:gt,seal:Wt,create:mp}=Object,{apply:Ac,construct:kc}=typeof Reflect<"u"&&Reflect;gt||(gt=function(e){return e});Wt||(Wt=function(e){return e});Ac||(Ac=function(e,t,r){return e.apply(t,r)});kc||(kc=function(e,t){return new e(...t)});var aa=Ot(Array.prototype.forEach),op=Ot(Array.prototype.pop),mn=Ot(Array.prototype.push),ca=Ot(String.prototype.toLowerCase),wc=Ot(String.prototype.toString),ap=Ot(String.prototype.match),gn=Ot(String.prototype.replace),_y=Ot(String.prototype.indexOf),Oy=Ot(String.prototype.trim),ni=Ot(Object.prototype.hasOwnProperty),mt=Ot(RegExp.prototype.test),vn=Ry(TypeError);function Ot(i){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return Ac(i,e,r)}}function Ry(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return kc(i,t)}}function ae(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ca;np&&np(i,null);let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){let n=t(s);n!==s&&(Py(e)||(e[r]=n),s=n)}i[s]=!0}return i}function Ly(i){for(let e=0;e<i.length;e++)ni(i,e)||(i[e]=null);return i}function Or(i){let e=mp(null);for(let[t,r]of fp(i))ni(i,t)&&(Array.isArray(r)?e[t]=Ly(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Or(r):e[t]=r);return e}function bn(i,e){for(;i!==null;){let r=Fy(i,e);if(r){if(r.get)return Ot(r.get);if(typeof r.value=="function")return Ot(r.value)}i=Cy(i)}function t(){return null}return t}var lp=gt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Sc=gt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ec=gt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),My=gt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Tc=gt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Iy=gt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),cp=gt(["#text"]),up=gt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),xc=gt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),hp=gt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),la=gt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dy=Wt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ny=Wt(/<%[\w\W]*|[\w\W]*%>/gm),By=Wt(/\${[\w\W]*}/gm),Uy=Wt(/^data-[\-\w.\u00B7-\uFFFF]/),zy=Wt(/^aria-[\-\w]+$/),gp=Wt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hy=Wt(/^(?:\w+script|data):/i),$y=Wt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),vp=Wt(/^html$/i),qy=Wt(/^[a-z][.\w]*(-[.\w]+)+$/i),dp=Object.freeze({__proto__:null,ARIA_ATTR:zy,ATTR_WHITESPACE:$y,CUSTOM_ELEMENT:qy,DATA_ATTR:Uy,DOCTYPE_NAME:vp,ERB_EXPR:Ny,IS_ALLOWED_URI:gp,IS_SCRIPT_OR_DATA:Hy,MUSTACHE_EXPR:Dy,TMPLIT_EXPR:By}),yn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Vy=function(){return typeof window>"u"?null:window},jy=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(r=t.getAttribute(s));let n="dompurify"+(r?"#"+r:"");try{return e.createPolicy(n,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+n+" could not be created."),null}},pp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function bp(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vy(),e=Z=>bp(Z);if(e.version="3.2.2",e.removed=[],!i||!i.document||i.document.nodeType!==yn.document)return e.isSupported=!1,e;let{document:t}=i,r=t,s=r.currentScript,{DocumentFragment:n,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:f,DOMParser:y,trustedTypes:v}=i,x=l.prototype,P=bn(x,"cloneNode"),C=bn(x,"remove"),I=bn(x,"nextSibling"),D=bn(x,"childNodes"),q=bn(x,"parentNode");if(typeof o=="function"){let Z=t.createElement("template");Z.content&&Z.content.ownerDocument&&(t=Z.content.ownerDocument)}let M,H="",{implementation:R,createNodeIterator:G,createDocumentFragment:K,getElementsByTagName:Y}=t,{importNode:ie}=r,Q=pp();e.isSupported=typeof fp=="function"&&typeof q=="function"&&R&&R.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:oe,ERB_EXPR:le,TMPLIT_EXPR:Ae,DATA_ATTR:We,ARIA_ATTR:T,IS_SCRIPT_OR_DATA:A,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:$}=dp,{IS_ALLOWED_URI:j}=dp,z=null,J=ae({},[...lp,...Sc,...Ec,...Tc,...cp]),ee=null,ke=ae({},[...up,...xc,...hp,...la]),se=Object.seal(mp(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ce=null,Me=null,Ne=!0,He=!0,fi=!1,mi=!0,Yt=!1,er=!0,Zt=!1,br=!1,ki=!1,Ut=!1,Pi=!1,Ci=!1,Ct=!0,gi=!1,tr="user-content-",Fi=!0,Qt=!1,Jt={},ei=null,yr=ae({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ir=null,en=ae({},["audio","video","img","source","image","track"]),fs=null,Lo=ae({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ms="http://www.w3.org/1998/Math/MathML",re="http://www.w3.org/2000/svg",zt="http://www.w3.org/1999/xhtml",vi=zt,ti=!1,tn=null,rr=ae({},[ms,re,zt],wc),Ge=ae({},["mi","mo","mn","ms","mtext"]),gs=ae({},["annotation-xml"]),Mo=ae({},["title","style","font","a","script"]),ye=null,we=["application/xhtml+xml","text/html"],Fl="text/html",Te=null,sr=null,bi=t.createElement("form"),Io=function(w){return w instanceof RegExp||w instanceof Function},Ie=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(sr&&sr===w)){if((!w||typeof w!="object")&&(w={}),w=Or(w),ye=we.indexOf(w.PARSER_MEDIA_TYPE)===-1?Fl:w.PARSER_MEDIA_TYPE,Te=ye==="application/xhtml+xml"?wc:ca,z=ni(w,"ALLOWED_TAGS")?ae({},w.ALLOWED_TAGS,Te):J,ee=ni(w,"ALLOWED_ATTR")?ae({},w.ALLOWED_ATTR,Te):ke,tn=ni(w,"ALLOWED_NAMESPACES")?ae({},w.ALLOWED_NAMESPACES,wc):rr,fs=ni(w,"ADD_URI_SAFE_ATTR")?ae(Or(Lo),w.ADD_URI_SAFE_ATTR,Te):Lo,ir=ni(w,"ADD_DATA_URI_TAGS")?ae(Or(en),w.ADD_DATA_URI_TAGS,Te):en,ei=ni(w,"FORBID_CONTENTS")?ae({},w.FORBID_CONTENTS,Te):yr,ce=ni(w,"FORBID_TAGS")?ae({},w.FORBID_TAGS,Te):{},Me=ni(w,"FORBID_ATTR")?ae({},w.FORBID_ATTR,Te):{},Jt=ni(w,"USE_PROFILES")?w.USE_PROFILES:!1,Ne=w.ALLOW_ARIA_ATTR!==!1,He=w.ALLOW_DATA_ATTR!==!1,fi=w.ALLOW_UNKNOWN_PROTOCOLS||!1,mi=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Yt=w.SAFE_FOR_TEMPLATES||!1,er=w.SAFE_FOR_XML!==!1,Zt=w.WHOLE_DOCUMENT||!1,Ut=w.RETURN_DOM||!1,Pi=w.RETURN_DOM_FRAGMENT||!1,Ci=w.RETURN_TRUSTED_TYPE||!1,ki=w.FORCE_BODY||!1,Ct=w.SANITIZE_DOM!==!1,gi=w.SANITIZE_NAMED_PROPS||!1,Fi=w.KEEP_CONTENT!==!1,Qt=w.IN_PLACE||!1,j=w.ALLOWED_URI_REGEXP||gp,vi=w.NAMESPACE||zt,Ge=w.MATHML_TEXT_INTEGRATION_POINTS||Ge,gs=w.HTML_INTEGRATION_POINTS||gs,se=w.CUSTOM_ELEMENT_HANDLING||{},w.CUSTOM_ELEMENT_HANDLING&&Io(w.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(se.tagNameCheck=w.CUSTOM_ELEMENT_HANDLING.tagNameCheck),w.CUSTOM_ELEMENT_HANDLING&&Io(w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(se.attributeNameCheck=w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(se.allowCustomizedBuiltInElements=w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Yt&&(He=!1),Pi&&(Ut=!0),Jt&&(z=ae({},cp),ee=[],Jt.html===!0&&(ae(z,lp),ae(ee,up)),Jt.svg===!0&&(ae(z,Sc),ae(ee,xc),ae(ee,la)),Jt.svgFilters===!0&&(ae(z,Ec),ae(ee,xc),ae(ee,la)),Jt.mathMl===!0&&(ae(z,Tc),ae(ee,hp),ae(ee,la))),w.ADD_TAGS&&(z===J&&(z=Or(z)),ae(z,w.ADD_TAGS,Te)),w.ADD_ATTR&&(ee===ke&&(ee=Or(ee)),ae(ee,w.ADD_ATTR,Te)),w.ADD_URI_SAFE_ATTR&&ae(fs,w.ADD_URI_SAFE_ATTR,Te),w.FORBID_CONTENTS&&(ei===yr&&(ei=Or(ei)),ae(ei,w.FORBID_CONTENTS,Te)),Fi&&(z["#text"]=!0),Zt&&ae(z,["html","head","body"]),z.table&&(ae(z,["tbody"]),delete ce.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw vn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=w.TRUSTED_TYPES_POLICY,H=M.createHTML("")}else M===void 0&&(M=jy(v,s)),M!==null&&typeof H=="string"&&(H=M.createHTML(""));gt&&gt(w),sr=w}},Ft=ae({},[...Sc,...Ec,...My]),_i=ae({},[...Tc,...Iy]),_l=function(w){let B=q(w);(!B||!B.tagName)&&(B={namespaceURI:vi,tagName:"template"});let X=ca(w.tagName),ve=ca(B.tagName);return tn[w.namespaceURI]?w.namespaceURI===re?B.namespaceURI===zt?X==="svg":B.namespaceURI===ms?X==="svg"&&(ve==="annotation-xml"||Ge[ve]):!!Ft[X]:w.namespaceURI===ms?B.namespaceURI===zt?X==="math":B.namespaceURI===re?X==="math"&&gs[ve]:!!_i[X]:w.namespaceURI===zt?B.namespaceURI===re&&!gs[ve]||B.namespaceURI===ms&&!Ge[ve]?!1:!_i[X]&&(Mo[X]||!Ft[X]):!!(ye==="application/xhtml+xml"&&tn[w.namespaceURI]):!1},xt=function(w){mn(e.removed,{element:w});try{q(w).removeChild(w)}catch{C(w)}},nr=function(w,B){try{mn(e.removed,{attribute:B.getAttributeNode(w),from:B})}catch{mn(e.removed,{attribute:null,from:B})}if(B.removeAttribute(w),w==="is")if(Ut||Pi)try{xt(B)}catch{}else try{B.setAttribute(w,"")}catch{}},or=function(w){let B=null,X=null;if(ki)w="<remove></remove>"+w;else{let Se=ap(w,/^[\r\n\t ]+/);X=Se&&Se[0]}ye==="application/xhtml+xml"&&vi===zt&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");let ve=M?M.createHTML(w):w;if(vi===zt)try{B=new y().parseFromString(ve,ye)}catch{}if(!B||!B.documentElement){B=R.createDocument(vi,"template",null);try{B.documentElement.innerHTML=ti?H:ve}catch{}}let Qe=B.body||B.documentElement;return w&&X&&Qe.insertBefore(t.createTextNode(X),Qe.childNodes[0]||null),vi===zt?Y.call(B,Zt?"html":"body")[0]:Zt?B.documentElement:Qe},Do=function(w){return G.call(w.ownerDocument||w,w,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},rn=function(w){return w instanceof f&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof d)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},sn=function(w){return typeof a=="function"&&w instanceof a};function Be(Z,w,B){aa(Z,X=>{X.call(e,w,B,sr)})}let pt=function(w){let B=null;if(Be(Q.beforeSanitizeElements,w,null),rn(w))return xt(w),!0;let X=Te(w.nodeName);if(Be(Q.uponSanitizeElement,w,{tagName:X,allowedTags:z}),w.hasChildNodes()&&!sn(w.firstElementChild)&&mt(/<[/\w]/g,w.innerHTML)&&mt(/<[/\w]/g,w.textContent)||w.nodeType===yn.progressingInstruction||er&&w.nodeType===yn.comment&&mt(/<[/\w]/g,w.data))return xt(w),!0;if(!z[X]||ce[X]){if(!ce[X]&&nn(X)&&(se.tagNameCheck instanceof RegExp&&mt(se.tagNameCheck,X)||se.tagNameCheck instanceof Function&&se.tagNameCheck(X)))return!1;if(Fi&&!ei[X]){let ve=q(w)||w.parentNode,Qe=D(w)||w.childNodes;if(Qe&&ve){let Se=Qe.length;for(let ut=Se-1;ut>=0;--ut){let Ht=P(Qe[ut],!0);Ht.__removalCount=(w.__removalCount||0)+1,ve.insertBefore(Ht,I(w))}}}return xt(w),!0}return w instanceof l&&!_l(w)||(X==="noscript"||X==="noembed"||X==="noframes")&&mt(/<\/no(script|embed|frames)/i,w.innerHTML)?(xt(w),!0):(Yt&&w.nodeType===yn.text&&(B=w.textContent,aa([oe,le,Ae],ve=>{B=gn(B,ve," ")}),w.textContent!==B&&(mn(e.removed,{element:w.cloneNode()}),w.textContent=B)),Be(Q.afterSanitizeElements,w,null),!1)},Oi=function(w,B,X){if(Ct&&(B==="id"||B==="name")&&(X in t||X in bi))return!1;if(!(He&&!Me[B]&&mt(We,B))){if(!(Ne&&mt(T,B))){if(!ee[B]||Me[B]){if(!(nn(w)&&(se.tagNameCheck instanceof RegExp&&mt(se.tagNameCheck,w)||se.tagNameCheck instanceof Function&&se.tagNameCheck(w))&&(se.attributeNameCheck instanceof RegExp&&mt(se.attributeNameCheck,B)||se.attributeNameCheck instanceof Function&&se.attributeNameCheck(B))||B==="is"&&se.allowCustomizedBuiltInElements&&(se.tagNameCheck instanceof RegExp&&mt(se.tagNameCheck,X)||se.tagNameCheck instanceof Function&&se.tagNameCheck(X))))return!1}else if(!fs[B]){if(!mt(j,gn(X,k,""))){if(!((B==="src"||B==="xlink:href"||B==="href")&&w!=="script"&&_y(X,"data:")===0&&ir[w])){if(!(fi&&!mt(A,gn(X,k,"")))){if(X)return!1}}}}}}return!0},nn=function(w){return w!=="annotation-xml"&&ap(w,$)},vs=function(w){Be(Q.beforeSanitizeAttributes,w,null);let{attributes:B}=w;if(!B)return;let X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0},ve=B.length;for(;ve--;){let Qe=B[ve],{name:Se,namespaceURI:ut,value:Ht}=Qe,ar=Te(Se),st=Se==="value"?Ht:Oy(Ht);if(X.attrName=ar,X.attrValue=st,X.keepAttr=!0,X.forceKeepAttr=void 0,Be(Q.uponSanitizeAttribute,w,X),st=X.attrValue,gi&&(ar==="id"||ar==="name")&&(nr(Se,w),st=tr+st),er&&mt(/((--!?|])>)|<\/(style|title)/i,st)){nr(Se,w);continue}if(X.forceKeepAttr||(nr(Se,w),!X.keepAttr))continue;if(!mi&&mt(/\/>/i,st)){nr(Se,w);continue}Yt&&aa([oe,le,Ae],Bo=>{st=gn(st,Bo," ")});let No=Te(w.nodeName);if(Oi(No,ar,st)){if(M&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!ut)switch(v.getAttributeType(No,ar)){case"TrustedHTML":{st=M.createHTML(st);break}case"TrustedScriptURL":{st=M.createScriptURL(st);break}}try{ut?w.setAttributeNS(ut,Se,st):w.setAttribute(Se,st),rn(w)?xt(w):op(e.removed)}catch{}}}Be(Q.afterSanitizeAttributes,w,null)},Ol=function Z(w){let B=null,X=Do(w);for(Be(Q.beforeSanitizeShadowDOM,w,null);B=X.nextNode();)Be(Q.uponSanitizeShadowNode,B,null),!pt(B)&&(B.content instanceof n&&Z(B.content),vs(B));Be(Q.afterSanitizeShadowDOM,w,null)};return e.sanitize=function(Z){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=null,X=null,ve=null,Qe=null;if(ti=!Z,ti&&(Z="<!-->"),typeof Z!="string"&&!sn(Z))if(typeof Z.toString=="function"){if(Z=Z.toString(),typeof Z!="string")throw vn("dirty is not a string, aborting")}else throw vn("toString is not a function");if(!e.isSupported)return Z;if(br||Ie(w),e.removed=[],typeof Z=="string"&&(Qt=!1),Qt){if(Z.nodeName){let Ht=Te(Z.nodeName);if(!z[Ht]||ce[Ht])throw vn("root node is forbidden and cannot be sanitized in-place")}}else if(Z instanceof a)B=or("<!---->"),X=B.ownerDocument.importNode(Z,!0),X.nodeType===yn.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?B=X:B.appendChild(X);else{if(!Ut&&!Yt&&!Zt&&Z.indexOf("<")===-1)return M&&Ci?M.createHTML(Z):Z;if(B=or(Z),!B)return Ut?null:Ci?H:""}B&&ki&&xt(B.firstChild);let Se=Do(Qt?Z:B);for(;ve=Se.nextNode();)pt(ve)||(ve.content instanceof n&&Ol(ve.content),vs(ve));if(Qt)return Z;if(Ut){if(Pi)for(Qe=K.call(B.ownerDocument);B.firstChild;)Qe.appendChild(B.firstChild);else Qe=B;return(ee.shadowroot||ee.shadowrootmode)&&(Qe=ie.call(r,Qe,!0)),Qe}let ut=Zt?B.outerHTML:B.innerHTML;return Zt&&z["!doctype"]&&B.ownerDocument&&B.ownerDocument.doctype&&B.ownerDocument.doctype.name&&mt(vp,B.ownerDocument.doctype.name)&&(ut="<!DOCTYPE "+B.ownerDocument.doctype.name+`>
7
+ `+ut),Yt&&aa([oe,le,Ae],Ht=>{ut=gn(ut,Ht," ")}),M&&Ci?M.createHTML(ut):ut},e.setConfig=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ie(Z),br=!0},e.clearConfig=function(){sr=null,br=!1},e.isValidAttribute=function(Z,w,B){sr||Ie({});let X=Te(Z),ve=Te(w);return Oi(X,ve,B)},e.addHook=function(Z,w){typeof w=="function"&&mn(Q[Z],w)},e.removeHook=function(Z){return op(Q[Z])},e.removeHooks=function(Z){Q[Z]=[]},e.removeAllHooks=function(){Q=pp()},e}var Ts=bp();function Fc(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lr=Fc();function xp(i){Lr=i}var En={exec:()=>null};function be(i,e=""){let t=typeof i=="string"?i:i.source,r={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(vt.caret,"$1"),t=t.replace(s,o),r},getRegex:()=>new RegExp(t,e)};return r}var vt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},Wy=/^(?:[ \t]*(?:\n|$))+/,Gy=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ky=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,xn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xy=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ap=/(?:[*+-]|\d{1,9}[.)])/,kp=be(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ap).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),_c=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Yy=/^[^\n]+/,Oc=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Zy=be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Oc).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qy=be(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ap).getRegex(),da="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Rc=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jy=be("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Rc).replace("tag",da).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pp=be(_c).replace("hr",xn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",da).getRegex(),e0=be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Pp).getRegex(),Lc={blockquote:e0,code:Gy,def:Zy,fences:Ky,heading:Xy,hr:xn,html:Jy,lheading:kp,list:Qy,newline:Wy,paragraph:Pp,table:En,text:Yy},yp=be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",xn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",da).getRegex(),t0={...Lc,table:yp,paragraph:be(_c).replace("hr",xn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",yp).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",da).getRegex()},i0={...Lc,html:be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Rc).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:En,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:be(_c).replace("hr",xn).replace("heading",` *#{1,6} *[^
8
+ ]`).replace("lheading",kp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Cp=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,r0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Fp=/^( {2,}|\\)\n(?!\s*$)/,s0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pa=/[\p{P}\p{S}]/u,Mc=/[\s\p{P}\p{S}]/u,_p=/[^\s\p{P}\p{S}]/u,n0=be(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Mc).getRegex(),o0=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,a0=be(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,"u").replace(/punct/g,pa).getRegex(),l0=be("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,_p).replace(/punctSpace/g,Mc).replace(/punct/g,pa).getRegex(),c0=be("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_p).replace(/punctSpace/g,Mc).replace(/punct/g,pa).getRegex(),u0=be(/\\(punct)/,"gu").replace(/punct/g,pa).getRegex(),h0=be(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),d0=be(Rc).replace("(?:-->|$)","-->").getRegex(),p0=be("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",d0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ha=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,f0=be(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",ha).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Op=be(/^!?\[(label)\]\[(ref)\]/).replace("label",ha).replace("ref",Oc).getRegex(),Rp=be(/^!?\[(ref)\](?:\[\])?/).replace("ref",Oc).getRegex(),m0=be("reflink|nolink(?!\\()","g").replace("reflink",Op).replace("nolink",Rp).getRegex(),Ic={_backpedal:En,anyPunctuation:u0,autolink:h0,blockSkip:o0,br:Fp,code:r0,del:En,emStrongLDelim:a0,emStrongRDelimAst:l0,emStrongRDelimUnd:c0,escape:Cp,link:f0,nolink:Rp,punctuation:n0,reflink:Op,reflinkSearch:m0,tag:p0,text:s0,url:En},g0={...Ic,link:be(/^!?\[(label)\]\((.*?)\)/).replace("label",ha).getRegex(),reflink:be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ha).getRegex()},Pc={...Ic,escape:be(Cp).replace("])","~|])").getRegex(),url:be(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},v0={...Pc,br:be(Fp).replace("{2,}","*").getRegex(),text:be(Pc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ua={normal:Lc,gfm:t0,pedantic:i0},wn={normal:Ic,gfm:Pc,breaks:v0,pedantic:g0},b0={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wp=i=>b0[i];function wi(i,e){if(e){if(vt.escapeTest.test(i))return i.replace(vt.escapeReplace,wp)}else if(vt.escapeTestNoEncode.test(i))return i.replace(vt.escapeReplaceNoEncode,wp);return i}function Sp(i){try{i=encodeURI(i).replace(vt.percentDecode,"%")}catch{return null}return i}function Ep(i,e){let t=i.replace(vt.findPipe,(n,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=t.split(vt.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(vt.slashPipe,"|");return r}function Sn(i,e,t){let r=i.length;if(r===0)return"";let s=0;for(;s<r;){let n=i.charAt(r-s-1);if(n===e&&!t)s++;else if(n!==e&&t)s++;else break}return i.slice(0,r-s)}function y0(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===e[0])t++;else if(i[r]===e[1]&&(t--,t<0))return r;return-1}function Tp(i,e,t,r,s){let n=e.href,o=e.title||null,a=i[1].replace(s.other.outputLinkReplace,"$1");if(i[0].charAt(0)!=="!"){r.state.inLink=!0;let l={type:"link",raw:t,href:n,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:t,href:n,title:o,text:a}}function w0(i,e,t){let r=i.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
9
+ `).map(n=>{let o=n.match(t.other.beginningSpace);if(o===null)return n;let[a]=o;return a.length>=s.length?n.slice(s.length):n}).join(`
10
+ `)}var As=class{options;rules;lexer;constructor(e){this.options=e||Lr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Sn(r,`
11
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],s=w0(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let s=Sn(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Sn(t[0],`
12
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=Sn(t[0],`
12
13
  `).split(`
13
- `),n="",s="",o=[];for(;r.length>0;){let a=!1,l=[],d;for(d=0;d<r.length;d++)if(this.rules.other.blockquoteStart.test(r[d]))l.push(r[d]),a=!0;else if(!a)l.push(r[d]);else break;r=r.slice(d);let p=l.join(`
14
- `),m=p.replace(this.rules.other.blockquoteSetextReplace,`
15
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
16
- ${p}`:p,s=s?`${s}
17
- ${m}`:m;let E=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(m,o,!0),this.lexer.state.top=E,r.length===0)break;let v=o.at(-1);if(v?.type==="code")break;if(v?.type==="blockquote"){let C=v,_=C.raw+`
14
+ `),s="",n="",o=[];for(;r.length>0;){let a=!1,l=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))l.push(r[c]),a=!0;else if(!a)l.push(r[c]);else break;r=r.slice(c);let d=l.join(`
15
+ `),f=d.replace(this.rules.other.blockquoteSetextReplace,`
16
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
17
+ ${d}`:d,n=n?`${n}
18
+ ${f}`:f;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=y,r.length===0)break;let v=o.at(-1);if(v?.type==="code")break;if(v?.type==="blockquote"){let x=v,P=x.raw+`
18
19
  `+r.join(`
19
- `),k=this.blockquote(_);o[o.length-1]=k,n=n.substring(0,n.length-C.raw.length)+k.raw,s=s.substring(0,s.length-C.text.length)+k.text;break}else if(v?.type==="list"){let C=v,_=C.raw+`
20
+ `),C=this.blockquote(P);o[o.length-1]=C,s=s.substring(0,s.length-x.raw.length)+C.raw,n=n.substring(0,n.length-x.text.length)+C.text;break}else if(v?.type==="list"){let x=v,P=x.raw+`
20
21
  `+r.join(`
21
- `),k=this.list(_);o[o.length-1]=k,n=n.substring(0,n.length-v.raw.length)+k.raw,s=s.substring(0,s.length-C.raw.length)+k.raw,r=_.substring(o.at(-1).raw.length).split(`
22
- `);continue}}return{type:"blockquote",raw:n,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,s={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let o=this.rules.other.listItemRegex(r),a=!1;for(;e;){let d=!1,p="",m="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;p=t[0],e=e.substring(p.length);let E=t[2].split(`
23
- `,1)[0].replace(this.rules.other.listReplaceTabs,q=>" ".repeat(3*q.length)),v=e.split(`
24
- `,1)[0],C=!E.trim(),_=0;if(this.options.pedantic?(_=2,m=E.trimStart()):C?_=t[1].length+1:(_=t[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,m=E.slice(_),_+=t[1].length),C&&this.rules.other.blankLine.test(v)&&(p+=v+`
25
- `,e=e.substring(v.length+1),d=!0),!d){let q=this.rules.other.nextBulletRegex(_),B=this.rules.other.hrRegex(_),S=this.rules.other.fencesBeginRegex(_),R=this.rules.other.headingBeginRegex(_),x=this.rules.other.htmlBeginRegex(_);for(;e;){let P=e.split(`
26
- `,1)[0],N;if(v=P,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),N=v):N=v.replace(this.rules.other.tabCharGlobal," "),S.test(v)||R.test(v)||x.test(v)||q.test(v)||B.test(v))break;if(N.search(this.rules.other.nonSpaceChar)>=_||!v.trim())m+=`
27
- `+N.slice(_);else{if(C||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(E)||R.test(E)||B.test(E))break;m+=`
28
- `+v}!C&&!v.trim()&&(C=!0),p+=P+`
29
- `,e=e.substring(P.length+1),E=N.slice(_)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0));let k=null,D;this.options.gfm&&(k=this.rules.other.listIsTask.exec(m),k&&(D=k[0]!=="[ ] ",m=m.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:p,task:!!k,checked:D,loose:!1,text:m,tokens:[]}),s.raw+=p}let l=s.items.at(-1);l&&(l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd()),s.raw=s.raw.trimEnd();for(let d=0;d<s.items.length;d++)if(this.lexer.state.top=!1,s.items[d].tokens=this.lexer.blockTokens(s.items[d].text,[]),!s.loose){let p=s.items[d].tokens.filter(E=>E.type==="space"),m=p.length>0&&p.some(E=>this.rules.other.anyLine.test(E.raw));s.loose=m}if(s.loose)for(let d=0;d<s.items.length;d++)s.items[d].loose=!0;return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=ja(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
- `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(let a of s)o.rows.push(ja(a,o.header.length).map((l,d)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[d]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
31
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=Di(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=Rh(t[2],"()");if(o>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Ua(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[n.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Ua(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){let o=[...n[0]].length-1,a,l,d=o,p=0,m=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+o);(n=m.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){d+=l;continue}else if((n[5]||n[6])&&o%3&&!((o+l)%3)){p+=l;continue}if(d-=l,d>0)continue;l=Math.min(l,l+d+p);let E=[...n[0]][0].length,v=e.slice(0,o+n.index+E+l);if(Math.min(o,l)%2){let _=v.slice(1,-1);return{type:"em",raw:v,text:_,tokens:this.lexer.inlineTokens(_)}}let C=v.slice(2,-2);return{type:"strong",raw:v,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,n;if(t[2]==="@")r=t[0],n="mailto:"+r;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);r=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},Me=class i{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||At,this.options.tokenizer=this.options.tokenizer||new ri,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:be,block:Jr.normal,inline:Pi.normal};this.options.pedantic?(t.block=Jr.pedantic,t.inline=Pi.pedantic):this.options.gfm&&(t.block=Jr.gfm,this.options.breaks?t.inline=Pi.breaks:t.inline=Pi.gfm),this.tokenizer.rules=t}static get rules(){return{block:Jr,inline:Pi}}static lex(e,t){return new i(t).lex(e)}static lexInline(e,t){return new i(t).inlineTokens(e)}lex(e){e=e.replace(be.carriageReturn,`
32
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(be.tabCharGlobal," ").replace(be.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(o=>(n=o.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let o=t.at(-1);n.raw.length===1&&o!==void 0?o.raw+=`
33
- `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
34
- `+n.raw,o.text+=`
35
- `+n.text,this.inlineQueue.at(-1).src=o.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
36
- `+n.raw,o.text+=`
37
- `+n.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0,a=e.slice(1),l;this.options.extensions.startBlock.forEach(d=>{l=d.call({lexer:this},a),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(n=this.tokenizer.paragraph(s))){let o=t.at(-1);r&&o?.type==="paragraph"?(o.raw+=`
38
- `+n.raw,o.text+=`
39
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n),r=s.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="text"?(o.raw+=`
40
- `+n.raw,o.text+=`
41
- `+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,n=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let a;if(this.options.extensions?.inline?.some(d=>(a=d.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let d=t.at(-1);a.type==="text"&&d?.type==="text"?(d.raw+=a.raw,d.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,r,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if(this.options.extensions?.startInline){let d=1/0,p=e.slice(1),m;this.options.extensions.startInline.forEach(E=>{m=E.call({lexer:this},p),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(l=e.substring(0,d+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),s=!0;let d=t.at(-1);d?.type==="text"?(d.raw+=a.raw,d.text+=a.text):t.push(a);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}},ni=class{options;parser;constructor(e){this.options=e||At}space(e){return""}code({text:e,lang:t,escaped:r}){let n=(t||"").match(be.notSpaceStart)?.[0],s=e.replace(be.endingNewline,"")+`
42
- `;return n?'<pre><code class="language-'+He(n)+'">'+(r?s:He(s,!0))+`</code></pre>
43
- `:"<pre><code>"+(r?s:He(s,!0))+`</code></pre>
22
+ `),C=this.list(P);o[o.length-1]=C,s=s.substring(0,s.length-v.raw.length)+C.raw,n=n.substring(0,n.length-x.raw.length)+C.raw,r=P.substring(o.at(-1).raw.length).split(`
23
+ `);continue}}return{type:"blockquote",raw:s,tokens:o,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),s=r.length>1,n={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let o=this.rules.other.listItemRegex(r),a=!1;for(;e;){let c=!1,d="",f="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let y=t[2].split(`
24
+ `,1)[0].replace(this.rules.other.listReplaceTabs,D=>" ".repeat(3*D.length)),v=e.split(`
25
+ `,1)[0],x=!y.trim(),P=0;if(this.options.pedantic?(P=2,f=y.trimStart()):x?P=t[1].length+1:(P=t[2].search(this.rules.other.nonSpaceChar),P=P>4?1:P,f=y.slice(P),P+=t[1].length),x&&this.rules.other.blankLine.test(v)&&(d+=v+`
26
+ `,e=e.substring(v.length+1),c=!0),!c){let D=this.rules.other.nextBulletRegex(P),q=this.rules.other.hrRegex(P),M=this.rules.other.fencesBeginRegex(P),H=this.rules.other.headingBeginRegex(P),R=this.rules.other.htmlBeginRegex(P);for(;e;){let G=e.split(`
27
+ `,1)[0],K;if(v=G,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),K=v):K=v.replace(this.rules.other.tabCharGlobal," "),M.test(v)||H.test(v)||R.test(v)||D.test(v)||q.test(v))break;if(K.search(this.rules.other.nonSpaceChar)>=P||!v.trim())f+=`
28
+ `+K.slice(P);else{if(x||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||M.test(y)||H.test(y)||q.test(y))break;f+=`
29
+ `+v}!x&&!v.trim()&&(x=!0),d+=G+`
30
+ `,e=e.substring(G.length+1),y=K.slice(P)}}n.loose||(a?n.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(a=!0));let C=null,I;this.options.gfm&&(C=this.rules.other.listIsTask.exec(f),C&&(I=C[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:d,task:!!C,checked:I,loose:!1,text:f,tokens:[]}),n.raw+=d}let l=n.items.at(-1);l&&(l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd()),n.raw=n.raw.trimEnd();for(let c=0;c<n.items.length;c++)if(this.lexer.state.top=!1,n.items[c].tokens=this.lexer.blockTokens(n.items[c].text,[]),!n.loose){let d=n.items[c].tokens.filter(y=>y.type==="space"),f=d.length>0&&d.some(y=>this.rules.other.anyLine.test(y.raw));n.loose=f}if(n.loose)for(let c=0;c<n.items.length;c++)n.items[c].loose=!0;return n}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:s,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=Ep(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
31
+ `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let a of s)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(let a of n)o.rows.push(Ep(a,o.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[c]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
32
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=Sn(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=y0(t[2],"()");if(o>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let s=t[2],n="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(s);o&&(s=o[1],n=o[3])}else n=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),Tp(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[s.toLowerCase()];if(!n){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Tp(r,n,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!r||this.rules.inline.punctuation.exec(r)){let o=[...s[0]].length-1,a,l,c=o,d=0,f=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(s=f.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(l=[...a].length,s[3]||s[4]){c+=l;continue}else if((s[5]||s[6])&&o%3&&!((o+l)%3)){d+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+d);let y=[...s[0]][0].length,v=e.slice(0,o+s.index+y+l);if(Math.min(o,l)%2){let P=v.slice(1,-1);return{type:"em",raw:v,text:P,tokens:this.lexer.inlineTokens(P)}}let x=v.slice(2,-2);return{type:"strong",raw:v,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,s;return t[2]==="@"?(r=t[1],s="mailto:"+r):(r=t[1],s=r),{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},oi=class i{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Lr,this.options.tokenizer=this.options.tokenizer||new As,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:vt,block:ua.normal,inline:wn.normal};this.options.pedantic?(t.block=ua.pedantic,t.inline=wn.pedantic):this.options.gfm&&(t.block=ua.gfm,this.options.breaks?t.inline=wn.breaks:t.inline=wn.gfm),this.tokenizer.rules=t}static get rules(){return{block:ua,inline:wn}}static lex(e,t){return new i(t).lex(e)}static lexInline(e,t){return new i(t).inlineTokens(e)}lex(e){e=e.replace(vt.carriageReturn,`
33
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(vt.tabCharGlobal," ").replace(vt.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(o=>(s=o.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let o=t.at(-1);s.raw.length===1&&o!==void 0?o.raw+=`
34
+ `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
35
+ `+s.raw,o.text+=`
36
+ `+s.text,this.inlineQueue.at(-1).src=o.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
37
+ `+s.raw,o.text+=`
38
+ `+s.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let n=e;if(this.options.extensions?.startBlock){let o=1/0,a=e.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(n=e.substring(0,o+1))}if(this.state.top&&(s=this.tokenizer.paragraph(n))){let o=t.at(-1);r&&o?.type==="paragraph"?(o.raw+=`
39
+ `+s.raw,o.text+=`
40
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(s),r=n.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let o=t.at(-1);o?.type==="text"?(o.raw+=`
41
+ `+s.raw,o.text+=`
42
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(s);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,s=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n=!1,o="";for(;e;){n||(o=""),n=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,r,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let l=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),f;this.options.extensions.startInline.forEach(y=>{f=y.call({lexer:this},d),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(l=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(l)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),n=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},ks=class{options;parser;constructor(e){this.options=e||Lr}space(e){return""}code({text:e,lang:t,escaped:r}){let s=(t||"").match(vt.notSpaceStart)?.[0],n=e.replace(vt.endingNewline,"")+`
43
+ `;return s?'<pre><code class="language-'+wi(s)+'">'+(r?n:wi(n,!0))+`</code></pre>
44
+ `:"<pre><code>"+(r?n:wi(n,!0))+`</code></pre>
44
45
  `}blockquote({tokens:e}){return`<blockquote>
45
46
  ${this.parser.parse(e)}</blockquote>
46
47
  `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
47
48
  `}hr(e){return`<hr>
48
- `}list(e){let t=e.ordered,r=e.start,n="";for(let a=0;a<e.items.length;a++){let l=e.items[a];n+=this.listitem(l)}let s=t?"ol":"ul",o=t&&r!==1?' start="'+r+'"':"";return"<"+s+o+`>
49
- `+n+"</"+s+`>
50
- `}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+He(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
49
+ `}list(e){let t=e.ordered,r=e.start,s="";for(let a=0;a<e.items.length;a++){let l=e.items[a];s+=this.listitem(l)}let n=t?"ol":"ul",o=t&&r!==1?' start="'+r+'"':"";return"<"+n+o+`>
50
+ `+s+"</"+n+`>
51
+ `}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+wi(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
51
52
  `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
52
- `}table(e){let t="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);t+=this.tablerow({text:r});let n="";for(let s=0;s<e.rows.length;s++){let o=e.rows[s];r="";for(let a=0;a<o.length;a++)r+=this.tablecell(o[a]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
53
+ `}table(e){let t="",r="";for(let n=0;n<e.header.length;n++)r+=this.tablecell(e.header[n]);t+=this.tablerow({text:r});let s="";for(let n=0;n<e.rows.length;n++){let o=e.rows[n];r="";for(let a=0;a<o.length;a++)r+=this.tablecell(o[a]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
53
54
  <thead>
54
55
  `+t+`</thead>
55
- `+n+`</table>
56
+ `+s+`</table>
56
57
  `}tablerow({text:e}){return`<tr>
57
58
  ${e}</tr>
58
59
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
59
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${He(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=$a(e);if(s===null)return n;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+He(t)+'"'),o+=">"+n+"</a>",o}image({href:e,title:t,text:r}){let n=$a(e);if(n===null)return He(r);e=n;let s=`<img src="${e}" alt="${r}"`;return t&&(s+=` title="${He(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:He(e.text)}},Bi=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Pe=class i{options;renderer;textRenderer;constructor(e){this.options=e||At,this.options.renderer=this.options.renderer||new ni,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Bi}static parse(e,t){return new i(t).parse(e)}static parseInline(e,t){return new i(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=l||"";continue}}let o=s;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,l=this.renderer.text(a);for(;n+1<e.length&&e[n+1].type==="text";)a=e[++n],l+=`
60
- `+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}let o=s;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ii=class{options;block;constructor(e){this.options=e||At}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Me.lex:Me.lexInline}provideParser(){return this.block?Pe.parse:Pe.parseInline}},Es=class{defaults=_s();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Pe;Renderer=ni;TextRenderer=Bi;Lexer=Me;Tokenizer=ri;Hooks=ii;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{let s=n;for(let o of s.header)r=r.concat(this.walkTokens(o.tokens,t));for(let o of s.rows)for(let a of o)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{let s=n;r=r.concat(this.walkTokens(s.items,t));break}default:{let s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let a=s[o].flat(1/0);r=r.concat(this.walkTokens(a,t))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=t.renderers[s.name];o?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),r.renderer){let s=this.defaults.renderer||new ni(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=r.renderer[a],d=s[a];s[a]=(...p)=>{let m=l.apply(s,p);return m===!1&&(m=d.apply(s,p)),m||""}}n.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new ri(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=r.tokenizer[a],d=s[a];s[a]=(...p)=>{let m=l.apply(s,p);return m===!1&&(m=d.apply(s,p)),m}}n.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new ii;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=r.hooks[a],d=s[a];ii.passThroughHooks.has(o)?s[a]=p=>{if(this.defaults.async)return Promise.resolve(l.call(s,p)).then(E=>d.call(s,E));let m=l.call(s,p);return d.call(s,m)}:s[a]=(...p)=>{let m=l.apply(s,p);return m===!1&&(m=d.apply(s,p)),m}}n.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;n.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Me.lex(e,t??this.defaults)}parser(e,t){return Pe.parse(e,t??this.defaults)}parseMarkdown(e){return(r,n)=>{let s={...n},o={...this.defaults,...s},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);let l=o.hooks?o.hooks.provideLexer():e?Me.lex:Me.lexInline,d=o.hooks?o.hooks.provideParser():e?Pe.parse:Pe.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(p=>l(p,o)).then(p=>o.hooks?o.hooks.processAllTokens(p):p).then(p=>o.walkTokens?Promise.all(this.walkTokens(p,o.walkTokens)).then(()=>p):p).then(p=>d(p,o)).then(p=>o.hooks?o.hooks.postprocess(p):p).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let p=l(r,o);o.hooks&&(p=o.hooks.processAllTokens(p)),o.walkTokens&&this.walkTokens(p,o.walkTokens);let m=d(p,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(p){return a(p)}}}onError(e,t){return r=>{if(r.message+=`
61
- Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+He(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},_t=new Es;function $(i,e){return _t.parse(i,e)}$.options=$.setOptions=function(i){return _t.setOptions(i),$.defaults=_t.defaults,Wa($.defaults),$};$.getDefaults=_s;$.defaults=At;$.use=function(...i){return _t.use(...i),$.defaults=_t.defaults,Wa($.defaults),$};$.walkTokens=function(i,e){return _t.walkTokens(i,e)};$.parseInline=_t.parseInline;$.Parser=Pe;$.parser=Pe.parse;$.Renderer=ni;$.TextRenderer=Bi;$.Lexer=Me;$.lexer=Me.lex;$.Tokenizer=ri;$.Hooks=ii;$.parse=$;var Pw=$.options,Dw=$.setOptions,Fw=$.use,Bw=$.walkTokens,Nw=$.parseInline;var Hw=Pe.parse,qw=Me.lex;var nn=class extends T{connect(){console.log(`easymde connected: ${this.element}`),this.easyMDE=new EasyMDE(this.#e()),this.element.setAttribute("data-action","turbo:morph-element->easymde#reconnect")}disconnect(){this.easyMDE.toTextArea(),this.easyMDE=null}reconnect(){this.disconnect(),this.connect()}#e(){let i={element:this.element,promptURLs:!0,spellChecker:!1,previewRender:e=>{let t=ys.sanitize(e,{ALLOWED_TAGS:["strong","em","sub","sup","details","summary"],ALLOWED_ATTR:[]}),r=$(t);return ys.sanitize(r,{USE_PROFILES:{html:!0}})}};return this.element.attributes.id.value&&(i.autosave={enabled:!0,uniqueId:this.element.attributes.id.value,delay:1e3}),i}};var sn=class extends T{connect(){console.log(`slim-select connected: ${this.element}`),this.slimSelect=new SlimSelect({select:this.element}),this.element.setAttribute("data-action","turbo:morph-element->slim-select#reconnect")}disconnect(){this.slimSelect.destroy(),this.slimSelect=null}reconnect(){this.disconnect(),this.connect()}};var on=class extends T{connect(){console.log(`flatpickr connected: ${this.element}`),this.picker=new flatpickr(this.element,this.#e()),this.element.setAttribute("data-action","turbo:morph-element->flatpickr#reconnect")}disconnect(){this.picker.destroy(),this.picker=null}reconnect(){this.disconnect(),this.connect()}#e(){let i={altInput:!0};return this.element.attributes.type.value=="datetime-local"?i.enableTime=!0:this.element.attributes.type.value=="time"&&(i.enableTime=!0,i.noCalendar=!0),i}};var an=class extends T{static targets=["input"];connect(){console.log(`intl-tel-input connected: ${this.element}`)}disconnect(){this.inputTargetDisconnected()}inputTargetConnected(){this.hasInputTarget&&(this.iti=window.intlTelInput(this.inputTarget,this.#e()),this.inputTarget.setAttribute("data-action","turbo:morph-element->intl-tel-input#reconnect"))}inputTargetDisconnected(){this.iti&&this.iti.destroy(),this.iti=null}reconnect(){this.inputTargetDisconnected(),this.inputTargetConnected()}#e(){return{strictMode:!0,hiddenInput:()=>({phone:this.inputTarget.attributes.name.value}),loadUtilsOnInit:"https://cdn.jsdelivr.net/npm/intl-tel-input@24.8.1/build/js/utils.js"}}};function Cs(i){i.register("resource-layout",nr),i.register("nav-grid-menu-item",sr),i.register("nav-grid-menu",or),i.register("nav-user-section",ar),i.register("nav-user-link",lr),i.register("nav-user",cr),i.register("header",ur),i.register("sidebar-menu-item",hr),i.register("sidebar-menu",dr),i.register("sidebar",pr),i.register("has-many-panel",fr),i.register("nested-resource-form-fields",mr),i.register("toolbar",gr),i.register("table-search-input",vr),i.register("table-toolbar",br),i.register("table",yr),i.register("form",wr),i.register("resource-drop-down",Ur),i.register("resource-collapse",Wr),i.register("resource-dismiss",Kr),i.register("frame-navigator",Gr),i.register("color-mode",Xr),i.register("easymde",nn),i.register("slim-select",sn),i.register("flatpickr",on),i.register("intl-tel-input",an)}(function(i){if(typeof i.requestSubmit=="function")return;i.requestSubmit=function(r){r?(e(r,this),r.click()):(r=document.createElement("input"),r.type="submit",r.hidden=!0,this.appendChild(r),r.click(),this.removeChild(r))};function e(r,n){r instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),r.type=="submit"||t(TypeError,"The specified element is not a submit button"),r.form==n||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(r,n,s){throw new r("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+n+".",s)}})(HTMLFormElement.prototype);var ol=new WeakMap;function Ph(i){let e=i instanceof Element?i:i instanceof Node?i.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function Dh(i){let e=Ph(i.target);e&&e.form&&ol.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let i=window.Event.prototype;if("SubmitEvent"in window){let e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))i=e;else return}addEventListener("click",Dh,!0),Object.defineProperty(i,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return ol.get(this.target)}})})();var oi={eager:"eager",lazy:"lazy"},qe=class i extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new i.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():e=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get loading(){return Fh(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}};function Fh(i){switch(i.toLowerCase()){case"lazy":return oi.lazy;default:return oi.eager}}function le(i){return new URL(i.toString(),document.baseURI)}function kt(i){let e;if(i.hash)return i.hash.slice(1);if(e=i.href.match(/#(.*)$/))return e[1]}function so(i,e){let t=e?.getAttribute("formaction")||i.getAttribute("action")||i.action;return le(t)}function Bh(i){return(Vh(i).match(/\.[^.]*$/)||[])[0]||""}function Nh(i){return!!Bh(i).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function Hh(i,e){let t=$h(e);return i.href===le(t).href||i.href.startsWith(t)}function ot(i,e){return Hh(i,e)&&Nh(i)}function Is(i){let e=kt(i);return e!=null?i.href.slice(0,-(e.length+1)):i.href}function ln(i){return Is(i)}function qh(i,e){return le(i).href==le(e).href}function zh(i){return i.pathname.split("/").slice(1)}function Vh(i){return zh(i).slice(-1)[0]}function $h(i){return jh(i.origin+i.pathname)}function jh(i){return i.endsWith("/")?i:i+"/"}var Hi=class{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return le(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}};function qi(i){if(i.getAttribute("data-turbo-eval")=="false")return i;{let e=document.createElement("script"),t=hi("csp-nonce");return t&&(e.nonce=t),e.textContent=i.textContent,e.async=!1,Uh(e,i),e}}function Uh(i,e){for(let{name:t,value:r}of e.attributes)i.setAttribute(t,r)}function Wh(i){let e=document.createElement("template");return e.innerHTML=i,e.content}function Q(i,{target:e,cancelable:t,detail:r}={}){let n=new CustomEvent(i,{cancelable:t,bubbles:!0,composed:!0,detail:r});return e&&e.isConnected?e.dispatchEvent(n):document.documentElement.dispatchEvent(n),n}function li(){return document.visibilityState==="hidden"?ll():al()}function al(){return new Promise(i=>requestAnimationFrame(()=>i()))}function ll(){return new Promise(i=>setTimeout(()=>i(),0))}function Kh(){return Promise.resolve()}function cl(i=""){return new DOMParser().parseFromString(i,"text/html")}function ul(i,...e){let t=Gh(i,e).replace(/^\n/,"").split(`
62
- `),r=t[0].match(/^\s+/),n=r?r[0].length:0;return t.map(s=>s.slice(n)).join(`
63
- `)}function Gh(i,e){return i.reduce((t,r,n)=>{let s=e[n]==null?"":e[n];return t+r+s},"")}function at(){return Array.from({length:36}).map((i,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function un(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function Xh(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function hn(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function dn(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function Yh(i,e=2e3){return new Promise(t=>{let r=()=>{i.removeEventListener("error",r),i.removeEventListener("load",r),t()};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),setTimeout(t,e)})}function hl(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function Zh(i){return i=="advance"||i=="replace"||i=="restore"}function xt(...i){let e=un("data-turbo-action",...i);return Zh(e)?e:null}function dl(i){return document.querySelector(`meta[name="${i}"]`)}function hi(i){let e=dl(i);return e&&e.content}function Qh(i,e){let t=dl(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function ci(i,e){if(i instanceof Element)return i.closest(e)||ci(i.assignedSlot||i.getRootNode()?.host,e)}function oo(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function pl(i){return Array.from(i.querySelectorAll("[autofocus]")).find(oo)}async function Jh(i,e){let t=e();i(),await al();let r=e();return[t,r]}function ed(i){if(i.hasAttribute("target")){for(let e of document.getElementsByName(i.target))if(e instanceof HTMLIFrameElement)return!1}return!0}function td(i){return ci(i,"a[href]:not([target^=_]):not([download])")}function fl(i){return le(i.getAttribute("href")||"")}function id(i,e){let t=null;return(...r)=>{let n=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(n,e)}}var Os=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let r=this.values().next().value;this.delete(r)}super.add(e)}},ml=new Os(20),rd=window.fetch;function gl(i,e={}){let t=new Headers(e.headers||{}),r=at();return ml.add(r),t.append("X-Turbo-Request-Id",r),rd(i,{...e,headers:t})}function ao(i){switch(i.toLowerCase()){case"get":return ke.get;case"post":return ke.post;case"put":return ke.put;case"patch":return ke.patch;case"delete":return ke.delete}}var ke={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function nd(i){switch(i.toLowerCase()){case Tt.multipart:return Tt.multipart;case Tt.plain:return Tt.plain;default:return Tt.urlEncoded}}var Tt={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},Lt=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,n=new URLSearchParams,s=null,o=Tt.urlEncoded){let[a,l]=tl(le(r),t,n,o);this.delegate=e,this.url=a,this.target=s,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t,headers:{...this.defaultHeaders},body:l,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=ao(e)||ke.get;this.url.search="";let[n,s]=tl(this.url,r,t,this.enctype);this.url=n,this.fetchOptions.body=s,this.fetchOptions.method=r}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=gl(this.url.href,e);let r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.#i(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Hi(e);return Q("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return lo(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(n=>this.#e=n),r=Q("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=r.detail.url,r.defaultPrevented&&await t,r}#i(e){return!Q("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function lo(i){return ao(i)==ke.get}function tl(i,e,t,r){let n=Array.from(t).length>0?new URLSearchParams(vl(t)):i.searchParams;return lo(e)?[sd(i,n),null]:r==Tt.urlEncoded?[i,n]:[i,t]}function vl(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function sd(i,e){let t=new URLSearchParams(vl(e));return i.search=t.toString(),i}var Rs=class{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},lt=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(Wh(e)):e}constructor(e){this.fragment=od(e)}};function od(i){for(let e of i.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let r of t.templateElement.content.querySelectorAll("script"))r.replaceWith(qi(r));e.replaceWith(t)}return i}var ad=100,Ms=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,r){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,r),this.#e=null},ad)}set(e,t,r){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+r)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},ld=10*1e3,ai=new Ms,si={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},zi=class i{state=si.initialized;static confirmMethod(e,t,r){return Promise.resolve(confirm(e))}constructor(e,t,r,n=!1){let s=fd(t,r),o=pd(dd(t,r),s),a=cd(t,r),l=md(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new Lt(this,s,o,a,t,l),this.mustRedirect=n}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=le(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:e,requesting:t}=si,r=un("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await i.confirmMethod(r,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=si;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=ud(hi("csrf-param"))||hi("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(lt.contentType)}requestStarted(e){this.state=si.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),hn(this.formElement),Q("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){ai.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(ai.clear(),this.requestMustRedirect(e)&&hd(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=si.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=si.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),dn(this.formElement),Q("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||Xh("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function cd(i,e){let t=new FormData(i),r=e?.getAttribute("name"),n=e?.getAttribute("value");return r&&t.append(r,n||""),t}function ud(i){if(i!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(i));if(t){let r=t.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function hd(i){return i.statusCode==200&&!i.redirected}function dd(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function pd(i,e){let t=le(i);return lo(e)&&(t.search=""),t}function fd(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return ao(t.toLowerCase())||ke.get}function md(i,e){return nd(e?.getAttribute("formenctype")||i.enctype)}var di=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return pl(this.element)}get permanentElements(){return yl(this.element)}getPermanentElementById(e){return bl(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let r of this.permanentElements){let{id:n}=r,s=e.getPermanentElementById(n);s&&(t[n]=[r,s])}return t}};function bl(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function yl(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var Vi=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&gd(t,r)&&vd(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function gd(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function vd(i,e){if(e?.hasAttribute("formtarget")||i.hasAttribute("target")){let t=e?.getAttribute("formtarget")||i.target;for(let r of document.getElementsByName(t))if(r instanceof HTMLIFrameElement)return!1;return!0}else return!0}var pn=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(kt(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:r,willRender:n,newSnapshot:s}=e,o=n;if(r)try{this.renderPromise=new Promise(p=>this.#e=p),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(p=>this.#t=p),l={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(s,l)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(s,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else o&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},Ps=class extends pn{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new di(this.element)}},fn=class{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.respondsToEventTarget(e.target)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.respondsToEventTarget(e.target)&&e.target instanceof Element&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};respondsToEventTarget(e){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},mn=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let t=e.composedPath&&e.composedPath()[0]||e.target,r=td(t);if(r&&ed(r)){let n=fl(r);this.delegate.willFollowLinkToLocation(r,n,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,n))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},gn=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new mn(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,r){return this.delegate.willSubmitFormLinkToLocation(e,t,r)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let r=document.createElement("form"),n="hidden";for(let[m,E]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:n,name:m,value:E}));let s=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",s.href),r.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&r.setAttribute("method",o);let a=e.getAttribute("data-turbo-frame");a&&r.setAttribute("data-turbo-frame",a);let l=xt(e);l&&r.setAttribute("data-turbo-action",l);let d=e.getAttribute("data-turbo-confirm");d&&r.setAttribute("data-turbo-confirm",d),e.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",()=>r.remove(),{once:!0}),requestAnimationFrame(()=>r.requestSubmit())}},vn=class{static async preservingPermanentElements(e,t,r){let n=new this(e,t);n.enter(),await r(),n.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=bd(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function bd(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var $i=class{#e=null;constructor(e,t,r,n,s=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.willRender=s,this.renderElement=r,this.promise=new Promise((o,a)=>this.resolvingFunctions={resolve:o,reject:a})}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await vn.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}},ji=class extends $i{static renderElement(e,t){let r=document.createRange();r.selectNodeContents(e),r.deleteContents();let n=t,s=n.ownerDocument?.createRange();s&&(s.selectNodeContents(n),e.appendChild(s.extractContents()))}constructor(e,t,r,n,s,o=!0){super(t,r,n,s,o),this.delegate=e}get shouldRender(){return!0}async render(){await li(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await li(),this.focusFirstAutofocusableElement(),await li(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=yd(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=wd(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:r}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=qi(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function yd(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function wd(i,e){return i=="auto"||i=="smooth"?i:e}var Ds=class i{static animationDuration=300;static get defaultCSS(){return ul`
60
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${wi(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let s=this.parser.parseInline(r),n=Sp(e);if(n===null)return s;e=n;let o='<a href="'+e+'"';return t&&(o+=' title="'+wi(t)+'"'),o+=">"+s+"</a>",o}image({href:e,title:t,text:r}){let s=Sp(e);if(s===null)return wi(r);e=s;let n=`<img src="${e}" alt="${r}"`;return t&&(n+=` title="${wi(t)}"`),n+=">",n}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:wi(e.text)}},Tn=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},ai=class i{options;renderer;textRenderer;constructor(e){this.options=e||Lr,this.options.renderer=this.options.renderer||new ks,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Tn}static parse(e,t){return new i(t).parse(e)}static parseInline(e,t){return new i(t).parseInline(e)}parse(e,t=!0){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=n,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=l||"";continue}}let o=n;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,l=this.renderer.text(a);for(;s+1<e.length&&e[s+1].type==="text";)a=e[++s],l+=`
61
+ `+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let a=this.options.extensions.renderers[n.type].call({parser:this},n);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=a||"";continue}}let o=n;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},xs=class{options;block;constructor(e){this.options=e||Lr}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?oi.lex:oi.lexInline}provideParser(){return this.block?ai.parse:ai.parseInline}},Cc=class{defaults=Fc();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ai;Renderer=ks;TextRenderer=Tn;Lexer=oi;Tokenizer=As;Hooks=xs;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let s of e)switch(r=r.concat(t.call(this,s)),s.type){case"table":{let n=s;for(let o of n.header)r=r.concat(this.walkTokens(o.tokens,t));for(let o of n.rows)for(let a of o)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{let n=s;r=r.concat(this.walkTokens(n.items,t));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(o=>{let a=n[o].flat(1/0);r=r.concat(this.walkTokens(a,t))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let o=t.renderers[n.name];o?t.renderers[n.name]=function(...a){let l=n.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[n.level];o?o.unshift(n.tokenizer):t[n.level]=[n.tokenizer],n.start&&(n.level==="block"?t.startBlock?t.startBlock.push(n.start):t.startBlock=[n.start]:n.level==="inline"&&(t.startInline?t.startInline.push(n.start):t.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(t.childTokens[n.name]=n.childTokens)}),s.extensions=t),r.renderer){let n=this.defaults.renderer||new ks(this.defaults);for(let o in r.renderer){if(!(o in n))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=r.renderer[a],c=n[a];n[a]=(...d)=>{let f=l.apply(n,d);return f===!1&&(f=c.apply(n,d)),f||""}}s.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new As(this.defaults);for(let o in r.tokenizer){if(!(o in n))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=r.tokenizer[a],c=n[a];n[a]=(...d)=>{let f=l.apply(n,d);return f===!1&&(f=c.apply(n,d)),f}}s.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new xs;for(let o in r.hooks){if(!(o in n))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=r.hooks[a],c=n[a];xs.passThroughHooks.has(o)?n[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(n,d)).then(y=>c.call(n,y));let f=l.call(n,d);return c.call(n,f)}:n[a]=(...d)=>{let f=l.apply(n,d);return f===!1&&(f=c.apply(n,d)),f}}s.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,o=r.walkTokens;s.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),n&&(l=l.concat(n.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return oi.lex(e,t??this.defaults)}parser(e,t){return ai.parse(e,t??this.defaults)}parseMarkdown(e){return(r,s)=>{let n={...s},o={...this.defaults,...n},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&n.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);let l=o.hooks?o.hooks.provideLexer():e?oi.lex:oi.lexInline,c=o.hooks?o.hooks.provideParser():e?ai.parse:ai.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(d=>l(d,o)).then(d=>o.hooks?o.hooks.processAllTokens(d):d).then(d=>o.walkTokens?Promise.all(this.walkTokens(d,o.walkTokens)).then(()=>d):d).then(d=>c(d,o)).then(d=>o.hooks?o.hooks.postprocess(d):d).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let d=l(r,o);o.hooks&&(d=o.hooks.processAllTokens(d)),o.walkTokens&&this.walkTokens(d,o.walkTokens);let f=c(d,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(d){return a(d)}}}onError(e,t){return r=>{if(r.message+=`
62
+ Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+wi(r.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(r);throw r}}},Rr=new Cc;function me(i,e){return Rr.parse(i,e)}me.options=me.setOptions=function(i){return Rr.setOptions(i),me.defaults=Rr.defaults,xp(me.defaults),me};me.getDefaults=Fc;me.defaults=Lr;me.use=function(...i){return Rr.use(...i),me.defaults=Rr.defaults,xp(me.defaults),me};me.walkTokens=function(i,e){return Rr.walkTokens(i,e)};me.parseInline=Rr.parseInline;me.Parser=ai;me.parser=ai.parse;me.Renderer=ks;me.TextRenderer=Tn;me.Lexer=oi;me.lexer=oi.lex;me.Tokenizer=As;me.Hooks=xs;me.parse=me;var RP=me.options,LP=me.setOptions,MP=me.use,IP=me.walkTokens,DP=me.parseInline;var NP=ai.parse,BP=oi.lex;var fa=class extends ne{connect(){this.easyMDE=new EasyMDE(this.#e()),this.element.setAttribute("data-action","turbo:morph-element->easymde#reconnect")}disconnect(){this.easyMDE.toTextArea(),this.easyMDE=null}reconnect(){this.disconnect(),this.connect()}#e(){let i={element:this.element,promptURLs:!0,spellChecker:!1,previewRender:e=>{let t=Ts.sanitize(e,{ALLOWED_TAGS:["strong","em","sub","sup","details","summary"],ALLOWED_ATTR:[]}),r=me(t);return Ts.sanitize(r,{USE_PROFILES:{html:!0}})}};return this.element.attributes.id.value&&(i.autosave={enabled:!0,uniqueId:this.element.attributes.id.value,delay:1e3}),i}};var ma=class extends ne{connect(){this.slimSelect=new SlimSelect({select:this.element}),this.element.setAttribute("data-action","turbo:morph-element->slim-select#reconnect")}disconnect(){this.slimSelect.destroy(),this.slimSelect=null}reconnect(){this.disconnect(),this.connect()}};var ga=class extends ne{connect(){this.picker=new flatpickr(this.element,this.#e()),this.element.setAttribute("data-action","turbo:morph-element->flatpickr#reconnect")}disconnect(){this.picker.destroy(),this.picker=null}reconnect(){this.disconnect(),this.connect()}#e(){let i={altInput:!0};return this.element.attributes.type.value=="datetime-local"?i.enableTime=!0:this.element.attributes.type.value=="time"&&(i.enableTime=!0,i.noCalendar=!0),i}};var va=class extends ne{static targets=["input"];connect(){}disconnect(){this.inputTargetDisconnected()}inputTargetConnected(){this.hasInputTarget&&(this.iti=window.intlTelInput(this.inputTarget,this.#e()),this.inputTarget.setAttribute("data-action","turbo:morph-element->intl-tel-input#reconnect"))}inputTargetDisconnected(){this.iti&&this.iti.destroy(),this.iti=null}reconnect(){this.inputTargetDisconnected(),this.inputTargetConnected()}#e(){return{strictMode:!0,hiddenInput:()=>({phone:this.inputTarget.attributes.name.value}),loadUtilsOnInit:"https://cdn.jsdelivr.net/npm/intl-tel-input@24.8.1/build/js/utils.js"}}};var ba=class extends ne{static targets=["select"];navigate(i){let e=this.selectTarget.value,t=document.createElement("a");t.href=e,this.element.appendChild(t),t.click(),t.remove()}};var ya=class extends ne{static targets=["btn","tab"];static values={defaultTab:String,activeClasses:String,inActiveClasses:String};connect(){this.activeClasses=this.hasActiveClassesValue?this.activeClassesValue.split(" "):[],this.inActiveClasses=this.hasInActiveClassesValue?this.inActiveClassesValue.split(" "):[],this.#e(this.defaultTabValue||this.btnTargets[0].id)}select(i){this.#e(i.currentTarget.id)}#e(i){let e=this.btnTargets.find(r=>r.id===i);if(!e){console.error(`Tab Button with id "${i}" not found`);return}let t=this.tabTargets.find(r=>r.id===e.dataset.target);if(!t){console.error(`Tab Panel with id "${e.dataset.target}" not found`);return}this.tabTargets.forEach(r=>{r.hidden=!0,r.setAttribute("aria-hidden","true")}),this.btnTargets.forEach(r=>{r.setAttribute("aria-selected","false"),r.setAttribute("tabindex","-1"),r.classList.remove(...this.activeClasses),r.classList.add(...this.inActiveClasses)}),e.setAttribute("aria-selected","true"),e.setAttribute("tabindex","0"),e.classList.remove(...this.inActiveClasses),e.classList.add(...this.activeClasses),t.hidden=!1,t.setAttribute("aria-hidden","false"),e!==document.activeElement&&e.focus()}};function wa(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var S0=0;function Mp(i){return"__private_"+S0+++"_"+i}function E0(i,e,t){let r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,o,a)=>{n!==""&&r.push(n),o<a.length-1&&r.push(t)})),r}function Lp(i,e){let t=/\$/g,r="$$$$",s=[i];if(e==null)return s;for(let n of Object.keys(e))if(n!=="_"){let o=e[n];typeof o=="string"&&(o=t[Symbol.replace](o,r)),s=E0(s,new RegExp(`%\\{${n}\\}`,"g"),o)}return s}var T0=i=>{throw new Error(`missing string: ${i}`)},An=Mp("onMissingKey"),kn=Mp("apply"),Mr=class{constructor(e,t){let{onMissingKey:r=T0}=t===void 0?{}:t;Object.defineProperty(this,kn,{value:x0}),Object.defineProperty(this,An,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(wa(this,kn)[kn],this):wa(this,kn)[kn](e),wa(this,An)[An]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(wa(this,An)[An](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return Lp(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return Lp(r,t)}};function x0(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}var Lf=Ce(Dp(),1);var A0="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Np=(i=21)=>{let e="",t=i|0;for(;t--;)e+=A0[Math.random()*64|0];return e};var Mf=Ce(vf(),1);function Ea(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var bw=0;function bf(i){return"__private_"+bw+++"_"+i}var yw={version:"4.1.2"},Ir=bf("callbacks"),zc=bf("publish"),Ta=class{constructor(){Object.defineProperty(this,zc,{value:ww}),this.state={},Object.defineProperty(this,Ir,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},r={...this.state,...e};this.state=r,Ea(this,zc)[zc](t,r,e)}subscribe(e){return Ea(this,Ir)[Ir].add(e),()=>{Ea(this,Ir)[Ir].delete(e)}}};function ww(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Ea(this,Ir)[Ir].forEach(r=>{r(...e)})}Ta.VERSION=yw.version;var yf=Ta;function Dr(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}var Hc={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Cn(i){var e;if(i.type)return i.type;let t=i.name?(e=Dr(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in Hc?Hc[t]:"application/octet-stream"}function Sw(i){return i.charCodeAt(0).toString(32)}function wf(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${Sw(t)}`,"/"))+e}function Sf(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${wf(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${wf(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function Ew(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function xa(i,e){if(Ew(i))return i.id;let t=Cn(i);return Sf({...i,type:t},e)}function $c(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}function qc(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function Vc(i){return i<10?`0${i}`:i.toString()}function Ps(){let i=new Date,e=Vc(i.getHours()),t=Vc(i.getMinutes()),r=Vc(i.getSeconds());return`${e}:${t}:${r}`}var Ef={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}},Tf={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Ps()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Ps()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Ps()}]`,...e)}};var Fn=Ce(Aa(),1),_f=Ce(Ff(),1),Of={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},kt=class extends Error{constructor(e,t){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=t?.isUserFacing)!=null?r:!0,t!=null&&t.file&&(this.file=t.file)}},ka=class{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var r;let s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(o=>!o.isGhost).length+t.length>s)throw new kt(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){let n=[...e,...t].reduce((o,a)=>{var l;return o+((l=a.size)!=null?l:0)},0);if(n>r)throw new kt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,Fn.default)(r),size:(0,Fn.default)(n)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(a=>a.includes("/")?e.type?(0,_f.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=s.join(", ");throw new kt(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t){var n;throw new kt(this.getI18n()("exceedsSize",{size:(0,Fn.default)(t),file:(n=e.name)!=null?n:this.getI18n()("unnamed")}),{file:e})}if(r&&e.size!=null&&e.size<r)throw new kt(this.getI18n()("inferiorSize",{size:(0,Fn.default)(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new kt(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let r=new kt(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,n=[];for(let o of s)(!Object.hasOwn(e.meta,o)||e.meta[o]==="")&&n.push(o);return{missingFields:n,error:r}}};var Rf={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function W(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Aw=0;function xe(i){return"__private_"+Aw+++"_"+i}var kw={version:"4.3.1"},Pa={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},ot=xe("plugins"),at=xe("restricter"),_n=xe("storeUnsubscribe"),Bi=xe("emitter"),Nr=xe("preProcessors"),Br=xe("uploaders"),Hi=xe("postProcessors"),Rt=xe("informAndEmit"),Dn=xe("checkRequiredMetaFieldsOnFile"),jc=xe("checkRequiredMetaFields"),On=xe("assertNewUploadAllowed"),Kc=xe("transformFile"),Rn=xe("startIfAutoProceed"),Ln=xe("checkAndUpdateFileState"),Xc=xe("handleUploadProgress"),Mn=xe("updateTotalProgress"),$i=xe("updateTotalProgressThrottled"),Yc=xe("calculateTotalProgress"),Wc=xe("addListeners"),li=xe("updateOnlineStatus"),In=xe("requestClientById"),Ui=xe("createUpload"),Gc=xe("getUpload"),Ur=xe("removeUpload"),zi=xe("runUpload"),Ca=class i{constructor(e){Object.defineProperty(this,zi,{value:zw}),Object.defineProperty(this,Ur,{value:Uw}),Object.defineProperty(this,Gc,{value:Bw}),Object.defineProperty(this,Ui,{value:Nw}),Object.defineProperty(this,Wc,{value:Dw}),Object.defineProperty(this,Yc,{value:Iw}),Object.defineProperty(this,Mn,{value:Mw}),Object.defineProperty(this,Ln,{value:Lw}),Object.defineProperty(this,Rn,{value:Rw}),Object.defineProperty(this,Kc,{value:Ow}),Object.defineProperty(this,On,{value:_w}),Object.defineProperty(this,jc,{value:Fw}),Object.defineProperty(this,Dn,{value:Cw}),Object.defineProperty(this,Rt,{value:Pw}),Object.defineProperty(this,ot,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,at,{writable:!0,value:void 0}),Object.defineProperty(this,_n,{writable:!0,value:void 0}),Object.defineProperty(this,Bi,{writable:!0,value:(0,Lf.default)()}),Object.defineProperty(this,Nr,{writable:!0,value:new Set}),Object.defineProperty(this,Br,{writable:!0,value:new Set}),Object.defineProperty(this,Hi,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Xc,{writable:!0,value:(s,n)=>{let o=s?this.getFile(s.id):void 0;if(s==null||!o){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(o.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}let a={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};o.progress.uploadStarted!=null?this.setFileState(s.id,{progress:{...o.progress,...a,bytesUploaded:n.bytesUploaded}}):this.setFileState(s.id,{progress:{...o.progress,...a}}),W(this,$i)[$i]()}}),Object.defineProperty(this,$i,{writable:!0,value:(0,Mf.default)(()=>W(this,Mn)[Mn](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,li,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,In,{writable:!0,value:new Map}),this.defaultLocale=Rf;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Of,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new yf,logger:Ef,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=Tf),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Pa,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:$c(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),W(this,at)[at]=new ka(()=>this.opts,()=>this.i18n),W(this,_n)[_n]=this.store.subscribe((s,n,o)=>{this.emit("state-update",s,n,o),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),W(this,Wc)[Wc]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];W(this,Bi)[Bi].emit(e,...r)}on(e,t){return W(this,Bi)[Bi].on(e,t),this}once(e,t){return W(this,Bi)[Bi].once(e,t),this}off(e,t){return W(this,Bi)[Bi].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=r=>this.log(`Missing i18n string: ${r}`,"error"),t=new Mr([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r=Object.create(null);Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:r,...Pa})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Pa,files:{}})}addPreProcessor(e){W(this,Nr)[Nr].add(e)}removePreProcessor(e){return W(this,Nr)[Nr].delete(e)}addPostProcessor(e){W(this,Hi)[Hi].add(e)}removePostProcessor(e){return W(this,Hi)[Hi].delete(e)}addUploader(e){W(this,Br)[Br].add(e)}removeUploader(e){return W(this,Br)[Br].delete(e)}setMeta(e){let t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){let r={...this.getState().files};if(!r[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],o=[],a=[],l=[],c=[],d=[],f=[],y=[],v=[];for(let x of s){let{progress:P}=x;!P.uploadComplete&&P.uploadStarted&&(n.push(x),x.isPaused||y.push(x)),P.uploadStarted||o.push(x),(P.uploadStarted||P.preprocess||P.postprocess)&&a.push(x),P.uploadStarted&&l.push(x),x.isPaused&&c.push(x),P.uploadComplete&&d.push(x),x.error&&f.push(x),(P.preprocess||P.postprocess)&&v.push(x)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:f,inProgressFiles:n,inProgressNotPausedFiles:y,processingFiles:v,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===s.length&&v.length===0,isAllErrored:!!r&&f.length===s.length,isAllPaused:n.length!==0&&c.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(x=>x.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{W(this,at)[at].validate(t,[e])}catch(r){return r}return null}validateSingleFile(e){try{W(this,at)[at].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{W(this,at)[at].validateAggregateRestrictions(t,e)}catch(r){return r.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){W(this,On)[On](e);let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Ln)[Ln]([e]),n=s.filter(a=>a.isRestriction);if(W(this,Rt)[Rt](n),s.length>0)throw s[0];this.setState({files:t});let[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),W(this,Rn)[Rn](),o.id}addFiles(e){W(this,On)[On]();let{nextFilesState:t,validFilesToAdd:r,errors:s}=W(this,Ln)[Ln](e),n=s.filter(a=>a.isRestriction);W(this,Rt)[Rt](n);let o=s.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files:
63
+ `;if(o.forEach(l=>{a+=`
64
+ * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,a);{let l=new Error(a);throw l.errors=o,l}}this.setState({files:t}),r.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(a=>{this.log(`Added file: ${a.name}
65
+ id: ${a.id}
66
+ type: ${a.type}`)}),r.length>0&&W(this,Rn)[Rn]()}removeFiles(e){let{files:t,currentUploads:r}=this.getState(),s={...t},n={...r},o=Object.create(null);e.forEach(d=>{t[d]&&(o[d]=t[d],delete s[d])});function a(d){return o[d]===void 0}Object.keys(n).forEach(d=>{let f=r[d].fileIDs.filter(a);if(f.length===0){delete n[d];return}let{capabilities:y}=this.getState();if(f.length!==r[d].fileIDs.length&&!y.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");n[d]={...r[d],fileIDs:f}});let l={currentUploads:n,files:s};Object.keys(s).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),W(this,$i)[$i]();let c=Object.keys(o);c.forEach(d=>{this.emit("file-removed",o[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),s=!(t.isPaused||!1);return this.setFileState(e,{isPaused:s}),this.emit("upload-pause",t,s),s}pauseAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!0};e[r]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!1,error:null};e[r]=s}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e={...this.getState().files},t=Object.keys(e).filter(s=>e[s].error);if(t.forEach(s=>{let n={...e[s],isPaused:!1,error:null};e[s]=n}),this.setState({files:e,error:null}),this.emit("retry-all",Object.values(e)),t.length===0)return Promise.resolve({successful:[],failed:[]});let r=W(this,Ui)[Ui](t,{forceAllowNewUpload:!0});return W(this,zi)[zi](r)}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(Pa)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=W(this,Ui)[Ui]([e],{forceAllowNewUpload:!0});return W(this,zi)[zi](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return W(this,Mn)[Mn]()}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e){if(typeof e!="function"){let l=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];let n=new e(this,...r),o=n.id;if(!o)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");let a=this.getPlugin(o);if(a){let l=`Already found a plugin named '${a.id}'. Tried to use: '${o}'.
67
+ Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${o} v${e.VERSION}`),n.type in W(this,ot)[ot]?W(this,ot)[ot][n.type].push(n):W(this,ot)[ot][n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(e){for(let t of Object.values(W(this,ot)[ot])){let r=t.find(s=>s.id===e);if(r!=null)return r}}[Symbol.for("uppy test: getPlugins")](e){return W(this,ot)[ot][e]}iteratePlugins(e){Object.values(W(this,ot)[ot]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=W(this,ot)[ot][e.type],r=t.findIndex(o=>o.id===e.id);r!==-1&&t.splice(r,1);let n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),W(this,_n)[_n](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",W(this,li)[li]),window.removeEventListener("offline",W(this,li)[li]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,r){t===void 0&&(t="info"),r===void 0&&(r=3e3);let s=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:s?e.message:e,details:s?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,t){let{logger:r}=this.opts;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e);break}}registerRequestClient(e,t){W(this,In)[In].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=W(this,In)[In].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?W(this,zi)[zi](e):(W(this,Ur)[Ur](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return W(this,Ui)[Ui](...arguments)}addResultData(e,t){if(!W(this,Gc)[Gc](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:r}=this.getState(),s={...r[e],result:{...r[e].result,...t}};this.setState({currentUploads:{...r,[e]:s}})}upload(){var e;(e=W(this,ot)[ot].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),r=this.opts.onBeforeUpload(t);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>W(this,at)[at].validateMinNumberOfFiles(t)).catch(s=>{throw W(this,Rt)[Rt]([s]),s}).then(()=>{if(!W(this,jc)[jc](t))throw new kt(this.i18n("missingRequiredMetaField"))}).catch(s=>{throw s}).then(()=>{let{currentUploads:s}=this.getState(),n=Object.values(s).flatMap(l=>l.fileIDs),o=[];Object.keys(t).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&n.indexOf(l)===-1&&o.push(c.id)});let a=W(this,Ui)[Ui](o);return W(this,zi)[zi](a)}).catch(s=>{throw this.emit("error",s),this.log(s,"error"),s}))}};function Pw(i){for(let n of i)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");let e=i.filter(n=>n.isUserFacing),t=4,r=e.slice(0,t),s=e.slice(t);r.forEach(n=>{let{message:o,details:a=""}=n;this.info({message:o,details:a},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}function Cw(i){let{missingFields:e,error:t}=W(this,at)[at].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function Fw(i){let e=!0;for(let t of Object.values(i))W(this,Dn)[Dn](t)||(e=!1);return e}function _w(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new kt(this.i18n("noMoreFilesAllowed"),{file:i});throw W(this,Rt)[Rt]([t]),t}}function Ow(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=Cn(e),r=qc(t,e),s=Dr(r).extension,n=xa(e,this.getID()),o=e.meta||{};o.name=r,o.type=t;let a=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:n,name:r,extension:s||"",meta:{...this.getState().meta,...o},type:t,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function Rw(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function Lw(i){let{files:e}=this.getState(),t={...e},r=[],s=[];for(let a of i)try{var n;let l=W(this,Kc)[Kc](a),c=(n=e[l.id])==null?void 0:n.isGhost;c&&(l={...e[l.id],isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`));let d=this.opts.onBeforeFileAdded(l,t);if(!d&&this.checkIfFileAlreadyExists(l.id)){var o;throw new kt(this.i18n("noDuplicates",{fileName:(o=l.name)!=null?o:this.i18n("unnamed")}),{file:a})}if(d===!1&&!c)throw new kt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof d=="object"&&d!==null&&(l=d),W(this,at)[at].validateSingleFile(l),t[l.id]=l,r.push(l)}catch(l){s.push(l)}try{W(this,at)[at].validateAggregateRestrictions(Object.values(e),r)}catch(a){return s.push(a),{nextFilesState:e,validFilesToAdd:[],errors:s}}return{nextFilesState:t,validFilesToAdd:r,errors:s}}function Mw(){var i,e;let t=W(this,Yc)[Yc](),r=null;t!=null&&(r=Math.round(t*100),r>100?r=100:r<0&&(r=0)),this.emit("progress",(i=r)!=null?i:0),this.setState({totalProgress:(e=r)!=null?e:0})}function Iw(){let e=this.getFiles().filter(a=>a.progress.uploadStarted||a.progress.preprocess||a.progress.postprocess);if(e.length===0)return 0;if(e.every(a=>a.progress.uploadComplete))return 1;let t=a=>a.progress.bytesTotal!=null&&a.progress.bytesTotal!==0,r=e.filter(t),s=e.filter(a=>!t(a));if(r.every(a=>a.progress.uploadComplete)&&s.length>0&&!s.every(a=>a.progress.uploadComplete))return null;let n=r.reduce((a,l)=>{var c;return a+((c=l.progress.bytesTotal)!=null?c:0)},0),o=r.reduce((a,l)=>a+(l.progress.bytesUploaded||0),0);return n===0?0:o/n}function Dw(){let i=(r,s,n)=>{let o=r.message||"Unknown error";r.details&&(o+=` ${r.details}`),this.setState({error:o}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:o,response:n})};this.on("error",i),this.on("upload-error",(r,s,n)=>{if(i(s,r,n),typeof s=="object"&&s.message){var o;this.log(s.message,"error");let a=new Error(this.i18n("failedToUpload",{file:(o=r?.name)!=null?o:""}));a.isUserFacing=!0,a.details=s.message,s.details&&(a.details+=` ${s.details}`),W(this,Rt)[Rt]([a])}else W(this,Rt)[Rt]([s])});let e=null;this.on("upload-stalled",(r,s)=>{let{message:n}=r,o=s.map(a=>a.meta.name).join(", ");e||(this.info({message:n,details:o},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${n} ${o}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=r=>{let s=r.filter(o=>{let a=o!=null&&this.getFile(o.id);return a||this.log(`Not setting progress for a file that has been removed: ${o?.id}`),a}),n=Object.fromEntries(s.map(o=>[o.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:o.size}}]));this.patchFilesState(n)};this.on("upload-start",t),this.on("upload-progress",W(this,Xc)[Xc]),this.on("upload-success",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let n=this.getFile(r.id).progress;this.setFileState(r.id,{progress:{...n,postprocess:W(this,Hi)[Hi].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:s.bytesUploaded||n.bytesTotal}),W(this,$i)[$i]()}),this.on("preprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:s}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:s}})}),this.on("postprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.postprocess,this.setState({files:s})}),this.on("restored",()=>{W(this,$i)[$i]()}),this.on("dashboard:file-edit-complete",r=>{r&&W(this,Dn)[Dn](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",W(this,li)[li]),window.addEventListener("offline",W(this,li)[li]),setTimeout(W(this,li)[li],3e3))}function Nw(i,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!t)throw new Error("Cannot create a new upload: already uploading.");let n=Np();return this.emit("upload",n,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[n]:{fileIDs:i,step:0,result:{}}}}),n}function Bw(i){let{currentUploads:e}=this.getState();return e[i]}function Uw(i){let e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}async function zw(i){let e=()=>{let{currentUploads:n}=this.getState();return n[i]},t=e(),r=[...W(this,Nr)[Nr],...W(this,Br)[Br],...W(this,Hi)[Hi]];try{for(let n=t.step||0;n<r.length&&t;n++){let o=r[n];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...t,step:n}}});let{fileIDs:a}=t;await o(a,i),t=e()}}catch(n){throw W(this,Ur)[Ur](i),n}if(t){t.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let n=t.fileIDs.map(l=>this.getFile(l)),o=n.filter(l=>!l.error),a=n.filter(l=>l.error);this.addResultData(i,{successful:o,failed:a,uploadID:i}),t=e()}let s;return t&&(s=t.result,this.emit("complete",s),W(this,Ur)[Ur](i)),s==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),s}Ca.VERSION=kw.version;var Zc=Ca;var Un,Ee,Uf,Hw,zr,If,zf,Qc,tu,Jc,eu,$w,Bn={},Hf=[],qw=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Oa=Array.isArray;function qi(i,e){for(var t in e)i[t]=e[t];return i}function $f(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function u(i,e,t){var r,s,n,o={};for(n in e)n=="key"?r=e[n]:n=="ref"?s=e[n]:o[n]=e[n];if(arguments.length>2&&(o.children=arguments.length>3?Un.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(n in i.defaultProps)o[n]===void 0&&(o[n]=i.defaultProps[n]);return Nn(i,o,r,s,null)}function Nn(i,e,t,r,s){var n={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Uf,__i:-1,__u:0};return s==null&&Ee.vnode!=null&&Ee.vnode(n),n}function qf(){return{current:null}}function Lt(i){return i.children}function ht(i,e){this.props=i,this.context=e}function Cs(i,e){if(e==null)return i.__?Cs(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?Cs(i):null}function Vf(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return Vf(i)}}function Df(i){(!i.__d&&(i.__d=!0)&&zr.push(i)&&!_a.__r++||If!==Ee.debounceRendering)&&((If=Ee.debounceRendering)||zf)(_a)}function _a(){var i,e,t,r,s,n,o,a;for(zr.sort(Qc);i=zr.shift();)i.__d&&(e=zr.length,r=void 0,n=(s=(t=i).__v).__e,o=[],a=[],t.__P&&((r=qi({},s)).__v=s.__v+1,Ee.vnode&&Ee.vnode(r),iu(t.__P,r,s,t.__n,t.__P.namespaceURI,32&s.__u?[n]:null,o,n??Cs(s),!!(32&s.__u),a),r.__v=s.__v,r.__.__k[r.__i]=r,Gf(o,r,a),r.__e!=n&&Vf(r)),zr.length>e&&zr.sort(Qc));_a.__r=0}function jf(i,e,t,r,s,n,o,a,l,c,d){var f,y,v,x,P,C=r&&r.__k||Hf,I=e.length;for(t.__d=l,Vw(t,e,C),l=t.__d,f=0;f<I;f++)(v=t.__k[f])!=null&&(y=v.__i===-1?Bn:C[v.__i]||Bn,v.__i=f,iu(i,v,y,s,n,o,a,l,c,d),x=v.__e,v.ref&&y.ref!=v.ref&&(y.ref&&ru(y.ref,null,v),d.push(v.ref,v.__c||x,v)),P==null&&x!=null&&(P=x),65536&v.__u||y.__k===v.__k?l=Wf(v,l,i):typeof v.type=="function"&&v.__d!==void 0?l=v.__d:x&&(l=x.nextSibling),v.__d=void 0,v.__u&=-196609);t.__d=l,t.__e=P}function Vw(i,e,t){var r,s,n,o,a,l=e.length,c=t.length,d=c,f=0;for(i.__k=[],r=0;r<l;r++)(s=e[r])!=null&&typeof s!="boolean"&&typeof s!="function"?(o=r+f,(s=i.__k[r]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Nn(null,s,null,null,null):Oa(s)?Nn(Lt,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?Nn(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=i,s.__b=i.__b+1,n=null,(a=s.__i=jw(s,t,o,d))!==-1&&(d--,(n=t[a])&&(n.__u|=131072)),n==null||n.__v===null?(a==-1&&f--,typeof s.type!="function"&&(s.__u|=65536)):a!==o&&(a==o-1?f--:a==o+1?f++:(a>o?f--:f++,s.__u|=65536))):s=i.__k[r]=null;if(d)for(r=0;r<c;r++)(n=t[r])!=null&&!(131072&n.__u)&&(n.__e==i.__d&&(i.__d=Cs(n)),Kf(n,n))}function Wf(i,e,t){var r,s;if(typeof i.type=="function"){for(r=i.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=i,e=Wf(r[s],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=Cs(i)),t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function Si(i,e){return e=e||[],i==null||typeof i=="boolean"||(Oa(i)?i.some(function(t){Si(t,e)}):e.push(i)),e}function jw(i,e,t,r){var s=i.key,n=i.type,o=t-1,a=t+1,l=e[t];if(l===null||l&&s==l.key&&n===l.type&&!(131072&l.__u))return t;if(r>(l!=null&&!(131072&l.__u)?1:0))for(;o>=0||a<e.length;){if(o>=0){if((l=e[o])&&!(131072&l.__u)&&s==l.key&&n===l.type)return o;o--}if(a<e.length){if((l=e[a])&&!(131072&l.__u)&&s==l.key&&n===l.type)return a;a++}}return-1}function Nf(i,e,t){e[0]==="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||qw.test(e)?t:t+"px"}function Fa(i,e,t,r,s){var n;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||Nf(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||Nf(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")n=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in i||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+n]=t,t?r?t.u=r.u:(t.u=tu,i.addEventListener(e,n?eu:Jc,n)):i.removeEventListener(e,n?eu:Jc,n);else{if(s=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!=="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function Bf(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=tu++;else if(e.t<t.u)return;return t(Ee.event?Ee.event(e):e)}}}function iu(i,e,t,r,s,n,o,a,l,c){var d,f,y,v,x,P,C,I,D,q,M,H,R,G,K,Y,ie=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),n=[a=e.__e=t.__e]),(d=Ee.__b)&&d(e);e:if(typeof ie=="function")try{if(I=e.props,D="prototype"in ie&&ie.prototype.render,q=(d=ie.contextType)&&r[d.__c],M=d?q?q.props.value:d.__:r,t.__c?C=(f=e.__c=t.__c).__=f.__E:(D?e.__c=f=new ie(I,M):(e.__c=f=new ht(I,M),f.constructor=ie,f.render=Gw),q&&q.sub(f),f.props=I,f.state||(f.state={}),f.context=M,f.__n=r,y=f.__d=!0,f.__h=[],f._sb=[]),D&&f.__s==null&&(f.__s=f.state),D&&ie.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=qi({},f.__s)),qi(f.__s,ie.getDerivedStateFromProps(I,f.__s))),v=f.props,x=f.state,f.__v=e,y)D&&ie.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),D&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(D&&ie.getDerivedStateFromProps==null&&I!==v&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(I,M),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(I,f.__s,M)===!1||e.__v===t.__v)){for(e.__v!==t.__v&&(f.props=I,f.state=f.__s,f.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),H=0;H<f._sb.length;H++)f.__h.push(f._sb[H]);f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(I,f.__s,M),D&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(v,x,P)})}if(f.context=M,f.props=I,f.__P=i,f.__e=!1,R=Ee.__r,G=0,D){for(f.state=f.__s,f.__d=!1,R&&R(e),d=f.render(f.props,f.state,f.context),K=0;K<f._sb.length;K++)f.__h.push(f._sb[K]);f._sb=[]}else do f.__d=!1,R&&R(e),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++G<25);f.state=f.__s,f.getChildContext!=null&&(r=qi(qi({},r),f.getChildContext())),D&&!y&&f.getSnapshotBeforeUpdate!=null&&(P=f.getSnapshotBeforeUpdate(v,x)),jf(i,Oa(Y=d!=null&&d.type===Lt&&d.key==null?d.props.children:d)?Y:[Y],e,t,r,s,n,o,a,l,c),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),C&&(f.__E=f.__=null)}catch(Q){if(e.__v=null,l||n!=null){for(e.__u|=l?160:128;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;n[n.indexOf(a)]=null,e.__e=a}else e.__e=t.__e,e.__k=t.__k;Ee.__e(Q,e,t)}else n==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Ww(t.__e,e,t,r,s,n,o,l,c);(d=Ee.diffed)&&d(e)}function Gf(i,e,t){e.__d=void 0;for(var r=0;r<t.length;r++)ru(t[r],t[++r],t[++r]);Ee.__c&&Ee.__c(e,i),i.some(function(s){try{i=s.__h,s.__h=[],i.some(function(n){n.call(s)})}catch(n){Ee.__e(n,s.__v)}})}function Ww(i,e,t,r,s,n,o,a,l){var c,d,f,y,v,x,P,C=t.props,I=e.props,D=e.type;if(D==="svg"?s="http://www.w3.org/2000/svg":D==="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),n!=null){for(c=0;c<n.length;c++)if((v=n[c])&&"setAttribute"in v==!!D&&(D?v.localName===D:v.nodeType===3)){i=v,n[c]=null;break}}if(i==null){if(D===null)return document.createTextNode(I);i=document.createElementNS(s,D,I.is&&I),a&&(Ee.__m&&Ee.__m(e,n),a=!1),n=null}if(D===null)C===I||a&&i.data===I||(i.data=I);else{if(n=n&&Un.call(i.childNodes),C=t.props||Bn,!a&&n!=null)for(C={},c=0;c<i.attributes.length;c++)C[(v=i.attributes[c]).name]=v.value;for(c in C)if(v=C[c],c!="children"){if(c=="dangerouslySetInnerHTML")f=v;else if(!(c in I)){if(c=="value"&&"defaultValue"in I||c=="checked"&&"defaultChecked"in I)continue;Fa(i,c,null,v,s)}}for(c in I)v=I[c],c=="children"?y=v:c=="dangerouslySetInnerHTML"?d=v:c=="value"?x=v:c=="checked"?P=v:a&&typeof v!="function"||C[c]===v||Fa(i,c,v,C[c],s);if(d)a||f&&(d.__html===f.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(f&&(i.innerHTML=""),jf(i,Oa(y)?y:[y],e,t,r,D==="foreignObject"?"http://www.w3.org/1999/xhtml":s,n,o,n?n[0]:t.__k&&Cs(t,0),a,l),n!=null)for(c=n.length;c--;)$f(n[c]);a||(c="value",D==="progress"&&x==null?i.removeAttribute("value"):x!==void 0&&(x!==i[c]||D==="progress"&&!x||D==="option"&&x!==C[c])&&Fa(i,c,x,C[c],s),c="checked",P!==void 0&&P!==i[c]&&Fa(i,c,P,C[c],s))}return i}function ru(i,e,t){try{if(typeof i=="function"){var r=typeof i.__u=="function";r&&i.__u(),r&&e==null||(i.__u=i(e))}else i.current=e}catch(s){Ee.__e(s,t)}}function Kf(i,e,t){var r,s;if(Ee.unmount&&Ee.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||ru(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){Ee.__e(n,e)}r.base=r.__P=null}if(r=i.__k)for(s=0;s<r.length;s++)r[s]&&Kf(r[s],e,t||typeof i.type!="function");t||$f(i.__e),i.__c=i.__=i.__e=i.__d=void 0}function Gw(i,e,t){return this.constructor(i,t)}function su(i,e,t){var r,s,n,o;Ee.__&&Ee.__(i,e),s=(r=typeof t=="function")?null:t&&t.__k||e.__k,n=[],o=[],iu(e,i=(!r&&t||e).__k=u(Lt,null,[i]),s||Bn,Bn,e.namespaceURI,!r&&t?[t]:s?null:e.firstChild?Un.call(e.childNodes):null,n,!r&&t?t:s?s.__e:e.firstChild,r,o),Gf(n,i,o)}function Ra(i,e,t){var r,s,n,o,a=qi({},i.props);for(n in i.type&&i.type.defaultProps&&(o=i.type.defaultProps),e)n=="key"?r=e[n]:n=="ref"?s=e[n]:a[n]=e[n]===void 0&&o!==void 0?o[n]:e[n];return arguments.length>2&&(a.children=arguments.length>3?Un.call(arguments,2):t),Nn(i.type,a,r||i.key,s||i.ref,null)}Un=Hf.slice,Ee={__e:function(i,e,t,r){for(var s,n,o;e=e.__;)if((s=e.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(i)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(i,r||{}),o=s.__d),o)return s.__E=s}catch(a){i=a}throw i}},Uf=0,Hw=function(i){return i!=null&&i.constructor==null},ht.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=qi({},this.state),typeof i=="function"&&(i=i(qi({},t),this.props)),i&&qi(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Df(this))},ht.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Df(this))},ht.prototype.render=Lt,zr=[],zf=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qc=function(i,e){return i.__v.__b-e.__v.__b},_a.__r=0,tu=0,Jc=Bf(!1),eu=Bf(!0),$w=0;function zn(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function Kw(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):zn(i)?i:null}var Xf=Kw;function Xw(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}var La=Xw;var Hr=class{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new Mr([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function Yf(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var Yw=0;function Zw(i){return"__private_"+Yw+++"_"+i}function Qw(i){let e=null,t;return function(){for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=s,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var Hn=Zw("updateUI"),nu=class i extends Hr{constructor(){super(...arguments),Object.defineProperty(this,Hn,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof i||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:i}}));else if(typeof e=="function"){let r=e;this.uppy.iteratePlugins(s=>{s instanceof r&&(t=s)})}return t}mount(e,t){let r=t.id,s=Xf(e);if(s){this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),Yf(this,Hn)[Hn]=Qw(l=>{this.uppy.getPlugin(this.id)&&(su(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),su(this.render(this.uppy.getState(),a),a),this.el=a,s.appendChild(a),a.dir=this.opts.direction||La(a)||"ltr",this.onMount(),this.el}let n=this.getTargetPlugin(e);if(n)return this.uppy.log(`Installing ${r} to ${n.id}`),this.parent=n,this.el=n.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let o=`Invalid target option given to ${r}.`;throw typeof e=="function"?o+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":o+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,r;(t=(r=Yf(this,Hn))[Hn])==null||t.call(r,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},ci=nu;function Ma(i,e,t,r){return t===0||i===e?i:r===0?e:i+(e-i)*2**(-r/t)}var Mt={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var du=Ce(bt(),1);function $n(i){let e=[],t="indeterminate",r;for(let{progress:n}of Object.values(i)){let{preprocess:o,postprocess:a}=n;r==null&&(o||a)&&({mode:t,message:r}=o||a),o?.mode==="determinate"&&e.push(o.value),a?.mode==="determinate"&&e.push(a.value)}let s=e.reduce((n,o)=>n+o/e.length,0);return{mode:t,message:r,value:s}}var cu=Ce(bt(),1),lu=Ce(Aa(),1);function ou(i){let e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,r=Math.floor(i%60);return{hours:e,minutes:t,seconds:r}}function au(i){let e=ou(i),t=e.hours===0?"":`${e.hours}h`,r=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,s=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${r}${s}`}var Jw="\xB7",Zf=()=>` ${Jw} `;function Qf(i){let{newFiles:e,isUploadStarted:t,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:o,startUpload:a}=i,l=(0,cu.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===Mt.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":o}),c=e&&t&&!r?s("uploadXNewFiles",{smart_count:e}):s("uploadXFiles",{smart_count:e});return u("button",{type:"button",className:l,"aria-label":s("uploadXFiles",{smart_count:e}),onClick:a,disabled:o,"data-uppy-super-focusable":!0},c)}function Jf(i){let{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},u("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e("retry"))}function em(i){let{i18n:e,uppy:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function tm(i){let{isAllPaused:e,i18n:t,isAllComplete:r,resumableUploads:s,uppy:n}=i,o=t(e?"resume":"pause");function a(){if(!r){if(!s){n.cancelAll();return}if(e){n.resumeAll();return}n.pauseAll()}}return u("button",{title:o,"aria-label":o,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:a,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},u("g",{fill:"none",fillRule:"evenodd"},u("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),u("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function im(i){let{i18n:e,doneButtonHandler:t}=i;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function rm(){return u("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},u("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function sm(i){let{progress:e}=i,{value:t,mode:r,message:s}=e;return u("div",{className:"uppy-StatusBar-content"},u(rm,null),r==="determinate"?`${Math.round(t*100)}% \xB7 `:"",s)}function e1(i){let{numUploads:e,complete:t,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:o}=i,a=e>1,l=(0,lu.default)(r);return u("div",{className:"uppy-StatusBar-statusSecondary"},a&&o("filesUploadedOfTotal",{complete:t,smart_count:e}),u("span",{className:"uppy-StatusBar-additionalInfo"},a&&Zf(),s!=null?o("dataUploadedOfTotal",{complete:l,total:(0,lu.default)(s)}):o("dataUploadedOfUnknown",{complete:l}),Zf(),n!=null&&o("xTimeLeft",{time:au(n)})))}function nm(i){let{i18n:e,complete:t,numUploads:r}=i;return u("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:r}))}function t1(i){let{i18n:e,newFiles:t,startUpload:r}=i,s=(0,cu.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return u("div",{className:"uppy-StatusBar-statusSecondary"},u("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),u("button",{type:"button",className:s,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:r},e("upload")))}function om(i){let{i18n:e,supportsUploadProgress:t,totalProgress:r,showProgressDetails:s,isUploadStarted:n,isAllComplete:o,isAllPaused:a,newFiles:l,numUploads:c,complete:d,totalUploadedSize:f,totalSize:y,totalETA:v,startUpload:x}=i,P=l&&n;if(!n||o)return null;let C=e(a?"paused":"uploading");function I(){return!a&&!P&&s?t?u(e1,{numUploads:c,complete:d,totalUploadedSize:f,totalSize:y,totalETA:v,i18n:e}):u(nm,{i18n:e,complete:d,numUploads:c}):null}return u("div",{className:"uppy-StatusBar-content","aria-label":C,title:C},a?null:u(rm,null),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t&&r!==0?`${C}: ${r}%`:C),I(),P?u(t1,{i18n:e,newFiles:l,startUpload:x}):null))}function am(i){let{i18n:e}=i;return u("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},u("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function lm(i){let{error:e,i18n:t,complete:r,numUploads:s}=i;function n(){let o=`${t("uploadFailed")}
68
+
69
+ ${e}`;alert(o)}return u("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),u("div",{className:"uppy-StatusBar-status"},u("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),u("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:n,type:"button"},"?")),u(nm,{i18n:t,complete:r,numUploads:s})))}var{STATE_ERROR:cm,STATE_WAITING:i1,STATE_PREPROCESSING:uu,STATE_UPLOADING:Da,STATE_POSTPROCESSING:hu,STATE_COMPLETE:Na}=Mt;function pu(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:r,isAllPaused:s,resumableUploads:n,error:o,hideUploadButton:a=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:f,uploadState:y,totalProgress:v,files:x,supportsUploadProgress:P,hideAfterFinish:C=!1,isSomeGhost:I,doneButtonHandler:D=void 0,isUploadStarted:q,i18n:M,startUpload:H,uppy:R,isAllComplete:G,showProgressDetails:K=void 0,numUploads:Y,complete:ie,totalSize:Q,totalETA:oe,totalUploadedSize:le}=i;function Ae(){switch(y){case hu:case uu:{let He=$n(x);return He.mode==="determinate"?He.value*100:v}case cm:return null;case Da:return P?v:null;default:return v}}function We(){switch(y){case hu:case uu:{let{mode:He}=$n(x);return He==="indeterminate"}case Da:return!P;default:return!1}}let T=Ae(),A=T??100,k=!o&&e&&(!r&&!s||f)&&t&&!a,$=!c&&y!==i1&&y!==Na,j=n&&!l&&y===Da,z=o&&!G&&!d,J=D&&y===Na,ee=(0,du.default)("uppy-StatusBar-progress",{"is-indeterminate":We()}),ke=(0,du.default)("uppy-StatusBar",`is-${y}`,{"has-ghosts":I}),se=(()=>{switch(y){case uu:case hu:return u(sm,{progress:$n(x)});case Na:return u(am,{i18n:M});case cm:return u(lm,{error:o,i18n:M,numUploads:Y,complete:ie});case Da:return u(om,{i18n:M,supportsUploadProgress:P,totalProgress:v,showProgressDetails:K,isUploadStarted:q,isAllComplete:G,isAllPaused:s,newFiles:e,numUploads:Y,complete:ie,totalUploadedSize:le,totalSize:Q,totalETA:oe,startUpload:H});default:return null}})();return u("div",{className:ke,"aria-hidden":!(k||z||j||$||J)&&!se||y===Na&&C},u("div",{className:ee,style:{width:`${A}%`},role:"progressbar","aria-label":`${A}%`,"aria-valuetext":`${A}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":T}),se,u("div",{className:"uppy-StatusBar-actions"},k?u(Qf,{newFiles:e,isUploadStarted:q,recoveredState:f,i18n:M,isSomeGhost:I,startUpload:H,uploadState:y}):null,z?u(Jf,{i18n:M,uppy:R}):null,j?u(tm,{isAllPaused:s,i18n:M,isAllComplete:G,resumableUploads:n,uppy:R}):null,$?u(em,{i18n:M,uppy:R}):null,J?u(im,{i18n:M,doneButtonHandler:D}):null))}var um={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Oe(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var r1=0;function Fs(i){return"__private_"+r1+++"_"+i}var s1={version:"4.0.6"},n1=2e3,o1=2e3;function a1(i,e,t,r){if(i)return Mt.STATE_ERROR;if(e)return Mt.STATE_COMPLETE;if(t)return Mt.STATE_WAITING;let s=Mt.STATE_WAITING,n=Object.keys(r);for(let o=0;o<n.length;o++){let{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return Mt.STATE_UPLOADING;a.preprocess&&(s=Mt.STATE_PREPROCESSING),a.postprocess&&s!==Mt.STATE_PREPROCESSING&&(s=Mt.STATE_POSTPROCESSING)}return s}var l1={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Gt=Fs("lastUpdateTime"),ui=Fs("previousUploadedBytes"),Vi=Fs("previousSpeed"),It=Fs("previousETA"),fu=Fs("computeSmoothETA"),qn=Fs("onUploadStart"),$r=class extends ci{constructor(e,t){super(e,{...l1,...t}),Object.defineProperty(this,fu,{value:c1}),Object.defineProperty(this,Gt,{writable:!0,value:void 0}),Object.defineProperty(this,ui,{writable:!0,value:void 0}),Object.defineProperty(this,Vi,{writable:!0,value:void 0}),Object.defineProperty(this,It,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,qn,{writable:!0,value:()=>{let{recoveredState:r}=this.uppy.getState();if(Oe(this,Vi)[Vi]=null,Oe(this,It)[It]=null,r){Oe(this,ui)[ui]=Object.values(r.files).reduce((s,n)=>{let{progress:o}=n;return s+o.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Oe(this,Gt)[Gt]=performance.now(),Oe(this,ui)[ui]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=um,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:r,allowNewUpload:s,totalProgress:n,error:o,recoveredState:a}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:f,isAllComplete:y,isAllPaused:v,isUploadInProgress:x,isSomeGhost:P}=this.uppy.getObjectOfFilesPerState(),C=a?Object.values(r):l,I=!!t.resumableUploads,D=t.uploadProgress!==!1,q=null,M=0;c.every(R=>R.progress.bytesTotal!=null&&R.progress.bytesTotal!==0)&&(q=0,c.forEach(R=>{q+=R.progress.bytesTotal||0,M+=R.progress.bytesUploaded||0})),c.forEach(R=>{M+=R.progress.bytesUploaded||0});let H=Oe(this,fu)[fu]({uploaded:M,total:q});return pu({error:o,uploadState:a1(o,y,a,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:q,totalUploadedSize:M,isAllComplete:!1,isAllPaused:v,isUploadStarted:f,isUploadInProgress:x,isSomeGhost:P,recoveredState:a,complete:d.length,newFiles:C.length,numUploads:c.length,totalETA:H,files:r,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:I,supportsUploadProgress:D,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let e=this.el;La(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Oe(this,qn)[qn]),Oe(this,Gt)[Gt]=performance.now(),Oe(this,ui)[ui]=this.uppy.getFiles().reduce((t,r)=>t+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Oe(this,qn)[qn])}};function c1(i){var e,t;if(i.total==null||i.total===0)return null;let r=i.total-i.uploaded;if(r<=0)return null;(t=(e=Oe(this,Gt))[Gt])!=null||(e[Gt]=performance.now());let s=performance.now()-Oe(this,Gt)[Gt];if(s===0){var n;return Math.round(((n=Oe(this,It)[It])!=null?n:0)/100)/10}let o=i.uploaded-Oe(this,ui)[ui];if(Oe(this,ui)[ui]=i.uploaded,o<=0){var a;return Math.round(((a=Oe(this,It)[It])!=null?a:0)/100)/10}let l=o/s,c=Oe(this,Vi)[Vi]==null?l:Ma(l,Oe(this,Vi)[Vi],n1,s);Oe(this,Vi)[Vi]=c;let d=r/c,f=Math.max(Oe(this,It)[It]-s,0),y=Oe(this,It)[It]==null?d:Ma(d,f,o1,s);return Oe(this,It)[It]=y,Oe(this,Gt)[Gt]=performance.now(),Math.round(y/100)/10}$r.VERSION=s1.version;var hm=300,Vn=class extends ht{constructor(){super(...arguments),this.ref=qf()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,hm)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,hm)}render(){let{children:e}=this.props;return u("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function u1(i,e){return Object.assign(i,e)}function h1(i,e){var t;return(t=i?.key)!=null?t:e}function d1(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=r=>{i.refs[e]=r})}function jn(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let r=h1(i[t],t.toString(36));e[r]=i[t]}return e}function p1(i,e){i=i||{},e=e||{};let t=o=>e.hasOwnProperty(o)?e[o]:i[o],r={},s=[];for(let o in i)e.hasOwnProperty(o)?s.length&&(r[o]=s,s=[]):s.push(o);let n={};for(let o in e){if(r.hasOwnProperty(o))for(let a=0;a<r[o].length;a++){let l=r[o][a];n[r[o][a]]=t(l)}n[o]=t(o)}for(let o=0;o<s.length;o++)n[s[o]]=t(s[o]);return n}var f1=i=>i,Ba=class extends ht{constructor(e,t){super(e,t),this.refs={},this.state={children:jn(Si(Si(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let e=this.state.children;for(let t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){let t=jn(Si(e.children)||[]),r=this.state.children;this.setState(n=>({children:p1(n.children,t)}));let s;for(s in t)if(t.hasOwnProperty(s)){let n=r&&r.hasOwnProperty(s);t[s]&&n&&this.currentlyTransitioningKeys[s]?(this.keysToEnter.push(s),this.keysToAbortLeave.push(s)):t[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToEnter.push(s)}for(s in r)if(r.hasOwnProperty(s)){let n=t&&t.hasOwnProperty(s);r[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToLeave.push(s)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){let t=this.keysToAbortLeave.indexOf(e);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=jn(Si(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=jn(Si(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;let r=this.refs[e];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;let r=this.refs[e];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let s=jn(Si(this.props.children)||[]);if(s&&s.hasOwnProperty(e))this.performEnter(e);else{let n=u1({},this.state.children);delete n[e],this.setState({children:n})}}render(e,t){let{childFactory:r,transitionLeave:s,transitionName:n,transitionAppear:o,transitionEnter:a,transitionLeaveTimeout:l,transitionEnterTimeout:c,transitionAppearTimeout:d,component:f,...y}=e,{children:v}=t,x=Object.entries(v).map(P=>{let[C,I]=P;if(!I)return;let D=d1(this,C);return Ra(r(I),{ref:D,key:C})}).filter(Boolean);return u(f,y,x)}};Ba.defaultProps={component:"span",childFactory:f1};var dm=Ba;var m1={version:"4.1.2"},qr=class extends ci{constructor(e,t){super(e,t),this.render=r=>u("div",{className:"uppy uppy-Informer"},u(dm,null,r.info.map(s=>u(Vn,{key:s.message},u("p",{role:"alert"},s.message," ",s.details&&u("span",{"aria-label":s.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${s.message}
70
+
71
+ ${s.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};qr.VERSION=m1.version;var g1=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function v1(i,e,t){var r,s;let n=g1.exec(i),o=(r=(s=e.mimeType)!=null?s:n?.[1])!=null?r:"plain/text",a;if(n?.[2]!=null){let l=atob(decodeURIComponent(n[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);a=[c]}else n?.[3]!=null&&(a=[decodeURIComponent(n[3])]);return t?new File(a,e.name||"",{type:o}):new Blob(a,{type:o})}var pm=v1;function Ua(i){return i.startsWith("blob:")}function za(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function ge(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Em=typeof self<"u"?self:global,Xn=typeof navigator<"u",b1=Xn&&typeof HTMLImageElement>"u",fm=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Tm=Em.Buffer,xm=!!Tm,y1=i=>i!==void 0;function Am(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(y1).length===0)}function it(i){let e=new Error(i);throw delete e.stack,e}function mm(i){let e=function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}var mu=i=>String.fromCharCode.apply(null,i),gm=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,jr=class i{static from(e,t){return e instanceof this&&e.le===t?e:new i(e,void 0,void 0,t)}constructor(e,t=0,r,s){if(typeof s=="boolean"&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){r===void 0&&(r=e.byteLength-t);let n=new DataView(e,t,r);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof i){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&it("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,r);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else it("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,r=i){return e instanceof DataView||e instanceof i?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||it("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new i(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return s=this.getUint8Array(e,t),gm?gm.decode(s):xm?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(mu(s)));var s}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return mu(r)}getUnicodeString(e=0,t=this.byteLength){let r=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)r.push(this.getUint16(e+s));return mu(r)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function vu(i,e){it(`${i} '${e}' was not loaded, try using full build of exifr.`)}var Yn=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||vu(this.kind,e),t&&(e in t||function(r,s){it(`Unknown ${r} '${s}'.`)}(this.kind,e),t[e].enabled||vu(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},ja=new Yn("file parser"),Dt=new Yn("segment parser"),Jn=new Yn("file reader"),w1=Em.fetch;function vm(i,e){return(t=i).startsWith("data:")||t.length>1e4?yu(i,e,"base64"):fm&&i.includes("://")?bu(i,e,"url",Ha):fm?yu(i,e,"fs"):Xn?bu(i,e,"url",Ha):void it("Invalid input argument");var t}async function bu(i,e,t,r){return Jn.has(t)?yu(i,e,t):r?async function(s,n){let o=await n(s);return new jr(o)}(i,r):void it(`Parser ${t} is not loaded`)}async function yu(i,e,t){let r=new(Jn.get(t))(i,e);return await r.read(),r}var Ha=i=>w1(i).then(e=>e.arrayBuffer()),Zn=i=>new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)}),wu=class extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}};function km(i,e,t){let r=new wu;for(let[s,n]of t)r.set(s,n);if(Array.isArray(e))for(let s of e)i.set(s,r);else i.set(e,r);return r}function Pm(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}var eo=new Map,Au=new Map,ku=new Map,_s=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Wa=["jfif","xmp","icc","iptc","ihdr"],Qn=["tiff",...Wa],Ve=["ifd0","ifd1","exif","gps","interop"],Os=[...Qn,...Ve],Rs=["makerNote","userComment"],Ga=["translateKeys","translateValues","reviveValues","multiSegment"],Ls=[...Ga,"sanitize","mergeOutput","silentErrors"],$a=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},Vr=class extends $a{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,s){if(super(),ge(this,"enabled",!1),ge(this,"skip",new Set),ge(this,"pick",new Set),ge(this,"deps",new Set),ge(this,"translateKeys",!1),ge(this,"translateValues",!1),ge(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=Ve.includes(e),this.canBeFiltered&&(this.dict=eo.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:n,skip:o}=r;n&&n.length>0&&this.translateTagSet(n,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:it(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of Ga)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,s,{tagKeys:n,tagValues:o}=this.dict;for(r of e)typeof r=="string"?(s=o.indexOf(r),s===-1&&(s=n.indexOf(Number(r))),s!==-1&&t.add(Number(n[s]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,qa(this.pick,this.deps)):this.enabled&&this.pick.size>0&&qa(this.pick,this.deps)}},yt={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},bm=new Map,Wr=class extends $a{static useCached(e){let t=bm.get(e);return t!==void 0||(t=new this(e),bm.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):it(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Xn?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of _s)this[e]=yt[e];for(e of Ls)this[e]=yt[e];for(e of Rs)this[e]=yt[e];for(e of Os)this[e]=new Vr(e,yt[e],void 0,this)}setupFromTrue(){let e;for(e of _s)this[e]=yt[e];for(e of Ls)this[e]=yt[e];for(e of Rs)this[e]=!0;for(e of Os)this[e]=new Vr(e,!0,void 0,this)}setupFromArray(e){let t;for(t of _s)this[t]=yt[t];for(t of Ls)this[t]=yt[t];for(t of Rs)this[t]=yt[t];for(t of Os)this[t]=new Vr(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ve)}setupFromObject(e){let t;for(t of(Ve.ifd0=Ve.ifd0||Ve.image,Ve.ifd1=Ve.ifd1||Ve.thumbnail,Object.assign(this,e),_s))this[t]=gu(e[t],yt[t]);for(t of Ls)this[t]=gu(e[t],yt[t]);for(t of Rs)this[t]=gu(e[t],yt[t]);for(t of Qn)this[t]=new Vr(t,yt[t],e[t],this);for(t of Ve)this[t]=new Vr(t,yt[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ve,Os),e.tiff===!0?this.batchEnableWithBool(Ve,!0):e.tiff===!1?this.batchEnableWithUserValue(Ve,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ve):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ve)}batchEnableWithBool(e,t){for(let r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let s=t[r];this[r].enabled=s!==!1&&s!==void 0}}setupGlobalFilters(e,t,r,s=r){if(e&&e.length){for(let o of s)this[o].enabled=!1;let n=ym(e,r);for(let[o,a]of n)qa(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let n=ym(t,r);for(let[o,a]of n)qa(this[o].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=Ve.some(n=>this[n].enabled===!0)||this.makerNote||this.userComment;for(let n of Ve)this[n].finalizeFilters()}get onlyTiff(){return!Wa.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Qn)this[e].enabled&&!Dt.has(e)&&vu("segment parser",e)}};function ym(i,e){let t,r,s,n,o=[];for(s of e){for(n of(t=eo.get(s),r=[],t))(i.includes(n[0])||i.includes(n[1]))&&r.push(n[0]);r.length&&o.push([s,r])}return o}function gu(i,e){return i!==void 0?i:e!==void 0?e:void 0}function qa(i,e){for(let t of e)i.add(t)}ge(Wr,"default",yt);var Ms=class{constructor(e){ge(this,"parsers",{}),ge(this,"output",{}),ge(this,"errors",[]),ge(this,"pushToErrors",t=>this.errors.push(t)),this.options=Wr.useCached(e)}async read(e){this.file=await function(t,r){return typeof t=="string"?vm(t,r):Xn&&!b1&&t instanceof HTMLImageElement?vm(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new jr(t):Xn&&t instanceof Blob?bu(t,r,"blob",Zn):void it("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,s]of ja)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[r]=!0;this.file.close&&this.file.close(),it("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),Am(r=e)?void 0:r;var r}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async r=>{let s=await r.parse();r.assignToOutput(e,s)});this.options.silentErrors&&(t=t.map(r=>r.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,r=Dt.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),s===void 0)return;let n=await this.fileParser.ensureSegmentChunk(s),o=this.parsers.tiff=new r(n,e,t),a=await o.extractThumbnail();return t.close&&t.close(),a}};async function Cm(i,e){let t=new Ms(e);return await t.read(i),t.parse()}var S1=Object.freeze({__proto__:null,parse:Cm,Exifr:Ms,fileParsers:ja,segmentParsers:Dt,fileReaders:Jn,tagKeys:eo,tagValues:Au,tagRevivers:ku,createDictionary:km,extendDictionary:Pm,fetchUrlAsArrayBuffer:Ha,readBlobAsArrayBuffer:Zn,chunkedProps:_s,otherSegments:Wa,segments:Qn,tiffBlocks:Ve,segmentsAndBlocks:Os,tiffExtractables:Rs,inheritables:Ga,allFormatters:Ls,Options:Wr}),hr=class{static findPosition(e,t){let r=e.getUint16(t+2)+2,s=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,n=t+s,o=r-s;return{offset:t,length:r,headerLength:s,start:n,size:o,end:n+o}}static parse(e,t={}){return new this(e,new Wr({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof jr?e:new jr(e)}constructor(e,t={},r){ge(this,"errors",[]),ge(this,"raw",new Map),ge(this,"handleError",s=>{if(!this.options.silentErrors)throw s;this.errors.push(s.message)}),this.chunk=this.normalizeInput(e),this.file=r,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let r=ku.get(t),s=Au.get(t),n=eo.get(t),o=this.options[t],a=o.reviveValues&&!!r,l=o.translateValues&&!!s,c=o.translateKeys&&!!n,d={};for(let[f,y]of e)a&&r.has(f)?y=r.get(f)(y):l&&s.has(f)&&(y=this.translateValue(y,s.get(f))),c&&n.has(f)&&(f=n.get(f)||f),d[f]=y;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}};ge(hr,"headerLength",4),ge(hr,"type",void 0),ge(hr,"multiSegment",!1),ge(hr,"canHandle",()=>!1);function E1(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function T1(i){return i>=224&&i<=239}function x1(i,e,t){for(let[r,s]of Dt)if(s.canHandle(i,e,t))return r}var Va=class extends class{constructor(e,t,r){ge(this,"errors",[]),ge(this,"ensureSegmentChunk",async s=>{let n=s.start,o=s.size||65536;if(this.file.chunked)if(this.file.available(n,o))s.chunk=this.file.subarray(n,o);else try{s.chunk=await this.file.readChunk(n,o)}catch(a){it(`Couldn't read segment: ${JSON.stringify(s)}. ${a.message}`)}else this.file.byteLength>n+o?s.chunk=this.file.subarray(n,o):s.size===void 0?s.chunk=this.file.subarray(n):it("Segment unreachable: "+JSON.stringify(s));return s.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(Dt.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:s}=t,n=this.options[r];if(n&&n.enabled){let o=this.parsers[r];o&&o.append||o||this.createParser(r,s)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),ge(this,"appSegments",[]),ge(this,"jpegSegments",[]),ge(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Dt.keyList())):(e=e===void 0?Dt.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&Dt.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:r,findAll:s,wanted:n,remaining:o}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some(a=>{let l=Dt.get(a),c=this.options[a];return l.multiSegment&&c.multiSegment}),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let a=!1;for(;o.size>0&&!a&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(a=e>l&&!c?!await r.readNextChunk(e):!await r.readNextChunk(l),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,s,n,o,a,l,{file:c,findAll:d,wanted:f,remaining:y,options:v}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(r=c.getUint8(e+1),T1(r)){if(s=c.getUint16(e+2),n=x1(c,e,s),n&&f.has(n)&&(o=Dt.get(n),a=o.findPosition(c,e),l=v[n],a.type=n,this.appSegments.push(a),!d&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||y.delete(n)):y.delete(n),y.size===0)))break;v.recordUnknownSegments&&(a=hr.findPosition(c,e),a.marker=r,this.unknownSegments.push(a)),e+=s+1}else if(E1(r)){if(s=c.getUint16(e+2),r===218&&v.stopAfterSos!==!1)return;v.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:r}),e+=s+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,r){let s,n,o,a=new Map;for(let l=0;l<t.length;l++)s=t[l],n=s[r],a.has(n)?o=a.get(n):a.set(n,o=[]),o.push(s);return Array.from(a)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,r])=>{let s=Dt.get(t,this.options);return s.handleMultiSegments?{type:t,chunk:s.handleMultiSegments(r)}:r[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}};ge(Va,"type","jpeg"),ja.set("jpeg",Va);var A1=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Su=class extends hr{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,r=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let o=s.size>0,a=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(o){if(s.has(d)&&(r.set(d,this.parseTag(e,d,t)),s.delete(d),s.size===0))break}else!a&&n.has(d)||r.set(d,this.parseTag(e,d,t));e+=12}return r}parseTag(e,t,r){let{chunk:s}=this,n=s.getUint16(e+2),o=s.getUint32(e+4),a=A1[n];if(a*o<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&it(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&it(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),n===1)return s.getUint8Array(e,o);if(n===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=s.getString(e,o)).trim())===""?void 0:l;var l;if(n===7)return s.getUint8Array(e,o);if(o===1)return this.parseTagValue(n,e);{let c=new(function(f){switch(f){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}(n))(o),d=a;for(let f=0;f<o;f++)c[f]=this.parseTagValue(n,e),e+=d;return c}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:it(`Invalid tiff type ${e}`)}}},Kn=class extends Su{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let r=new Map;return this[t]=r,this.parseTags(e,t,r),r}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&it("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&it(`IFD0 offset points to outside of file.
72
+ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,mm(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,mm(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let r=e.get(t);r&&r.length===1&&e.set(t,r[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",wm(...e.get(2),e.get(1))),e.set("longitude",wm(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,r,s={};for(t of Ve)if(e=this[t],!Am(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,r)}else s[t]=r;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,s]of Object.entries(t))this.assignObjectToOutput(e,r,s)}};function wm(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}ge(Kn,"type","tiff"),ge(Kn,"headerLength",10),Dt.set("tiff",Kn);var tF=Object.freeze({__proto__:null,default:S1,Exifr:Ms,fileParsers:ja,segmentParsers:Dt,fileReaders:Jn,tagKeys:eo,tagValues:Au,tagRevivers:ku,createDictionary:km,extendDictionary:Pm,fetchUrlAsArrayBuffer:Ha,readBlobAsArrayBuffer:Zn,chunkedProps:_s,otherSegments:Wa,segments:Qn,tiffBlocks:Ve,segmentsAndBlocks:Os,tiffExtractables:Rs,inheritables:Ga,allFormatters:Ls,Options:Wr,parse:Cm}),Pu={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},iF=Object.assign({},Pu,{firstChunkSize:4e4,gps:[1,2,3,4]});var rF=Object.assign({},Pu,{tiff:!1,ifd1:!0,mergeOutput:!1});var k1=Object.assign({},Pu,{firstChunkSize:4e4,ifd0:[274]});async function P1(i){let e=new Ms(k1);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}var C1=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}}),Wn=!0,Gn=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,r]=e;Wn=Number(t)+.1*Number(r)<13.4,Gn=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Wn=Gn=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Wn=Gn=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Wn=Gn=Number(e)<77}}async function Fm(i){let e=await P1(i);return Object.assign({canvas:Wn,css:Gn},C1[e])}var Eu=class extends jr{constructor(...e){super(...e),ge(this,"ranges",new Tu),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let s=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(s)}else{let s=e+t;if(s>this.byteLength){let{dataView:n}=this._extend(s);this._swapDataView(n)}}}_extend(e){let t;t=xm?Tm.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}},Tu=class{constructor(){ge(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter(o=>Sm(e,o.offset,s)||Sm(e,o.end,s));if(n.length>0){e=Math.min(e,...n.map(a=>a.offset)),s=Math.max(s,...n.map(a=>a.end)),t=s-e;let o=n.shift();o.offset=e,o.length=t,o.end=s,this.list=this.list.filter(a=>!n.includes(a))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let r=e+t;return this.list.some(s=>s.offset<=e&&r<=s.end)}};function Sm(i,e,t){return i<=e&&e<=t}var xu=class extends Eu{constructor(e,t){super(0),ge(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,r=await this.readChunk(e,t);return!!r&&r.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};Jn.set("blob",class extends xu{async readWhole(){this.chunked=!1;let i=await Zn(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,r=this.input.slice(i,t),s=await Zn(r);return this.set(s,i,!0)}});var _m={strings:{generatingThumbnails:"Generating thumbnails..."}};var F1={version:"4.0.2"};function _1(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>pm(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function O1(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);let s=document.createElement("canvas");s.width=t,s.height=r;let n=s.getContext("2d");return n.translate(t/2,r/2),e.canvas&&(n.rotate(e.rad),n.scale(e.scaleX,e.scaleY)),n.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),s}function R1(i){let e=i.width/i.height,t=5e6,r=4096,s=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(s>r&&(s=r,n=Math.round(s/e)),n>r&&(n=r,s=Math.round(e*n)),i.width>s){let o=document.createElement("canvas");return o.width=s,o.height=n,o.getContext("2d").drawImage(i,0,0,s,n),o}return i}var L1={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},Is=class extends ci{constructor(e,t){if(super(e,{...L1,...t}),this.onFileAdded=r=>{!r.preview&&r.data&&za(r.type)&&!r.isRemote&&this.addToQueue(r.id)},this.onCancelRequest=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1)},this.onFileRemoved=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1),r.preview&&Ua(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||Ua(s.preview))&&this.addToQueue(s.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",o,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let s=()=>{r.forEach(n=>{let o=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",o)})};return new Promise(n=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{s(),n()}):(s(),n())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=_m,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,r){let s=URL.createObjectURL(e.data),n=new Promise((a,l)=>{let c=new Image;c.src=s,c.addEventListener("load",()=>{URL.revokeObjectURL(s),a(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(s),l(d.error||new Error("Could not create thumbnail"))})}),o=Fm(e.data).catch(()=>1);return Promise.all([n,o]).then(a=>{let[l,c]=a,d=this.getProportionalDimensions(l,t,r,c.deg),f=O1(l,c),y=this.resizeImage(f,d.width,d.height);return _1(y,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,t,r,s){let n=e.width/e.height;return(s===90||s===270)&&(n=e.height/e.width),t!=null?{width:t,height:Math.round(t/n)}:r!=null?{width:Math.round(r*n),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,r){let s=R1(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let o=t*2**(n-1),a=r*2**(n-1),l=2;for(;n--;){let c=document.createElement("canvas");c.width=o,c.height=a,c.getContext("2d").drawImage(s,0,0,o,a),s=c,o=Math.round(o/l),a=Math.round(a/l)}return s}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return za(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};Is.VERSION=F1.version;function M1(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&zn(i)?[i]:null}var Cu=M1;var dr=Array.from;function Ka(i,e,t,r){let{onSuccess:s}=r;i.readEntries(n=>{let o=[...e,...n];n.length?queueMicrotask(()=>{Ka(i,o,t,{onSuccess:s})}):s(o)},n=>{t(n),s(e)})}function Om(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,r)=>i.file(t,r))},async*values(){let t=i.createReader();yield*await new Promise(s=>{Ka(t,[],e,{onSuccess:n=>s(n.map(o=>Om(o,e)))})})},isSameEntry:void 0}}function Rm(i,e,t){try{return t===void 0&&(t=void 0),async function*(){let r=()=>`${e}/${i.name}`;if(i.kind==="file"){let s=await i.getFile();s!=null?(s.relativePath=e?r():null,yield s):t!=null&&(yield t)}else if(i.kind==="directory")for await(let s of i.values())yield*Rm(s,e?r():i.name);else t!=null&&(yield t)}()}catch(r){return Promise.reject(r)}}async function*Fu(i,e){let t=await Promise.all(Array.from(i.items,async r=>{var s;let n,o=()=>typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry();return(s=n)!=null||(n=Om(o(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(let{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*Rm(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}function _u(i){let e=dr(i.files);return Promise.resolve(e)}async function Ou(i,e){var t;let r=(t=e?.logDropError)!=null?t:Function.prototype;try{let s=[];for await(let n of Fu(i,r))s.push(n);return s}catch{return _u(i)}}var cg=Ce(bt(),1);function to(i){return{...i,type:i.mimeType,extension:i.name?Dr(i.name).extension:null}}var io,ze,Ru,Lm,ro=0,Hm=[],je=Ee,Mm=je.__b,Im=je.__r,Dm=je.diffed,Nm=je.__c,Bm=je.unmount,Um=je.__;function Mu(i,e){je.__h&&je.__h(ze,i,ro||e),ro=0;var t=ze.__H||(ze.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function hi(i){return ro=1,I1(qm,i)}function I1(i,e,t){var r=Mu(io++,2);if(r.t=i,!r.__c&&(r.__=[t?t(e):qm(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],c=r.t(l,a);l!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=ze,!ze.u)){var s=function(a,l,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(y){return!!y.__c});if(d.every(function(y){return!y.__N}))return!n||n.call(this,a,l,c);var f=!1;return d.forEach(function(y){if(y.__N){var v=y.__[0];y.__=y.__N,y.__N=void 0,v!==y.__[0]&&(f=!0)}}),!(!f&&r.__c.props===a)&&(!n||n.call(this,a,l,c))};ze.u=!0;var n=ze.shouldComponentUpdate,o=ze.componentWillUpdate;ze.componentWillUpdate=function(a,l,c){if(this.__e){var d=n;n=void 0,s(a,l,c),n=d}o&&o.call(this,a,l,c)},ze.shouldComponentUpdate=s}return r.__N||r.__}function Ei(i,e){var t=Mu(io++,3);!je.__s&&$m(t.__H,e)&&(t.__=i,t.i=e,ze.__H.__h.push(t))}function Gr(i){return ro=5,Kr(function(){return{current:i}},[])}function Kr(i,e){var t=Mu(io++,7);return $m(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Xr(i,e){return ro=8,Kr(function(){return i},e)}function D1(){for(var i;i=Hm.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Xa),i.__H.__h.forEach(Lu),i.__H.__h=[]}catch(e){i.__H.__h=[],je.__e(e,i.__v)}}je.__b=function(i){ze=null,Mm&&Mm(i)},je.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Um&&Um(i,e)},je.__r=function(i){Im&&Im(i),io=0;var e=(ze=i.__c).__H;e&&(Ru===ze?(e.__h=[],ze.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0})):(e.__h.forEach(Xa),e.__h.forEach(Lu),e.__h=[],io=0)),Ru=ze},je.diffed=function(i){Dm&&Dm(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Hm.push(e)!==1&&Lm===je.requestAnimationFrame||((Lm=je.requestAnimationFrame)||N1)(D1)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.i=void 0})),Ru=ze=null},je.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Xa),t.__h=t.__h.filter(function(r){return!r.__||Lu(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],je.__e(r,t.__v)}}),Nm&&Nm(i,e)},je.unmount=function(i){Bm&&Bm(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{Xa(r)}catch(s){e=s}}),t.__H=void 0,e&&je.__e(e,t.__v))};var zm=typeof requestAnimationFrame=="function";function N1(i){var e,t=function(){clearTimeout(r),zm&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,100);zm&&(e=requestAnimationFrame(t))}function Xa(i){var e=ze,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),ze=e}function Lu(i){var e=ze;i.__c=i.__(),ze=e}function $m(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function qm(i,e){return typeof e=="function"?e(i):e}function B1(){return u("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},u("g",{fill:"none","fill-rule":"evenodd"},u("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),u("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),u("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),u("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),u("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),u("path",{d:"M4 4h18v18H4z"})))}function U1(i){let{pluginName:e,i18n:t,onAuth:r}=i,s=e==="Google Drive",n=Xr(o=>{o.preventDefault(),r()},[r]);return u("form",{onSubmit:n},s?u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},u(B1,null),t("signInWithGoogle")):u("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var z1=i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return u(U1,{pluginName:e,i18n:t,onAuth:r})};function Ya(i){let{loading:e,pluginName:t,pluginIcon:r,i18n:s,handleAuth:n,renderForm:o=z1}=i;return u("div",{className:"uppy-Provider-auth"},u("div",{className:"uppy-Provider-authIcon"},r()),u("div",{className:"uppy-Provider-authTitle"},s("authenticateWithTitle",{pluginName:t})),o({pluginName:t,i18n:s,loading:e,onAuth:n}))}var Vm=Ce(bt(),1);function Iu(i){let{i18n:e,logout:t,username:r}=i;return u(Lt,null,r&&u("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),u("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function Du(i){let{openFolder:e,title:t,breadcrumbsIcon:r,breadcrumbs:s,i18n:n}=i;return u("div",{className:"uppy-Provider-breadcrumbs"},u("div",{className:"uppy-Provider-breadcrumbsIcon"},r),s.map((o,a)=>{var l;return u(Lt,null,u("button",{key:o.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(o.id)},o.type==="root"?t:(l=o.data.name)!=null?l:n("unnamed")),s.length===a+1?"":" / ")}))}function Nu(i){return u("div",{className:"uppy-ProviderBrowser-header"},u("div",{className:(0,Vm.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&u(Du,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),u(Iu,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Bu(){return Bu=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Bu.apply(null,arguments)}var H1={position:"relative",width:"100%",minHeight:"100%"},$1={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Uu=class extends ht{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:r,renderRow:s,overscanCount:n=10,...o}=e,{offset:a,height:l}=this.state,c=Math.floor(a/r),d=Math.floor(l/r);n&&(c=Math.max(0,c-c%n),d+=n);let f=c+d+4,y=t.slice(c,f),v={...H1,height:t.length*r},x={...$1,top:c*r};return u("div",Bu({onScroll:this.handleScroll},o),u("div",{role:"presentation",style:v},u("div",{role:"presentation",style:x},y.map(s))))}},Za=Uu;var jm=Ce(bt(),1);function q1(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},u("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function V1(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},u("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function j1(){return u("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},u("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),u("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function Ds(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return u(q1,null);case"folder":return u(V1,null);case"video":return u(j1,null);default:return u("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function W1(i){var e,t;let{file:r,toggleCheckbox:s,className:n,isDisabled:o,restrictionError:a,showTitles:l,children:c=null,i18n:d}=i;return u("li",{className:n,title:o&&a?a:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:s,name:"listitem",id:r.id,checked:r.status==="checked",disabled:o,"data-uppy-super-focusable":!0}),u("label",{htmlFor:r.id,"aria-label":(e=r.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u(Ds,{itemIconString:r.data.thumbnail||r.data.icon}),l&&((t=r.data.name)!=null?t:d("unnamed")),c))}var zu=W1;function Hu(i){var e,t,r;let{file:s,openFolder:n,className:o,isDisabled:a,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:f}=i;return u("li",{className:o,title:s.status!=="checked"&&l?l:void 0},u("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:s.id,checked:s.status==="checked","aria-label":s.data.isFolder?f("allFilesFromFolderNamed",{name:(e=s.data.name)!=null?e:f("unnamed")}):null,disabled:a,"data-uppy-super-focusable":!0}),s.data.isFolder?u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>n(s.id),"aria-label":f("openFolderNamed",{name:(t=s.data.name)!=null?t:f("unnamed")})},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(Ds,{itemIconString:s.data.icon})),d&&s.data.name?u("span",null,s.data.name):f("unnamed")):u("label",{htmlFor:s.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},u("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u(Ds,{itemIconString:s.data.icon})),d&&((r=s.data.name)!=null?r:f("unnamed"))))}function $u(i){let{viewType:e,toggleCheckbox:t,showTitles:r,i18n:s,openFolder:n,file:o}=i,a=o.type==="folder"?null:o.restrictionError,l=!!a&&o.status!=="checked",c={file:o,openFolder:n,toggleCheckbox:t,i18n:s,viewType:e,showTitles:r,className:(0,jm.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":l},{"uppy-ProviderBrowserItem--noPreview":o.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":o.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":o.status==="partial"}),isDisabled:l,restrictionError:a};switch(e){case"grid":return u(zu,c);case"list":return u(Hu,c);case"unsplash":return u(zu,c,u("a",{href:`${o.data.author.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},o.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function G1(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:o,isLoading:a,openFolder:l,noResultsLabel:c,virtualList:d}=i,[f,y]=hi(!1);if(Ei(()=>{let x=C=>{C.key==="Shift"&&y(!1)},P=C=>{C.key==="Shift"&&y(!0)};return document.addEventListener("keyup",x),document.addEventListener("keydown",P),()=>{document.removeEventListener("keyup",x),document.removeEventListener("keydown",P)}},[]),a)return u("div",{className:"uppy-Provider-loading"},typeof a=="string"?a:o("loading"));if(e.length===0)return u("div",{className:"uppy-Provider-empty"},c);let v=x=>u($u,{viewType:t,toggleCheckbox:P=>{var C;P.stopPropagation(),P.preventDefault(),(C=document.getSelection())==null||C.removeAllRanges(),r(x,f)},showTitles:n,i18n:o,openFolder:l,file:x});return d?u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list"},u(Za,{data:e,renderRow:v,rowHeight:31}))):u("div",{className:"uppy-ProviderBrowser-body"},u("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,role:"listbox",tabIndex:-1},e.map(v)))}var Qa=G1;var K1=(i,e,t,r,s)=>{let n=e.filter(v=>v.isFolder===!0),o=e.filter(v=>v.isFolder===!1),a=t.type==="folder"&&t.status==="checked",l=n.map(v=>({type:"folder",id:v.requestPath,cached:!1,nextPagePath:null,status:a?"checked":"unchecked",parentId:t.id,data:v})),c=o.map(v=>{let x=s(v);return{type:"file",id:v.requestPath,restrictionError:x,status:a&&!x?"checked":"unchecked",parentId:t.id,data:v}}),d={...t,cached:!0,nextPagePath:r};return[...i.map(v=>v.id===d.id?d:v),...l,...c]},Wm=K1;var X1=(i,e,t,r,s)=>{let n=i.find(x=>x.id===e),o=t.filter(x=>x.isFolder===!0),a=t.filter(x=>x.isFolder===!1),l={...n,nextPagePath:r},c=i.map(x=>x.id===l.id?l:x),d=l.type==="folder"&&l.status==="checked",f=o.map(x=>({type:"folder",id:x.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:x})),y=a.map(x=>{let P=s(x);return{type:"file",id:x.requestPath,restrictionError:P,status:d&&!P?"checked":"unchecked",parentId:l.id,data:x}});return[...c,...f,...y]},Gm=X1;var Y1=i=>i.map(e=>({...e})),Ja=Y1;var qu=(i,e,t)=>{i.filter(s=>s.type!=="root"&&s.parentId===e).forEach(s=>{s.status=t&&!(s.type==="file"&&s.restrictionError)?"checked":"unchecked",qu(i,s.id,t)})},Vu=(i,e)=>{let t=i.find(o=>o.id===e);if(t.type==="root")return;let r=i.filter(o=>o.type!=="root"&&o.parentId===t.id&&!(o.type==="file"&&o.restrictionError)),s=r.every(o=>o.status==="checked"),n=r.every(o=>o.status==="unchecked");s?t.status="checked":n?t.status="unchecked":t.status="partial",Vu(i,t.parentId)},Z1=(i,e)=>{let t=Ja(i);if(e.length>=2){let r=t.filter(s=>s.type!=="root"&&e.includes(s.id));r.forEach(s=>{s.type==="file"?s.status=s.restrictionError?"unchecked":"checked":s.status="checked"}),r.forEach(s=>{qu(t,s.id,!0)}),Vu(t,r[0].parentId)}else{let r=t.find(s=>s.id===e[0]);r.status=r.status==="checked"?"unchecked":"checked",qu(t,r.id,r.status==="checked"),Vu(t,r.parentId)}return t},Km=Z1;var Wu=Ce(Ym(),1);var no=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Gu=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Zm=i=>globalThis.DOMException===void 0?new Gu(i):new DOMException(i),Qm=i=>{let e=i.reason===void 0?Zm("This operation was aborted."):i.reason;return e instanceof Error?e:Zm(e)};function Ku(i,e){let{milliseconds:t,fallback:r,message:s,customTimers:n={setTimeout,clearTimeout}}=e,o,l=new Promise((c,d)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:y}=e;y.aborted&&d(Qm(y));let v=()=>{d(Qm(y))};y.addEventListener("abort",v,{once:!0}),i.finally(()=>{y.removeEventListener("abort",v)})}if(t===Number.POSITIVE_INFINITY){i.then(c,d);return}let f=new no;o=n.setTimeout.call(void 0,()=>{if(r){try{c(r())}catch(y){d(y)}return}typeof i.cancel=="function"&&i.cancel(),s===!1?c():s instanceof Error?d(s):(f.message=s??`Promise timed out after ${t} milliseconds`,d(f))},t),(async()=>{try{c(await i)}catch(y){d(y)}})()}).finally(()=>{l.clear()});return l.clear=()=>{n.clearTimeout.call(void 0,o),o=void 0},l}function Xu(i,e,t){let r=0,s=i.length;for(;s>0;){let n=Math.trunc(s/2),o=r+n;t(i[o],e)<=0?(r=++o,s-=n+1):s=n}return r}var oo=class{#e=[];enqueue(e,t){t={priority:0,...t};let r={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(r);return}let s=Xu(this.#e,r,(n,o)=>o.priority-n.priority);this.#e.splice(s,0,r)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var ao=class extends Wu.default{#e;#t;#i=0;#s;#r;#n=0;#a;#c;#l;#u;#o=0;#d;#h;#f;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:oo,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#t=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#s=e.intervalCap,this.#r=e.interval,this.#l=new e.queueClass,this.#u=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#f=e.throwOnTimeout===!0,this.#h=e.autoStart===!1}get#p(){return this.#t||this.#i<this.#s}get#v(){return this.#o<this.#d}#m(){this.#o--,this.#g(),this.emit("next")}#b(){this.#T(),this.#E(),this.#c=void 0}get#y(){let e=Date.now();if(this.#a===void 0){let t=this.#n-e;if(t<0)this.#i=this.#e?this.#o:0;else return this.#c===void 0&&(this.#c=setTimeout(()=>{this.#b()},t)),!0}return!1}#g(){if(this.#l.size===0)return this.#a&&clearInterval(this.#a),this.#a=void 0,this.emit("empty"),this.#o===0&&this.emit("idle"),!1;if(!this.#h){let e=!this.#y;if(this.#p&&this.#v){let t=this.#l.dequeue();return t?(this.emit("active"),t(),e&&this.#E(),!0):!1}}return!1}#E(){this.#t||this.#a!==void 0||(this.#a=setInterval(()=>{this.#T()},this.#r),this.#n=Date.now()+this.#r)}#T(){this.#i===0&&this.#o===0&&this.#a&&(clearInterval(this.#a),this.#a=void 0),this.#i=this.#e?this.#o:0,this.#w()}#w(){for(;this.#g(););}get concurrency(){return this.#d}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#d=e,this.#w()}async#x(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(e.reason)},{once:!0})})}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:this.#f,...t},new Promise((r,s)=>{this.#l.enqueue(async()=>{this.#o++,this.#i++;try{t.signal?.throwIfAborted();let n=e({signal:t.signal});t.timeout&&(n=Ku(Promise.resolve(n),{milliseconds:t.timeout})),t.signal&&(n=Promise.race([n,this.#x(t.signal)]));let o=await n;r(o),this.emit("completed",o)}catch(n){if(n instanceof no&&!t.throwOnTimeout){r();return}s(n),this.emit("error",n)}finally{this.#m()}},t),this.emit("add"),this.#g()})}async addAll(e,t){return Promise.all(e.map(async r=>this.add(r,t)))}start(){return this.#h?(this.#h=!1,this.#w(),this):this}pause(){this.#h=!0}clear(){this.#l=new this.#u}async onEmpty(){this.#l.size!==0&&await this.#S("empty")}async onSizeLessThan(e){this.#l.size<e||await this.#S("next",()=>this.#l.size<e)}async onIdle(){this.#o===0&&this.#l.size===0||await this.#S("idle")}async#S(e,t){return new Promise(r=>{let s=()=>{t&&!t()||(this.off(e,s),r())};this.on(e,s)})}get size(){return this.#l.size}sizeBy(e){return this.#l.filter(e).length}get pending(){return this.#o}get isPaused(){return this.#h}};var Jm=async(i,e,t,r,s)=>{let n=[],o=t.cached?t.nextPagePath:t.id;for(;o;){let f=await r(o);n=n.concat(f.items),o=f.nextPagePath}let a=n.filter(f=>f.isFolder===!0),l=n.filter(f=>f.isFolder===!1),c=a.map(f=>({type:"folder",id:f.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:f})),d=l.map(f=>{let y=s(f);return{type:"file",id:f.requestPath,restrictionError:y,status:y?"unchecked":"checked",parentId:t.id,data:f}});t.cached=!0,t.nextPagePath=null,e.push(...d,...c),c.forEach(async f=>{i.add(()=>Jm(i,e,f,r,s))})},eS=async(i,e,t,r)=>{let s=new ao({concurrency:6}),n=Ja(i);return n.filter(a=>a.type==="folder"&&a.status==="checked"&&(a.cached===!1||a.nextPagePath)).forEach(a=>{s.add(()=>Jm(s,n,a,e,t))}),s.on("completed",()=>{let a=n.filter(l=>l.type==="file"&&l.status==="checked").length;r(a)}),await s.onIdle(),n},eg=eS;var Yr={afterOpenFolder:Wm,afterScrollFolder:Gm,afterToggleCheckbox:Km,afterFill:eg};var tS=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:r}=i.target;return e-(t+r)<50},tl=tS;var iS=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},ji=iS;var rS=(i,e,t,r)=>{let s=e.findIndex(n=>n.id===r);if(s!==-1&&t){let n=e.findIndex(a=>a.id===i);return e.slice(Math.min(s,n),Math.max(s,n)+1).map(a=>a.id)}return[i]},il=rS;var sS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var tg=(i=21)=>{let e="",t=i|0;for(;t--;)e+=sS[Math.random()*64|0];return e};function nS(i){let{searchString:e,setSearchString:t,submitSearchString:r,wrapperClassName:s,inputClassName:n,inputLabel:o,clearSearchLabel:a="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,f=x=>{t(x.target.value)},y=Xr(x=>{x.preventDefault(),r()},[r]),[v]=hi(()=>{let x=document.createElement("form");return x.setAttribute("tabindex","-1"),x.id=tg(),x});return Ei(()=>(document.body.appendChild(v),v.addEventListener("submit",y),()=>{v.removeEventListener("submit",y),document.body.removeChild(v)}),[v,y]),u("section",{className:s},u("input",{className:`uppy-u-reset ${n}`,type:"search","aria-label":o,placeholder:o,value:e,onInput:f,form:v.id,"data-uppy-super-focusable":!0}),!l&&u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},u("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&e&&u("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t("")},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},u("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&u("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:v.id},c))}var Ns=nS;var rg=Ce(bt(),1);var oS=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(s=>s.type!=="root"&&s.parentId===t.id):!1).length,ig=oS;function lo(i){let{cancelSelection:e,donePicking:t,i18n:r,partialTree:s,validateAggregateRestrictions:n}=i,o=Kr(()=>n(s),[s,n]),a=Kr(()=>ig(s),[s]);return a===0?null:u("div",{className:"uppy-ProviderBrowser-footer"},u("div",{className:"uppy-ProviderBrowser-footer-buttons"},u("button",{className:(0,rg.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":o}),disabled:!!o,onClick:t,type:"button"},r("selectX",{smart_count:a})),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},r("cancel"))),o&&u("div",{className:"uppy-ProviderBrowser-footer-error"},o))}var aS=(i,e,t)=>{var r,s;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(r=i.author)==null?void 0:r.name,authorUrl:(s=i.author)==null?void 0:s.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},sg=aS;var lS=(i,e,t)=>{let r=i.map(o=>sg(o,e,t)),s=[],n=[];r.forEach(o=>{e.uppy.checkIfFileAlreadyExists(xa(o,e.uppy.getID()))?n.push(o):s.push(o)}),s.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:s.length})),n.length>0&&e.uppy.info(`Not adding ${n.length} files because they already exist`),e.uppy.addFiles(s)},rl=lS;var ng=(i,e,t)=>{let r=e===null?"null":e;if(t[r])return t[r];let s=i.find(o=>o.id===e);if(s.type==="root")return[];let n=[...ng(i,s.parentId,t),s];return t[r]=n,n},cS=i=>{let e=Object.create(null);return i.filter(s=>s.type==="file"&&s.status==="checked").map(s=>{let n=ng(i,s.id,e),o=n.findIndex(d=>d.type==="folder"&&d.status==="checked"),a=n.slice(o),l=`/${n.map(d=>d.data.name).join("/")}`,c=a.length===1?void 0:a.map(d=>d.data.name).join("/");return{...s.data,absDirPath:l,relDirPath:c}})},sl=cS;var uS=(i,e)=>{let t=i.find(s=>s.id===e),r=[];for(;r=[t,...r],t.type!=="root";){let s=t.parentId;t=i.find(n=>n.id===s)}return r},og=uS;function pr(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var hS=0;function lg(i){return"__private_"+hS+++"_"+i}var dS={version:"4.2.0"};function co(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},u("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var ag=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),Zr=lg("abortController"),di=lg("withAbort"),Bs=class{constructor(e,t){Object.defineProperty(this,di,{value:pS}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,Zr,{writable:!0,value:void 0}),this.validateSingleFile=s=>{let n=to(s);return this.plugin.uppy.validateSingleFile(n)},this.getDisplayedPartialTree=()=>{let{partialTree:s,currentFolderId:n,searchString:o}=this.plugin.getPluginState(),a=s.filter(c=>c.type!=="root"&&c.parentId===n);return o===""?a:a.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(o.toLowerCase())!==-1})},this.validateAggregateRestrictions=s=>{let o=s.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider;let r={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts={...r,...t},this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(ag(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),r=t.find(s=>s.id===e);if(r.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await pr(this,di)[di](async s=>{let n=e,o=[];do{let{username:l,nextPagePath:c,items:d}=await this.provider.list(n,{signal:s});this.plugin.setPluginState({username:l}),n=c,o=o.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length}))}while(this.opts.loadAllFiles&&n);let a=Yr.afterOpenFolder(t,o,r,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(ji(this.plugin.uppy)),this.setLoading(!1)}async logout(){await pr(this,di)[di](async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let r=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(r,"info",7e3)}this.plugin.setPluginState({...ag(this.plugin.rootFolderId),authenticated:!1})}}).catch(ji(this.plugin.uppy))}async handleAuth(e){await pr(this,di)[di](async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(ji(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:r}=this.plugin.getPluginState(),s=t.find(n=>n.id===r);tl(e)&&!this.isHandlingScroll&&s.nextPagePath&&(this.isHandlingScroll=!0,await pr(this,di)[di](async n=>{let{nextPagePath:o,items:a}=await this.provider.list(s.nextPagePath,{signal:n}),l=Yr.afterScrollFolder(t,r,a,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})}).catch(ji(this.plugin.uppy)),this.isHandlingScroll=!1)}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await pr(this,di)[di](async t=>{let r=await Yr.afterFill(e,o=>this.provider.list(o,{signal:t}),this.validateSingleFile,o=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:o}))});if(this.validateAggregateRestrictions(r)){this.plugin.setPluginState({partialTree:r});return}let n=sl(r);rl(n,this.plugin,this.provider),this.resetPluginState()}).catch(ji(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=il(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=Yr.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:r}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy;r||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let n={...this.opts,...t},{authenticated:o,loading:a}=this.plugin.getPluginState(),l=this.plugin.icon||co;if(o===!1)return u(Ya,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:a});let{partialTree:c,currentFolderId:d,username:f,searchString:y}=this.plugin.getPluginState(),v=og(c,d);return u("div",{className:(0,cg.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`)},u(Nu,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:v,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:f,i18n:s}),n.showFilter&&u(Ns,{searchString:y,setSearchString:x=>{this.plugin.setPluginState({searchString:x})},submitSearchString:()=>{},inputLabel:s("filter"),clearSearchLabel:s("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Qa,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:n.virtualList,noResultsLabel:s("noFilesFound"),handleScroll:this.handleScroll,viewType:n.viewType,showTitles:n.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a}),u(lo,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};async function pS(i){var e;(e=pr(this,Zr)[Zr])==null||e.abort();let t=new AbortController;pr(this,Zr)[Zr]=t;let r=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),await i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),pr(this,Zr)[Zr]=void 0}}Bs.VERSION=dS.version;var ug=Ce(bt(),1);var fS={version:"4.2.0"},mS={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},Us=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=s=>{let n=to(s);return this.plugin.uppy.validateSingleFile(n)},this.getDisplayedPartialTree=()=>{let{partialTree:s}=this.plugin.getPluginState();return s.filter(n=>n.type!=="root")},this.setSearchString=s=>{this.plugin.setPluginState({searchString:s}),s===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=s=>{let o=s.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider;let r={viewType:"grid",showTitles:!0,showFilter:!0};this.opts={...r,...t},this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(mS)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(r=>r.type==="root"?r:{...r,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=await this.provider.search(e),r=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(s=>({type:"file",id:s.requestPath,status:"unchecked",parentId:null,data:s}))];this.plugin.setPluginState({partialTree:r,isInputMode:!1})}catch(t){ji(this.plugin.uppy)(t)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:r}=this.plugin.getPluginState(),s=t.find(n=>n.type==="root");if(tl(e)&&!this.isHandlingScroll&&s.nextPagePath){this.isHandlingScroll=!0;try{let n=await this.provider.search(r,s.nextPagePath),o={...s,nextPagePath:n.nextPageQuery},a=t.filter(c=>c.type!=="root"),l=[o,...a,...n.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(n){ji(this.plugin.uppy)(n)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState(),t=sl(e);rl(t,this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:r}=this.plugin.getPluginState(),s=il(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=Yr.afterToggleCheckbox(r,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:r,searchString:s,loading:n,partialTree:o}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,l={...this.opts,...t};return r?u(Ns,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):u("div",{className:(0,ug.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&u(Ns,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),u(Qa,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:async()=>{},noResultsLabel:a("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:n,i18n:a,virtualList:!1}),u(lo,{partialTree:o,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};Us.VERSION=fS.version;var gS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var nl=(i=21)=>{let e="",t=i|0;for(;t--;)e+=gS[Math.random()*64|0];return e};var hg=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function vS(i,e){return!!(i===e||hg(i)&&hg(e))}function bS(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!vS(i[t],e[t]))return!1;return!0}function Yu(i,e){e===void 0&&(e=bS);var t=null;function r(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];if(t&&t.lastThis===this&&e(s,t.lastArgs))return t.lastResult;var o=i.apply(this,s);return t={lastResult:o,lastArgs:s,lastThis:this},o}return r.clear=function(){t=null},r}var ol=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function uo(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function dg(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function yS(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function wS(i){return i.contains(document.activeElement)}function Zu(i,e,t){let r=uo(t,e),s=dr(r.querySelectorAll(ol)),n=s.indexOf(document.activeElement);wS(r)?i.shiftKey&&n===0?yS(i,s):!i.shiftKey&&n===s.length-1&&dg(i,s):dg(i,s)}function pg(i,e,t){e===null||Zu(i,e,t)}var fg=Ce(Uc(),1);function Qu(){let i=!1;return(0,fg.default)((t,r)=>{let s=uo(t,r),n=s.contains(document.activeElement);if(n&&i)return;let o=s.querySelector("[data-uppy-super-focusable]");if(!(n&&!o))if(o)o.focus({preventScroll:!0}),i=!0;else{let a=s.querySelector(ol);a?.focus({preventScroll:!0}),i=!1}},260)}var Rg=Ce(bt(),1);function Ju(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var bg=Ce(bt(),1);function mg(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),r=Object.keys(e),s=t.length;if(r.length!==s)return!1;for(let n=0;n<s;n++){let o=t[n];if(i[o]!==e[o]||!Object.prototype.hasOwnProperty.call(e,o))return!1}return!0}function ES(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#686DE0",fillRule:"evenodd"},u("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),u("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),u("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function TS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function xS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function AS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function kS(){return u("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function PS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("g",{fill:"#A7AFB7",fillRule:"nonzero"},u("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),u("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function CS(){return u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},u("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function Qr(i){let e={color:"#838999",icon:PS()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:CS()}:t==="image"?{color:"#686de0",icon:ES()}:t==="audio"?{color:"#068dbb",icon:TS()}:t==="video"?{color:"#19af67",icon:xS()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:AS()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:kS()}:e}function ho(i){let{file:e}=i;if(e.preview)return u("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:r}=Qr(e.type);return u("div",{className:"uppy-Dashboard-Item-previewIconWrap"},u("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},r),u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},u("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var FS=(i,e)=>(typeof e=="function"?e():e).filter(s=>s.id===i)[0].name;function po(i){let{file:e,toggleFileCard:t,i18n:r,metaFields:s}=i,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;let o=n.map(a=>FS(a,s)).join(", ");return u("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:n.length,fields:o})," ",u("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},r("editFile")))}function eh(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":Qr(e.type).color;return u("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a}},n&&e.uploadURL&&u("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},u("span",{hidden:!0},e.meta.name)),u(ho,{file:e}),u(po,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function _S(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function gg(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function th(i){return u("div",{className:"uppy-Dashboard-Item-progress"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":gg(i),title:gg(i),onClick:()=>_S(i)},i.children))}function al(i){let{children:e}=i;return u("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function ih(i){let{progress:e}=i,t=2*Math.PI*15;return u("g",null,u("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),u("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function rh(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(al,null,u("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),u("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?u(th,i,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},u("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),u("path",{d:"M7.9 3H10v2H7.9z"}),u("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),u("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?u(th,i,u(al,null,u(ih,{progress:i.file.progress.percentage}),i.file.isPaused?u("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):u("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},u("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),u("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?u(th,i,u(al,null,u(ih,{progress:i.file.progress.percentage}),u("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):u("div",{className:"uppy-Dashboard-Item-progress"},u("div",{className:"uppy-Dashboard-Item-progressIndicator"},u(al,null,u(ih,{progress:i.file.progress.percentage}))))}var vg=Ce(Aa(),1);var sh="...";function ll(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=sh.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-sh.length,r=Math.ceil(t/2),s=Math.floor(t/2);return i.slice(0,r)+sh+i.slice(-s)}var OS=i=>{let{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return u("div",{className:"uppy-Dashboard-Item-name",title:t},ll(t,r()))},RS=i=>{var e;let{author:t}=i.file.meta,r=(e=i.file.remote)==null?void 0:e.providerName,s="\xB7";return t?u("div",{className:"uppy-Dashboard-Item-author"},u("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},ll(t.name,13)),r?u(Fragment,null,` ${s} `,r,` ${s} `):null):null},LS=i=>i.file.size&&u("div",{className:"uppy-Dashboard-Item-statusSize"},(0,vg.default)(i.file.size)),MS=i=>i.file.isGhost&&u("span",null," \u2022 ",u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),IS=i=>{let{file:e,onClick:t}=i;return e.error?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function nh(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,toggleAddFilesPanel:n,isSingleFile:o,containerHeight:a,containerWidth:l}=i;return u("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},u("div",{className:"uppy-Dashboard-Item-fileName"},OS({file:e,isSingleFile:o,containerHeight:a,containerWidth:l}),u(IS,{file:e,onClick:()=>alert(e.error)})),u("div",{className:"uppy-Dashboard-Item-status"},RS({file:e}),LS({file:e}),MS({file:e,toggleAddFilesPanel:n,i18n:t})),u(po,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}function oh(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();let s=()=>{document.body.removeChild(r),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(r),t()):s()}catch{return document.body.removeChild(r),s()}})}function DS(i){let{file:e,uploadInProgressOrComplete:t,metaFields:r,canEditFile:s,i18n:n,onClick:o}=i;return!t&&r&&r.length>0||!t&&s(e)?u("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:e.meta.name}),title:n("editFileWithFilename",{file:e.meta.name}),onClick:()=>o()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},u("g",{fillRule:"evenodd"},u("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),u("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),u("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function NS(i){let{i18n:e,onClick:t,file:r}=i;return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:r.meta.name}),title:e("removeFile",{file:r.meta.name}),onClick:()=>t()},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},u("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),u("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function BS(i){let{file:e,uppy:t,i18n:r}=i,s=n=>{oh(e.uploadURL,r("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(r("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>n.target.focus({preventScroll:!0}))};return u("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":r("copyLink"),title:r("copyLink"),onClick:n=>s(n)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},u("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function ah(i){let{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:o,showRemoveButton:a,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return u("div",{className:"uppy-Dashboard-Item-actionWrapper"},u(DS,{i18n:l,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:()=>{n&&n.length>0?c(!0,t.id):d(t)}}),o&&t.uploadURL?u(BS,{file:t,uppy:e,i18n:l}):null,a?u(NS,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var fo=class extends ht{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!mg(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,r=!!e.progress.uploadComplete&&!t&&!e.error,s=!!e.progress.uploadStarted||!!t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:a}=e,l=(this.props.individualCancellation||!n)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,bg.default)({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return u("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},u("div",{className:"uppy-Dashboard-Item-preview"},u(eh,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),u(rh,{uppy:this.props.uppy,file:e,error:o,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),u("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},u(nh,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),u(ah,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function US(i,e){let t=[],r=[];return i.forEach(s=>{r.length<e?r.push(s):(t.push(r),r=[s])}),r.length&&t.push(r),t}function lh(i){let{id:e,i18n:t,uppy:r,files:s,resumableUploads:n,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:f,isSingleFile:y,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,recoveredState:C,individualCancellation:I,itemsPerRow:D,openFileEditor:q,canEditFile:M,toggleAddFilesPanel:H,containerWidth:R,containerHeight:G}=i,K=D===1?71:200,Y=Kr(()=>{let Q=(le,Ae)=>Number(s[Ae].isGhost)-Number(s[le].isGhost),oe=Object.keys(s);return C&&oe.sort(Q),US(oe,D)},[s,D,C]),ie=Q=>u("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:Q[0]},Q.map(oe=>u(fo,{key:oe,uppy:r,id:e,i18n:t,resumableUploads:n,individualCancellation:I,hideRetryButton:o,hidePauseResumeButton:a,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:f,recoveredState:C,isSingleFile:y,containerWidth:R,containerHeight:G,toggleFileCard:v,handleRequestThumbnail:x,handleCancelThumbnail:P,role:"listitem",openFileEditor:q,canEditFile:M,toggleAddFilesPanel:H,file:s[oe]})));return y?u("div",{class:"uppy-Dashboard-files"},ie(Y[0])):u(Za,{class:"uppy-Dashboard-files",role:"list",data:Y,renderRow:ie,rowHeight:K})}var ch=class extends ht{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var r;return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(r=this.props.allowedFileTypes)==null?void 0:r.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,r)=>{let n={photo:"image/*",video:"video/*"}[e];return u("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:n,ref:r})},this.renderMyDeviceAcquirer=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},u("div",{className:"uppy-DashboardTab-inner"},u("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},u("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),u("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let r=this.props.acquirers.length;return u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),s=this.props.fileManagerSelectionType,n=s.charAt(0).toUpperCase()+s.slice(1);return u("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:r,browse:t}))},this.renderAcquirer=e=>{var t;return u("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},u("div",{className:"uppy-DashboardTab-inner"},e.icon()),u("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],r=t.splice(e.length-2,e.length);return u(Lt,null,t.map(s=>this.renderAcquirer(s)),u("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(s=>this.renderAcquirer(s))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:r,showNativeVideoCameraButton:s}=this.props,n=[],o="myDevice";t||n.push({key:o,elements:this.renderMyDeviceAcquirer()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),n.length===1&&n[0].key===o&&(n=[]);let l=[...n],c=l.splice(n.length-2,n.length);return u(Lt,null,this.renderDropPasteBrowseTagline(n.length),u("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:f,elements:y}=d;return u(Lt,{key:f},y)}),u("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:f,elements:y}=d;return u(Lt,{key:f},y)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=u("span",null,u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},u("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),u("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),r=e("poweredBy",{uppy:t});return u("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return u("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,s=>{this.fileInput=s}),this.renderHiddenInput(!0,s=>{this.folderInput=s}),e&&this.renderHiddenCameraInput("photo",r,s=>{this.mobilePhotoFileInput=s}),t&&this.renderHiddenCameraInput("video",r,s=>{this.mobileVideoFileInput=s}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),u("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&u("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},cl=ch;var yg=Ce(bt(),1);var zS=i=>u("div",{className:(0,yg.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),u(cl,i)),wg=zS;var Sg=Ce(bt(),1);function HS(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ti=HS;function $S(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:o}=i,a=Gr(null);return u("div",{className:(0,Sg.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Ti,onDragLeave:Ti,onDrop:Ti,onPaste:Ti},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},s("importFrom",{name:e.name})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},s("cancel"))),u("div",{ref:a,className:"uppy-DashboardContent-panelBody"},o.getPlugin(e.id).render(n,a.current)))}var Eg=$S;var Tg=Ce(bt(),1);function qS(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return u("div",{className:(0,Tg.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),u("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),u("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))))}var xg=qS;var xi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function VS(i,e,t,r){if(r===void 0&&(r={}),i)return xi.STATE_ERROR;if(e)return xi.STATE_COMPLETE;if(t)return xi.STATE_PAUSED;let s=xi.STATE_WAITING,n=Object.keys(r);for(let o=0;o<n.length;o++){let{progress:a}=r[n[o]];if(a.uploadStarted&&!a.uploadComplete)return xi.STATE_UPLOADING;a.preprocess&&s!==xi.STATE_UPLOADING&&(s=xi.STATE_PREPROCESSING),a.postprocess&&s!==xi.STATE_UPLOADING&&s!==xi.STATE_PREPROCESSING&&(s=xi.STATE_POSTPROCESSING)}return s}function jS(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:o,newFiles:a,processingFiles:l}=i;switch(VS(s,r,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:o.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function WS(i){let{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:o}=i,{allowNewUpload:a}=i;return a&&s&&(a=i.totalFileCount<i.maxNumberOfFiles),u("div",{className:"uppy-DashboardContent-bar"},!t&&!r?u("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>o.cancelAll()},e("cancel")):u("div",null),u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},u(jS,i)),a?u("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>n(!0)},u("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},u("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),u("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):u("div",null))}var Ag=WS;var kg=Ce(bt(),1);function uh(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:s,formState:n}=i,o={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{let l=`uppy-Dashboard-FileCard-input-${a.id}`,c=t.includes(a.id);return u("fieldset",{key:a.id,className:"uppy-Dashboard-FileCard-fieldset"},u("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},a.name),a.render!==void 0?a.render({value:n[a.id],onChange:d=>r(d,a.id),fieldCSSClasses:o,required:c,form:s.id},u):u("input",{className:o.text,id:l,form:s.id,type:a.type||"text",required:c,value:n[a.id],placeholder:a.placeholder,onInput:d=>r(d.target.value,a.id),"data-uppy-super-focusable":!0}))})}function hh(i){var e;let{files:t,fileCardFor:r,toggleFileCard:s,saveFileCard:n,metaFields:o,requiredMetaFields:a,openFileEditor:l,i18n:c,i18nArray:d,className:f,canEditFile:y}=i,v=()=>typeof o=="function"?o(t[r]):o,x=t[r],P=(e=v())!=null?e:[],C=y(x),I={};P.forEach(K=>{var Y;I[K.id]=(Y=x.meta[K.id])!=null?Y:""});let[D,q]=hi(I),M=Xr(K=>{K.preventDefault(),n(D,r)},[n,D,r]),H=(K,Y)=>{q({...D,[Y]:K})},R=()=>{s(!1)},[G]=hi(()=>{let K=document.createElement("form");return K.setAttribute("tabindex","-1"),K.id=nl(),K});return Ei(()=>(document.body.appendChild(G),G.addEventListener("submit",M),()=>{G.removeEventListener("submit",M),document.body.removeChild(G)}),[G,M]),u("div",{className:(0,kg.default)("uppy-Dashboard-FileCard",f),"data-uppy-panelType":"FileCard",onDragOver:Ti,onDragLeave:Ti,onDrop:Ti,onPaste:Ti},u("div",{className:"uppy-DashboardContent-bar"},u("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:u("span",{className:"uppy-DashboardContent-titleFile"},x.meta?x.meta.name:x.name)})),u("button",{className:"uppy-DashboardContent-back",type:"button",form:G.id,title:c("finishEditingFile"),onClick:R},c("cancel"))),u("div",{className:"uppy-Dashboard-FileCard-inner"},u("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Qr(x.type).color}},u(ho,{file:x}),C&&u("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:K=>{M(K),l(x)}},c("editImage"))),u("div",{className:"uppy-Dashboard-FileCard-info"},u(uh,{computedMetaFields:P,requiredMetaFields:a,updateMeta:H,form:G,formState:D})),u("div",{className:"uppy-Dashboard-FileCard-actions"},u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:G.id},c("saveChanges")),u("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:R,form:G.id},c("cancel")))))}var Cg=Ce(bt(),1),zs="uppy-transition-slideDownUp",Pg=250;function GS(i){let{children:e}=i,[t,r]=hi(null),[s,n]=hi(""),o=Gr(),a=Gr(),l=Gr(),c=()=>{n(`${zs}-enter`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${zs}-enter ${zs}-enter-active`),o.current=setTimeout(()=>{n("")},Pg)})},d=()=>{n(`${zs}-leave`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame(()=>{n(`${zs}-leave ${zs}-leave-active`),a.current=setTimeout(()=>{r(null),n("")},Pg)})};return Ei(()=>{let f=Si(e)[0];t!==f&&(f&&!t?c():t&&!f&&!a.current&&d(),r(f))},[e,t]),Ei(()=>()=>{clearTimeout(o.current),clearTimeout(a.current),cancelAnimationFrame(l.current)},[]),t?Ra(t,{className:(0,Cg.default)(s,t.props.className)}):null}var mo=GS;function Hs(){return Hs=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Hs.apply(null,arguments)}var Fg=900,_g=700,dh=576,Og=330;function ph(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>dh,s=i.containerHeight>Og,n=(0,Rg.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>dh,"uppy-size--lg":i.containerWidth>_g,"uppy-size--xl":i.containerWidth>Fg,"uppy-size--height-md":i.containerHeight>Og,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s}),o=1;i.containerWidth>Fg?o=5:i.containerWidth>_g?o=4:i.containerWidth>dh&&(o=3);let a=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(y=>i.files[y].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return u("div",{className:n,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Ju(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},u("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),u("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:u("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},u("span",{"aria-hidden":"true"},"\xD7")),u("div",{className:"uppy-Dashboard-innerWrap"},u("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),a&&u(Ag,i),l&&u("div",{className:"uppy-Dashboard-serviceMsg"},u("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},u("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},u("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),u("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),u("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),u("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),u("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),a?u(lh,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:o,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):u(cl,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),u(mo,null,i.showAddFilesPanel?u(wg,Hs({key:"AddFiles"},i,{isSizeMD:r})):null),u(mo,null,i.fileCardFor?u(hh,Hs({key:"FileCard"},i)):null),u(mo,null,i.activePickerPanel?u(Eg,Hs({key:"Picker"},i)):null),u(mo,null,i.showFileEditor?u(xg,Hs({key:"Editor"},i)):null),u("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(y=>i.uppy.getPlugin(y.id).render(i.state))))))}var Lg={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function de(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var KS=0;function lt(i){return"__private_"+KS+++"_"+i}var XS={version:"4.1.3"},fh=Yu.default||Yu,Mg=9,YS=27;function Ig(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var ZS={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:co,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550},Jr=lt("disabledNodes"),Wi=lt("generateLargeThumbnailIfSingleFile"),go=lt("openFileEditorWhenFilesAdded"),es=lt("attachRenderFunctionToTarget"),mh=lt("isTargetSupported"),gh=lt("getAcquirers"),vh=lt("getProgressIndicators"),Gi=lt("getEditors"),bh=lt("addSpecifiedPluginsFromOptions"),yh=lt("autoDiscoverPlugins"),ts=lt("addSupportedPluginIfNoTarget"),vo=lt("getStatusBarOpts"),bo=lt("getThumbnailGeneratorOpts"),wh=lt("getInformerOpts"),yo=lt("getStatusBarId"),wo=lt("getThumbnailGeneratorId"),Sh=lt("getInformerId"),fr=class extends ci{constructor(e,t){var r,s,n;let o=(r=t?.autoOpen)!=null?r:null;super(e,{...ZS,...t,autoOpen:o}),Object.defineProperty(this,Sh,{value:rE}),Object.defineProperty(this,wo,{value:iE}),Object.defineProperty(this,yo,{value:tE}),Object.defineProperty(this,wh,{value:eE}),Object.defineProperty(this,bo,{value:JS}),Object.defineProperty(this,vo,{value:QS}),Object.defineProperty(this,Jr,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${nl()}`,this.superFocus=Qu(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let c=this.getPluginState().targets.filter(d=>d.id!==a.id);this.setPluginState({targets:c})},this.addTarget=a=>{let l=a.id||a.constructor.name,c=a.title||l,d=a.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let f={id:l,name:c,type:d},v=this.getPluginState().targets.slice();return v.push(f),this.setPluginState({targets:v}),this.el},this.hideAllPanels=()=>{var a;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===a);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return de(this,Gi)[Gi](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),c=de(this,Gi)[Gi](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();de(this,Gi)[Gi](a).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=Ig();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),a},this.closeModal=a=>{var l;let c=(l=a?.manualClose)!=null?l:!0,{isHidden:d,isClosing:f}=this.getPluginState();if(d||f)return;let{promise:y,resolve:v}=Ig();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let P=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",P,!1),v()};this.el.addEventListener("animationend",P,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),v();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var x;(x=history.state)!=null&&x[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),y},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:{...l,darkMode:a}})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let c=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(a=>{let l=a[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=de(this,Jr)[Jr])!=null?l:dr(this.el.querySelectorAll(c)).filter(f=>!f.classList.contains("uppy-Dashboard-close"));for(let f of d)f.tagName==="A"?f.setAttribute("aria-disabled",a):f.disabled=a;a?de(this,Jr)[Jr]=d:de(this,Jr)[Jr]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===YS&&this.requestCloseModal(),a.keyCode===Mg&&Zu(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(a))});let l=dr(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=dr(a.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{a.preventDefault(),a.stopPropagation();let l=()=>{let y=!0;return this.uppy.iteratePlugins(v=>{v.canHandleRootDrop!=null&&v.canHandleRootDrop(a)&&(y=!0)}),y},c=()=>{let{types:y}=a.dataTransfer;return y.some(v=>v==="Files")},d=l(),f=c();if(!d&&!f||this.opts.disabled||this.opts.disableLocalFiles&&(f||!d)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none";return}a.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(a)},this.handleDragLeave=a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(a)},this.handleDrop=async a=>{a.preventDefault(),a.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(f=>{f.type==="acquirer"&&(f.handleRootDrop==null||f.handleRootDrop(a))});let l=!1,c=f=>{this.uppy.log(f,"error"),l||(this.uppy.info(f.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=await Ou(a.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(a)},this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===Mg&&pg(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Wi,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:a});let d={...l[0],preview:void 0};c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,go,{writable:!0,value:a=>{let l=a[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,f=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):f&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let a=Cu(this.opts.trigger);a?a.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",de(this,ts)[ts]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",de(this,Wi)[Wi]),this.uppy.on("file-removed",de(this,Wi)[Wi]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",de(this,go)[go])},this.removeEvents=()=>{let a=Cu(this.opts.trigger);!this.opts.inline&&a&&a.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",de(this,ts)[ts]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",de(this,Wi)[Wi]),this.uppy.off("file-removed",de(this,Wi)[Wi]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",de(this,go)[go])},this.superFocusOnEachUpdate=()=>{let a=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||a||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,es,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return{...a,icon:l.icon||this.opts.defaultPickerIcon,render:l.render}}}),Object.defineProperty(this,mh,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,gh,{writable:!0,value:fh(a=>a.filter(l=>l.type==="acquirer"&&de(this,mh)[mh](l)).map(de(this,es)[es]))}),Object.defineProperty(this,vh,{writable:!0,value:fh(a=>a.filter(l=>l.type==="progressindicator").map(de(this,es)[es]))}),Object.defineProperty(this,Gi,{writable:!0,value:fh(a=>a.filter(l=>l.type==="editor").map(de(this,es)[es]))}),this.render=a=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:f}=a,{newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:C,inProgressNotPausedFiles:I,processingFiles:D,isUploadStarted:q,isAllComplete:M,isAllPaused:H}=this.uppy.getObjectOfFilesPerState(),R=de(this,gh)[gh](l.targets),G=de(this,vh)[vh](l.targets),K=de(this,Gi)[Gi](l.targets),Y;return this.opts.theme==="auto"?Y=d.darkMode?"dark":"light":Y=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),ph({state:a,isHidden:l.isHidden,files:c,newFiles:y,uploadStartedFiles:v,completeFiles:x,erroredFiles:P,inProgressFiles:C,inProgressNotPausedFiles:I,processingFiles:D,isUploadStarted:q,isAllComplete:M,isAllPaused:H,totalFileCount:Object.keys(c).length,totalProgress:a.totalProgress,allowNewUpload:f,acquirers:R,theme:Y,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:G,editors:K,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:a.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,bh,{writable:!0,value:()=>{let{plugins:a}=this.opts;a.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,yh,{writable:!0,value:()=>{this.uppy.iteratePlugins(de(this,ts)[ts])}}),Object.defineProperty(this,ts,{writable:!0,value:a=>{var l;let c=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&c.includes(a.type)&&(this.getPluginState().targets.some(f=>a.id===f.id)||a.mount(this,a))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:a,closeAfterFinish:l}=this.opts;if(a&&l)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:f}=this.opts;f&&this.mount(f,this),this.opts.disableStatusBar||this.uppy.use($r,{id:de(this,yo)[yo](),target:this,...de(this,vo)[vo]()}),this.opts.disableInformer||this.uppy.use(qr,{id:de(this,Sh)[Sh](),target:this,...de(this,wh)[wh]()}),this.opts.disableThumbnailGenerator||this.uppy.use(Is,{id:de(this,wo)[wo](),...de(this,bo)[bo]()}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let y=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${y?"on":"off"}`),this.setDarkModeCapability(y),this.opts.theme==="auto"){var v;(v=this.darkModeMediaQuery)==null||v.addListener(this.handleSystemDarkModeChange)}de(this,bh)[bh](),de(this,yh)[yh](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:a}=this.opts;if(a.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=Lg,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(n=(s=this.opts).onRequestCloseModal)!=null||(s.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,r;super.setOptions(e),(t=this.uppy.getPlugin(de(this,yo)[yo]()))==null||t.setOptions(de(this,vo)[vo]()),(r=this.uppy.getPlugin(de(this,wo)[wo]()))==null||r.setOptions(de(this,bo)[bo]())}};function QS(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideProgressAfterFinish:n,locale:o,doneButtonHandler:a}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:r,showProgressDetails:s,hideAfterFinish:n,locale:o,doneButtonHandler:a}}function JS(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:r,lazy:!r}}function eE(){return{}}function tE(){return`${this.id}:StatusBar`}function iE(){return`${this.id}:ThumbnailGenerator`}function rE(){return`${this.id}:Informer`}fr.VERSION=XS.version;var Hg=Ce(Dg(),1);function sE(i,e){let t=i.width/e.width,r=i.height/e.height,s=Math.min(t,r),n=e.width*s,o=e.height*s,a=(i.width-n)/2,l=(i.height-o)/2;return{width:n,height:o,left:a,top:l}}var Ng=sE;function nE(i){return i*(Math.PI/180)}function oE(i,e,t){let r=Math.abs(nE(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}var Bg=oE;function aE(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}var Ug=aE;function lE(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}var zg=lE;var So=class extends ht{constructor(e){super(e),this.onRotate90Deg=()=>{let{angle90Deg:t}=this.state,r=t-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);let s=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),o=Ng(n,s);this.cropper.setCanvasData(o),this.cropper.setCropBoxData(o)},this.onRotateGranular=t=>{let r=Number(t.target.value);this.setState({angleGranular:r});let{angle90Deg:s}=this.state,n=s+r;this.cropper.rotateTo(n);let o=this.cropper.getImageData(),a=Bg(o.naturalWidth,o.naturalHeight,r),l=this.cropper.getImageData().scaleX<0?-a:a;this.cropper.scale(l,a)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){let{opts:e,storeCropperInstance:t}=this.props;this.cropper=new Hg.default(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){let t=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if(e.detail.action==="all"){let n=Ug(t,r,s);n&&this.cropper.setCropBoxData(n)}else{let n=zg(t,r,s);n&&this.cropper.setCropBoxData(n)}}renderGranularRotate(){let{i18n:e}=this.props,{angleGranular:t}=this.state;return u("label",{role:"tooltip","aria-label":`${t}\xBA`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},u("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){let{i18n:e,opts:t}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),u("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0V0z",fill:"none"}),u("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M0 0h24v24H0z",fill:"none"}),u("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),u("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){let{i18n:e}=this.props;return u("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},u("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},u("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),u("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){let{currentImage:e,opts:t}=this.props,{actions:r}=t,s=URL.createObjectURL(e.data);return u("div",{className:"uppy-ImageCropper"},u("div",{className:"uppy-ImageCropper-container"},u("img",{className:"uppy-ImageCropper-image",alt:e.name,src:s,ref:n=>{this.imgElement=n}})),u("div",{className:"uppy-ImageCropper-controls"},r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}};var $g={strings:{revert:"Reset",rotate:"Rotate 90\xB0",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};var cE={version:"3.2.1"},qg={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},Vg={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},uE={quality:.8,actions:Vg,cropperOptions:qg},is=class extends ci{constructor(e,t){super(e,{...uE,...t,actions:{...Vg,...t?.actions},cropperOptions:{...qg,...t?.cropperOptions}}),this.save=()=>{let r=o=>{var a;let{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([o],(a=l.name)!=null?a:this.i18n("unnamed"),{type:o.type}),size:o.size,preview:void 0});let c=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",c),this.setPluginState({currentImage:c}),this.uppy.emit("file-editor:complete",c)},{currentImage:s}=this.getPluginState(),n=this.cropper.getCroppedCanvas({});n.width%2!==0&&this.cropper.setData({width:n.width-1}),n.height%2!==0&&this.cropper.setData({height:n.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(r,s.type,this.opts.quality)},this.storeCropperInstance=r=>{this.cropper=r},this.selectFile=r=>{this.uppy.emit("file-editor:start",r),this.setPluginState({currentImage:r})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=$g,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;let t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){let{currentImage:e}=this.getPluginState();if(e){let t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){let{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:u(So,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};is.VERSION=cE.version;function Ki(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var hE=0;function jg(i){return"__private_"+hE+++"_"+i}var St=jg("uppy"),Eo=jg("events"),To=class{constructor(e){Object.defineProperty(this,St,{writable:!0,value:void 0}),Object.defineProperty(this,Eo,{writable:!0,value:[]}),Ki(this,St)[St]=e}on(e,t){return Ki(this,Eo)[Eo].push([e,t]),Ki(this,St)[St].on(e,t)}remove(){for(let[e,t]of Ki(this,Eo)[Eo].splice(0))Ki(this,St)[St].off(e,t)}onFilePause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onFileRemove(e,t){this.on("file-removed",r=>{e===r.id&&t(r.id)})}onPause(e,t){this.on("upload-pause",(r,s)=>{e===r?.id&&t(s)})}onRetry(e,t){this.on("upload-retry",r=>{e===r?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{Ki(this,St)[St].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Ki(this,St)[St].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Ki(r,St)[St].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Ki(this,St)[St].getFile(e)&&t()})}};function te(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var dE=0;function Pt(i){return"__private_"+dE+++"_"+i}function pE(i){return new Error("Cancelled",{cause:i})}function Wg(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let r=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,r,r)}return this}var Bt=Pt("activeRequests"),Tt=Pt("queuedHandlers"),Nt=Pt("paused"),rs=Pt("pauseTimer"),Et=Pt("downLimit"),ss=Pt("upperLimit"),Xi=Pt("rateLimitingTimer"),xo=Pt("call"),Yi=Pt("queueNext"),kh=Pt("next"),xh=Pt("queue"),Ph=Pt("dequeue"),Ah=Pt("resume"),ns=Pt("increaseLimit"),ul=class{constructor(e){Object.defineProperty(this,Ph,{value:bE}),Object.defineProperty(this,xh,{value:vE}),Object.defineProperty(this,kh,{value:gE}),Object.defineProperty(this,Yi,{value:mE}),Object.defineProperty(this,xo,{value:fE}),Object.defineProperty(this,Bt,{writable:!0,value:0}),Object.defineProperty(this,Tt,{writable:!0,value:[]}),Object.defineProperty(this,Nt,{writable:!0,value:!1}),Object.defineProperty(this,rs,{writable:!0,value:void 0}),Object.defineProperty(this,Et,{writable:!0,value:1}),Object.defineProperty(this,ss,{writable:!0,value:void 0}),Object.defineProperty(this,Xi,{writable:!0,value:void 0}),Object.defineProperty(this,Ah,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,ns,{writable:!0,value:()=>{if(te(this,Nt)[Nt]){te(this,Xi)[Xi]=setTimeout(te(this,ns)[ns],0);return}te(this,Et)[Et]=this.limit,this.limit=Math.ceil((te(this,ss)[ss]+te(this,Et)[Et])/2);for(let t=te(this,Et)[Et];t<=this.limit;t++)te(this,Yi)[Yi]();te(this,ss)[ss]-te(this,Et)[Et]>3?te(this,Xi)[Xi]=setTimeout(te(this,ns)[ns],2e3):te(this,Et)[Et]=Math.floor(te(this,Et)[Et]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!te(this,Nt)[Nt]&&te(this,Bt)[Bt]<this.limit?te(this,xo)[xo](e):te(this,xh)[xh](e,t)}wrapSyncFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a=r.run(()=>(e(...n),queueMicrotask(()=>a.done()),()=>{}),t);return{abortOn:Wg,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];let a,l=new Promise((c,d)=>{a=r.run(()=>{let f,y;try{y=Promise.resolve(e(...n))}catch(v){y=Promise.reject(v)}return y.then(v=>{f?d(f):(a.done(),c(v))},v=>{f?d(f):(a.done(),d(v))}),v=>{f=pE(v)}},t)});return l.abort=c=>{a.abort(c)},l.abortOn=Wg,l}}resume(){te(this,Nt)[Nt]=!1,clearTimeout(te(this,rs)[rs]);for(let e=0;e<this.limit;e++)te(this,Yi)[Yi]()}pause(e){e===void 0&&(e=null),te(this,Nt)[Nt]=!0,clearTimeout(te(this,rs)[rs]),e!=null&&(te(this,rs)[rs]=setTimeout(te(this,Ah)[Ah],e))}rateLimit(e){clearTimeout(te(this,Xi)[Xi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(te(this,ss)[ss]=this.limit-1,this.limit=te(this,Et)[Et],te(this,Xi)[Xi]=setTimeout(te(this,ns)[ns],e))}get isPaused(){return te(this,Nt)[Nt]}};function fE(i){te(this,Bt)[Bt]+=1;let e=!1,t;try{t=i()}catch(r){throw te(this,Bt)[Bt]-=1,r}return{abort:r=>{e||(e=!0,te(this,Bt)[Bt]-=1,t?.(r),te(this,Yi)[Yi]())},done:()=>{e||(e=!0,te(this,Bt)[Bt]-=1,te(this,Yi)[Yi]())}}}function mE(){queueMicrotask(()=>te(this,kh)[kh]())}function gE(){if(te(this,Nt)[Nt]||te(this,Bt)[Bt]>=this.limit||te(this,Tt)[Tt].length===0)return;let i=te(this,Tt)[Tt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=te(this,xo)[xo](i.fn);i.abort=e.abort,i.done=e.done}function vE(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{te(this,Ph)[Ph](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=te(this,Tt)[Tt].findIndex(s=>t.priority>s.priority);return r===-1?te(this,Tt)[Tt].push(t):te(this,Tt)[Tt].splice(r,0,t),t}function bE(i){let e=te(this,Tt)[Tt].indexOf(i);e!==-1&&te(this,Tt)[Tt].splice(e,1)}var hl=Symbol("__queue");var Ch=class extends Error{constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}},$s=Ch;function yE(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}var Gg=yE;function Kt(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var wE=0;function dl(i){return"__private_"+wE+++"_"+i}var Zi=dl("aliveTimer"),os=dl("isDone"),Ao=dl("onTimedOut"),as=dl("timeout"),Fh=class{constructor(e,t){Object.defineProperty(this,Zi,{writable:!0,value:void 0}),Object.defineProperty(this,os,{writable:!0,value:!1}),Object.defineProperty(this,Ao,{writable:!0,value:void 0}),Object.defineProperty(this,as,{writable:!0,value:void 0}),Kt(this,as)[as]=e,Kt(this,Ao)[Ao]=()=>t(e)}progress(){Kt(this,os)[os]||Kt(this,as)[as]>0&&(clearTimeout(Kt(this,Zi)[Zi]),Kt(this,Zi)[Zi]=setTimeout(Kt(this,Ao)[Ao],Kt(this,as)[as]))}done(){Kt(this,os)[os]||(clearTimeout(Kt(this,Zi)[Zi]),Kt(this,Zi)[Zi]=void 0,Kt(this,os)[os]=!0)}},Kg=Fh;var pl=()=>{};function Xg(i,e){e===void 0&&(e={});let{body:t=null,headers:r={},method:s="GET",onBeforeRequest:n=pl,onUploadProgress:o=pl,shouldRetry:a=()=>!0,onAfterResponse:l=pl,onTimeout:c=pl,responseType:d,retries:f=3,signal:y=null,timeout:v=3e4,withCredentials:x=!1}=e,P=D=>.3*2**(D-1)*1e3,C=new Kg(v,c);function I(D){return D===void 0&&(D=0),new Promise(async(q,M)=>{let H=new XMLHttpRequest;H.open(s,i,!0),H.withCredentials=x,d&&(H.responseType=d),y?.addEventListener("abort",()=>{H.abort(),M(new DOMException("Aborted","AbortError"))}),H.onload=async()=>{await l(H,D),H.status>=200&&H.status<300?(C.done(),q(H)):a(H)&&D<f?setTimeout(()=>{I(D+1).then(q,M)},P(D)):(C.done(),M(new $s(H.statusText,H)))},H.onerror=()=>{a(H)&&D<f?setTimeout(()=>{I(D+1).then(q,M)},P(D)):(C.done(),M(new $s(H.statusText,H)))},H.upload.onprogress=R=>{C.progress(),o(R)},r&&Object.keys(r).forEach(R=>{H.setRequestHeader(R,r[R])}),await n(H,D),H.send(t)})}return I()}function Yg(i){let e=t=>"error"in t&&!!t.error;return i.filter(t=>!e(t))}function Zg(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}function fl(i,e){return i===!0?Object.keys(e):Array.isArray(i)?i:[]}var Qg={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Qi(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var SE=0;function Vs(i){return"__private_"+SE+++"_"+i}var EE={version:"4.2.3"};function TE(i,e){let t=e;return t||(t=new Error("Upload error")),typeof t=="string"&&(t=new Error(t)),t instanceof Error||(t=Object.assign(new Error("Upload error"),{data:t})),Gg(i)?(t=new $s(t,i),t):(t.request=i,t)}function Jg(i){return i.data.slice(0,i.data.size,i.meta.type)}var xE={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""},ls=Vs("getFetcher"),Rh=Vs("uploadLocalFile"),_h=Vs("uploadBundle"),Lh=Vs("getCompanionClientArgs"),Oh=Vs("uploadFiles"),ko=Vs("handleUpload"),qs=class extends Hr{constructor(e,t){if(super(e,{...xE,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,Oh,{value:CE}),Object.defineProperty(this,Lh,{value:PE}),Object.defineProperty(this,_h,{value:kE}),Object.defineProperty(this,Rh,{value:AE}),Object.defineProperty(this,ls,{writable:!0,value:void 0}),Object.defineProperty(this,ko,{writable:!0,value:async r=>{if(r.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[hl]&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");let s=this.uppy.getFilesByIds(r),n=Yg(s),o=Zg(n);if(this.uppy.emit("upload-start",o),this.opts.bundle){if(n.some(l=>l.isRemote))throw new Error("Can\u2019t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await Qi(this,_h)[_h](n)}else await Qi(this,Oh)[Oh](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Qg,this.i18nInit(),hl in this.opts?this.requests=this.opts[hl]:this.requests=new ul(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),Qi(this,ls)[ls]=r=>async(s,n)=>{try{var o,a,l;let d=await Xg(s,{...n,onBeforeRequest:(v,x)=>{var P,C;return(P=(C=this.opts).onBeforeRequest)==null?void 0:P.call(C,v,x,r)},shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:v=>{let x=Math.ceil(v/1e3),P=new Error(this.i18n("uploadStalled",{seconds:x}));this.uppy.emit("upload-stalled",P,r)},onUploadProgress:v=>{if(v.lengthComputable)for(let{id:P}of r){var x;let C=this.uppy.getFile(P);this.uppy.emit("upload-progress",C,{uploadStarted:(x=C.progress.uploadStarted)!=null?x:0,bytesUploaded:v.loaded/v.total*C.size,bytesTotal:C.size})}}}),f=await((o=(a=this.opts).getResponseData)==null?void 0:o.call(a,d));try{var c;(c=f)!=null||(f=JSON.parse(d.responseText))}catch(v){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:v})}let y=typeof((l=f)==null?void 0:l.url)=="string"?f.url:void 0;for(let{id:v}of r)this.uppy.emit("upload-success",this.uppy.getFile(v),{status:d.status,body:f,uploadURL:y});return d}catch(d){if(d.name==="AbortError")return;if(d instanceof $s){let f=d.request;for(let y of r)this.uppy.emit("upload-error",this.uppy.getFile(y.id),TE(f,d),f)}throw d}}}getOptions(e){let t=this.uppy.getState().xhrUpload,{headers:r}=this.opts,s={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return typeof r=="function"?s.headers=r(e):Object.assign(s.headers,this.opts.headers),t&&Object.assign(s.headers,t.headers),e.xhrUpload&&Object.assign(s.headers,e.xhrUpload.headers),s}addMetadata(e,t,r){fl(r.allowedMetaFields,t).forEach(n=>{let o=t[n];Array.isArray(o)?o.forEach(a=>e.append(n,a)):e.append(n,o)})}createFormDataUpload(e,t){let r=new FormData;this.addMetadata(r,e.meta,t);let s=Jg(e);return e.name?r.append(t.fieldName,s,e.meta.name):r.append(t.fieldName,s),r}createBundledUpload(e,t){let r=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(r,s,t),e.forEach(n=>{let o=this.getOptions(n),a=Jg(n);n.name?r.append(o.fieldName,a,n.name):r.append(o.fieldName,a)}),r}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(Qi(this,ko)[ko])}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(Qi(this,ko)[ko])}};async function AE(i){let e=new To(this.uppy),t=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{let s=this.getOptions(i),n=Qi(this,ls)[ls]([i]),o=s.formData?this.createFormDataUpload(i,s):i.data;return n(s.endpoint,{...s,body:o,signal:t.signal})});e.onFileRemove(i.id,()=>t.abort()),e.onCancelAll(i.id,()=>{t.abort()});try{await r().abortOn(t.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{e.remove()}}async function kE(i){let e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var s;let n=(s=this.uppy.getState().xhrUpload)!=null?s:{},o=Qi(this,ls)[ls](i),a=this.createBundledUpload(i,{...this.opts,...n});return o(this.opts.endpoint,{...this.opts,body:a,signal:e.signal})});function r(){e.abort()}this.uppy.once("cancel-all",r);try{await t().abortOn(e.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{this.uppy.off("cancel-all",r)}}function PE(i){var e;let t=this.getOptions(i),r=fl(t.allowedMetaFields,i.meta);return{...(e=i.remote)==null?void 0:e.body,protocol:"multipart",endpoint:t.endpoint,size:i.data.size,fieldname:t.fieldName,metadata:Object.fromEntries(r.map(s=>[s,i.meta[s]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}async function CE(i){await Promise.allSettled(i.map(e=>{if(e.isRemote){let t=()=>this.requests,r=new AbortController,s=o=>{o.id===e.id&&r.abort()};this.uppy.on("file-removed",s);let n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,Qi(this,Lh)[Lh](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return Qi(this,Rh)[Rh](e)}))}qs.VERSION=EE.version;var ct=class{static fromTemplate(i){if(Ts.isSupported)return Ts.sanitize(i,{USE_PROFILES:{html:!0,svg:!0},RETURN_DOM:!0}).children[0];{let e=new DOMParser().parseFromString(i,"text/html").body.children[0];return FE(e)}}};function FE(i){return _E(i),ev(i),i}function _E(i){let e=i.querySelectorAll("script");for(let t of e)t.remove()}function OE(i,e){let t=e.replace(/\s+/g,"").toLowerCase();if(["src","href","xlink:href"].includes(i)&&(t.includes("javascript:")||t.includes("data:"))||i.startsWith("on"))return!0}function RE(i){let e=i.attributes;for(let{name:t,value:r}of e)OE(t,r)&&i.removeAttribute(t)}function ev(i){let e=i.children;for(let t of e)RE(t),ev(t)}var ml=class extends ne{static values={identifier:String,maxFileSize:{type:Number,default:null},minFileSize:{type:Number,default:null},maxTotalSize:{type:Number,default:null},maxFileNum:{type:Number,default:null},minFileNum:{type:Number,default:null},allowedFileTypes:{type:Array,default:null},requiredMetaFields:{type:Array,default:[]}};static outlets=["attachment-preview","attachment-preview-container"];connect(){this.uploadedFiles=[],this.element.style.display="none",this.configureUppy(),this.#n(),this.#r()}disconnect(){this.uppy=null}attachmentPreviewOutletConnected(i,e){this.#r()}attachmentPreviewOutletDisconnected(i,e){this.#r()}configureUppy(){this.uppy=new Zc({restrictions:{maxFileSize:this.maxFileSizeValue,minFileSize:this.minFileSizeValue,maxTotalFileSize:this.maxTotalSizeValue,maxNumberOfFiles:this.maxFileNumValue,minNumberOfFiles:this.minFileNumValue,allowedFileTypes:this.allowedFileTypesValue,requiredMetaFields:this.requiredMetaFieldsValue}}).use(fr,{inline:!1,closeAfterFinish:!0}).use(is,{target:fr}),this.#e(),this.#t()}#e(){this.uppy.use(qs,{endpoint:"/upload"})}#t(){this.uppy.on("upload-success",this.#s.bind(this))}#i(){let i=document.documentElement.getAttribute("data-bs-theme")||"auto";this.#o.setOptions({theme:i});let e=null;for(;e=this.uploadedFiles.pop();)this.uppy.removeFile(e.id);this.#o.openModal()}#s(i,e){this.uploadedFiles.push(i),this.multiple||this.attachmentPreviewOutlets.forEach(s=>s.remove());let t=e.body.data,r=e.body.url;this.attachmentPreviewContainerOutlet.element.appendChild(this.#l(t,r))}#r(){if(!this.deleteAllTrigger)return;this.attachmentPreviewOutlets.length>1?(this.deleteAllTrigger.style.display="initial",this.deleteAllTrigger.textContent=`Delete ${this.attachmentPreviewOutlets.length}`):this.deleteAllTrigger.style.display="none"}#n(){this.triggerContainer=document.createElement("div"),this.triggerContainer.className="flex items-center gap-2",this.element.insertAdjacentElement("afterend",this.triggerContainer),this.#a(),this.uploadTrigger&&this.triggerContainer.append(this.uploadTrigger),this.deleteAllTrigger&&this.triggerContainer.append(this.deleteAllTrigger)}#a(){let i=this.multiple?"Choose files":"Choose file";this.uploadTrigger=ct.fromTemplate(`<button type="button" class="text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700 inline-flex items-center">
73
+ <svg class="w-4 h-4 mr-2" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 16">
74
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"/>
75
+ </svg>
76
+ ${i}
77
+ </button>`,!1),this.uploadTrigger.addEventListener("click",this.#i.bind(this))}#c(){this.deleteAllTrigger=ct.fromTemplate(`<button type="button" class="text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-red-600 dark:hover:bg-red-700 focus:outline-none dark:focus:ring-red-800 inline-flex items-center">
78
+ Delete ${this.attachmentPreviewOutlets.length}
79
+ </button>`,!1),this.deleteAllTrigger.addEventListener("click",()=>{confirm("Are you sure?")&&this.attachmentPreviewContainerOutlet.clear()})}#l(i,e){let t=i.metadata.filename,r=t.substring(t.lastIndexOf(".")+1,t.length)||t,s=this.multiple?"multiple":"",n=i.metadata.mime_type,a=["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/bmp","image/tiff"].includes(n.toLowerCase()),l=ct.fromTemplate(this.#u(t,r,n,e,a)),c=ct.fromTemplate(`<input name="${this.element.name}" ${s} type="hidden" autocomplete="off" hidden />`);return c.value=JSON.stringify(i),l.appendChild(c),l}#u(i,e,t,r,s){return`
80
+ <div class="${this.identifierValue} attachment-preview group relative bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm hover:shadow-md transition-all duration-300"
81
+ data-controller="attachment-preview"
82
+ data-attachment-preview-mime-type-value="${t}"
83
+ data-attachment-preview-thumbnail-url-value="${s?r:""}"
84
+ data-attachment-preview-target="thumbnail"
85
+ title="${i}">
86
+ <a class="block aspect-square overflow-hidden rounded-t-lg"
87
+ data-attachment-preview-target="thumbnailLink">
88
+ ${s?`<img src="${r}" class="w-full h-full object-cover" />`:`<div class="w-full h-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 text-gray-500 dark:text-gray-400 font-mono">.${e}</div>`}
89
+ </a>
90
+ <div class="px-2 py-1.5 text-sm text-gray-700 dark:text-gray-300 border-t border-gray-200 dark:border-gray-700 truncate text-center bg-white dark:bg-gray-800"
91
+ title="${i}">
92
+ ${i}
93
+ </div>
94
+ <button type="button"
95
+ class="w-full py-2 px-4 text-sm text-red-600 dark:text-red-400 bg-white dark:bg-gray-800 hover:bg-red-50 dark:hover:bg-red-900/50 rounded-b-lg transition-colors duration-200 flex items-center justify-center gap-2 border-t border-gray-200 dark:border-gray-700"
96
+ data-action="click->attachment-preview#remove">
97
+ <span class="bi bi-trash"></span>
98
+ Delete
99
+ </button>
100
+ </div>
101
+ `}get#o(){return this.uppy.getPlugin("Dashboard")}get multiple(){return this.maxFileNumValue!=1}};function LE(){return ct.fromTemplate(`
102
+ <svg aria-hidden="true" focusable="false" width="25" height="25" viewBox="0 0 25 25">
103
+ <g fill="#686DE0" fillRule="evenodd">
104
+ <path d="M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z" fillRule="nonzero" />
105
+ <path d="M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z" fillRule="nonzero" />
106
+ <circle cx="7.5" cy="9.5" r="1.5" />
107
+ </g>
108
+ </svg>
109
+ `)}function ME(){return ct.fromTemplate(`
110
+ <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
111
+ <path d="M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z" fill="#049BCF" fillRule="nonzero" />
112
+ </svg>
113
+ `)}function IE(){return ct.fromTemplate(`
114
+ <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
115
+ <path d="M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z" fill="#19AF67" fillRule="nonzero" />
116
+ </svg>
117
+ `)}function DE(){return ct.fromTemplate(`
118
+ <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
119
+ <path d="M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z" fill="#E2514A" fillRule="nonzero" />
120
+ </svg>
121
+ `)}function NE(){return ct.fromTemplate(`
122
+ <svg aria-hidden="true" focusable="false" width="25" height="25" viewBox="0 0 25 25">
123
+ <path d="M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z" fill="#00C469" fillRule="nonzero" />
124
+ </svg>
125
+ `)}function BE(){return ct.fromTemplate(`
126
+ <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
127
+ <g fill="#A7AFB7" fillRule="nonzero">
128
+ <path d="M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z" />
129
+ <path d="M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z" />
130
+ </g>
131
+ </svg>
132
+ `)}function UE(){return ct.fromTemplate(`
133
+ <svg aria-hidden="true" focusable="false" className="uppy-c-icon" width="25" height="25" viewBox="0 0 25 25">
134
+ <path d="M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z" fill="#5A5E69" fillRule="nonzero" />
135
+ </svg>
136
+ `)}function Mh(i){let e={color:"#838999",icon:BE()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:UE()}:t==="image"?{color:"#686de0",icon:LE()}:t==="audio"?{color:"#068dbb",icon:ME()}:t==="video"?{color:"#19af67",icon:IE()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:DE()}:t==="application"&&["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:NE()}:e}var gl=class extends ne{static targets=["thumbnail","thumbnailLink"];static values={mimeType:String,thumbnailUrl:String};connect(){this.hasThumbnailTarget&&(this.thumbnailUrlValue?this.useThumbnailPreview():this.useMimeIconPreview())}remove(){this.element.remove()}useThumbnailPreview(){let i=ct.fromTemplate(`
137
+ <img src="${this.thumbnailUrlValue}" class="w-full h-full object-cover" />
138
+ `);this.thumbnailLinkTarget.innerHTML=null,this.thumbnailLinkTarget.appendChild(i)}useMimeIconPreview(){let i=Mh(this.mimeTypeValue);i.icon.classList.add("w-3/5","h-4/5","rounded-lg","shadow-lg","bg-white","p-2"),this.thumbnailLinkTarget.classList.add("flex","items-center","justify-center"),this.thumbnailLinkTarget.style.backgroundColor=i.color,this.thumbnailLinkTarget.innerHTML=null,this.thumbnailLinkTarget.appendChild(i.icon)}};var vl=class extends ne{connect(){}append(i){this.element.appendChild(i)}clear(){this.element.innerHTML=null}};function Ih(i){i.register("resource-header",Go),i.register("nested-resource-form-fields",Ko),i.register("form",Xo),i.register("resource-drop-down",ia),i.register("resource-collapse",ra),i.register("resource-dismiss",sa),i.register("frame-navigator",na),i.register("color-mode",oa),i.register("easymde",fa),i.register("slim-select",ma),i.register("flatpickr",ga),i.register("intl-tel-input",va),i.register("select-navigator",ba),i.register("resource-tab-list",ya),i.register("attachment-input",ml),i.register("attachment-preview",gl),i.register("attachment-preview-container",vl)}(function(i){if(typeof i.requestSubmit=="function")return;i.requestSubmit=function(r){r?(e(r,this),r.click()):(r=document.createElement("input"),r.type="submit",r.hidden=!0,this.appendChild(r),r.click(),this.removeChild(r))};function e(r,s){r instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),r.type=="submit"||t(TypeError,"The specified element is not a submit button"),r.form==s||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(r,s,n){throw new r("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+s+".",n)}})(HTMLFormElement.prototype);var ov=new WeakMap;function zE(i){let e=i instanceof Element?i:i instanceof Node?i.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function HE(i){let e=zE(i.target);e&&e.form&&ov.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let i=window.Event.prototype;if("SubmitEvent"in window){let e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))i=e;else return}addEventListener("click",HE,!0),Object.defineProperty(i,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return ov.get(this.target)}})})();var Ws={eager:"eager",lazy:"lazy"},Ai=class i extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new i.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():e=="disabled"&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get loading(){return $E(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}};function $E(i){switch(i.toLowerCase()){case"lazy":return Ws.lazy;default:return Ws.eager}}function rt(i){return new URL(i.toString(),document.baseURI)}function hs(i){let e;if(i.hash)return i.hash.slice(1);if(e=i.href.match(/#(.*)$/))return e[1]}function hd(i,e){let t=e?.getAttribute("formaction")||i.getAttribute("action")||i.action;return rt(t)}function qE(i){return(KE(i).match(/\.[^.]*$/)||[])[0]||""}function VE(i){return!!qE(i).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function jE(i,e){let t=XE(e);return i.href===rt(t).href||i.href.startsWith(t)}function mr(i,e){return jE(i,e)&&VE(i)}function Dh(i){let e=hs(i);return e!=null?i.href.slice(0,-(e.length+1)):i.href}function bl(i){return Dh(i)}function WE(i,e){return rt(i).href==rt(e).href}function GE(i){return i.pathname.split("/").slice(1)}function KE(i){return GE(i).slice(-1)[0]}function XE(i){return YE(i.origin+i.pathname)}function YE(i){return i.endsWith("/")?i:i+"/"}var Po=class{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return rt(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}};function Co(i){if(i.getAttribute("data-turbo-eval")=="false")return i;{let e=document.createElement("script"),t=Zs("csp-nonce");return t&&(e.nonce=t),e.textContent=i.textContent,e.async=!1,ZE(e,i),e}}function ZE(i,e){for(let{name:t,value:r}of e.attributes)i.setAttribute(t,r)}function QE(i){let e=document.createElement("template");return e.innerHTML=i,e.content}function Le(i,{target:e,cancelable:t,detail:r}={}){let s=new CustomEvent(i,{cancelable:t,bubbles:!0,composed:!0,detail:r});return e&&e.isConnected?e.dispatchEvent(s):document.documentElement.dispatchEvent(s),s}function Ks(){return document.visibilityState==="hidden"?lv():av()}function av(){return new Promise(i=>requestAnimationFrame(()=>i()))}function lv(){return new Promise(i=>setTimeout(()=>i(),0))}function JE(){return Promise.resolve()}function cv(i=""){return new DOMParser().parseFromString(i,"text/html")}function uv(i,...e){let t=eT(i,e).replace(/^\n/,"").split(`
139
+ `),r=t[0].match(/^\s+/),s=r?r[0].length:0;return t.map(n=>n.slice(s)).join(`
140
+ `)}function eT(i,e){return i.reduce((t,r,s)=>{let n=e[s]==null?"":e[s];return t+r+n},"")}function gr(){return Array.from({length:36}).map((i,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function wl(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function tT(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function Sl(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function El(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function iT(i,e=2e3){return new Promise(t=>{let r=()=>{i.removeEventListener("error",r),i.removeEventListener("load",r),t()};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),setTimeout(t,e)})}function hv(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function rT(i){return i=="advance"||i=="replace"||i=="restore"}function ds(...i){let e=wl("data-turbo-action",...i);return rT(e)?e:null}function dv(i){return document.querySelector(`meta[name="${i}"]`)}function Zs(i){let e=dv(i);return e&&e.content}function sT(i,e){let t=dv(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function Xs(i,e){if(i instanceof Element)return i.closest(e)||Xs(i.assignedSlot||i.getRootNode()?.host,e)}function dd(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function pv(i){return Array.from(i.querySelectorAll("[autofocus]")).find(dd)}async function nT(i,e){let t=e();i(),await av();let r=e();return[t,r]}function oT(i){if(i.hasAttribute("target")){for(let e of document.getElementsByName(i.target))if(e instanceof HTMLIFrameElement)return!1}return!0}function aT(i){return Xs(i,"a[href]:not([target^=_]):not([download])")}function fv(i){return rt(i.getAttribute("href")||"")}function lT(i,e){let t=null;return(...r)=>{let s=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(s,e)}}var Nh=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let r=this.values().next().value;this.delete(r)}super.add(e)}},mv=new Nh(20),cT=window.fetch;function gv(i,e={}){let t=new Headers(e.headers||{}),r=gr();return mv.add(r),t.append("X-Turbo-Request-Id",r),cT(i,{...e,headers:t})}function pd(i){switch(i.toLowerCase()){case"get":return Xt.get;case"post":return Xt.post;case"put":return Xt.put;case"patch":return Xt.patch;case"delete":return Xt.delete}}var Xt={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function uT(i){switch(i.toLowerCase()){case us.multipart:return us.multipart;case us.plain:return us.plain;default:return us.urlEncoded}}var us={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},ps=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,s=new URLSearchParams,n=null,o=us.urlEncoded){let[a,l]=tv(rt(r),t,s,o);this.delegate=e,this.url=a,this.target=n,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t,headers:{...this.defaultHeaders},body:l,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=pd(e)||Xt.get;this.url.search="";let[s,n]=tv(this.url,r,t,this.enctype);this.url=s,this.fetchOptions.body=n,this.fetchOptions.method=r}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=gv(this.url.href,e);let r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.#i(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Po(e);return Le("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return fd(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(s=>this.#e=s),r=Le("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=r.detail.url,r.defaultPrevented&&await t,r}#i(e){return!Le("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function fd(i){return pd(i)==Xt.get}function tv(i,e,t,r){let s=Array.from(t).length>0?new URLSearchParams(vv(t)):i.searchParams;return fd(e)?[hT(i,s),null]:r==us.urlEncoded?[i,s]:[i,t]}function vv(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function hT(i,e){let t=new URLSearchParams(vv(e));return i.search=t.toString(),i}var Bh=class{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},vr=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(QE(e)):e}constructor(e){this.fragment=dT(e)}};function dT(i){for(let e of i.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let r of t.templateElement.content.querySelectorAll("script"))r.replaceWith(Co(r));e.replaceWith(t)}return i}var pT=100,Uh=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,r){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,r),this.#e=null},pT)}set(e,t,r){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+r)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},fT=10*1e3,Gs=new Uh,js={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},Fo=class i{state=js.initialized;static confirmMethod(e,t,r){return Promise.resolve(confirm(e))}constructor(e,t,r,s=!1){let n=wT(t,r),o=yT(bT(t,r),n),a=mT(t,r),l=ST(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new ps(this,n,o,a,t,l),this.mustRedirect=s}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=rt(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){let{initialized:e,requesting:t}=js,r=wl("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await i.confirmMethod(r,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=js;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=gT(Zs("csrf-param"))||Zs("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(vr.contentType)}requestStarted(e){this.state=js.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),Sl(this.formElement),Le("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){Gs.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(Gs.clear(),this.requestMustRedirect(e)&&vT(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=js.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=js.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),El(this.formElement),Le("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(!(!this.submitter||!this.submitsWith)){if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||tT("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function mT(i,e){let t=new FormData(i),r=e?.getAttribute("name"),s=e?.getAttribute("value");return r&&t.append(r,s||""),t}function gT(i){if(i!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(i));if(t){let r=t.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function vT(i){return i.statusCode==200&&!i.redirected}function bT(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function yT(i,e){let t=rt(i);return fd(e)&&(t.search=""),t}function wT(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return pd(t.toLowerCase())||Xt.get}function ST(i,e){return uT(e?.getAttribute("formenctype")||i.enctype)}var Qs=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return pv(this.element)}get permanentElements(){return yv(this.element)}getPermanentElementById(e){return bv(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let r of this.permanentElements){let{id:s}=r,n=e.getPermanentElementById(s);n&&(t[s]=[r,n])}return t}};function bv(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function yv(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var _o=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){let t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&ET(t,r)&&TT(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function ET(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function TT(i,e){if(e?.hasAttribute("formtarget")||i.hasAttribute("target")){let t=e?.getAttribute("formtarget")||i.target;for(let r of document.getElementsByName(t))if(r instanceof HTMLIFrameElement)return!1;return!0}else return!0}var Tl=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(hs(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){let{isPreview:t,shouldRender:r,willRender:s,newSnapshot:n}=e,o=s;if(r)try{this.renderPromise=new Promise(d=>this.#e=d),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(d=>this.#t=d),l={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(n,l)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(n,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(void 0),delete this.renderPromise}else o&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}},zh=class extends Tl{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new Qs(this.element)}},xl=class{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.respondsToEventTarget(e.target)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.respondsToEventTarget(e.target)&&e.target instanceof Element&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};respondsToEventTarget(e){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},Al=class{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){let t=e.composedPath&&e.composedPath()[0]||e.target,r=aT(t);if(r&&oT(r)){let s=fv(r);this.delegate.willFollowLinkToLocation(r,s,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,s))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},kl=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new Al(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,r){return this.delegate.willSubmitFormLinkToLocation(e,t,r)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let r=document.createElement("form"),s="hidden";for(let[f,y]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:s,name:f,value:y}));let n=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",n.href),r.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&r.setAttribute("method",o);let a=e.getAttribute("data-turbo-frame");a&&r.setAttribute("data-turbo-frame",a);let l=ds(e);l&&r.setAttribute("data-turbo-action",l);let c=e.getAttribute("data-turbo-confirm");c&&r.setAttribute("data-turbo-confirm",c),e.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",()=>r.remove(),{once:!0}),requestAnimationFrame(()=>r.requestSubmit())}},Pl=class{static async preservingPermanentElements(e,t,r){let s=new this(e,t);s.enter(),await r(),s.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=xT(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function xT(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var Oo=class{#e=null;constructor(e,t,r,s,n=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=s,this.willRender=n,this.renderElement=r,this.promise=new Promise((o,a)=>this.resolvingFunctions={resolve:o,reject:a})}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await Pl.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}},Ro=class extends Oo{static renderElement(e,t){let r=document.createRange();r.selectNodeContents(e),r.deleteContents();let s=t,n=s.ownerDocument?.createRange();n&&(n.selectNodeContents(s),e.appendChild(n.extractContents()))}constructor(e,t,r,s,n,o=!0){super(t,r,s,n,o),this.delegate=e}get shouldRender(){return!0}async render(){await Ks(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await Ks(),this.focusFirstAutofocusableElement(),await Ks(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=AT(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=kT(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:r}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=Co(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function AT(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function kT(i,e){return i=="auto"||i=="smooth"?i:e}var Hh=class i{static animationDuration=300;static get defaultCSS(){return uv`
64
141
  .turbo-progress-bar {
65
142
  position: fixed;
66
143
  display: block;
@@ -74,7 +151,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
74
151
  opacity ${i.animationDuration/2}ms ${i.animationDuration/2}ms ease-in;
75
152
  transform: translate3d(0, 0, 0);
76
153
  }
77
- `}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,i.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,i.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=i.defaultCSS,this.cspNonce&&(e.nonce=this.cspNonce),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}get cspNonce(){return hi("csp-nonce")}},Fs=class extends di{detailsByOuterHTML=this.children.filter(e=>!Sd(e)).map(e=>xd(e)).reduce((e,t)=>{let{outerHTML:r}=t,n=r in e?e[r]:{type:Ed(t),tracked:_d(t),elements:[]};return{...e,[r]:{...n,elements:[...n.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(r=>!(r in t.detailsByOuterHTML)).map(r=>this.detailsByOuterHTML[r]).filter(({type:r})=>r==e).map(({elements:[r]})=>r)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:r,tracked:n,elements:s}=this.detailsByOuterHTML[t];return r==null&&!n?[...e,...s]:s.length>1?[...e,...s.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{let{elements:[n]}=this.detailsByOuterHTML[r];return kd(n,e)?n:t},void 0|void 0)}};function Ed(i){if(Ad(i))return"script";if(Td(i))return"stylesheet"}function _d(i){return i.getAttribute("data-turbo-track")=="reload"}function Ad(i){return i.localName=="script"}function Sd(i){return i.localName=="noscript"}function Td(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function kd(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function xd(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var De=class i extends di{static fromHTMLString(e=""){return this.fromDocument(cl(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Fs(r))}constructor(e,t,r){super(t),this.documentElement=e,this.headSnapshot=r}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(let[n,s]of t.entries()){let o=r[n];for(let a of o.selectedOptions)a.selected=!1;for(let a of s.selectedOptions)o.options[a.index].selected=!0}for(let n of e.querySelectorAll('input[type="password"]'))n.value="";return new i(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return le(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},Bs=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},Ld={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},cn={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Qe={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},ui={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Cd={advance:"forward",restore:"back",replace:"none"},Ns=class{identifier=at();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Qe.initialized;viewTransitioner=new Bs;constructor(e,t,r,n={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||at();let{action:s,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:d,response:p,visitCachedSnapshot:m,willRender:E,updateHistory:v,shouldCacheSnapshot:C,acceptsStreamResponse:_,direction:k}={...Ld,...n};this.action=s,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=d,this.response=p,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=m,this.willRender=E,this.updateHistory=v,this.scrolled=!E,this.shouldCacheSnapshot=C,this.acceptsStreamResponse=_,this.direction=k||Cd[s]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==Qe.initialized&&(this.recordTimingMetric(cn.visitStart),this.state=Qe.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Qe.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Qe.canceled)}complete(){this.state==Qe.started&&(this.recordTimingMetric(cn.visitEnd),this.adapter.visitCompleted(this),this.state=Qe.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Qe.started&&(this.state=Qe.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=hl(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new Lt(this,ke.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(cn.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;il(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(cn.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,il(e)&&t!=null){let r=De.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(De.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!kt(this.location)||e.hasAnchor(kt(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return De.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(lt.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ui.contentTypeMismatch,redirected:n}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:s,responseHTML:r,redirected:n}))}async requestFailedWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ui.contentTypeMismatch,redirected:n}):this.recordResponse({statusCode:s,responseHTML:r,redirected:n})}requestErrored(e,t){this.recordResponse({statusCode:ui.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=kt(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),this.frame=await li(),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function il(i){return i>=200&&i<300}var Hs=class{progressBar=new Ds;constructor(e){this.session=e}visitProposedToLocation(e,t){ot(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||at(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case ui.networkFailure:case ui.timeoutFailure:case ui.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){Q("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},qs=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},zs=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new fn(this,t),this.formSubmitObserver=new Vi(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,r){return this.#t(e)}linkClickIntercepted(e,t,r){let n=this.#i(e);n&&n.delegate.linkClickIntercepted(e,t,r)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let r=this.#i(e,t);r&&r.delegate.formSubmitted(e,t)}#e(e,t){let r=so(e,t),n=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),s=le(n?.content??"/");return this.#t(e,t)&&ot(r,s)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let n=this.#i(e,t);return n?n!=e.closest("turbo-frame"):!1}else return!1}#i(e,t){let r=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(r&&r!="_top"){let n=this.element.querySelector(`#${r}:not([disabled])`);if(n instanceof qe)return n}}},Vs=class{location;restorationIdentifier=at();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,r=at()){e===history.pushState&&++this.currentIndex;let n={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,n,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,r=this.restorationData[t];this.restorationData[t]={...r,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:r,restorationIndex:n}=t;this.restorationIdentifier=r;let s=n>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,s),this.currentIndex=n}}};onPageLoad=async e=>{await Kh(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},$s=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!0};#i=e=>{if(hi("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#a(t)){let n=t,s=fl(n);if(this.delegate.canPrefetchRequestToLocation(n,s)){this.#e=n;let o=new Lt(this,ke.get,s,new URLSearchParams,t);ai.setLater(s.toString(),o,this.#o)}}};#n=e=>{e.target===this.#e&&this.#s()};#s=()=>{ai.clear(),this.#e=null};#r=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="get"){let t=ai.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),ai.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let r=t.closest("turbo-frame"),n=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;n&&n!=="_top"&&(e.headers["Turbo-Frame"]=n)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#o(){return Number(hi("turbo-prefetch-cache-time"))||ld}#a(e){return!(!e.getAttribute("href")||Id(e)||Od(e)||Rd(e)||Md(e)||Dd(e))}},Id=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),Od=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),Rd=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=ci(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},Md=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||Pd(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},Pd=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),Dd=i=>Q("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,js=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,r={}){this.stop(),this.currentVisit=new Ns(this,le(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new zi(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let r=await t.responseHTML;if(r){let n=e.isSafe;n||this.view.clearSnapshotCache();let{statusCode:s,redirected:o}=t,l={action:this.#e(e,t),shouldCacheSnapshot:n,response:{statusCode:s,responseHTML:r,redirected:o}};this.proposeVisit(t.location,l)}}}async formSubmissionFailedWithResponse(e,t){let r=await t.responseHTML;if(r){let n=De.fromHTMLString(r);t.serverError?await this.view.renderError(n,this.currentVisit):await this.view.renderPage(n,!1,!0,this.currentVisit),n.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let r=kt(e),n=kt(this.view.lastRenderedLocation),s=t==="restore"&&typeof r>"u";return t!=="replace"&&Is(e)===Is(this.view.lastRenderedLocation)&&(s||r!=null&&r!==n)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:r,formElement:n}=e;return xt(r,n)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},St={initial:0,loading:1,interactive:2,complete:3},Us=class{stage=St.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==St.initial&&(this.stage=St.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==St.loading&&(this.stage=St.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==St.interactive&&(this.stage=St.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},Ws=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},Ks=class{render({fragment:e}){vn.preservingPermanentElements(this,Fd(e),()=>{Bd(e,()=>{Nd(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function Fd(i){let e=yl(document.documentElement),t={};for(let r of e){let{id:n}=r;for(let s of i.querySelectorAll("turbo-stream")){let o=bl(s.templateElement.content,n);o&&(t[n]=[r,o])}}return t}async function Bd(i,e){let t=`turbo-stream-autofocus-${at()}`,r=i.querySelectorAll("turbo-stream"),n=Hd(r),s=null;if(n&&(n.id?s=n.id:s=t,n.id=s),e(),await li(),(document.activeElement==null||document.activeElement==document.body)&&s){let a=document.getElementById(s);oo(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function Nd(i){let[e,t]=await Jh(i,()=>document.activeElement),r=e&&e.id;if(r){let n=document.getElementById(r);oo(n)&&n!=t&&n.focus()}}function Hd(i){for(let e of i){let t=pl(e.templateElement.content);if(t)return t}return null}var Gs=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=qd(e);t&&zd(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(lt.wrap(e))}};function qd(i){let e=i.detail?.fetchResponse;if(e instanceof Hi)return e}function zd(i){return(i.contentType??"").startsWith(lt.contentType)}var bn=class extends $i{static renderElement(e,t){let{documentElement:r,body:n}=document;r.replaceChild(t,n)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let r=qi(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},Vd=function(){let i=new Set,e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:E,afterNodeAdded:E,beforeNodeMorphed:E,afterNodeMorphed:E,beforeNodeRemoved:E,afterNodeRemoved:E,beforeAttributeUpdated:E},head:{style:"merge",shouldPreserve:function(u){return u.getAttribute("im-preserve")==="true"},shouldReAppend:function(u){return u.getAttribute("im-re-append")==="true"},shouldRemove:E,afterHeadMorphed:E}};function t(u,h,f={}){u instanceof Document&&(u=u.documentElement),typeof h=="string"&&(h=S(h));let y=R(h),w=C(u,y,f);return r(u,y,w)}function r(u,h,f){if(f.head.block){let y=u.querySelector("head"),w=h.querySelector("head");if(y&&w){let b=m(w,y,f);Promise.all(b).then(function(){r(u,h,Object.assign(f,{head:{block:!1,ignore:!0}}))});return}}if(f.morphStyle==="innerHTML")return o(h,u,f),u.children;if(f.morphStyle==="outerHTML"||f.morphStyle==null){let y=P(h,u,f),w=y?.previousSibling,b=y?.nextSibling,O=s(u,y,f);return y?x(w,O,b):[]}else throw"Do not understand how to morph style "+f.morphStyle}function n(u,h){return h.ignoreActiveValue&&u===document.activeElement&&u!==document.body}function s(u,h,f){if(!(f.ignoreActive&&u===document.activeElement))return h==null?f.callbacks.beforeNodeRemoved(u)===!1?u:(u.remove(),f.callbacks.afterNodeRemoved(u),null):k(u,h)?(f.callbacks.beforeNodeMorphed(u,h)===!1||(u instanceof HTMLHeadElement&&f.head.ignore||(u instanceof HTMLHeadElement&&f.head.style!=="morph"?m(h,u,f):(l(h,u,f),n(u,f)||o(h,u,f))),f.callbacks.afterNodeMorphed(u,h)),u):f.callbacks.beforeNodeRemoved(u)===!1||f.callbacks.beforeNodeAdded(h)===!1?u:(u.parentElement.replaceChild(h,u),f.callbacks.afterNodeAdded(h),f.callbacks.afterNodeRemoved(u),h)}function o(u,h,f){let y=u.firstChild,w=h.firstChild,b;for(;y;){if(b=y,y=b.nextSibling,w==null){if(f.callbacks.beforeNodeAdded(b)===!1)return;h.appendChild(b),f.callbacks.afterNodeAdded(b),Y(f,b);continue}if(_(b,w,f)){s(w,b,f),w=w.nextSibling,Y(f,b);continue}let O=q(u,h,b,w,f);if(O){w=D(w,O,f),s(O,b,f),Y(f,b);continue}let M=B(u,h,b,w,f);if(M){w=D(w,M,f),s(M,b,f),Y(f,b);continue}if(f.callbacks.beforeNodeAdded(b)===!1)return;h.insertBefore(b,w),f.callbacks.afterNodeAdded(b),Y(f,b)}for(;w!==null;){let O=w;w=w.nextSibling,U(O,f)}}function a(u,h,f,y){return u==="value"&&y.ignoreActiveValue&&h===document.activeElement?!0:y.callbacks.beforeAttributeUpdated(u,h,f)===!1}function l(u,h,f){let y=u.nodeType;if(y===1){let w=u.attributes,b=h.attributes;for(let O of w)a(O.name,h,"update",f)||h.getAttribute(O.name)!==O.value&&h.setAttribute(O.name,O.value);for(let O=b.length-1;0<=O;O--){let M=b[O];a(M.name,h,"remove",f)||u.hasAttribute(M.name)||h.removeAttribute(M.name)}}(y===8||y===3)&&h.nodeValue!==u.nodeValue&&(h.nodeValue=u.nodeValue),n(h,f)||p(u,h,f)}function d(u,h,f,y){if(u[f]!==h[f]){let w=a(f,h,"update",y);w||(h[f]=u[f]),u[f]?w||h.setAttribute(f,u[f]):a(f,h,"remove",y)||h.removeAttribute(f)}}function p(u,h,f){if(u instanceof HTMLInputElement&&h instanceof HTMLInputElement&&u.type!=="file"){let y=u.value,w=h.value;d(u,h,"checked",f),d(u,h,"disabled",f),u.hasAttribute("value")?y!==w&&(a("value",h,"update",f)||(h.setAttribute("value",y),h.value=y)):a("value",h,"remove",f)||(h.value="",h.removeAttribute("value"))}else if(u instanceof HTMLOptionElement)d(u,h,"selected",f);else if(u instanceof HTMLTextAreaElement&&h instanceof HTMLTextAreaElement){let y=u.value,w=h.value;if(a("value",h,"update",f))return;y!==w&&(h.value=y),h.firstChild&&h.firstChild.nodeValue!==y&&(h.firstChild.nodeValue=y)}}function m(u,h,f){let y=[],w=[],b=[],O=[],M=f.head.style,ce=new Map;for(let V of u.children)ce.set(V.outerHTML,V);for(let V of h.children){let ne=ce.has(V.outerHTML),de=f.head.shouldReAppend(V),Le=f.head.shouldPreserve(V);ne||Le?de?w.push(V):(ce.delete(V.outerHTML),b.push(V)):M==="append"?de&&(w.push(V),O.push(V)):f.head.shouldRemove(V)!==!1&&w.push(V)}O.push(...ce.values());let H=[];for(let V of O){let ne=document.createRange().createContextualFragment(V.outerHTML).firstChild;if(f.callbacks.beforeNodeAdded(ne)!==!1){if(ne.href||ne.src){let de=null,Le=new Promise(function(Ct){de=Ct});ne.addEventListener("load",function(){de()}),H.push(Le)}h.appendChild(ne),f.callbacks.afterNodeAdded(ne),y.push(ne)}}for(let V of w)f.callbacks.beforeNodeRemoved(V)!==!1&&(h.removeChild(V),f.callbacks.afterNodeRemoved(V));return f.head.afterHeadMorphed(h,{added:y,kept:b,removed:w}),H}function E(){}function v(u){let h={};return Object.assign(h,e),Object.assign(h,u),h.callbacks={},Object.assign(h.callbacks,e.callbacks),Object.assign(h.callbacks,u.callbacks),h.head={},Object.assign(h.head,e.head),Object.assign(h.head,u.head),h}function C(u,h,f){return f=v(f),{target:u,newContent:h,config:f,morphStyle:f.morphStyle,ignoreActive:f.ignoreActive,ignoreActiveValue:f.ignoreActiveValue,idMap:xe(u,h),deadIds:new Set,callbacks:f.callbacks,head:f.head}}function _(u,h,f){return u==null||h==null?!1:u.nodeType===h.nodeType&&u.tagName===h.tagName?u.id!==""&&u.id===h.id?!0:W(f,u,h)>0:!1}function k(u,h){return u==null||h==null?!1:u.nodeType===h.nodeType&&u.tagName===h.tagName}function D(u,h,f){for(;u!==h;){let y=u;u=u.nextSibling,U(y,f)}return Y(f,h),h.nextSibling}function q(u,h,f,y,w){let b=W(w,f,h),O=null;if(b>0){let M=y,ce=0;for(;M!=null;){if(_(f,M,w))return M;if(ce+=W(w,M,u),ce>b)return null;M=M.nextSibling}}return O}function B(u,h,f,y,w){let b=y,O=f.nextSibling,M=0;for(;b!=null;){if(W(w,b,u)>0)return null;if(k(f,b))return b;if(k(O,b)&&(M++,O=O.nextSibling,M>=2))return null;b=b.nextSibling}return b}function S(u){let h=new DOMParser,f=u.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(f.match(/<\/html>/)||f.match(/<\/head>/)||f.match(/<\/body>/)){let y=h.parseFromString(u,"text/html");if(f.match(/<\/html>/))return y.generatedByIdiomorph=!0,y;{let w=y.firstChild;return w?(w.generatedByIdiomorph=!0,w):null}}else{let w=h.parseFromString("<body><template>"+u+"</template></body>","text/html").body.querySelector("template").content;return w.generatedByIdiomorph=!0,w}}function R(u){if(u==null)return document.createElement("div");if(u.generatedByIdiomorph)return u;if(u instanceof Node){let h=document.createElement("div");return h.append(u),h}else{let h=document.createElement("div");for(let f of[...u])h.append(f);return h}}function x(u,h,f){let y=[],w=[];for(;u!=null;)y.push(u),u=u.previousSibling;for(;y.length>0;){let b=y.pop();w.push(b),h.parentElement.insertBefore(b,h)}for(w.push(h);f!=null;)y.push(f),w.push(f),f=f.nextSibling;for(;y.length>0;)h.parentElement.insertBefore(y.pop(),h.nextSibling);return w}function P(u,h,f){let y;y=u.firstChild;let w=y,b=0;for(;y;){let O=N(y,h,f);O>b&&(w=y,b=O),y=y.nextSibling}return w}function N(u,h,f){return k(u,h)?.5+W(f,u,h):0}function U(u,h){Y(h,u),h.callbacks.beforeNodeRemoved(u)!==!1&&(u.remove(),h.callbacks.afterNodeRemoved(u))}function X(u,h){return!u.deadIds.has(h)}function z(u,h,f){return(u.idMap.get(f)||i).has(h)}function Y(u,h){let f=u.idMap.get(h)||i;for(let y of f)u.deadIds.add(y)}function W(u,h,f){let y=u.idMap.get(h)||i,w=0;for(let b of y)X(u,b)&&z(u,b,f)&&++w;return w}function ye(u,h){let f=u.parentElement,y=u.querySelectorAll("[id]");for(let w of y){let b=w;for(;b!==f&&b!=null;){let O=h.get(b);O==null&&(O=new Set,h.set(b,O)),O.add(w.id),b=b.parentElement}}}function xe(u,h){let f=new Map;return ye(u,f),ye(h,f),f}return{morph:t,defaults:e}}(),pi=class extends $i{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(Yh(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(qi(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[r,n]of t.entries()){if(e.tagName=="TITLE"){if(n.tagName!="TITLE")continue;if(e.innerHTML==n.innerHTML)return t.splice(r,1),!0}if(n.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=qi(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},Xs=class extends pi{async render(){this.willRender&&await this.#e()}get renderMethod(){return"morph"}async#e(){this.#t(this.currentElement,this.newElement),this.#a(),Q("turbo:morph",{detail:{currentElement:this.currentElement,newElement:this.newElement}})}#t(e,t,r="outerHTML"){this.isMorphingTurboFrame=this.#l(e),Vd.morph(e,t,{morphStyle:r,callbacks:{beforeNodeAdded:this.#i,beforeNodeMorphed:this.#n,beforeAttributeUpdated:this.#s,beforeNodeRemoved:this.#o,afterNodeMorphed:this.#r}})}#i=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));#n=(e,t)=>{if(e instanceof HTMLElement)return!e.hasAttribute("data-turbo-permanent")&&(this.isMorphingTurboFrame||!this.#l(e))?!Q("turbo:before-morph-element",{cancelable:!0,target:e,detail:{newElement:t}}).defaultPrevented:!1};#s=(e,t,r)=>!Q("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:r}}).defaultPrevented;#r=(e,t)=>{t instanceof HTMLElement&&Q("turbo:morph-element",{target:e,detail:{newElement:t}})};#o=e=>this.#n(e);#a(){this.#d().forEach(e=>{this.#l(e)&&(this.#u(e),e.reload())})}#u(e){e.addEventListener("turbo:before-frame-render",t=>{t.detail.render=this.#h},{once:!0})}#h=(e,t)=>{Q("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),this.#t(e,t.children,"innerHTML")};#l(e){return e.src&&e.refresh==="morph"}#d(){return Array.from(document.querySelectorAll("turbo-frame[src]")).filter(e=>!e.closest("[data-turbo-permanent]"))}},Ys=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return ln(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[ln(e)]}write(e,t){this.snapshots[ln(e)]=t}touch(e){let t=ln(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},Zs=class extends pn{snapshotCache=new Ys(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,n){let o=this.isPageRefresh(n)&&this.snapshot.shouldMorphPage?Xs:pi,a=new o(this.snapshot,e,pi.renderElement,t,r);return a.shouldRender?n?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,t){t?.changeHistory();let r=new bn(this.snapshot,e,bn.renderElement,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await ll();let r=e.clone();return this.snapshotCache.put(t,r),r}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return De.fromElement(this.element)}},Qs=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new Lt(this,ke.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let r=await t.responseHTML,n=De.fromHTMLString(r);this.snapshotCache.put(e.url,n)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},Js=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){Qh("turbo-cache-control",e)}},eo=class{navigator=new js(this);history=new Vs(this);view=new Zs(this,document.documentElement);adapter=new Hs(this);pageObserver=new Us(this);cacheObserver=new qs;linkPrefetchObserver=new $s(this,document);linkClickObserver=new mn(this,window);formSubmitObserver=new Vi(this,document);scrollObserver=new Ws(this);streamObserver=new Gs(this);formLinkClickObserver=new gn(this,document.documentElement);frameRedirector=new zs(this,document.documentElement);streamMessageRenderer=new Ks;cache=new Js(this);drive=!0;enabled=!0;progressBarDelay=500;started=!1;formMode="on";#e=150;constructor(e){this.recentRequests=e,this.preloader=new Qs(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let r=t.frame?document.getElementById(t.frame):null;if(r instanceof qe){let n=t.action||xt(r);r.delegate.proposeVisitIfNavigatedWithAction(r,n),r.src=e.toString()}else this.navigator.proposeVisit(le(e),t)}refresh(e,t){t&&this.recentRequests.has(t)||this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(lt.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}setFormMode(e){this.formMode=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=id(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),n=e.getAttribute("data-turbo-frame"),s=n=="_top"?null:document.getElementById(n)||ci(e,"turbo-frame:not([disabled])");if(t||r||s instanceof qe)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&ot(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,r){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:r}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&ot(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&ot(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&ot(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){let r=this.getActionForLink(e),n=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:n})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){rl(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(hn(document.documentElement),this.view.markVisitDirection(e.direction)),rl(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),dn(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let r=so(e,t);return this.submissionIsNavigatable(e,t)&&ot(le(r),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(r)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,r){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,r).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,r){return Q("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return Q("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return Q("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return Q("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return Q("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return Q("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return Q("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return Q("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return Q("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(this.formMode=="off")return!1;{let r=t?this.elementIsNavigatable(t):!0;return this.formMode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=ci(e,"[data-turbo]"),r=ci(e,"turbo-frame");return this.drive||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return xt(e)||"advance"}get snapshot(){return this.view.snapshot}};function rl(i){Object.defineProperties(i,$d)}var $d={absoluteURL:{get(){return this.toString()}}},Z=new eo(ml),{cache:jd,navigator:Ud}=Z;function wl(){Z.start()}function Wd(i){Z.registerAdapter(i)}function Kd(i,e){Z.visit(i,e)}function El(i){Z.connectStreamSource(i)}function _l(i){Z.disconnectStreamSource(i)}function Gd(i){Z.renderStreamMessage(i)}function Xd(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Z.clearCache()}function Yd(i){Z.setProgressBarDelay(i)}function Zd(i){zi.confirmMethod=i}function Qd(i){Z.setFormMode(i)}var Jd=Object.freeze({__proto__:null,navigator:Ud,session:Z,cache:jd,PageRenderer:pi,PageSnapshot:De,FrameRenderer:ji,fetch:gl,start:wl,registerAdapter:Wd,visit:Kd,connectStreamSource:El,disconnectStreamSource:_l,renderStreamMessage:Gd,clearCache:Xd,setProgressBarDelay:Yd,setConfirmMethod:Zd,setFormMode:Qd}),to=class extends Error{},io=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#i=!1;#n=!1;#s=new Set;action=null;constructor(e){this.element=e,this.view=new Ps(this,this.element),this.appearanceObserver=new Rs(this,this.element),this.formLinkClickObserver=new gn(this,this.element),this.linkInterceptor=new fn(this,this.element),this.restorationIdentifier=at(),this.formSubmitObserver=new Vi(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==oi.lazy?this.appearanceObserver.start():this.#r(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#i&&(this.#i=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==oi.eager&&this.#r()}sourceURLChanged(){this.#v("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==oi.eager||this.#n)&&this.#r())}sourceURLReloaded(){let{src:e}=this.element;return this.element.removeAttribute("complete"),this.element.src=null,this.element.src=e,this.element.loaded}loadingStyleChanged(){this.loadingStyle==oi.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#a(le(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#n=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let r=cl(t);De.fromDocument(r).isVisitable?await this.#o(e,r):await this.#h(e)}}finally{this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,xt(e)),this.#r()}willSubmitFormLinkToLocation(e){return this.#p(e)}submittedFormLinkToLocation(e,t,r){let n=this.#c(e);n&&r.setAttribute("data-turbo-frame",n.id)}shouldInterceptLinkClick(e,t,r){return this.#p(e)}linkClickIntercepted(e,t){this.#u(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#p(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new zi(this,e,t);let{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(lt.contentType)}requestStarted(e){hn(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){dn(this.element)}formSubmissionStarted({formElement:e}){hn(e,this.#c(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#c(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,xt(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||Z.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),Z.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){dn(e,this.#c(e))}allowsImmediateRender({element:e},t){let r=Q("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){Z.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#o(e,t){let r=await this.extractForeignFrameElement(t.body);if(r){let n=new di(r),s=new ji(this,this.view.snapshot,n,ji.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(s),this.complete=!0,Z.frameRendered(e,this.element),Z.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#l(e)&&this.#d(e)}async#a(e){let t=new Lt(this,ke.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(r=>{this.#t=()=>{this.#t=()=>{},this.#e=null,r()},t.perform()})}#u(e,t,r){let n=this.#c(e,r);n.delegate.proposeVisitIfNavigatedWithAction(n,xt(r,e,n)),this.#y(e,()=>{n.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=De.fromElement(e).clone(),{visitCachedSnapshot:n}=e.delegate;e.delegate.fetchResponseLoaded=async s=>{if(e.src){let{statusCode:o,redirected:a}=s,l=await s.responseHTML,p={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:n,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(p.action=this.action),Z.visit(e.src,p)}}}}changeHistory(){if(this.action){let e=hl(this.action);Z.history.update(e,le(this.element.src||""),this.restorationIdentifier)}}async#h(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#f(e.response)}#l(e){this.element.setAttribute("complete","");let t=e.response,r=async(s,o)=>{s instanceof Response?this.#f(s):Z.visit(s,o)};return!Q("turbo:frame-missing",{target:this.element,detail:{response:t,visit:r},cancelable:!0}).defaultPrevented}#d(e){this.view.missing(),this.#m(e)}#m(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new to(t)}async#f(e){let t=new Hi(e),r=await t.responseHTML,{location:n,redirected:s,statusCode:o}=t;return Z.visit(n,{response:{redirected:s,statusCode:o,responseHTML:r}})}#c(e,t){let r=un("data-turbo-frame",t,e)||this.element.getAttribute("target");return nl(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=sl(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=sl(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(n){return console.error(n),new qe}return null}#g(e,t){let r=so(e,t);return ot(le(r),this.rootLocation)}#p(e,t){let r=un("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#g(e,t)||!this.enabled||r=="_top")return!1;if(r){let n=nl(r);if(n)return!n.disabled}return!(!Z.elementIsNavigatable(e)||t&&!Z.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#b("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#i}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return le(t)}#v(e){return this.#s.has(e)}#b(e,t){this.#s.add(e),t(),this.#s.delete(e)}#y(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function nl(i){if(i!=null){let e=document.getElementById(i);if(e instanceof qe)return e}}function sl(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&qh(t,e))throw new Error(`Matching <turbo-frame id="${i.id}"> element has a source URL which references itself`);if(i.ownerDocument!==document&&(i=document.importNode(i,!0)),i instanceof qe)return i.connectedCallback(),i.disconnectedCallback(),i}}var Al={after(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.append(this.templateContent))},before(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.prepend(this.templateContent))},remove(){this.targetElements.forEach(i=>i.remove())},replace(){this.targetElements.forEach(i=>i.replaceWith(this.templateContent))},update(){this.targetElements.forEach(i=>{i.innerHTML="",i.append(this.templateContent)})},refresh(){Z.refresh(this.baseURI,this.requestId)}},ro=class i extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await li(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),t=[...this.templateContent?.children||[]].filter(r=>!!r.id).map(r=>r.id);return e.filter(r=>t.includes(r.id))}get performAction(){if(this.action){let e=Al[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:i.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},no=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),El(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),_l(this.streamSource))}get src(){return this.getAttribute("src")||""}};qe.delegateConstructor=io;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",qe);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",ro);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",no);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(ul`
154
+ `}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,i.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,i.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=i.defaultCSS,this.cspNonce&&(e.nonce=this.cspNonce),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}get cspNonce(){return Zs("csp-nonce")}},$h=class extends Qs{detailsByOuterHTML=this.children.filter(e=>!_T(e)).map(e=>LT(e)).reduce((e,t)=>{let{outerHTML:r}=t,s=r in e?e[r]:{type:PT(t),tracked:CT(t),elements:[]};return{...e,[r]:{...s,elements:[...s.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(r=>!(r in t.detailsByOuterHTML)).map(r=>this.detailsByOuterHTML[r]).filter(({type:r})=>r==e).map(({elements:[r]})=>r)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:r,tracked:s,elements:n}=this.detailsByOuterHTML[t];return r==null&&!s?[...e,...n]:n.length>1?[...e,...n.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{let{elements:[s]}=this.detailsByOuterHTML[r];return RT(s,e)?s:t},void 0|void 0)}};function PT(i){if(FT(i))return"script";if(OT(i))return"stylesheet"}function CT(i){return i.getAttribute("data-turbo-track")=="reload"}function FT(i){return i.localName=="script"}function _T(i){return i.localName=="noscript"}function OT(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function RT(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function LT(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var pi=class i extends Qs{static fromHTMLString(e=""){return this.fromDocument(cv(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new $h(r))}constructor(e,t,r){super(t),this.documentElement=e,this.headSnapshot=r}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(let[s,n]of t.entries()){let o=r[s];for(let a of o.selectedOptions)a.selected=!1;for(let a of n.selectedOptions)o.options[a.index].selected=!0}for(let s of e.querySelectorAll('input[type="password"]'))s.value="";return new i(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return rt(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},qh=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},MT={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},yl={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Ji={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},Ys={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},IT={advance:"forward",restore:"back",replace:"none"},Vh=class{identifier=gr();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Ji.initialized;viewTransitioner=new qh;constructor(e,t,r,s={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||gr();let{action:n,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:c,response:d,visitCachedSnapshot:f,willRender:y,updateHistory:v,shouldCacheSnapshot:x,acceptsStreamResponse:P,direction:C}={...MT,...s};this.action=n,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=c,this.response=d,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=f,this.willRender=y,this.updateHistory=v,this.scrolled=!y,this.shouldCacheSnapshot=x,this.acceptsStreamResponse=P,this.direction=C||IT[n]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==Ji.initialized&&(this.recordTimingMetric(yl.visitStart),this.state=Ji.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Ji.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Ji.canceled)}complete(){this.state==Ji.started&&(this.recordTimingMetric(yl.visitEnd),this.adapter.visitCompleted(this),this.state=Ji.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Ji.started&&(this.state=Ji.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=hv(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new ps(this,Xt.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(yl.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;iv(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(yl.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,iv(e)&&t!=null){let r=pi.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(pi.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!hs(this.location)||e.hasAnchor(hs(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return pi.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(vr.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let r=await t.responseHTML,{redirected:s,statusCode:n}=t;r==null?this.recordResponse({statusCode:Ys.contentTypeMismatch,redirected:s}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:n,responseHTML:r,redirected:s}))}async requestFailedWithResponse(e,t){let r=await t.responseHTML,{redirected:s,statusCode:n}=t;r==null?this.recordResponse({statusCode:Ys.contentTypeMismatch,redirected:s}):this.recordResponse({statusCode:n,responseHTML:r,redirected:s})}requestErrored(e,t){this.recordResponse({statusCode:Ys.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=hs(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),this.frame=await Ks(),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function iv(i){return i>=200&&i<300}var jh=class{progressBar=new Hh;constructor(e){this.session=e}visitProposedToLocation(e,t){mr(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||gr(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case Ys.networkFailure:case Ys.timeoutFailure:case Ys.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){Le("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},Wh=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},Gh=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new xl(this,t),this.formSubmitObserver=new _o(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,r){return this.#t(e)}linkClickIntercepted(e,t,r){let s=this.#i(e);s&&s.delegate.linkClickIntercepted(e,t,r)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let r=this.#i(e,t);r&&r.delegate.formSubmitted(e,t)}#e(e,t){let r=hd(e,t),s=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),n=rt(s?.content??"/");return this.#t(e,t)&&mr(r,n)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let s=this.#i(e,t);return s?s!=e.closest("turbo-frame"):!1}else return!1}#i(e,t){let r=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(r&&r!="_top"){let s=this.element.querySelector(`#${r}:not([disabled])`);if(s instanceof Ai)return s}}},Kh=class{location;restorationIdentifier=gr();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,r=gr()){e===history.pushState&&++this.currentIndex;let s={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,s,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,r=this.restorationData[t];this.restorationData[t]={...r,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:r,restorationIndex:s}=t;this.restorationIdentifier=r;let n=s>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,n),this.currentIndex=s}}};onPageLoad=async e=>{await JE(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},Xh=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#s,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#n,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#s,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#n,!0),this.started=!0};#i=e=>{if(Zs("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#c(t)){let s=t,n=fv(s);if(this.delegate.canPrefetchRequestToLocation(s,n)){this.#e=s;let o=new ps(this,Xt.get,n,new URLSearchParams,t);Gs.setLater(n.toString(),o,this.#a)}}};#s=e=>{e.target===this.#e&&this.#r()};#r=()=>{Gs.clear(),this.#e=null};#n=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="get"){let t=Gs.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),Gs.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let r=t.closest("turbo-frame"),s=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;s&&s!=="_top"&&(e.headers["Turbo-Frame"]=s)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#a(){return Number(Zs("turbo-prefetch-cache-time"))||fT}#c(e){return!(!e.getAttribute("href")||DT(e)||NT(e)||BT(e)||UT(e)||HT(e))}},DT=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),NT=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),BT=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=Xs(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},UT=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||zT(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},zT=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),HT=i=>Le("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,Yh=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,r={}){this.stop(),this.currentVisit=new Vh(this,rt(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new Fo(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let r=await t.responseHTML;if(r){let s=e.isSafe;s||this.view.clearSnapshotCache();let{statusCode:n,redirected:o}=t,l={action:this.#e(e,t),shouldCacheSnapshot:s,response:{statusCode:n,responseHTML:r,redirected:o}};this.proposeVisit(t.location,l)}}}async formSubmissionFailedWithResponse(e,t){let r=await t.responseHTML;if(r){let s=pi.fromHTMLString(r);t.serverError?await this.view.renderError(s,this.currentVisit):await this.view.renderPage(s,!1,!0,this.currentVisit),s.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let r=hs(e),s=hs(this.view.lastRenderedLocation),n=t==="restore"&&typeof r>"u";return t!=="replace"&&Dh(e)===Dh(this.view.lastRenderedLocation)&&(n||r!=null&&r!==s)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:r,formElement:s}=e;return ds(r,s)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},cs={initial:0,loading:1,interactive:2,complete:3},Zh=class{stage=cs.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==cs.initial&&(this.stage=cs.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==cs.loading&&(this.stage=cs.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==cs.interactive&&(this.stage=cs.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},Qh=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},Jh=class{render({fragment:e}){Pl.preservingPermanentElements(this,$T(e),()=>{qT(e,()=>{VT(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function $T(i){let e=yv(document.documentElement),t={};for(let r of e){let{id:s}=r;for(let n of i.querySelectorAll("turbo-stream")){let o=bv(n.templateElement.content,s);o&&(t[s]=[r,o])}}return t}async function qT(i,e){let t=`turbo-stream-autofocus-${gr()}`,r=i.querySelectorAll("turbo-stream"),s=jT(r),n=null;if(s&&(s.id?n=s.id:n=t,s.id=n),e(),await Ks(),(document.activeElement==null||document.activeElement==document.body)&&n){let a=document.getElementById(n);dd(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function VT(i){let[e,t]=await nT(i,()=>document.activeElement),r=e&&e.id;if(r){let s=document.getElementById(r);dd(s)&&s!=t&&s.focus()}}function jT(i){for(let e of i){let t=pv(e.templateElement.content);if(t)return t}return null}var ed=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=WT(e);t&&GT(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(vr.wrap(e))}};function WT(i){let e=i.detail?.fetchResponse;if(e instanceof Po)return e}function GT(i){return(i.contentType??"").startsWith(vr.contentType)}var Cl=class extends Oo{static renderElement(e,t){let{documentElement:r,body:s}=document;r.replaceChild(t,s)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let r=Co(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},KT=function(){let i=new Set,e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:y,afterNodeAdded:y,beforeNodeMorphed:y,afterNodeMorphed:y,beforeNodeRemoved:y,afterNodeRemoved:y,beforeAttributeUpdated:y},head:{style:"merge",shouldPreserve:function(T){return T.getAttribute("im-preserve")==="true"},shouldReAppend:function(T){return T.getAttribute("im-re-append")==="true"},shouldRemove:y,afterHeadMorphed:y}};function t(T,A,k={}){T instanceof Document&&(T=T.documentElement),typeof A=="string"&&(A=M(A));let $=H(A),j=x(T,$,k);return r(T,$,j)}function r(T,A,k){if(k.head.block){let $=T.querySelector("head"),j=A.querySelector("head");if($&&j){let z=f(j,$,k);Promise.all(z).then(function(){r(T,A,Object.assign(k,{head:{block:!1,ignore:!0}}))});return}}if(k.morphStyle==="innerHTML")return o(A,T,k),T.children;if(k.morphStyle==="outerHTML"||k.morphStyle==null){let $=G(A,T,k),j=$?.previousSibling,z=$?.nextSibling,J=n(T,$,k);return $?R(j,J,z):[]}else throw"Do not understand how to morph style "+k.morphStyle}function s(T,A){return A.ignoreActiveValue&&T===document.activeElement&&T!==document.body}function n(T,A,k){if(!(k.ignoreActive&&T===document.activeElement))return A==null?k.callbacks.beforeNodeRemoved(T)===!1?T:(T.remove(),k.callbacks.afterNodeRemoved(T),null):C(T,A)?(k.callbacks.beforeNodeMorphed(T,A)===!1||(T instanceof HTMLHeadElement&&k.head.ignore||(T instanceof HTMLHeadElement&&k.head.style!=="morph"?f(A,T,k):(l(A,T,k),s(T,k)||o(A,T,k))),k.callbacks.afterNodeMorphed(T,A)),T):k.callbacks.beforeNodeRemoved(T)===!1||k.callbacks.beforeNodeAdded(A)===!1?T:(T.parentElement.replaceChild(A,T),k.callbacks.afterNodeAdded(A),k.callbacks.afterNodeRemoved(T),A)}function o(T,A,k){let $=T.firstChild,j=A.firstChild,z;for(;$;){if(z=$,$=z.nextSibling,j==null){if(k.callbacks.beforeNodeAdded(z)===!1)return;A.appendChild(z),k.callbacks.afterNodeAdded(z),oe(k,z);continue}if(P(z,j,k)){n(j,z,k),j=j.nextSibling,oe(k,z);continue}let J=D(T,A,z,j,k);if(J){j=I(j,J,k),n(J,z,k),oe(k,z);continue}let ee=q(T,A,z,j,k);if(ee){j=I(j,ee,k),n(ee,z,k),oe(k,z);continue}if(k.callbacks.beforeNodeAdded(z)===!1)return;A.insertBefore(z,j),k.callbacks.afterNodeAdded(z),oe(k,z)}for(;j!==null;){let J=j;j=j.nextSibling,Y(J,k)}}function a(T,A,k,$){return T==="value"&&$.ignoreActiveValue&&A===document.activeElement?!0:$.callbacks.beforeAttributeUpdated(T,A,k)===!1}function l(T,A,k){let $=T.nodeType;if($===1){let j=T.attributes,z=A.attributes;for(let J of j)a(J.name,A,"update",k)||A.getAttribute(J.name)!==J.value&&A.setAttribute(J.name,J.value);for(let J=z.length-1;0<=J;J--){let ee=z[J];a(ee.name,A,"remove",k)||T.hasAttribute(ee.name)||A.removeAttribute(ee.name)}}($===8||$===3)&&A.nodeValue!==T.nodeValue&&(A.nodeValue=T.nodeValue),s(A,k)||d(T,A,k)}function c(T,A,k,$){if(T[k]!==A[k]){let j=a(k,A,"update",$);j||(A[k]=T[k]),T[k]?j||A.setAttribute(k,T[k]):a(k,A,"remove",$)||A.removeAttribute(k)}}function d(T,A,k){if(T instanceof HTMLInputElement&&A instanceof HTMLInputElement&&T.type!=="file"){let $=T.value,j=A.value;c(T,A,"checked",k),c(T,A,"disabled",k),T.hasAttribute("value")?$!==j&&(a("value",A,"update",k)||(A.setAttribute("value",$),A.value=$)):a("value",A,"remove",k)||(A.value="",A.removeAttribute("value"))}else if(T instanceof HTMLOptionElement)c(T,A,"selected",k);else if(T instanceof HTMLTextAreaElement&&A instanceof HTMLTextAreaElement){let $=T.value,j=A.value;if(a("value",A,"update",k))return;$!==j&&(A.value=$),A.firstChild&&A.firstChild.nodeValue!==$&&(A.firstChild.nodeValue=$)}}function f(T,A,k){let $=[],j=[],z=[],J=[],ee=k.head.style,ke=new Map;for(let ce of T.children)ke.set(ce.outerHTML,ce);for(let ce of A.children){let Me=ke.has(ce.outerHTML),Ne=k.head.shouldReAppend(ce),He=k.head.shouldPreserve(ce);Me||He?Ne?j.push(ce):(ke.delete(ce.outerHTML),z.push(ce)):ee==="append"?Ne&&(j.push(ce),J.push(ce)):k.head.shouldRemove(ce)!==!1&&j.push(ce)}J.push(...ke.values());let se=[];for(let ce of J){let Me=document.createRange().createContextualFragment(ce.outerHTML).firstChild;if(k.callbacks.beforeNodeAdded(Me)!==!1){if(Me.href||Me.src){let Ne=null,He=new Promise(function(fi){Ne=fi});Me.addEventListener("load",function(){Ne()}),se.push(He)}A.appendChild(Me),k.callbacks.afterNodeAdded(Me),$.push(Me)}}for(let ce of j)k.callbacks.beforeNodeRemoved(ce)!==!1&&(A.removeChild(ce),k.callbacks.afterNodeRemoved(ce));return k.head.afterHeadMorphed(A,{added:$,kept:z,removed:j}),se}function y(){}function v(T){let A={};return Object.assign(A,e),Object.assign(A,T),A.callbacks={},Object.assign(A.callbacks,e.callbacks),Object.assign(A.callbacks,T.callbacks),A.head={},Object.assign(A.head,e.head),Object.assign(A.head,T.head),A}function x(T,A,k){return k=v(k),{target:T,newContent:A,config:k,morphStyle:k.morphStyle,ignoreActive:k.ignoreActive,ignoreActiveValue:k.ignoreActiveValue,idMap:We(T,A),deadIds:new Set,callbacks:k.callbacks,head:k.head}}function P(T,A,k){return T==null||A==null?!1:T.nodeType===A.nodeType&&T.tagName===A.tagName?T.id!==""&&T.id===A.id?!0:le(k,T,A)>0:!1}function C(T,A){return T==null||A==null?!1:T.nodeType===A.nodeType&&T.tagName===A.tagName}function I(T,A,k){for(;T!==A;){let $=T;T=T.nextSibling,Y($,k)}return oe(k,A),A.nextSibling}function D(T,A,k,$,j){let z=le(j,k,A),J=null;if(z>0){let ee=$,ke=0;for(;ee!=null;){if(P(k,ee,j))return ee;if(ke+=le(j,ee,T),ke>z)return null;ee=ee.nextSibling}}return J}function q(T,A,k,$,j){let z=$,J=k.nextSibling,ee=0;for(;z!=null;){if(le(j,z,T)>0)return null;if(C(k,z))return z;if(C(J,z)&&(ee++,J=J.nextSibling,ee>=2))return null;z=z.nextSibling}return z}function M(T){let A=new DOMParser,k=T.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(k.match(/<\/html>/)||k.match(/<\/head>/)||k.match(/<\/body>/)){let $=A.parseFromString(T,"text/html");if(k.match(/<\/html>/))return $.generatedByIdiomorph=!0,$;{let j=$.firstChild;return j?(j.generatedByIdiomorph=!0,j):null}}else{let j=A.parseFromString("<body><template>"+T+"</template></body>","text/html").body.querySelector("template").content;return j.generatedByIdiomorph=!0,j}}function H(T){if(T==null)return document.createElement("div");if(T.generatedByIdiomorph)return T;if(T instanceof Node){let A=document.createElement("div");return A.append(T),A}else{let A=document.createElement("div");for(let k of[...T])A.append(k);return A}}function R(T,A,k){let $=[],j=[];for(;T!=null;)$.push(T),T=T.previousSibling;for(;$.length>0;){let z=$.pop();j.push(z),A.parentElement.insertBefore(z,A)}for(j.push(A);k!=null;)$.push(k),j.push(k),k=k.nextSibling;for(;$.length>0;)A.parentElement.insertBefore($.pop(),A.nextSibling);return j}function G(T,A,k){let $;$=T.firstChild;let j=$,z=0;for(;$;){let J=K($,A,k);J>z&&(j=$,z=J),$=$.nextSibling}return j}function K(T,A,k){return C(T,A)?.5+le(k,T,A):0}function Y(T,A){oe(A,T),A.callbacks.beforeNodeRemoved(T)!==!1&&(T.remove(),A.callbacks.afterNodeRemoved(T))}function ie(T,A){return!T.deadIds.has(A)}function Q(T,A,k){return(T.idMap.get(k)||i).has(A)}function oe(T,A){let k=T.idMap.get(A)||i;for(let $ of k)T.deadIds.add($)}function le(T,A,k){let $=T.idMap.get(A)||i,j=0;for(let z of $)ie(T,z)&&Q(T,z,k)&&++j;return j}function Ae(T,A){let k=T.parentElement,$=T.querySelectorAll("[id]");for(let j of $){let z=j;for(;z!==k&&z!=null;){let J=A.get(z);J==null&&(J=new Set,A.set(z,J)),J.add(j.id),z=z.parentElement}}}function We(T,A){let k=new Map;return Ae(T,k),Ae(A,k),k}return{morph:t,defaults:e}}(),Js=class extends Oo{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(iT(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(Co(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[r,s]of t.entries()){if(e.tagName=="TITLE"){if(s.tagName!="TITLE")continue;if(e.innerHTML==s.innerHTML)return t.splice(r,1),!0}if(s.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=Co(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},td=class extends Js{async render(){this.willRender&&await this.#e()}get renderMethod(){return"morph"}async#e(){this.#t(this.currentElement,this.newElement),this.#c(),Le("turbo:morph",{detail:{currentElement:this.currentElement,newElement:this.newElement}})}#t(e,t,r="outerHTML"){this.isMorphingTurboFrame=this.#o(e),KT.morph(e,t,{morphStyle:r,callbacks:{beforeNodeAdded:this.#i,beforeNodeMorphed:this.#s,beforeAttributeUpdated:this.#r,beforeNodeRemoved:this.#a,afterNodeMorphed:this.#n}})}#i=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));#s=(e,t)=>{if(e instanceof HTMLElement)return!e.hasAttribute("data-turbo-permanent")&&(this.isMorphingTurboFrame||!this.#o(e))?!Le("turbo:before-morph-element",{cancelable:!0,target:e,detail:{newElement:t}}).defaultPrevented:!1};#r=(e,t,r)=>!Le("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:r}}).defaultPrevented;#n=(e,t)=>{t instanceof HTMLElement&&Le("turbo:morph-element",{target:e,detail:{newElement:t}})};#a=e=>this.#s(e);#c(){this.#d().forEach(e=>{this.#o(e)&&(this.#l(e),e.reload())})}#l(e){e.addEventListener("turbo:before-frame-render",t=>{t.detail.render=this.#u},{once:!0})}#u=(e,t)=>{Le("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),this.#t(e,t.children,"innerHTML")};#o(e){return e.src&&e.refresh==="morph"}#d(){return Array.from(document.querySelectorAll("turbo-frame[src]")).filter(e=>!e.closest("[data-turbo-permanent]"))}},id=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return bl(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[bl(e)]}write(e,t){this.snapshots[bl(e)]=t}touch(e){let t=bl(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},rd=class extends Tl{snapshotCache=new id(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,s){let o=this.isPageRefresh(s)&&this.snapshot.shouldMorphPage?td:Js,a=new o(this.snapshot,e,Js.renderElement,t,r);return a.shouldRender?s?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,t){t?.changeHistory();let r=new Cl(this.snapshot,e,Cl.renderElement,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await lv();let r=e.clone();return this.snapshotCache.put(t,r),r}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return pi.fromElement(this.element)}},sd=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new ps(this,Xt.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let r=await t.responseHTML,s=pi.fromHTMLString(r);this.snapshotCache.put(e.url,s)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},nd=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){sT("turbo-cache-control",e)}},od=class{navigator=new Yh(this);history=new Kh(this);view=new rd(this,document.documentElement);adapter=new jh(this);pageObserver=new Zh(this);cacheObserver=new Wh;linkPrefetchObserver=new Xh(this,document);linkClickObserver=new Al(this,window);formSubmitObserver=new _o(this,document);scrollObserver=new Qh(this);streamObserver=new ed(this);formLinkClickObserver=new kl(this,document.documentElement);frameRedirector=new Gh(this,document.documentElement);streamMessageRenderer=new Jh;cache=new nd(this);drive=!0;enabled=!0;progressBarDelay=500;started=!1;formMode="on";#e=150;constructor(e){this.recentRequests=e,this.preloader=new sd(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let r=t.frame?document.getElementById(t.frame):null;if(r instanceof Ai){let s=t.action||ds(r);r.delegate.proposeVisitIfNavigatedWithAction(r,s),r.src=e.toString()}else this.navigator.proposeVisit(rt(e),t)}refresh(e,t){t&&this.recentRequests.has(t)||this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(vr.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}setFormMode(e){this.formMode=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=lT(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),s=e.getAttribute("data-turbo-frame"),n=s=="_top"?null:document.getElementById(s)||Xs(e,"turbo-frame:not([disabled])");if(t||r||n instanceof Ai)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&mr(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,r){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:r}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&mr(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&mr(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&mr(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){let r=this.getActionForLink(e),s=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:s})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){rv(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(Sl(document.documentElement),this.view.markVisitDirection(e.direction)),rv(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),El(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let r=hd(e,t);return this.submissionIsNavigatable(e,t)&&mr(rt(r),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:s,detail:{render:n}}=r;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!s}viewRenderedSnapshot(e,t,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(r)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,r){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,r).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,r){return Le("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return Le("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return Le("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return Le("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return Le("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return Le("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return Le("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return Le("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return Le("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(this.formMode=="off")return!1;{let r=t?this.elementIsNavigatable(t):!0;return this.formMode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=Xs(e,"[data-turbo]"),r=Xs(e,"turbo-frame");return this.drive||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return ds(e)||"advance"}get snapshot(){return this.view.snapshot}};function rv(i){Object.defineProperties(i,XT)}var XT={absoluteURL:{get(){return this.toString()}}},Re=new od(mv),{cache:YT,navigator:ZT}=Re;function wv(){Re.start()}function QT(i){Re.registerAdapter(i)}function JT(i,e){Re.visit(i,e)}function Sv(i){Re.connectStreamSource(i)}function Ev(i){Re.disconnectStreamSource(i)}function ex(i){Re.renderStreamMessage(i)}function tx(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Re.clearCache()}function ix(i){Re.setProgressBarDelay(i)}function rx(i){Fo.confirmMethod=i}function sx(i){Re.setFormMode(i)}var nx=Object.freeze({__proto__:null,navigator:ZT,session:Re,cache:YT,PageRenderer:Js,PageSnapshot:pi,FrameRenderer:Ro,fetch:gv,start:wv,registerAdapter:QT,visit:JT,connectStreamSource:Sv,disconnectStreamSource:Ev,renderStreamMessage:ex,clearCache:tx,setProgressBarDelay:ix,setConfirmMethod:rx,setFormMode:sx}),ad=class extends Error{},ld=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#i=!1;#s=!1;#r=new Set;action=null;constructor(e){this.element=e,this.view=new zh(this,this.element),this.appearanceObserver=new Bh(this,this.element),this.formLinkClickObserver=new kl(this,this.element),this.linkInterceptor=new xl(this,this.element),this.restorationIdentifier=gr(),this.formSubmitObserver=new _o(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==Ws.lazy?this.appearanceObserver.start():this.#n(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#i&&(this.#i=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==Ws.eager&&this.#n()}sourceURLChanged(){this.#b("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==Ws.eager||this.#s)&&this.#n())}sourceURLReloaded(){let{src:e}=this.element;return this.element.removeAttribute("complete"),this.element.src=null,this.element.src=e,this.element.loaded}loadingStyleChanged(){this.loadingStyle==Ws.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#n())}async#n(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#c(rt(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#s=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let r=cv(t);pi.fromDocument(r).isVisitable?await this.#a(e,r):await this.#u(e)}}finally{this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,ds(e)),this.#n()}willSubmitFormLinkToLocation(e){return this.#m(e)}submittedFormLinkToLocation(e,t,r){let s=this.#p(e);s&&r.setAttribute("data-turbo-frame",s.id)}shouldInterceptLinkClick(e,t,r){return this.#m(e)}linkClickIntercepted(e,t){this.#l(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#m(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new Fo(this,e,t);let{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(vr.contentType)}requestStarted(e){Sl(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){El(this.element)}formSubmissionStarted({formElement:e}){Sl(e,this.#p(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#p(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,ds(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||Re.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),Re.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){El(e,this.#p(e))}allowsImmediateRender({element:e},t){let r=Le("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:s,detail:{render:n}}=r;return this.view.renderer&&n&&(this.view.renderer.renderElement=n),!s}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){Re.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#a(e,t){let r=await this.extractForeignFrameElement(t.body);if(r){let s=new Qs(r),n=new Ro(this,this.view.snapshot,s,Ro.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(n),this.complete=!0,Re.frameRendered(e,this.element),Re.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#o(e)&&this.#d(e)}async#c(e){let t=new ps(this,Xt.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(r=>{this.#t=()=>{this.#t=()=>{},this.#e=null,r()},t.perform()})}#l(e,t,r){let s=this.#p(e,r);s.delegate.proposeVisitIfNavigatedWithAction(s,ds(r,e,s)),this.#g(e,()=>{s.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=pi.fromElement(e).clone(),{visitCachedSnapshot:s}=e.delegate;e.delegate.fetchResponseLoaded=async n=>{if(e.src){let{statusCode:o,redirected:a}=n,l=await n.responseHTML,d={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:s,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(d.action=this.action),Re.visit(e.src,d)}}}}changeHistory(){if(this.action){let e=hv(this.action);Re.history.update(e,rt(this.element.src||""),this.restorationIdentifier)}}async#u(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#f(e.response)}#o(e){this.element.setAttribute("complete","");let t=e.response,r=async(n,o)=>{n instanceof Response?this.#f(n):Re.visit(n,o)};return!Le("turbo:frame-missing",{target:this.element,detail:{response:t,visit:r},cancelable:!0}).defaultPrevented}#d(e){this.view.missing(),this.#h(e)}#h(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new ad(t)}async#f(e){let t=new Po(e),r=await t.responseHTML,{location:s,redirected:n,statusCode:o}=t;return Re.visit(s,{response:{redirected:n,statusCode:o,responseHTML:r}})}#p(e,t){let r=wl("data-turbo-frame",t,e)||this.element.getAttribute("target");return sv(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=nv(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=nv(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(s){return console.error(s),new Ai}return null}#v(e,t){let r=hd(e,t);return mr(rt(r),this.rootLocation)}#m(e,t){let r=wl("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#v(e,t)||!this.enabled||r=="_top")return!1;if(r){let s=sv(r);if(s)return!s.disabled}return!(!Re.elementIsNavigatable(e)||t&&!Re.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#y("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#i}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return rt(t)}#b(e){return this.#r.has(e)}#y(e,t){this.#r.add(e),t(),this.#r.delete(e)}#g(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function sv(i){if(i!=null){let e=document.getElementById(i);if(e instanceof Ai)return e}}function nv(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&WE(t,e))throw new Error(`Matching <turbo-frame id="${i.id}"> element has a source URL which references itself`);if(i.ownerDocument!==document&&(i=document.importNode(i,!0)),i instanceof Ai)return i.connectedCallback(),i.disconnectedCallback(),i}}var Tv={after(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.append(this.templateContent))},before(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.prepend(this.templateContent))},remove(){this.targetElements.forEach(i=>i.remove())},replace(){this.targetElements.forEach(i=>i.replaceWith(this.templateContent))},update(){this.targetElements.forEach(i=>{i.innerHTML="",i.append(this.templateContent)})},refresh(){Re.refresh(this.baseURI,this.requestId)}},cd=class i extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await Ks(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),t=[...this.templateContent?.children||[]].filter(r=>!!r.id).map(r=>r.id);return e.filter(r=>t.includes(r.id))}get performAction(){if(this.action){let e=Tv[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:i.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},ud=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),Sv(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Ev(this.streamSource))}get src(){return this.getAttribute("src")||""}};Ai.delegateConstructor=ld;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",Ai);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",cd);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",ud);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(uv`
78
155
  You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
79
156
 
80
157
  Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
@@ -83,12 +160,45 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
83
160
 
84
161
  ——
85
162
  Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
86
- `,i.outerHTML);i=i.parentElement}})();window.Turbo={...Jd,StreamActions:Al};wl();["turbo:click","turbo:before-visit","turbo:visit","turbo:submit-start","turbo:before-fetch-request","turbo:before-fetch-response","turbo:submit-end","turbo:before-cache","turbo:before-render","turbo:before-stream-render","turbo:render","turbo:load","turbo:before-frame-render","turbo:frame-render","turbo:frame-load","turbo:frame-missing","turbo:fetch-request-error","turbo:reload","turbo:morph","turbo:before-morph-element","turbo:morph-attribute","turbo:morph"].forEach(i=>{document.addEventListener(i,e=>{console.log(e.type,e)})});var ep=ir.start();Cs(ep);})();
163
+ `,i.outerHTML);i=i.parentElement}})();window.Turbo={...nx,StreamActions:Tv};wv();["turbo:click","turbo:before-visit","turbo:visit","turbo:submit-start","turbo:before-fetch-request","turbo:before-fetch-response","turbo:submit-end","turbo:before-cache","turbo:before-render","turbo:before-stream-render","turbo:render","turbo:load","turbo:before-frame-render","turbo:frame-render","turbo:frame-load","turbo:frame-missing","turbo:fetch-request-error","turbo:reload","turbo:morph","turbo:before-morph-element","turbo:morph-attribute","turbo:morph"].forEach(i=>{document.addEventListener(i,e=>{console.log(e.type,e)})});var ox=jo.start();Ih(ox);})();
164
+ /*!
165
+ * Sanitize an HTML node
166
+ */
87
167
  /*! Bundled license information:
88
168
 
169
+ classnames/index.js:
170
+ (*!
171
+ Copyright (c) 2018 Jed Watson.
172
+ Licensed under the MIT License (MIT), see
173
+ http://jedwatson.github.io/classnames
174
+ *)
175
+
176
+ cropperjs/dist/cropper.js:
177
+ (*!
178
+ * Cropper.js v1.6.2
179
+ * https://fengyuanchen.github.io/cropperjs
180
+ *
181
+ * Copyright 2015-present Chen Fengyuan
182
+ * Released under the MIT license
183
+ *
184
+ * Date: 2024-04-21T07:43:05.335Z
185
+ *)
186
+
89
187
  dompurify/dist/purify.es.mjs:
90
188
  (*! @license DOMPurify 3.2.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.2/LICENSE *)
91
189
 
190
+ @uppy/utils/lib/Translator.js:
191
+ (**
192
+ * Takes a string with placeholder variables like `%{smart_count} file selected`
193
+ * and replaces it with values from options `{smart_count: 5}`
194
+ *
195
+ * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
196
+ * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
197
+ *
198
+ * @param phrase that needs interpolation, with placeholders
199
+ * @param options with values that will be used to replace placeholders
200
+ *)
201
+
92
202
  @hotwired/turbo/dist/turbo.es2017-esm.js:
93
203
  (*!
94
204
  Turbo 8.0.4