@romansmirnov/doku 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +113 -0
- package/bin/doku.js +32 -0
- package/bin/init.js +71 -0
- package/client/src/lib/utils.js +4 -0
- package/dist/assets/index-Bq96uZdY.css +1 -0
- package/dist/assets/index-DP3uLjsR.js +196 -0
- package/dist/assets/inter-v12-latin-100-46Mq0mOp.woff +0 -0
- package/dist/assets/inter-v12-latin-100-BQDzDElq.woff2 +0 -0
- package/dist/assets/inter-v12-latin-200-BxfrU12A.woff2 +0 -0
- package/dist/assets/inter-v12-latin-200-DXfqWPZg.woff +0 -0
- package/dist/assets/inter-v12-latin-300-DEbyFmpd.woff2 +0 -0
- package/dist/assets/inter-v12-latin-300-f7r92Nkj.woff +0 -0
- package/dist/assets/inter-v12-latin-500-BQ2gQN_M.woff +0 -0
- package/dist/assets/inter-v12-latin-500-DfX5FI9E.woff2 +0 -0
- package/dist/assets/inter-v12-latin-600-BvOeHRLc.woff2 +0 -0
- package/dist/assets/inter-v12-latin-600-D01NXWOK.woff +0 -0
- package/dist/assets/inter-v12-latin-700-B5TOIllR.woff +0 -0
- package/dist/assets/inter-v12-latin-700-Bj1B9WKG.woff2 +0 -0
- package/dist/assets/inter-v12-latin-800-Bdy4lAMa.woff2 +0 -0
- package/dist/assets/inter-v12-latin-800-DFVvDWwT.woff +0 -0
- package/dist/assets/inter-v12-latin-900-CMga-52B.woff2 +0 -0
- package/dist/assets/inter-v12-latin-900-ORHAl5ZU.woff +0 -0
- package/dist/assets/inter-v12-latin-regular-CahmJf_6.woff +0 -0
- package/dist/assets/inter-v12-latin-regular-YtgfLPRn.woff2 +0 -0
- package/dist/assets/module-CFHRyJc-.js +716 -0
- package/dist/assets/native-CUze18dq.js +1 -0
- package/dist/index.html +13 -0
- package/icons/LICENSE +21 -0
- package/icons/README.md +31 -0
- package/icons/icons/a-arrow-down.tsx +119 -0
- package/icons/icons/a-arrow-up.tsx +120 -0
- package/icons/icons/accessibility.tsx +172 -0
- package/icons/icons/activity.tsx +109 -0
- package/icons/icons/air-vent.tsx +119 -0
- package/icons/icons/airplane.tsx +134 -0
- package/icons/icons/airplay.tsx +130 -0
- package/icons/icons/alarm-clock.tsx +178 -0
- package/icons/icons/align-center.tsx +98 -0
- package/icons/icons/align-horizontal.tsx +126 -0
- package/icons/icons/align-left.tsx +126 -0
- package/icons/icons/align-right.tsx +126 -0
- package/icons/icons/align-vertical.tsx +126 -0
- package/icons/icons/ambulance.tsx +205 -0
- package/icons/icons/angry.tsx +165 -0
- package/icons/icons/annoyed.tsx +163 -0
- package/icons/icons/archive.tsx +132 -0
- package/icons/icons/arrow-big-down-dash.tsx +107 -0
- package/icons/icons/arrow-big-down.tsx +97 -0
- package/icons/icons/arrow-big-left-dash.tsx +107 -0
- package/icons/icons/arrow-big-left.tsx +97 -0
- package/icons/icons/arrow-big-right-dash.tsx +107 -0
- package/icons/icons/arrow-big-right.tsx +97 -0
- package/icons/icons/arrow-big-up-dash.tsx +107 -0
- package/icons/icons/arrow-big-up.tsx +96 -0
- package/icons/icons/arrow-down-0-1.tsx +120 -0
- package/icons/icons/arrow-down-1-0.tsx +120 -0
- package/icons/icons/arrow-down-a-z.tsx +116 -0
- package/icons/icons/arrow-down-left.tsx +113 -0
- package/icons/icons/arrow-down-right.tsx +117 -0
- package/icons/icons/arrow-down-z-a.tsx +116 -0
- package/icons/icons/arrow-down.tsx +112 -0
- package/icons/icons/arrow-left.tsx +112 -0
- package/icons/icons/arrow-right.tsx +112 -0
- package/icons/icons/arrow-up-left.tsx +98 -0
- package/icons/icons/arrow-up-right.tsx +99 -0
- package/icons/icons/arrow-up.tsx +112 -0
- package/icons/icons/at-sign.tsx +135 -0
- package/icons/icons/atom.tsx +124 -0
- package/icons/icons/attach-file.tsx +100 -0
- package/icons/icons/audio-lines.tsx +138 -0
- package/icons/icons/axe.tsx +104 -0
- package/icons/icons/badge-alert.tsx +98 -0
- package/icons/icons/badge-percent.tsx +111 -0
- package/icons/icons/ban.tsx +137 -0
- package/icons/icons/banana.tsx +115 -0
- package/icons/icons/battery-charging.tsx +101 -0
- package/icons/icons/battery-full.tsx +136 -0
- package/icons/icons/battery-low.tsx +116 -0
- package/icons/icons/battery-medium.tsx +127 -0
- package/icons/icons/battery-plus.tsx +102 -0
- package/icons/icons/battery-warning.tsx +104 -0
- package/icons/icons/battery.tsx +100 -0
- package/icons/icons/bell-electric.tsx +124 -0
- package/icons/icons/bell.tsx +93 -0
- package/icons/icons/blocks.tsx +92 -0
- package/icons/icons/bluetooth-connected.tsx +136 -0
- package/icons/icons/bluetooth-off.tsx +124 -0
- package/icons/icons/bluetooth-searching.tsx +128 -0
- package/icons/icons/bluetooth.tsx +99 -0
- package/icons/icons/bold.tsx +95 -0
- package/icons/icons/bone.tsx +98 -0
- package/icons/icons/book-text.tsx +101 -0
- package/icons/icons/bookmark-check.tsx +120 -0
- package/icons/icons/bookmark-minus.tsx +123 -0
- package/icons/icons/bookmark-plus.tsx +137 -0
- package/icons/icons/bookmark-x.tsx +131 -0
- package/icons/icons/bookmark.tsx +98 -0
- package/icons/icons/bot-message-square.tsx +172 -0
- package/icons/icons/bot.tsx +122 -0
- package/icons/icons/box.tsx +117 -0
- package/icons/icons/boxes.tsx +105 -0
- package/icons/icons/brain.tsx +192 -0
- package/icons/icons/calendar-check-2.tsx +111 -0
- package/icons/icons/calendar-check.tsx +111 -0
- package/icons/icons/calendar-cog.tsx +105 -0
- package/icons/icons/calendar-days.tsx +127 -0
- package/icons/icons/cart.tsx +97 -0
- package/icons/icons/cast.tsx +113 -0
- package/icons/icons/cctv.tsx +125 -0
- package/icons/icons/chart-bar-decreasing.tsx +129 -0
- package/icons/icons/chart-bar-increasing.tsx +129 -0
- package/icons/icons/chart-column-decreasing.tsx +130 -0
- package/icons/icons/chart-column-increasing.tsx +130 -0
- package/icons/icons/chart-line.tsx +103 -0
- package/icons/icons/chart-no-axes-column-decreasing.tsx +129 -0
- package/icons/icons/chart-no-axes-column-increasing.tsx +129 -0
- package/icons/icons/chart-pie.tsx +98 -0
- package/icons/icons/chart-scatter.tsx +146 -0
- package/icons/icons/chart-spline.tsx +103 -0
- package/icons/icons/check-check.tsx +117 -0
- package/icons/icons/check.tsx +108 -0
- package/icons/icons/chess-bishop.tsx +112 -0
- package/icons/icons/chess-king.tsx +113 -0
- package/icons/icons/chess-knight.tsx +114 -0
- package/icons/icons/chess-pawn.tsx +150 -0
- package/icons/icons/chevron-down.tsx +94 -0
- package/icons/icons/chevron-first.tsx +102 -0
- package/icons/icons/chevron-left.tsx +94 -0
- package/icons/icons/chevron-right.tsx +95 -0
- package/icons/icons/chevron-up.tsx +94 -0
- package/icons/icons/chevrons-down-up.tsx +108 -0
- package/icons/icons/chevrons-left-right.tsx +108 -0
- package/icons/icons/chevrons-right-left.tsx +108 -0
- package/icons/icons/chevrons-up-down.tsx +108 -0
- package/icons/icons/chrome.tsx +137 -0
- package/icons/icons/circle-check.tsx +107 -0
- package/icons/icons/circle-chevron-down.tsx +99 -0
- package/icons/icons/circle-chevron-left.tsx +97 -0
- package/icons/icons/circle-chevron-right.tsx +97 -0
- package/icons/icons/circle-chevron-up.tsx +99 -0
- package/icons/icons/circle-dashed.tsx +108 -0
- package/icons/icons/circle-dollar-sign.tsx +137 -0
- package/icons/icons/circle-help.tsx +98 -0
- package/icons/icons/clap.tsx +121 -0
- package/icons/icons/clipboard-check.tsx +109 -0
- package/icons/icons/clock.tsx +138 -0
- package/icons/icons/cloud-cog.tsx +101 -0
- package/icons/icons/cloud-download.tsx +98 -0
- package/icons/icons/cloud-lightning.tsx +97 -0
- package/icons/icons/cloud-rain-wind.tsx +109 -0
- package/icons/icons/cloud-rain.tsx +112 -0
- package/icons/icons/cloud-snow.tsx +125 -0
- package/icons/icons/cloud-sun.tsx +137 -0
- package/icons/icons/cloud-upload.tsx +97 -0
- package/icons/icons/coffee.tsx +118 -0
- package/icons/icons/cog.tsx +103 -0
- package/icons/icons/compass.tsx +98 -0
- package/icons/icons/concierge-bell.tsx +123 -0
- package/icons/icons/connect.tsx +164 -0
- package/icons/icons/construction.tsx +111 -0
- package/icons/icons/contrast.tsx +100 -0
- package/icons/icons/cooking-pot.tsx +120 -0
- package/icons/icons/copy.tsx +110 -0
- package/icons/icons/corner-down-left.tsx +98 -0
- package/icons/icons/corner-down-right.tsx +98 -0
- package/icons/icons/corner-left-down.tsx +98 -0
- package/icons/icons/corner-left-up.tsx +98 -0
- package/icons/icons/corner-right-down.tsx +98 -0
- package/icons/icons/corner-right-up.tsx +98 -0
- package/icons/icons/corner-up-left.tsx +98 -0
- package/icons/icons/corner-up-right.tsx +98 -0
- package/icons/icons/cpu.tsx +159 -0
- package/icons/icons/cup-soda.tsx +180 -0
- package/icons/icons/cursor-click.tsx +146 -0
- package/icons/icons/database-backup.tsx +96 -0
- package/icons/icons/delete.tsx +133 -0
- package/icons/icons/disc-3.tsx +93 -0
- package/icons/icons/discord.tsx +131 -0
- package/icons/icons/dollar-sign.tsx +135 -0
- package/icons/icons/download.tsx +99 -0
- package/icons/icons/downvote.tsx +96 -0
- package/icons/icons/dribbble.tsx +183 -0
- package/icons/icons/droplet.tsx +97 -0
- package/icons/icons/drum.tsx +112 -0
- package/icons/icons/earth.tsx +157 -0
- package/icons/icons/euro.tsx +141 -0
- package/icons/icons/ev-charger.tsx +102 -0
- package/icons/icons/expand.tsx +123 -0
- package/icons/icons/eye-off.tsx +99 -0
- package/icons/icons/eye.tsx +100 -0
- package/icons/icons/facebook.tsx +108 -0
- package/icons/icons/feather.tsx +103 -0
- package/icons/icons/figma.tsx +122 -0
- package/icons/icons/file-chart-line.tsx +105 -0
- package/icons/icons/file-check-2.tsx +108 -0
- package/icons/icons/file-check.tsx +108 -0
- package/icons/icons/file-cog.tsx +99 -0
- package/icons/icons/file-pen-line.tsx +115 -0
- package/icons/icons/file-stack.tsx +105 -0
- package/icons/icons/file-text.tsx +159 -0
- package/icons/icons/fingerprint.tsx +197 -0
- package/icons/icons/fish-symbol.tsx +101 -0
- package/icons/icons/flame.tsx +105 -0
- package/icons/icons/flask.tsx +120 -0
- package/icons/icons/folder-archive.tsx +95 -0
- package/icons/icons/folder-check.tsx +106 -0
- package/icons/icons/folder-clock.tsx +139 -0
- package/icons/icons/folder-code.tsx +108 -0
- package/icons/icons/folder-cog.tsx +101 -0
- package/icons/icons/folder-dot.tsx +97 -0
- package/icons/icons/folder-down.tsx +100 -0
- package/icons/icons/folder-git-2.tsx +146 -0
- package/icons/icons/folder-git.tsx +116 -0
- package/icons/icons/folder-heart.tsx +101 -0
- package/icons/icons/folder-input.tsx +100 -0
- package/icons/icons/folder-kanban.tsx +111 -0
- package/icons/icons/folder-key.tsx +104 -0
- package/icons/icons/folder-lock.tsx +103 -0
- package/icons/icons/folder-minus.tsx +96 -0
- package/icons/icons/folder-open.tsx +100 -0
- package/icons/icons/folder-output.tsx +101 -0
- package/icons/icons/folder-plus.tsx +109 -0
- package/icons/icons/folder-root.tsx +107 -0
- package/icons/icons/folder-sync.tsx +102 -0
- package/icons/icons/folder-tree.tsx +145 -0
- package/icons/icons/folder-up.tsx +100 -0
- package/icons/icons/folder-x.tsx +105 -0
- package/icons/icons/folders.tsx +122 -0
- package/icons/icons/frame.tsx +152 -0
- package/icons/icons/frown.tsx +174 -0
- package/icons/icons/gallery-horizontal-end.tsx +117 -0
- package/icons/icons/gallery-thumbnails.tsx +100 -0
- package/icons/icons/gallery-vertical-end.tsx +117 -0
- package/icons/icons/gauge.tsx +102 -0
- package/icons/icons/gavel.tsx +107 -0
- package/icons/icons/georgian-lari.tsx +148 -0
- package/icons/icons/git-branch.tsx +174 -0
- package/icons/icons/git-commit-horizontal.tsx +123 -0
- package/icons/icons/git-commit-vertical.tsx +117 -0
- package/icons/icons/git-compare-arrows.tsx +199 -0
- package/icons/icons/git-compare.tsx +170 -0
- package/icons/icons/git-fork.tsx +189 -0
- package/icons/icons/git-graph.tsx +212 -0
- package/icons/icons/git-merge.tsx +148 -0
- package/icons/icons/git-pull-request-closed.tsx +199 -0
- package/icons/icons/git-pull-request-create.tsx +189 -0
- package/icons/icons/git-pull-request.tsx +166 -0
- package/icons/icons/github.tsx +149 -0
- package/icons/icons/gitlab.tsx +103 -0
- package/icons/icons/graduation-cap.tsx +125 -0
- package/icons/icons/grip-horizontal.tsx +131 -0
- package/icons/icons/grip-vertical.tsx +128 -0
- package/icons/icons/grip.tsx +130 -0
- package/icons/icons/hammer.tsx +105 -0
- package/icons/icons/hand-coins.tsx +150 -0
- package/icons/icons/hand-fist.tsx +98 -0
- package/icons/icons/hand-grab.tsx +96 -0
- package/icons/icons/hand-heart.tsx +114 -0
- package/icons/icons/hand-helping.tsx +95 -0
- package/icons/icons/hand-metal.tsx +96 -0
- package/icons/icons/hand.tsx +95 -0
- package/icons/icons/hard-drive-download.tsx +102 -0
- package/icons/icons/hard-drive-upload.tsx +102 -0
- package/icons/icons/heart-handshake.tsx +97 -0
- package/icons/icons/heart-pulse.tsx +136 -0
- package/icons/icons/heart.tsx +90 -0
- package/icons/icons/history.tsx +159 -0
- package/icons/icons/home.tsx +103 -0
- package/icons/icons/hourglass.tsx +104 -0
- package/icons/icons/id-card.tsx +123 -0
- package/icons/icons/index.ts +3686 -0
- package/icons/icons/indian-rupee.tsx +153 -0
- package/icons/icons/instagram.tsx +187 -0
- package/icons/icons/italic.tsx +126 -0
- package/icons/icons/japanese-yen.tsx +141 -0
- package/icons/icons/key-circle.tsx +93 -0
- package/icons/icons/key-square.tsx +94 -0
- package/icons/icons/key.tsx +104 -0
- package/icons/icons/keyboard.tsx +134 -0
- package/icons/icons/languages.tsx +158 -0
- package/icons/icons/laptop-minimal-check.tsx +109 -0
- package/icons/icons/laugh.tsx +160 -0
- package/icons/icons/layers.tsx +113 -0
- package/icons/icons/layout-grid.tsx +157 -0
- package/icons/icons/layout-panel-top.tsx +143 -0
- package/icons/icons/link.tsx +107 -0
- package/icons/icons/linkedin.tsx +185 -0
- package/icons/icons/loader-circle.tsx +107 -0
- package/icons/icons/loader-pinwheel.tsx +110 -0
- package/icons/icons/loader.tsx +113 -0
- package/icons/icons/lock-keyhole-open.tsx +116 -0
- package/icons/icons/lock-keyhole.tsx +115 -0
- package/icons/icons/lock-open.tsx +114 -0
- package/icons/icons/lock.tsx +114 -0
- package/icons/icons/logout.tsx +105 -0
- package/icons/icons/mail-check.tsx +108 -0
- package/icons/icons/mailbox.tsx +110 -0
- package/icons/icons/map-pin-check-inside.tsx +120 -0
- package/icons/icons/map-pin-check.tsx +120 -0
- package/icons/icons/map-pin-house.tsx +120 -0
- package/icons/icons/map-pin-minus-inside.tsx +120 -0
- package/icons/icons/map-pin-minus.tsx +120 -0
- package/icons/icons/map-pin-off.tsx +122 -0
- package/icons/icons/map-pin-plus-inside.tsx +141 -0
- package/icons/icons/map-pin-plus.tsx +141 -0
- package/icons/icons/map-pin-x-inside.tsx +141 -0
- package/icons/icons/map-pin.tsx +122 -0
- package/icons/icons/maximize-2.tsx +105 -0
- package/icons/icons/maximize.tsx +123 -0
- package/icons/icons/meh.tsx +174 -0
- package/icons/icons/menu.tsx +125 -0
- package/icons/icons/message-circle-check.tsx +107 -0
- package/icons/icons/message-circle-dashed.tsx +108 -0
- package/icons/icons/message-circle-more.tsx +125 -0
- package/icons/icons/message-circle-plus.tsx +131 -0
- package/icons/icons/message-circle-x.tsx +131 -0
- package/icons/icons/message-circle.tsx +107 -0
- package/icons/icons/message-square-check.tsx +108 -0
- package/icons/icons/message-square-dashed.tsx +109 -0
- package/icons/icons/message-square-more.tsx +125 -0
- package/icons/icons/message-square-plus.tsx +131 -0
- package/icons/icons/message-square-x.tsx +131 -0
- package/icons/icons/message-square.tsx +107 -0
- package/icons/icons/mic-off.tsx +112 -0
- package/icons/icons/mic.tsx +104 -0
- package/icons/icons/minimize.tsx +123 -0
- package/icons/icons/monitor-check.tsx +110 -0
- package/icons/icons/moon.tsx +98 -0
- package/icons/icons/nfc.tsx +134 -0
- package/icons/icons/panel-left-close.tsx +99 -0
- package/icons/icons/panel-left-open.tsx +99 -0
- package/icons/icons/panel-right-open.tsx +99 -0
- package/icons/icons/party-popper.tsx +171 -0
- package/icons/icons/pause.tsx +130 -0
- package/icons/icons/pen-tool.tsx +114 -0
- package/icons/icons/philippine-peso.tsx +142 -0
- package/icons/icons/pickaxe.tsx +106 -0
- package/icons/icons/play.tsx +102 -0
- package/icons/icons/plug-zap.tsx +102 -0
- package/icons/icons/plus.tsx +92 -0
- package/icons/icons/pound-sterling.tsx +148 -0
- package/icons/icons/rabbit.tsx +107 -0
- package/icons/icons/radio-tower.tsx +138 -0
- package/icons/icons/radio.tsx +136 -0
- package/icons/icons/redo-dot.tsx +114 -0
- package/icons/icons/redo.tsx +103 -0
- package/icons/icons/refresh-ccw-dot.tsx +88 -0
- package/icons/icons/refresh-ccw.tsx +86 -0
- package/icons/icons/refresh-cw-off.tsx +90 -0
- package/icons/icons/refresh-cw.tsx +83 -0
- package/icons/icons/rocket.tsx +130 -0
- package/icons/icons/rocking-chair.tsx +131 -0
- package/icons/icons/roller-coaster.tsx +109 -0
- package/icons/icons/rotate-ccw.tsx +81 -0
- package/icons/icons/rotate-cw.tsx +81 -0
- package/icons/icons/route.tsx +131 -0
- package/icons/icons/russian-ruble.tsx +136 -0
- package/icons/icons/saudi-riyal.tsx +124 -0
- package/icons/icons/scan-face.tsx +145 -0
- package/icons/icons/scan-text.tsx +139 -0
- package/icons/icons/search.tsx +94 -0
- package/icons/icons/send.tsx +119 -0
- package/icons/icons/settings.tsx +92 -0
- package/icons/icons/shield-check.tsx +109 -0
- package/icons/icons/ship.tsx +120 -0
- package/icons/icons/shower-head.tsx +129 -0
- package/icons/icons/shrink.tsx +123 -0
- package/icons/icons/sliders-horizontal.tsx +247 -0
- package/icons/icons/smartphone-charging.tsx +98 -0
- package/icons/icons/smartphone-nfc.tsx +129 -0
- package/icons/icons/smile-plus.tsx +99 -0
- package/icons/icons/smile.tsx +163 -0
- package/icons/icons/snowflake.tsx +109 -0
- package/icons/icons/sparkles.tsx +148 -0
- package/icons/icons/square-activity.tsx +132 -0
- package/icons/icons/square-arrow-down.tsx +119 -0
- package/icons/icons/square-arrow-left.tsx +119 -0
- package/icons/icons/square-arrow-right.tsx +119 -0
- package/icons/icons/square-arrow-up.tsx +119 -0
- package/icons/icons/square-chevron-down.tsx +96 -0
- package/icons/icons/square-chevron-left.tsx +96 -0
- package/icons/icons/square-chevron-right.tsx +96 -0
- package/icons/icons/square-chevron-up.tsx +96 -0
- package/icons/icons/square-pen.tsx +101 -0
- package/icons/icons/square-stack.tsx +123 -0
- package/icons/icons/stethoscope.tsx +192 -0
- package/icons/icons/sun-dim.tsx +108 -0
- package/icons/icons/sun-medium.tsx +108 -0
- package/icons/icons/sun-moon.tsx +137 -0
- package/icons/icons/sun.tsx +107 -0
- package/icons/icons/sunset.tsx +133 -0
- package/icons/icons/swiss-franc.tsx +141 -0
- package/icons/icons/syringe.tsx +97 -0
- package/icons/icons/telescope.tsx +113 -0
- package/icons/icons/terminal.tsx +103 -0
- package/icons/icons/thermometer.tsx +100 -0
- package/icons/icons/timer.tsx +136 -0
- package/icons/icons/tornado.tsx +138 -0
- package/icons/icons/train-track.tsx +133 -0
- package/icons/icons/trending-down.tsx +151 -0
- package/icons/icons/trending-up-down.tsx +162 -0
- package/icons/icons/trending-up.tsx +150 -0
- package/icons/icons/truck.tsx +186 -0
- package/icons/icons/turkish-lira.tsx +141 -0
- package/icons/icons/twitch.tsx +157 -0
- package/icons/icons/twitter.tsx +109 -0
- package/icons/icons/underline.tsx +108 -0
- package/icons/icons/undo-dot.tsx +114 -0
- package/icons/icons/undo.tsx +109 -0
- package/icons/icons/upload.tsx +99 -0
- package/icons/icons/upvote.tsx +96 -0
- package/icons/icons/user-check.tsx +108 -0
- package/icons/icons/user-round-check.tsx +109 -0
- package/icons/icons/user-round-plus.tsx +127 -0
- package/icons/icons/user.tsx +119 -0
- package/icons/icons/users.tsx +113 -0
- package/icons/icons/vibrate.tsx +106 -0
- package/icons/icons/volume.tsx +135 -0
- package/icons/icons/washing-machine.tsx +132 -0
- package/icons/icons/waves-ladder.tsx +90 -0
- package/icons/icons/waves.tsx +112 -0
- package/icons/icons/waypoints.tsx +146 -0
- package/icons/icons/webhook.tsx +116 -0
- package/icons/icons/wifi-low.tsx +177 -0
- package/icons/icons/wifi.tsx +112 -0
- package/icons/icons/wind-arrow-down.tsx +150 -0
- package/icons/icons/wind.tsx +124 -0
- package/icons/icons/workflow.tsx +127 -0
- package/icons/icons/wrench.tsx +100 -0
- package/icons/icons/x.tsx +102 -0
- package/icons/icons/youtube.tsx +146 -0
- package/icons/icons/zap-off.tsx +115 -0
- package/icons/icons/zap.tsx +105 -0
- package/package.json +52 -0
- package/server/api.js +313 -0
- package/server/config.js +32 -0
- package/server/frontmatter.js +47 -0
- package/server/index.js +34 -0
- package/server/search.js +62 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ne(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ne(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),ne(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=ne(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=ne(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ne(te(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function re(e,t,n){if(e==null)return e;var r=[],i=0;return ne(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},ae={map:re,forEach:function(e,t,n){re(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return re(e,function(){t++}),t},toArray:function(e){return re(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ae,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),p=s(((e,t)=>{t.exports=f()})),m=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,k=ee.port2;ee.port1.onmessage=D,O=function(){k.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=h(),n=p(),r=_();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var ne=Symbol.for(`react.client.reference`);function re(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?re(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return re(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function ue(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function de(e,t){ce++,se[ce]=e.current,e.current=t}var fe=le(null),pe=le(null),me=le(null),he=le(null);function ge(e,t){switch(de(me,t),de(pe,e),de(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zd(t),e=Qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ue(fe),de(fe,e)}function _e(){ue(fe),ue(pe),ue(me)}function ve(e){e.memoizedState!==null&&de(he,e);var t=fe.current,n=Qd(t,e.type);t!==n&&(de(pe,e),de(fe,n))}function ye(e){pe.current===e&&(ue(fe),ue(pe)),he.current===e&&(ue(he),cp._currentValue=oe)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,eee=t.unstable_LowPriority,Le=t.unstable_IdlePriority,tee=t.log,nee=t.unstable_setDisableYieldValue,Re=null,ze=null;function Be(e){if(typeof tee==`function`&&nee(e),ze&&typeof ze.setStrictMode==`function`)try{ze.setStrictMode(Re,e)}catch{}}var Ve=Math.clz32?Math.clz32:Ue,He=Math.log,ree=Math.LN2;function Ue(e){return e>>>=0,e===0?32:31-(He(e)/ree|0)|0}var We=256,Ge=262144,Ke=4194304;function qe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Je(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=qe(n))):i=qe(o):i=qe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=qe(n))):i=qe(o)):i=qe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ye(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function iee(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var e=Ke;return Ke<<=1,!(Ke&62914560)&&(Ke=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ve(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&et(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function et(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ve(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function tt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ve(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function nt(e,t){var n=t&-t;return n=n&42?1:rt(n),(n&(e.suspendedLanes|t))===0?n:0}function rt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function it(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function at(){var e=ae.p;return e===0?(e=window.event,e===void 0?32:wp(e.type)):e}function ot(e,t){var n=ae.p;try{return ae.p=e,t()}finally{ae.p=n}}var st=Math.random().toString(36).slice(2),ct=`__reactFiber$`+st,lt=`__reactProps$`+st,ut=`__reactContainer$`+st,dt=`__reactEvents$`+st,ft=`__reactListeners$`+st,pt=`__reactHandles$`+st,mt=`__reactResources$`+st,ht=`__reactMarker$`+st;function gt(e){delete e[ct],delete e[lt],delete e[dt],delete e[ft],delete e[pt]}function _t(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ut]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xf(e);e!==null;){if(n=e[ct])return n;e=xf(e)}return t}e=n,n=e.parentNode}return null}function vt(e){if(e=e[ct]||e[ut]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function yt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function bt(e){var t=e[mt];return t||=e[mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function xt(e){e[ht]=!0}var St=new Set,Ct={};function wt(e,t){Tt(e,t),Tt(e+`Capture`,t)}function Tt(e,t){for(Ct[e]=t,e=0;e<t.length;e++)St.add(t[e])}var Et=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Dt={},Ot={};function kt(e){return De.call(Ot,e)?!0:De.call(Dt,e)?!1:Et.test(e)?Ot[e]=!0:(Dt[e]=!0,!1)}function At(e,t,n){if(kt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Mt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Nt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Pt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Ft(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function It(e){if(!e._valueTracker){var t=Pt(e)?`checked`:`value`;e._valueTracker=Ft(e,t,``+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Pt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Rt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var zt=/[\n"\\]/g;function Bt(e){return e.replace(zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Vt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Nt(t)):e.value!==``+Nt(t)&&(e.value=``+Nt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ut(e,o,Nt(n)):Ut(e,o,Nt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Nt(s):e.removeAttribute(`name`)}function Ht(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){It(e);return}n=n==null?``:``+Nt(n),t=t==null?n:``+Nt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),It(e)}function Ut(e,t,n){t===`number`&&Rt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Wt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Nt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Gt(e,t,n){if(t!=null&&(t=``+Nt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Nt(n)}function Kt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ie(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Nt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),It(e)}function qt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Yt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Jt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Xt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Yt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Yt(e,o,t[o])}function Zt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),$t=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function en(e){return $t.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function tn(){}var nn=null;function rn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var an=null,on=null;function sn(e){var t=vt(e);if(t&&(e=t.stateNode)){var n=e[lt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Vt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Bt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[lt]||null;if(!a)throw Error(i(90));Vt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Lt(r)}break a;case`textarea`:Gt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Wt(e,!!n.multiple,t,!1)}}}var cn=!1;function ln(e,t,n){if(cn)return e(t,n);cn=!0;try{return e(t)}finally{if(cn=!1,(an!==null||on!==null)&&(Ou(),an&&(t=an,e=on,on=an=null,sn(t),e)))for(t=0;t<e.length;t++)sn(e[t])}}function un(e,t){var n=e.stateNode;if(n===null)return null;var r=n[lt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var dn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,`passive`,{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return gn=i.slice(e,1<r?1-r:void 0)}function vn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function yn(){return!0}function bn(){return!1}function xn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?yn:bn,this.isPropagationStopped=bn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=yn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=yn)},persist:function(){},isPersistent:yn}),t}var Sn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=xn(Sn),wn=f({},Sn,{view:0,detail:0}),Tn=xn(wn),En,Dn,On,kn=f({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),An=xn(kn),jn=xn(f({},kn,{dataTransfer:0})),Mn=xn(f({},wn,{relatedTarget:0})),Nn=xn(f({},Sn,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=xn(f({},Sn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=xn(f({},Sn,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=xn(f({},wn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Hn=xn(f({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=xn(f({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Wn=xn(f({},Sn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Gn=xn(f({},kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Kn=xn(f({},Sn,{newState:0,oldState:0})),qn=[9,13,27,32],Jn=dn&&`CompositionEvent`in window,Yn=null;dn&&`documentMode`in document&&(Yn=document.documentMode);var Xn=dn&&`TextEvent`in window&&!Yn,Zn=dn&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=_n(),gn=hn=mn=null,nr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){an?on?on.push(r):on=[r]:an=r,t=Id(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,M=null;function lr(e){Od(e,0)}function ur(e){if(Lt(yt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(dn){var pr;if(dn){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){cr&&(cr.detachEvent(`onpropertychange`,_r),M=cr=null)}function _r(e){if(e.propertyName===`value`&&ur(M)){var t=[];sr(t,M,e,rn(e)),ln(lr,t)}}function aee(e,t,n){e===`focusin`?(gr(),cr=t,M=n,cr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function N(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(M)}function vr(e,t){if(e===`click`)return ur(t)}function yr(e,t){if(e===`input`||e===`change`)return ur(t)}function br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var xr=typeof Object.is==`function`?Object.is:br;function Sr(e,t){if(xr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!De.call(t,i)||!xr(e[i],t[i]))return!1}return!0}function Cr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wr(e,t){var n=Cr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Cr(n)}}function Tr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Er(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(e.document)}return t}function Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Or=dn&&`documentMode`in document&&11>=document.documentMode,kr=null,Ar=null,jr=null,Mr=!1;function Nr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mr||kr==null||kr!==Rt(r)||(r=kr,`selectionStart`in r&&Dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&Sr(jr,r)||(jr=r,r=Id(Ar,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Pr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Fr={animationend:Pr(`Animation`,`AnimationEnd`),animationiteration:Pr(`Animation`,`AnimationIteration`),animationstart:Pr(`Animation`,`AnimationStart`),transitionrun:Pr(`Transition`,`TransitionRun`),transitionstart:Pr(`Transition`,`TransitionStart`),transitioncancel:Pr(`Transition`,`TransitionCancel`),transitionend:Pr(`Transition`,`TransitionEnd`)},Ir={},Lr={};dn&&(Lr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Fr.animationend.animation,delete Fr.animationiteration.animation,delete Fr.animationstart.animation),`TransitionEvent`in window||delete Fr.transitionend.transition);function Rr(e){if(Ir[e])return Ir[e];if(!Fr[e])return e;var t=Fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Lr)return Ir[e]=t[n];return e}var zr=Rr(`animationend`),Br=Rr(`animationiteration`),Vr=Rr(`animationstart`),Hr=Rr(`transitionrun`),Ur=Rr(`transitionstart`),Wr=Rr(`transitioncancel`),Gr=Rr(`transitionend`),Kr=new Map,qr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);qr.push(`scrollEnd`);function Jr(e,t){Kr.set(e,t),wt(t,[e])}var Yr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Xr=[],Zr=0,Qr=0;function $r(){for(var e=Zr,t=Qr=Zr=0;t<e;){var n=Xr[t];Xr[t++]=null;var r=Xr[t];Xr[t++]=null;var i=Xr[t];Xr[t++]=null;var a=Xr[t];if(Xr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ri(n,i,a)}}function ei(e,t,n,r){Xr[Zr++]=e,Xr[Zr++]=t,Xr[Zr++]=n,Xr[Zr++]=r,Qr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ti(e,t,n,r){return ei(e,t,n,r),ii(e)}function ni(e,t){return ei(e,null,null,t),ii(e)}function ri(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ve(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ii(e){if(50<yu)throw yu=0,bu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ai={};function oi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function si(e,t,n,r){return new oi(e,t,n,r)}function ci(e){return e=e.prototype,!(!e||!e.isReactComponent)}function li(e,t){var n=e.alternate;return n===null?(n=si(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ui(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function di(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ci(e)&&(s=1);else if(typeof e==`string`)s=$f(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=si(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return fi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=si(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=si(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=si(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=si(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function fi(e,t,n,r){return e=si(7,e,r,t),e.lanes=n,e}function pi(e,t,n){return e=si(6,e,null,t),e.lanes=n,e}function mi(e){var t=si(18,null,null,0);return t.stateNode=e,t}function hi(e,t,n){return t=si(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gi=new WeakMap;function _i(e,t){if(typeof e==`object`&&e){var n=gi.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},gi.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var vi=[],yi=0,bi=null,xi=0,Si=[],Ci=0,wi=null,Ti=1,Ei=``;function Di(e,t){vi[yi++]=xi,vi[yi++]=bi,bi=e,xi=t}function Oi(e,t,n){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,wi=e;var r=Ti;e=Ei;var i=32-Ve(r)-1;r&=~(1<<i),n+=1;var a=32-Ve(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ti=1<<32-Ve(t)+i|n<<i|r,Ei=a+e}else Ti=1<<a|n<<i|r,Ei=e}function ki(e){e.return!==null&&(Di(e,1),Oi(e,1,0))}function Ai(e){for(;e===bi;)bi=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null;for(;e===wi;)wi=Si[--Ci],Si[Ci]=null,Ei=Si[--Ci],Si[Ci]=null,Ti=Si[--Ci],Si[Ci]=null}function ji(e,t){Si[Ci++]=Ti,Si[Ci++]=Ei,Si[Ci++]=wi,Ti=t.id,Ei=t.overflow,wi=e}var Mi=null,Ni=null,Pi=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(_i(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ct]=e,t[lt]=r,n){case`dialog`:kd(`cancel`,t),kd(`close`,t);break;case`iframe`:case`object`:case`embed`:kd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Ed.length;n++)kd(Ed[n],t);break;case`source`:kd(`error`,t);break;case`img`:case`image`:case`link`:kd(`error`,t),kd(`load`,t);break;case`details`:kd(`toggle`,t);break;case`input`:kd(`invalid`,t),Ht(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:kd(`invalid`,t);break;case`textarea`:kd(`invalid`,t),Kt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Vd(t.textContent,n)?(r.popover!=null&&(kd(`beforetoggle`,t),kd(`toggle`,t)),r.onScroll!=null&&kd(`scroll`,t),r.onScrollEnd!=null&&kd(`scrollend`,t),r.onClick!=null&&(t.onclick=tn),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Mi=e.return;Mi;)switch(Mi.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Mi=Mi.return}}function Vi(e){if(e!==Mi)return!1;if(!Pi)return Bi(e),Pi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||$d(e.type,e.memoizedProps)),n=!n),n&&Ni&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=bf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ni=bf(e)}else t===27?(t=Ni,cf(e.type)?(e=yf,yf=null,Ni=e):Ni=t):Ni=Mi?vf(e.stateNode.nextSibling):null;return!0}function Hi(){Ni=Mi=null,Pi=!1}function Ui(){var e=Fi;return e!==null&&(au===null?au=e:au.push.apply(au,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=le(null),Ki=null,qi=null;function Ji(e,t,n){de(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,ue(Gi)}function Xi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Zi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Xi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Xi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;xr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===he.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[cp]:e.push(cp))}a=a.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=bd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var _a=j.S;j.S=function(e,t){cu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=le(null);function ya(){var e=va.current;return e===null?Ul.pooledCache:e}function ba(e,t){t===null?de(va,va.current):de(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(tn,tn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(tn,tn);else{if(e=Ul,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Oa(i)===t.type)?(t=a(t,n.props),Fa(t,n),t.return=e,t):(t=di(n.type,n.key,n.props,null,e.mode,r),Fa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=fi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=di(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case v:return t=hi(t,e.mode,n),t.return=e,t;case O:return t=Oa(t),f(e,t,n)}if(ie(t)||te(t))return t=fi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===C)return f(e,na(e,t),n);Ia(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Oa(n),p(e,t,n,r)}if(ie(n)||te(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===C)return p(e,t,na(e,n),r);Ia(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Oa(r),m(e,t,n,r,i)}if(ie(r)||te(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===C)return m(e,t,n,na(t,r),i);Ia(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Pi&&Di(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Pi&&Di(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Pi&&Di(i,h),l}function _(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Pi&&Di(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Pi&&Di(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Pi&&Di(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=fi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=di(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=hi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Oa(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(te(o)){if(l=te(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),_(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Ia(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=si(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Hl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ii(e),ri(e,null,n),t}return ei(e,r,t,n),ii(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Gl&p)===p:(r&p)===p){p!==0&&p===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ba=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),$l|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=le(null),$a=le(0);function eo(e,t){e=Zl,de($a,e),de(Qa,t),Zl=e|t.baseLanes}function to(){de($a,Zl),de(Qa,Qa.current)}function no(){Zl=$a.current,ue(Qa),ue($a)}var ro=le(null),io=null;function ao(e){var t=e.alternate;de(uo,uo.current&1),de(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){de(uo,uo.current),de(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(de(uo,uo.current),de(ro,e),io===null&&(io=e)):co(e)}function co(){de(uo,uo.current),de(ro,ro.current)}function lo(e){ue(ro),io===e&&(io=null),ue(uo)}var uo=le(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hf(n)||gf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var po=0,mo=null,ho=null,go=null,_o=!1,vo=!1,yo=!1,bo=0,xo=0,So=null,Co=0;function wo(){throw Error(i(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xr(e[n],t[n]))return!1;return!0}function Eo(e,t,n,r,i,a){return po=a,mo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Us:Ws,yo=!1,a=n(r,i),yo=!1,vo&&(a=Oo(t,n,r,i)),Do(e),a}function Do(e){j.H=Hs;var t=ho!==null&&ho.next!==null;if(po=0,go=ho=mo=null,_o=!1,xo=0,So=null,t)throw Error(i(300));e===null||ac||(e=e.dependencies,e!==null&&$i(e)&&(ac=!0))}function Oo(e,t,n,r){mo=e;var a=0;do{if(vo&&(So=null),xo=0,vo=!1,25<=a)throw Error(i(301));if(a+=1,go=ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Gs,o=t(n,r)}while(vo);return o}function ko(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?Io(t):t,e=e.useState()[0],(ho===null?null:ho.memoizedState)!==e&&(mo.flags|=1024),t}function Ao(){var e=bo!==0;return bo=0,e}function jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mo(e){if(_o){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_o=!1}po=0,go=ho=mo=null,vo=!1,xo=bo=0,So=null}function No(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return go===null?mo.memoizedState=go=e:go=go.next=e,go}function Po(){if(ho===null){var e=mo.alternate;e=e===null?null:e.memoizedState}else e=ho.next;var t=go===null?mo.memoizedState:go.next;if(t!==null)go=t,ho=e;else{if(e===null)throw mo.alternate===null?Error(i(467)):Error(i(310));ho=e,e={memoizedState:ho.memoizedState,baseState:ho.baseState,baseQueue:ho.baseQueue,queue:ho.queue,next:null},go===null?mo.memoizedState=go=e:go=go.next=e}return go}function Fo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(e){var t=xo;return xo+=1,So===null&&(So=[]),e=Da(So,e,t),t=mo,(go===null?t.memoizedState:go.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Us:Ws),e}function Lo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Io(e);if(e.$$typeof===C)return ta(e)}throw Error(i(438,String(e)))}function Ro(e){var t=null,n=mo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=mo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Fo(),mo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){return Vo(Po(),ho,e)}function Vo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(po&f)===f:(Gl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((po&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,mo.lanes|=p,$l|=p;f=u.action,yo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,mo.lanes|=f,$l|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!xr(o,e.memoizedState)&&(ac=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ho(e){var t=Po(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);xr(o,t.memoizedState)||(ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Uo(e,t,n){var r=mo,a=Po(),o=Pi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!xr((ho||a).memoizedState,n);if(s&&(a.memoizedState=n,ac=!0),a=a.queue,hs(Ko.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||go!==null&&go.memoizedState.tag&1){if(r.flags|=2048,us(9,{destroy:void 0},Go.bind(null,r,a,n,t),null),Ul===null)throw Error(i(349));o||po&127||Wo(r,t,n)}return n}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=mo.updateQueue,t===null?(t=Fo(),mo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xr(e,n)}catch{return!0}}function Jo(e){var t=ni(e,2);t!==null&&Cu(t,e,2)}function Yo(e){var t=No();if(typeof e==`function`){var n=e;if(e=n(),yo){Be(!0);try{n()}finally{Be(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t}function Xo(e,t,n,r){return e.baseState=n,Vo(e,ho,typeof r==`function`?r:zo)}function Zo(e,t,n,r,a){if(zs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),$o(e,t,s)}catch(n){ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),$o(e,t,a)}catch(n){ts(e,t,n)}}function $o(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){es(e,t,n)},function(n){return ts(e,t,n)}):es(e,t,n)}function es(e,t,n){t.status=`fulfilled`,t.value=n,ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qo(e,n)))}function ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ns(t),t=t.next;while(t!==r)}e.action=null}function ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rs(e,t){return t}function is(e,t){if(Pi){var n=Ul.formState;if(n!==null){a:{var r=mo;if(Pi){if(Ni){b:{for(var i=Ni,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=vf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ni=vf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=No(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:t},n.queue=r,n=Is.bind(null,mo,r),r.dispatch=n,r=Yo(!1),a=Rs.bind(null,mo,!1,r.queue),r=No(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Zo.bind(null,mo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function as(e){return ss(Po(),ho,e)}function ss(e,t,n){if(t=Vo(e,t,rs)[0],e=Bo(zo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Io(t)}catch(e){throw e===Sa?wa:e}else r=t;t=Po();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(mo.flags|=2048,us(9,{destroy:void 0},cs.bind(null,i,n),null)),[r,a,e]}function cs(e,t){e.action=t}function ls(e){var t=Po(),n=ho;if(n!==null)return ss(t,n,e);Po(),t=t.memoizedState,n=Po();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function us(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=mo.updateQueue,t===null&&(t=Fo(),mo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ds(){return Po().memoizedState}function fs(e,t,n,r){var i=No();mo.flags|=e,i.memoizedState=us(1|t,{destroy:void 0},n,r===void 0?null:r)}function ps(e,t,n,r){var i=Po();r=r===void 0?null:r;var a=i.memoizedState.inst;ho!==null&&r!==null&&To(r,ho.memoizedState.deps)?i.memoizedState=us(t,a,n,r):(mo.flags|=e,i.memoizedState=us(1|t,a,n,r))}function ms(e,t){fs(8390656,8,e,t)}function hs(e,t){ps(2048,8,e,t)}function gs(e){mo.flags|=4;var t=mo.updateQueue;if(t===null)t=Fo(),mo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function _s(e){var t=Po().memoizedState;return gs({ref:t,nextImpl:e}),function(){if(Hl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function vs(e,t){return ps(4,2,e,t)}function ys(e,t){return ps(4,4,e,t)}function bs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xs(e,t,n){n=n==null?null:n.concat([e]),ps(4,4,bs.bind(null,t,e),n)}function Ss(){}function Cs(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&To(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ws(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&To(t,r[1]))return r[0];if(r=e(),yo){Be(!0);try{e()}finally{Be(!1)}}return n.memoizedState=[r,t],r}function Ts(e,t,n){return n===void 0||po&1073741824&&!(Gl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Su(),mo.lanes|=e,$l|=e,n)}function Es(e,t,n,r){return xr(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(Gl&261930)?(ac=!0,e.memoizedState=n):(e=Su(),mo.lanes|=e,$l|=e,t):(e=Ts(e,n,r),xr(e,t)||(ac=!0),e)}function Ds(e,t,n,r,i){var a=ae.p;ae.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Rs(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ls(e,t,ga(c,r),xu(e)):Ls(e,t,r,xu(e))}catch(n){Ls(e,t,{then:function(){},status:`rejected`,reason:n},xu())}finally{ae.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function oee(){}function Os(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ks(e).queue;Ds(e,a,t,oe,n===null?oee:function(){return As(e),n(r)})}function ks(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:oe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function As(e){var t=ks(e);t.next===null&&(t=e.alternate.memoizedState),Ls(e,t.next.queue,{},xu())}function js(){return ta(cp)}function Ms(){return Po().memoizedState}function Ns(){return Po().memoizedState}function Ps(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=xu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(Cu(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Fs(e,t,n){var r=xu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zs(e)?Bs(t,n):(n=ti(e,t,n,r),n!==null&&(Cu(n,e,r),Vs(n,t,r)))}function Is(e,t,n){Ls(e,t,n,xu())}function Ls(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(zs(e))Bs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,xr(s,o))return ei(e,t,i,0),Ul===null&&$r(),!1}catch{}if(n=ti(e,t,i,r),n!==null)return Cu(n,e,r),Vs(n,t,r),!0}return!1}function Rs(e,t,n,r){if(r={lane:2,revertLane:bd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(i(479))}else t=ti(e,n,r,2),t!==null&&Cu(t,e,2)}function zs(e){var t=e.alternate;return e===mo||t!==null&&t===mo}function Bs(e,t){vo=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Hs={readContext:ta,use:Lo,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useLayoutEffect:wo,useInsertionEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useSyncExternalStore:wo,useId:wo,useHostTransitionStatus:wo,useFormState:wo,useActionState:wo,useOptimistic:wo,useMemoCache:wo,useCacheRefresh:wo};Hs.useEffectEvent=wo;var Us={readContext:ta,use:Lo,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),fs(4194308,4,bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fs(4194308,4,e,t)},useInsertionEffect:function(e,t){fs(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(yo){Be(!0);try{e()}finally{Be(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(yo){Be(!0);try{n(t)}finally{Be(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Fs.bind(null,mo,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Yo(e);var t=e.queue,n=Is.bind(null,mo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ss,useDeferredValue:function(e,t){return Ts(No(),e,t)},useTransition:function(){var e=Yo(!1);return e=Ds.bind(null,mo,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=mo,a=No();if(Pi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ul===null)throw Error(i(349));Gl&127||Wo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ms(Ko.bind(null,r,o,e),[e]),r.flags|=2048,us(9,{destroy:void 0},Go.bind(null,r,o,n,t),null),n},useId:function(){var e=No(),t=Ul.identifierPrefix;if(Pi){var n=Ei,r=Ti;n=(r&~(1<<32-Ve(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:js,useFormState:is,useActionState:is,useOptimistic:function(e){var t=No();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Rs.bind(null,mo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ro,useCacheRefresh:function(){return No().memoizedState=Ps.bind(null,mo)},useEffectEvent:function(e){var t=No(),n={impl:e};return t.memoizedState=n,function(){if(Hl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ws={readContext:ta,use:Lo,useCallback:Cs,useContext:ta,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Bo,useRef:ds,useState:function(){return Bo(zo)},useDebugValue:Ss,useDeferredValue:function(e,t){return Es(Po(),ho.memoizedState,e,t)},useTransition:function(){var e=Bo(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:as,useActionState:as,useOptimistic:function(e,t){return Xo(Po(),ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Ws.useEffectEvent=_s;var Gs={readContext:ta,use:Lo,useCallback:Cs,useContext:ta,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Ho,useRef:ds,useState:function(){return Ho(zo)},useDebugValue:Ss,useDeferredValue:function(e,t){var n=Po();return ho===null?Ts(n,e,t):Es(n,ho.memoizedState,e,t)},useTransition:function(){var e=Ho(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:ls,useActionState:ls,useOptimistic:function(e,t){var n=Po();return ho===null?(n.baseState=e,[e,n.queue.dispatch]):Xo(n,ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Gs.useEffectEvent=_s;function Ks(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(Cu(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(Cu(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xu(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(Cu(t,e,n),Ga(t,e,n))}};function Js(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Sr(n,r)||!Sr(i,a):!0}function Ys(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&qs.enqueueReplaceState(t,t.state,null)}function Xs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function see(e){Yr(e)}function P(e){console.error(e)}function Zs(e){Yr(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=Ua(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(du===null?du=new Set([this]):du.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,a,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?Fu():n.alternate===null&&Ql===0&&(Ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ed(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ed(e,r,a)),!1}throw Error(i(435,n.tag))}return ed(e,r,a),Fu(),!1}if(Pi)return t=ro.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(_i(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=_i(r,n),a=ec(e.stateNode,r,a),Ka(e,a),Ql!==4&&(Ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(_i(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=_i(o,n),iu===null?iu=[o]:iu.push(o),Ql!==4&&(Ql=2),t===null)return!0;r=_i(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ec(n.stateNode,r,e),Ka(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(du===null||!du.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=tc(a),nc(a,e,n,r),Ka(n,a),!1}n=n.return}while(n!==null);return!1}var ic=Error(i(461)),ac=!1;function oc(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=Eo(e,t,n,o,a,i),s=Ao(),e!==null&&!ac?(jo(e,t,i),jc(e,t,i)):(Pi&&s&&ki(t),t.flags|=1,oc(e,t,r,i),t.child)}function cc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ci(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,lc(e,t,a,r,i)):(e=di(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Mc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Sr:n,n(o,r)&&e.ref===t.ref)return jc(e,t,i)}return t.flags|=1,e=li(a,r),e.ref=t.ref,e.return=t,t.child=e}function lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Sr(a,r)&&e.ref===t.ref)if(ac=!1,t.pendingProps=r=a,Mc(e,i))e.flags&131072&&(ac=!0);else return t.lanes=e.lanes,jc(e,t,i)}return _c(e,t,n,r,i)}function uc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),to(),co(t)):(ba(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return oc(e,t,i,n),t.child}function dc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),to(),so(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function pc(e,t){return t=Ec({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mc(e,t,n){return Ra(t,e.child,null,n),e=pc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function hc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Pi){if(r.mode===`hidden`)return e=pc(t,r),t.lanes=536870912,dc(null,e);if(oo(t),(e=Ni)?(e=mf(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return pc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),a)if(t.flags&256)t.flags&=-257,t=mc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ac||Qi(e,t,n,!1),a=(n&e.childLanes)!==0,ac||a){if(r=Ul,r!==null&&(s=nt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ni(e,s),Cu(r,e,s),ic;Fu(),t=mc(e,t,n)}else e=o.treeContext,Ni=vf(s.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=pc(t,r),t.flags|=4096;return t}return e=li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function _c(e,t,n,r,i){return ea(t),n=Eo(e,t,n,r,void 0,i),r=Ao(),e!==null&&!ac?(jo(e,t,i),jc(e,t,i)):(Pi&&r&&ki(t),t.flags|=1,oc(e,t,n,i),t.child)}function vc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=Oo(t,r,n,i),Do(e),r=Ao(),e!==null&&!ac?(jo(e,t,a),jc(e,t,a)):(Pi&&r&&ki(t),t.flags|=1,oc(e,t,n,a),t.child)}function yc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=ai,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=qs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ks(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&qs.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Xs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ai,typeof u==`object`&&u&&(o=ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ys(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Ks(t,n,d,r),l=t.memoizedState),(c=Ba||Js(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ha(e,t),o=t.memoizedProps,u=Xs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ai,typeof l==`object`&&l&&(c=ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ys(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Ks(t,n,s,r),p=t.memoizedState),(u=Ba||Js(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,gc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=jc(e,t,i),e}function bc(e,t,n,r){return Hi(),t.flags|=256,oc(e,t,n,r),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sc(e){return{baseLanes:e,cachePool:xa()}}function Cc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=nu),e}function wc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(uo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Pi){if(a?ao(t):co(t),(e=Ni)?(e=mf(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:wi===null?null:{id:Ti,overflow:Ei},retryLane:536870912,hydrationErrors:null},n=mi(e),n.return=t,t.child=n,Mi=t,Ni=null)):e=null,e===null)throw Ri(t);return gf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(co(t),a=t.mode,c=Ec({mode:`hidden`,children:c},a),r=fi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(null,r)):(ao(t),Tc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,a=t.mode,r=Ec({mode:`visible`,children:r.children},a),c=fi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,t=dc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),gf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Dc(e,t,n)}else if(ac||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,ac||s){if(s=Ul,s!==null&&(r=nt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ni(e,r),Cu(s,e,r),ic;hf(c)||Fu(),t=Dc(e,t,n)}else hf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ni=vf(c.nextSibling),Mi=t,Pi=!0,Fi=null,Ii=!1,e!==null&&ji(t,e),t=Tc(t,r.children),t.flags|=4096);return t}return a?(co(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=li(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=fi(c,a,n,null),c.flags|=2):c=li(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,dc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Sc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Tc(e,t){return t=Ec({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=si(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return Ra(t,e.child,null,n),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function kc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ac(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,de(uo,o),oc(e,t,r,n),r=Pi?xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oc(e,n,t);else if(e.tag===19)Oc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kc(t,!0,n,null,a,r);break;case`together`:kc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function jc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$l|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Mc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&$i(e))):!0}function Nc(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=jc(e,t,n),e===null?null:e.sibling):wc(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ac(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),de(uo,uo.current),r)break;return null;case 22:return t.lanes=0,uc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return jc(e,t,n)}function Pc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ac=!0;else{if(!Mc(e,n)&&!(t.flags&128))return ac=!1,Nc(e,t,n);ac=!!(e.flags&131072)}else ac=!1,Pi&&t.flags&1048576&&Oi(t,xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)ci(e)?(r=Xs(e,r),t.tag=1,t=yc(null,t,e,r,n)):(t.tag=0,t=_c(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=sc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=cc(null,t,e,r,n);break a}}throw t=re(e)||e,Error(i(306,t,``))}}return t;case 0:return _c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Xs(r,t.pendingProps),yc(e,t,r,a,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],n,!0),Ja(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=bc(e,t,r,n);break a}else if(r!==a){a=_i(Error(i(424)),t),Wi(a),t=bc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ni=vf(e.firstChild),Mi=t,Pi=!0,Fi=null,Ii=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=jc(e,t,n);break a}oc(e,t,r,n)}t=t.child}return t;case 26:return gc(e,t),e===null?(n=zf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Pi||(n=t.type,e=t.pendingProps,r=Xd(me.current).createElement(n),r[ct]=t,r[lt]=e,Wd(r,n,e),xt(r),t.stateNode=r):t.memoizedState=zf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Pi&&(r=t.stateNode=Sf(t.type,t.pendingProps,me.current),Mi=t,Ii=!0,a=Ni,cf(t.type)?(yf=a,Ni=vf(r.firstChild)):Ni=a),oc(e,t,t.pendingProps.children,n),gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pi&&((a=r=Ni)&&(r=ff(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Mi=t,Ni=vf(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,$d(a,o)?r=null:s!==null&&$d(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Eo(e,t,ko,null,null,n),cp._currentValue=a),gc(e,t),oc(e,t,r,n),t.child;case 6:return e===null&&Pi&&((e=n=Ni)&&(n=pf(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Mi=t,Ni=null,e=!0)),e||Ri(t)),null;case 13:return wc(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):oc(e,t,r,n),t.child;case 11:return sc(e,t,t.type,t.pendingProps,n);case 7:return oc(e,t,t.pendingProps,n),t.child;case 8:return oc(e,t,t.pendingProps.children,n),t.child;case 12:return oc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),oc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ea(t),a=ta(a),r=r(a),t.flags|=1,oc(e,t,r,n),t.child;case 14:return cc(e,t,t.type,t.pendingProps,n);case 15:return lc(e,t,t.type,t.pendingProps,n);case 19:return Ac(e,t,n);case 31:return hc(e,t,n);case 22:return uc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(a=ya(),a===null&&(a=Ul,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Va(t),Ji(t,sa,a)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,sa,r))),oc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Fc(e){e.flags|=4}function Ic(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Mu())e.flags|=8192;else throw ka=Ta,Ca}else e.flags&=-16777217}function Lc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ep(t))if(Mu())e.flags|=8192;else throw ka=Ta,Ca}function Rc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Xe(),e.lanes|=t,ru|=t)}function zc(e,t){if(!Pi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Vc(e,t,n){var r=t.pendingProps;switch(Ai(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bc(t),null;case 1:return Bc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Fc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Bc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Fc(t),o===null?(Bc(t),Ic(t,a,null,r,n)):(Bc(t),Lc(t,o))):o?o===e.memoizedState?(Bc(t),t.flags&=-16777217):(Fc(t),Bc(t),Lc(t,o)):(e=e.memoizedProps,e!==r&&Fc(t),Bc(t),Ic(t,a,e,r,n)),null;case 27:if(ye(t),n=me.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}e=fe.current,Vi(t)?zi(t,e):(e=Sf(a,r,n),t.stateNode=e,Fc(t))}return Bc(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Bc(t),null}if(o=fe.current,Vi(t))zi(t,o);else{var s=Xd(me.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ct]=t,o[lt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Wd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Fc(t)}}return Bc(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Fc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Mi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Vd(e.nodeValue,n)),e||Ri(t,!0)}else e=Xd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Bc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ct]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return Bc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ct]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Rc(t,t.updateQueue),Bc(t),null);case 4:return _e(),e===null&&Md(t.stateNode.containerInfo),Bc(t),null;case 10:return Yi(t.type),Bc(t),null;case 19:if(ue(uo),r=t.memoizedState,r===null)return Bc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)zc(r,!1);else{if(Ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,zc(r,!1),e=o.updateQueue,t.updateQueue=e,Rc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ui(n,e),n=n.sibling;return de(uo,uo.current&1|2),Pi&&Di(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>lu&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Rc(t,e),zc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Pi)return Bc(t),null}else 2*Me()-r.renderingStartTime>lu&&n!==536870912&&(t.flags|=128,a=!0,zc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Bc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=uo.current,de(uo,a?n&1|2:n&1),Pi&&Di(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Bc(t),t.subtreeFlags&6&&(t.flags|=8192)):Bc(t),n=t.updateQueue,n!==null&&Rc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ue(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Bc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Hc(e,t){switch(Ai(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(uo),null;case 4:return _e(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&ue(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Uc(e,t){switch(Ai(t),t.tag){case 3:Yi(sa),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:ue(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&ue(va);break;case 24:Yi(sa)}}function Wc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){$u(t,t.return,e)}}function Gc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){$u(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){$u(t,t.return,e)}}function Kc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){$u(e,e.return,t)}}}function qc(e,t,n){n.props=Xs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){$u(e,t,n)}}function Jc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){$u(e,t,n)}}function Yc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){$u(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){$u(e,t,n)}else n.current=null}function Xc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){$u(e,e.return,t)}}function Zc(e,t,n){try{var r=e.stateNode;Gd(r,e.type,n,t),r[lt]=t}catch(t){$u(e,e.return,t)}}function Qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&cf(e.type)||e.tag===4}function $c(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&cf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tn));else if(r!==4&&(r===27&&cf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&cf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Wd(t,r,n),t[ct]=e,t[lt]=n}catch(t){$u(e,e.return,t)}}var rl=!1,il=!1,al=!1,ol=typeof WeakSet==`function`?WeakSet:Set,sl=null;function cee(e,t){if(e=e.containerInfo,Jd=_p,e=Er(e),Dr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Yd={focusedElem:e,selectionRange:n},_p=!1,sl=t;sl!==null;)if(t=sl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,sl=e;else for(;sl!==null;){switch(t=sl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Xs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){$u(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)df(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:df(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,sl=e;break}sl=t.return}}function cl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Cl(e,n),r&4&&Wc(5,n);break;case 1:if(Cl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){$u(n,n.return,e)}else{var i=Xs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){$u(n,n.return,e)}}r&64&&Kc(n),r&512&&Jc(n,n.return);break;case 3:if(Cl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Za(e,t)}catch(e){$u(n,n.return,e)}}break;case 27:t===null&&r&4&&nl(n);case 26:case 5:Cl(e,n),t===null&&r&4&&Xc(n),r&512&&Jc(n,n.return);break;case 12:Cl(e,n);break;case 31:Cl(e,n),r&4&&ml(e,n);break;case 13:Cl(e,n),r&4&&hl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=rd.bind(null,n),_f(e,n))));break;case 22:if(r=n.memoizedState!==null||rl,!r){t=t!==null&&t.memoizedState!==null||il,i=rl;var a=il;rl=r,(il=t)&&!a?Tl(e,n,(n.subtreeFlags&8772)!=0):Cl(e,n),rl=i,il=a}break;case 30:break;default:Cl(e,n)}}function ll(e){var t=e.alternate;t!==null&&(e.alternate=null,ll(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&>(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ul=null,dl=!1;function fl(e,t,n){for(n=n.child;n!==null;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(ze&&typeof ze.onCommitFiberUnmount==`function`)try{ze.onCommitFiberUnmount(Re,n)}catch{}switch(n.tag){case 26:il||Yc(n,t),fl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:il||Yc(n,t);var r=ul,i=dl;cf(n.type)&&(ul=n.stateNode,dl=!1),fl(e,t,n),Cf(n.stateNode),ul=r,dl=i;break;case 5:il||Yc(n,t);case 6:if(r=ul,i=dl,ul=null,fl(e,t,n),ul=r,dl=i,ul!==null)if(dl)try{(ul.nodeType===9?ul.body:ul.nodeName===`HTML`?ul.ownerDocument.body:ul).removeChild(n.stateNode)}catch(e){$u(n,t,e)}else try{ul.removeChild(n.stateNode)}catch(e){$u(n,t,e)}break;case 18:ul!==null&&(dl?(e=ul,lf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Up(e)):lf(ul,n.stateNode));break;case 4:r=ul,i=dl,ul=n.stateNode.containerInfo,dl=!0,fl(e,t,n),ul=r,dl=i;break;case 0:case 11:case 14:case 15:Gc(2,n,t),il||Gc(4,n,t),fl(e,t,n);break;case 1:il||(Yc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&qc(n,t,r)),fl(e,t,n);break;case 21:fl(e,t,n);break;case 22:il=(r=il)||n.memoizedState!==null,fl(e,t,n),il=r;break;default:fl(e,t,n)}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Up(e)}catch(e){$u(t,t.return,e)}}}function hl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Up(e)}catch(e){$u(t,t.return,e)}}function gl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ol),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ol),t;default:throw Error(i(435,e.tag))}}function _l(e,t){var n=gl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=id.bind(null,e,t);t.then(r,r)}})}function vl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(cf(c.type)){ul=c.stateNode,dl=!1;break a}break;case 5:ul=c.stateNode,dl=!1;break a;case 3:case 4:ul=c.stateNode.containerInfo,dl=!0;break a}c=c.return}if(ul===null)throw Error(i(160));pl(o,s,a),ul=null,dl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bl(t,e),t=t.sibling}var yl=null;function bl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vl(t,e),xl(e),r&4&&(Gc(3,e,e.return),Wc(3,e),Gc(5,e,e.return));break;case 1:vl(t,e),xl(e),r&512&&(il||n===null||Yc(n,n.return)),r&64&&rl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=yl;if(vl(t,e),xl(e),r&512&&(il||n===null||Yc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ht]||o[ct]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Wd(o,r,n),o[ct]=e,xt(o),r=o;break a;case`link`:var s=Zf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Wd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Zf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Wd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ct]=e,xt(o),r=o}e.stateNode=r}else Qf(a,e.type,e.stateNode);else e.stateNode=Kf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Qf(a,e.type,e.stateNode):Kf(a,r,e.memoizedProps))}break;case 27:vl(t,e),xl(e),r&512&&(il||n===null||Yc(n,n.return)),n!==null&&r&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(vl(t,e),xl(e),r&512&&(il||n===null||Yc(n,n.return)),e.flags&32){a=e.stateNode;try{qt(a,``)}catch(t){$u(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Zc(e,a,n===null?a:n.memoizedProps)),r&1024&&(al=!0);break;case 6:if(vl(t,e),xl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){$u(e,e.return,t)}}break;case 3:if(Xf=null,a=yl,yl=Ef(t.containerInfo),vl(t,e),yl=a,xl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Up(t.containerInfo)}catch(t){$u(e,e.return,t)}al&&(al=!1,Sl(e));break;case 4:r=yl,yl=Ef(e.stateNode.containerInfo),vl(t,e),xl(e),yl=r;break;case 12:vl(t,e),xl(e);break;case 31:vl(t,e),xl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 13:vl(t,e),xl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(su=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=rl,d=il;if(rl=u||a,il=d||l,vl(t,e),il=d,rl=u,xl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||rl||il||wl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){$u(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){$u(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?uf(m,!0):uf(l.stateNode,!1)}catch(e){$u(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,_l(e,n))));break;case 19:vl(t,e),xl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 30:break;case 21:break;default:vl(t,e),xl(e)}}function xl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;tl(e,$c(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(qt(o,``),n.flags&=-33),tl(e,$c(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;el(e,$c(e),s);break;default:throw Error(i(161))}}catch(t){$u(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Cl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cl(e,t.alternate,t),t=t.sibling}function wl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Gc(4,t,t.return),wl(t);break;case 1:Yc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&qc(t,t.return,n),wl(t);break;case 27:Cf(t.stateNode);case 26:case 5:Yc(t,t.return),wl(t);break;case 22:t.memoizedState===null&&wl(t);break;case 30:wl(t);break;default:wl(t)}e=e.sibling}}function Tl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Tl(i,a,n),Wc(4,a);break;case 1:if(Tl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){$u(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Xa(c[i],s)}catch(e){$u(r,r.return,e)}}n&&o&64&&Kc(a),Jc(a,a.return);break;case 27:nl(a);case 26:case 5:Tl(i,a,n),n&&r===null&&o&4&&Xc(a),Jc(a,a.return);break;case 12:Tl(i,a,n);break;case 31:Tl(i,a,n),n&&o&4&&ml(i,a);break;case 13:Tl(i,a,n),n&&o&4&&hl(i,a);break;case 22:a.memoizedState===null&&Tl(i,a,n),Jc(a,a.return);break;case 30:break;default:Tl(i,a,n)}t=t.sibling}}function El(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&la(n))}function Dl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function Ol(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kl(e,t,n,r),t=t.sibling}function kl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ol(e,t,n,r),i&2048&&Wc(9,t);break;case 1:Ol(e,t,n,r);break;case 3:Ol(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){Ol(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){$u(t,t.return,e)}}else Ol(e,t,n,r);break;case 31:Ol(e,t,n,r);break;case 13:Ol(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Ol(e,t,n,r):(a._visibility|=2,Al(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Ol(e,t,n,r):jl(e,t),i&2048&&El(o,t);break;case 24:Ol(e,t,n,r),i&2048&&Dl(t.alternate,t);break;default:Ol(e,t,n,r)}}function Al(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Al(a,o,s,c,i),Wc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Al(a,o,s,c,i)):u._visibility&2?Al(a,o,s,c,i):jl(a,o),i&&l&2048&&El(o.alternate,o);break;case 24:Al(a,o,s,c,i),i&&l&2048&&Dl(o.alternate,o);break;default:Al(a,o,s,c,i)}t=t.sibling}}function jl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:jl(n,r),i&2048&&El(r.alternate,r);break;case 24:jl(n,r),i&2048&&Dl(r.alternate,r);break;default:jl(n,r)}t=t.sibling}}var Ml=8192;function Nl(e,t,n){if(e.subtreeFlags&Ml)for(e=e.child;e!==null;)Pl(e,t,n),e=e.sibling}function Pl(e,t,n){switch(e.tag){case 26:Nl(e,t,n),e.flags&Ml&&e.memoizedState!==null&&tp(n,yl,e.memoizedState,e.memoizedProps);break;case 5:Nl(e,t,n);break;case 3:case 4:var r=yl;yl=Ef(e.stateNode.containerInfo),Nl(e,t,n),yl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ml,Ml=16777216,Nl(e,t,n),Ml=r):Nl(e,t,n));break;default:Nl(e,t,n)}}function Fl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,zl(r,e)}Fl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ll(e),e=e.sibling}function Ll(e){switch(e.tag){case 0:case 11:case 15:Il(e),e.flags&2048&&Gc(9,e,e.return);break;case 3:Il(e);break;case 12:Il(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Rl(e)):Il(e);break;default:Il(e)}}function Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,zl(r,e)}Fl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Gc(8,t,t.return),Rl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Rl(t));break;default:Rl(t)}e=e.sibling}}function zl(e,t){for(;sl!==null;){var n=sl;switch(n.tag){case 0:case 11:case 15:Gc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,sl=r;else a:for(n=e;sl!==null;){r=sl;var i=r.sibling,a=r.return;if(ll(r),r===n){sl=null;break a}if(i!==null){i.return=a,sl=i;break a}sl=a}}}var Bl={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Vl=typeof WeakMap==`function`?WeakMap:Map,Hl=0,Ul=null,Wl=null,Gl=0,Kl=0,ql=null,Jl=!1,Yl=!1,Xl=!1,Zl=0,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=null,au=null,ou=!1,su=0,cu=0,lu=1/0,uu=null,du=null,fu=0,pu=null,mu=null,hu=0,gu=0,_u=null,vu=null,yu=0,bu=null;function xu(){return Hl&2&&Gl!==0?Gl&-Gl:j.T===null?at():bd()}function Su(){if(nu===0)if(!(Gl&536870912)||Pi){var e=Ge;Ge<<=1,!(Ge&3932160)&&(Ge=262144),nu=e}else nu=536870912;return e=ro.current,e!==null&&(e.flags|=32),nu}function Cu(e,t,n){(e===Ul&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)&&(Au(e,0),Du(e,Gl,nu,!1)),Qe(e,n),(!(Hl&2)||e!==Ul)&&(e===Ul&&(!(Hl&2)&&(eu|=n),Ql===4&&Du(e,Gl,nu,!1)),fd(e))}function wu(e,t,n){if(Hl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ye(e,t),a=r?Ru(e,t):Iu(e,t,!0),o=r;do{if(a===0){Yl&&!r&&Du(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Eu(n)){a=Iu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=iu;var l=c.current.memoizedState.isDehydrated;if(l&&(Au(c,s).flags|=256),s=Iu(c,s,!1),s!==2){if(Xl&&!l){c.errorRecoveryDisabledLanes|=o,eu|=o,a=4;break a}o=au,au=a,o!==null&&(au===null?au=o:au.push.apply(au,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Au(e,0),Du(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Du(r,t,nu,!Jl);break a;case 2:au=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=su+300-Me(),10<a)){if(Du(r,t,nu,!Jl),Je(r,0,!0)!==0)break a;hu=t,r.timeoutHandle=nf(Tu.bind(null,r,n,au,uu,ou,t,nu,eu,ru,Jl,o,`Throttled`,-0,0),a);break a}Tu(r,n,au,uu,ou,t,nu,eu,ru,Jl,o,null,-0,0)}}break}while(1);fd(e)}function Tu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:tn},Pl(t,a,d);var m=(a&62914560)===a?su-Me():(a&4194048)===a?cu-Me():0;if(m=rp(d,m),m!==null){hu=a,e.cancelPendingCommit=m(Gu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Du(e,a,o,!l);return}}Gu(e,t,a,n,r,i,o,s,c)}function Eu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!xr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Du(e,t,n,r){t&=~tu,t&=~eu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ve(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&et(e,n,t)}function Ou(){return Hl&6?!0:(pd(0,!1),!1)}function ku(){if(Wl!==null){if(Kl===0)var e=Wl.return;else e=Wl,qi=Ki=null,Mo(e),Ma=null,Na=0,e=Wl;for(;e!==null;)Uc(e.alternate,e),e=e.return;Wl=null}}function Au(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,rf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),hu=0,ku(),Ul=e,Wl=n=li(e.current,null),Gl=t,Kl=0,ql=null,Jl=!1,Yl=Ye(e,t),Xl=!1,ru=nu=tu=eu=$l=Ql=0,au=iu=null,ou=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ve(r),a=1<<i;t|=e[i],r&=~a}return Zl=t,$r(),n}function ju(e,t){mo=null,j.H=Hs,t===Sa||t===wa?(t=Aa(),Kl=3):t===Ca?(t=Aa(),Kl=4):Kl=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ql=t,Wl===null&&(Ql=1,Qs(e,_i(t,e.current)))}function Mu(){var e=ro.current;return e===null?!0:(Gl&4194048)===Gl?io===null:(Gl&62914560)===Gl||Gl&536870912?e===io:!1}function Nu(){var e=j.H;return j.H=Hs,e===null?Hs:e}function Pu(){var e=j.A;return j.A=Bl,e}function Fu(){Ql=4,Jl||(Gl&4194048)!==Gl&&ro.current!==null||(Yl=!0),!($l&134217727)&&!(eu&134217727)||Ul===null||Du(Ul,Gl,nu,!1)}function Iu(e,t,n){var r=Hl;Hl|=2;var i=Nu(),a=Pu();(Ul!==e||Gl!==t)&&(uu=null,Au(e,t)),t=!1;var o=Ql;a:do try{if(Kl!==0&&Wl!==null){var s=Wl,c=ql;switch(Kl){case 8:ku(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=Kl;if(Kl=0,ql=null,Hu(e,s,c,l),n&&Yl){o=0;break a}break;default:l=Kl,Kl=0,ql=null,Hu(e,s,c,l)}}Lu(),o=Ql;break}catch(t){ju(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,Hl=r,j.H=i,j.A=a,Wl===null&&(Ul=null,Gl=0,$r()),o}function Lu(){for(;Wl!==null;)Bu(Wl)}function Ru(e,t){var n=Hl;Hl|=2;var r=Nu(),a=Pu();Ul!==e||Gl!==t?(uu=null,lu=Me()+500,Au(e,t)):Yl=Ye(e,t);a:do try{if(Kl!==0&&Wl!==null){t=Wl;var o=ql;b:switch(Kl){case 1:Kl=0,ql=null,Hu(e,t,o,1);break;case 2:case 9:if(Ea(o)){Kl=0,ql=null,Vu(t);break}t=function(){Kl!==2&&Kl!==9||Ul!==e||(Kl=7),fd(e)},o.then(t,t);break a;case 3:Kl=7;break a;case 4:Kl=5;break a;case 7:Ea(o)?(Kl=0,ql=null,Vu(t)):(Kl=0,ql=null,Hu(e,t,o,7));break;case 5:var s=null;switch(Wl.tag){case 26:s=Wl.memoizedState;case 5:case 27:var c=Wl;if(s?ep(s):c.stateNode.complete){Kl=0,ql=null;var l=c.sibling;if(l!==null)Wl=l;else{var u=c.return;u===null?Wl=null:(Wl=u,Uu(u))}break b}}Kl=0,ql=null,Hu(e,t,o,5);break;case 6:Kl=0,ql=null,Hu(e,t,o,6);break;case 8:ku(),Ql=6;break a;default:throw Error(i(462))}}zu();break}catch(t){ju(e,t)}while(1);return qi=Ki=null,j.H=r,j.A=a,Hl=n,Wl===null?(Ul=null,Gl=0,$r(),Ql):0}function zu(){for(;Wl!==null&&!Ae();)Bu(Wl)}function Bu(e){var t=Pc(e.alternate,e,Zl);e.memoizedProps=e.pendingProps,t===null?Uu(e):Wl=t}function Vu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=vc(n,t,t.pendingProps,t.type,void 0,Gl);break;case 11:t=vc(n,t,t.pendingProps,t.type.render,t.ref,Gl);break;case 5:Mo(t);default:Uc(n,t),t=Wl=ui(t,Zl),t=Pc(n,t,Zl)}e.memoizedProps=e.pendingProps,t===null?Uu(e):Wl=t}function Hu(e,t,n,r){qi=Ki=null,Mo(t),Ma=null,Na=0;var i=t.return;try{if(rc(e,i,t,n,Gl)){Ql=1,Qs(e,_i(n,e.current)),Wl=null;return}}catch(t){if(i!==null)throw Wl=i,t;Ql=1,Qs(e,_i(n,e.current)),Wl=null;return}t.flags&32768?(Pi||r===1?e=!0:Yl||Gl&536870912?e=!1:(Jl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),Wu(t,e)):Uu(t)}function Uu(e){var t=e;do{if(t.flags&32768){Wu(t,Jl);return}e=t.return;var n=Vc(t.alternate,t,Zl);if(n!==null){Wl=n;return}if(t=t.sibling,t!==null){Wl=t;return}Wl=t=e}while(t!==null);Ql===0&&(Ql=5)}function Wu(e,t){do{var n=Hc(e.alternate,e);if(n!==null){n.flags&=32767,Wl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Wl=e;return}Wl=e=n}while(e!==null);Ql=6,Wl=null}function Gu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Xu();while(fu!==0);if(Hl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Qr,$e(e,n,o,s,c,l),e===Ul&&(Wl=Ul=null,Gl=0),mu=t,pu=e,hu=n,gu=o,_u=a,vu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ad(Ie,function(){return Zu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,a=ae.p,ae.p=2,s=Hl,Hl|=4;try{cee(e,t,n)}finally{Hl=s,ae.p=a,j.T=r}}fu=1,Ku(),qu(),Ju()}}function Ku(){if(fu===1){fu=0;var e=pu,t=mu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=ae.p;ae.p=2;var i=Hl;Hl|=4;try{bl(t,e);var a=Yd,o=Er(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Tr(s.ownerDocument.documentElement,s)){if(c!==null&&Dr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=wr(s,h),v=wr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}_p=!!Jd,Yd=Jd=null}finally{Hl=i,ae.p=r,j.T=n}}e.current=t,fu=2}}function qu(){if(fu===2){fu=0;var e=pu,t=mu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=ae.p;ae.p=2;var i=Hl;Hl|=4;try{cl(e,t.alternate,t)}finally{Hl=i,ae.p=r,j.T=n}}fu=3}}function Ju(){if(fu===4||fu===3){fu=0,je();var e=pu,t=mu,n=hu,r=vu;t.subtreeFlags&10256||t.flags&10256?fu=5:(fu=0,mu=pu=null,Yu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(du=null),it(n),t=t.stateNode,ze&&typeof ze.onCommitFiberRoot==`function`)try{ze.onCommitFiberRoot(Re,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=ae.p,ae.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,ae.p=i}}hu&3&&Xu(),fd(e),i=e.pendingLanes,n&261930&&i&42?e===bu?yu++:(yu=0,bu=e):yu=0,pd(0,!1)}}function Yu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Xu(){return Ku(),qu(),Ju(),Zu()}function Zu(){if(fu!==5)return!1;var e=pu,t=gu;gu=0;var n=it(hu),r=j.T,a=ae.p;try{ae.p=32>n?32:n,j.T=null,n=_u,_u=null;var o=pu,s=hu;if(fu=0,mu=pu=null,hu=0,Hl&6)throw Error(i(331));var c=Hl;if(Hl|=4,Ll(o.current),kl(o,o.current,s,n),Hl=c,pd(0,!1),ze&&typeof ze.onPostCommitFiberRoot==`function`)try{ze.onPostCommitFiberRoot(Re,o)}catch{}return!0}finally{ae.p=a,j.T=r,Yu(e,t)}}function Qu(e,t,n){t=_i(n,t),t=ec(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(Qe(e,2),fd(e))}function $u(e,t,n){if(e.tag===3)Qu(e,e,n);else for(;t!==null;){if(t.tag===3){Qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(du===null||!du.has(r))){e=_i(n,e),n=tc(2),r=Wa(t,n,2),r!==null&&(nc(n,r,t,e),Qe(r,2),fd(r));break}}t=t.return}}function ed(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Vl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Xl=!0,i.add(n),e=td.bind(null,e,t,n),t.then(e,e))}function td(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ul===e&&(Gl&n)===n&&(Ql===4||Ql===3&&(Gl&62914560)===Gl&&300>Me()-su?!(Hl&2)&&Au(e,0):tu|=n,ru===Gl&&(ru=0)),fd(e)}function nd(e,t){t===0&&(t=Xe()),e=ni(e,t),e!==null&&(Qe(e,t),fd(e))}function rd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nd(e,n)}function id(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),nd(e,n)}function ad(e,t){return Oe(e,t)}var od=null,sd=null,cd=!1,ld=!1,ud=!1,dd=0;function fd(e){e!==sd&&e.next===null&&(sd===null?od=sd=e:sd=sd.next=e),ld=!0,cd||(cd=!0,yd())}function pd(e,t){if(!ud&&ld){ud=!0;do for(var n=!1,r=od;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ve(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,vd(r,a))}else a=Gl,a=Je(r,r===Ul?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ye(r,a)||(n=!0,vd(r,a));r=r.next}while(n);ud=!1}}function md(){hd()}function hd(){ld=cd=!1;var e=0;dd!==0&&tf()&&(e=dd);for(var t=Me(),n=null,r=od;r!==null;){var i=r.next,a=gd(r,t);a===0?(r.next=null,n===null?od=i:n.next=i,i===null&&(sd=n)):(n=r,(e!==0||a&3)&&(ld=!0)),r=i}fu!==0&&fu!==5||pd(e,!1),dd!==0&&(dd=0)}function gd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ve(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=iee(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ul,n=Gl,n=Je(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ye(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),it(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Le;break;default:n=Ie}return r=_d.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function _d(e,t){if(fu!==0&&fu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Xu()&&e.callbackNode!==n)return null;var r=Gl;return r=Je(e,e===Ul?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(wu(e,r,t),gd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?_d.bind(null,e):null)}function vd(e,t){if(Xu())return null;wu(e,t,!0)}function yd(){of(function(){Hl&6?Oe(Pe,md):hd()})}function bd(){if(dd===0){var e=fa;e===0&&(e=We,We<<=1,!(We&261888)&&(We=256)),dd=e}return dd}function xd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:en(``+e)}function Sd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Cd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=xd((i[lt]||null).action),o=r.submitter;o&&(t=(t=o[lt]||null)?xd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(dd!==0){var e=o?Sd(i,o):new FormData(i);Os(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Sd(i,o):new FormData(i),Os(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var wd=0;wd<qr.length;wd++){var Td=qr[wd];Jr(Td.toLowerCase(),`on`+(Td[0].toUpperCase()+Td.slice(1)))}Jr(zr,`onAnimationEnd`),Jr(Br,`onAnimationIteration`),Jr(Vr,`onAnimationStart`),Jr(`dblclick`,`onDoubleClick`),Jr(`focusin`,`onFocus`),Jr(`focusout`,`onBlur`),Jr(Hr,`onTransitionRun`),Jr(Ur,`onTransitionStart`),Jr(Wr,`onTransitionCancel`),Jr(Gr,`onTransitionEnd`),Tt(`onMouseEnter`,[`mouseout`,`mouseover`]),Tt(`onMouseLeave`,[`mouseout`,`mouseover`]),Tt(`onPointerEnter`,[`pointerout`,`pointerover`]),Tt(`onPointerLeave`,[`pointerout`,`pointerover`]),wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Ed=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Dd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Ed));function Od(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Yr(e)}i.currentTarget=null,a=c}}}}function kd(e,t){var n=t[dt];n===void 0&&(n=t[dt]=new Set);var r=e+`__bubble`;n.has(r)||(Nd(t,e,2,!1),n.add(r))}function Ad(e,t,n){var r=0;t&&(r|=4),Nd(n,e,r,t)}var jd=`_reactListening`+Math.random().toString(36).slice(2);function Md(e){if(!e[jd]){e[jd]=!0,St.forEach(function(t){t!==`selectionchange`&&(Dd.has(t)||Ad(t,!1,e),Ad(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jd]||(t[jd]=!0,Ad(`selectionchange`,!1,t))}}function Nd(e,t,n,r){switch(wp(t)){case 2:var i=vp;break;case 8:i=yp;break;default:i=bp}n=i.bind(null,t,n,e),i=void 0,!fn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Pd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=_t(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}ln(function(){var r=a,i=rn(n),s=[];a:{var c=Kr.get(e);if(c!==void 0){var l=Cn,u=e;switch(e){case`keypress`:if(vn(n)===0)break a;case`keydown`:case`keyup`:l=Vn;break;case`focusin`:u=`focus`,l=Mn;break;case`focusout`:u=`blur`,l=Mn;break;case`beforeblur`:case`afterblur`:l=Mn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=An;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Un;break;case zr:case Br:case Vr:l=Nn;break;case Gr:l=Wn;break;case`scroll`:case`scrollend`:l=Tn;break;case`wheel`:l=Gn;break;case`copy`:case`cut`:case`paste`:l=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Hn;break;case`toggle`:case`beforetoggle`:l=Kn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=un(m,p),g!=null&&d.push(Fd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==nn&&(u=n.relatedTarget||n.fromElement)&&(_t(u)||u[ut]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?_t(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=An,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Hn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:yt(l),h=u==null?c:yt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,_t(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ld,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Rd(s,c,l,d,!1),u!==null&&f!==null&&Rd(s,f,u,d,!0)}}a:{if(c=r?yt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=dr;else if(or(c))if(fr)v=yr;else{v=N;var y=aee}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Zt(r.elementType)&&(v=dr):v=vr;if(v&&=v(e,r)){sr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Ut(c,`number`,c.value)}switch(y=r?yt(r):window,e){case`focusin`:(or(y)||y.contentEditable===`true`)&&(kr=y,Ar=r,jr=null);break;case`focusout`:jr=Ar=kr=null;break;case`mousedown`:Mr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Mr=!1,Nr(s,n,i);break;case`selectionchange`:if(Or)break;case`keydown`:case`keyup`:Nr(s,n,i)}var b;if(Jn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else nr?er(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Zn&&n.locale!==`ko`&&(nr||x!==`onCompositionStart`?x===`onCompositionEnd`&&nr&&(b=_n()):(mn=i,hn=`value`in mn?mn.value:mn.textContent,nr=!0)),y=Id(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=tr(n),b!==null&&(x.data=b)))),(b=Xn?rr(e,n):ir(e,n))&&(x=Id(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Cd(s,e,r,n,i)}Od(s,t)})}function Fd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Id(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=un(e,n),i!=null&&r.unshift(Fd(e,i,a)),i=un(e,t),i!=null&&r.push(Fd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ld(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=un(n,a),l!=null&&o.unshift(Fd(n,l,c))):i||(l=un(n,a),l!=null&&o.push(Fd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var zd=/\r\n?/g,lee=/\u0000|\uFFFD/g;function Bd(e){return(typeof e==`string`?e:``+e).replace(zd,`
|
|
9
|
+
`).replace(lee,``)}function Vd(e,t){return t=Bd(t),Bd(e)===t}function Hd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&qt(e,``+r);break;case`className`:jt(e,`class`,r);break;case`tabIndex`:jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:jt(e,n,r);break;case`style`:Xt(e,r,o);break;case`data`:if(t!==`object`){jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Hd(e,t,`name`,a.name,a,null),Hd(e,t,`formEncType`,a.formEncType,a,null),Hd(e,t,`formMethod`,a.formMethod,a,null),Hd(e,t,`formTarget`,a.formTarget,a,null)):(Hd(e,t,`encType`,a.encType,a,null),Hd(e,t,`method`,a.method,a,null),Hd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=en(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`onScroll`:r!=null&&kd(`scroll`,e);break;case`onScrollEnd`:r!=null&&kd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=en(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:kd(`beforetoggle`,e),kd(`toggle`,e),At(e,`popover`,r);break;case`xlinkActuate`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Mt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Mt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:At(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Qt.get(n)||n,At(e,n,r))}}function Ud(e,t,n,r,a,o){switch(n){case`style`:Xt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&qt(e,``+r);break;case`onScroll`:r!=null&&kd(`scroll`,e);break;case`onScrollEnd`:r!=null&&kd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=tn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ct.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[lt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):At(e,n,r)}}}function Wd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:kd(`error`,e),kd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Hd(e,t,o,s,n,null)}}a&&Hd(e,t,`srcSet`,n.srcSet,n,null),r&&Hd(e,t,`src`,n.src,n,null);return;case`input`:kd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Hd(e,t,r,d,n,null)}}Ht(e,o,c,l,u,s,a,!1);return;case`select`:for(a in kd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Hd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Wt(e,!!r,n,!0):Wt(e,!!r,t,!1);return;case`textarea`:for(s in kd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Hd(e,t,s,c,n,null)}Kt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Hd(e,t,l,r,n,null)}return;case`dialog`:kd(`beforetoggle`,e),kd(`toggle`,e),kd(`cancel`,e),kd(`close`,e);break;case`iframe`:case`object`:kd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Ed.length;r++)kd(Ed[r],e);break;case`image`:kd(`error`,e),kd(`load`,e);break;case`details`:kd(`toggle`,e);break;case`embed`:case`source`:case`link`:kd(`error`,e),kd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Hd(e,t,u,r,n,null)}return;default:if(Zt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ud(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Hd(e,t,c,r,n,null))}function Gd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Hd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Hd(e,t,p,m,r,f)}}Vt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Hd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Hd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Wt(e,!!n,n?[]:``,!1):Wt(e,!!n,t,!0)):Wt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Hd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Hd(e,t,s,a,r,o)}Gt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Hd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Hd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Hd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Hd(e,t,u,p,r,m)}return;default:if(Zt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ud(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Ud(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Hd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Hd(e,t,f,p,r,m)}function Kd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function qd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Kd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Kd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Jd=null,Yd=null;function Xd(e){return e.nodeType===9?e:e.ownerDocument}function Zd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Qd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function $d(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ef=null;function tf(){var e=window.event;return e&&e.type===`popstate`?e===ef?!1:(ef=e,!0):(ef=null,!1)}var nf=typeof setTimeout==`function`?setTimeout:void 0,rf=typeof clearTimeout==`function`?clearTimeout:void 0,af=typeof Promise==`function`?Promise:void 0,of=typeof queueMicrotask==`function`?queueMicrotask:af===void 0?nf:function(e){return af.resolve(null).then(e).catch(sf)};function sf(e){setTimeout(function(){throw e})}function cf(e){return e===`head`}function lf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Up(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cf(e.ownerDocument.body);n=i}while(n);Up(t)}function uf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function df(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:df(n),gt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function ff(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=vf(e.nextSibling),e===null)break}return null}function pf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=vf(e.nextSibling),e===null))return null;return e}function mf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=vf(e.nextSibling),e===null))return null;return e}function hf(e){return e.data===`$?`||e.data===`$~`}function gf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _f(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function vf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var yf=null;function bf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return vf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function xf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Sf(e,t,n){switch(t=Xd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Cf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);gt(e)}var wf=new Map,Tf=new Set;function Ef(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Df=ae.d;ae.d={f:Of,r:kf,D:Mf,C:Nf,L:Pf,m:Ff,X:Lf,S:If,M:Rf};function Of(){var e=Df.f(),t=Ou();return e||t}function kf(e){var t=vt(e);t!==null&&t.tag===5&&t.type===`form`?As(t):Df.r(e)}var Af=typeof document>`u`?null:document;function jf(e,t,n){var r=Af;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tf.has(i)||(Tf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Wd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Mf(e){Df.D(e),jf(`dns-prefetch`,e,null)}function Nf(e,t){Df.C(e,t),jf(`preconnect`,e,t)}function Pf(e,t,n){Df.L(e,t,n);var r=Af;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=Bf(e);break;case`script`:a=Wf(e)}wf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vf(a))||t===`script`&&r.querySelector(Gf(a))||(t=r.createElement(`link`),Wd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Ff(e,t){Df.m(e,t);var n=Af;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wf(e)}if(!wf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),wf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gf(a)))return}r=n.createElement(`link`),Wd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function If(e,t,n){Df.S(e,t,n);var r=Af;if(r&&e){var i=bt(r).hoistableStyles,a=Bf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wf.get(a))&&Jf(e,n);var c=o=r.createElement(`link`);xt(c),Wd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lf(e,t){Df.X(e,t);var n=Af;if(n&&e){var r=bt(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=f({src:e,async:!0},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),xt(a),Wd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rf(e,t){Df.M(e,t);var n=Af;if(n&&e){var r=bt(n).hoistableScripts,i=Wf(e),a=r.get(i);a||(a=n.querySelector(Gf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=wf.get(i))&&Yf(e,t),a=n.createElement(`script`),xt(a),Wd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t,n,r){var a=(a=me.current)?Ef(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Bf(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bf(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Vf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),wf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wf.set(e,n),o||Uf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Wf(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Bf(e){return`href="`+Bt(e)+`"`}function Vf(e){return`link[rel="stylesheet"][`+e+`]`}function Hf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Uf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Wd(t,`link`,n),xt(t),e.head.appendChild(t))}function Wf(e){return`[src="`+Bt(e)+`"]`}function Gf(e){return`script[async]`+e}function Kf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Wd(r,`style`,a),qf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Bf(n.href);var o=e.querySelector(Vf(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Hf(n),(a=wf.get(a))&&Jf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Wd(o,`link`,r),t.state.loading|=4,qf(o,n.precedence,e),t.instance=o;case`script`:return o=Wf(n.src),(a=e.querySelector(Gf(o)))?(t.instance=a,xt(a),a):(r=n,(a=wf.get(o))&&(r=f({},n),Yf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Wd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qf(r,n.precedence,e));return t.instance}function qf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Yf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xf=null;function Zf(e,t,n){if(Xf===null){var r=new Map,i=Xf=new Map;i.set(n,r)}else i=Xf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ht]||a[ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $f(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ep(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function tp(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bf(r.href),a=t.querySelector(Vf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ip.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Hf(r),(i=wf.get(i))&&Jf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Wd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ip.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var np=0;function rp(e,t){return e.stylesheets&&e.count===0&&op(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&op(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&np===0&&(np=62500*qd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&op(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>np?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ip(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)op(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ap=null;function op(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ap=new Map,t.forEach(sp,e),ap=null,ip.call(e))}function sp(e,t){if(!(t.state.loading&4)){var n=ap.get(e);if(n)var r=n.get(null);else{n=new Map,ap.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ip.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var cp={$$typeof:C,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function lp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ze(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ze(0),this.hiddenUpdates=Ze(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function up(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=si(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function dp(e){return e?(e=ai,e):ai}function fp(e,t,n,r,i,a){i=dp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(Cu(n,e,t),Ga(n,e,t))}function pp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mp(e,t){pp(e,t),(e=e.alternate)&&pp(e,t)}function hp(e){if(e.tag===13||e.tag===31){var t=ni(e,67108864);t!==null&&Cu(t,e,67108864),mp(e,67108864)}}function gp(e){if(e.tag===13||e.tag===31){var t=xu();t=rt(t);var n=ni(e,t);n!==null&&Cu(n,e,t),mp(e,t)}}var _p=!0;function vp(e,t,n,r){var i=j.T;j.T=null;var a=ae.p;try{ae.p=2,bp(e,t,n,r)}finally{ae.p=a,j.T=i}}function yp(e,t,n,r){var i=j.T;j.T=null;var a=ae.p;try{ae.p=8,bp(e,t,n,r)}finally{ae.p=a,j.T=i}}function bp(e,t,n,r){if(_p){var i=xp(r);if(i===null)Pd(e,t,r,Sp,n),Np(e,r);else if(Fp(i,e,t,n,r))r.stopPropagation();else if(Np(e,r),t&4&&-1<Mp.indexOf(e)){for(;i!==null;){var a=vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=qe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ve(o);s.entanglements[1]|=c,o&=~c}fd(a),!(Hl&6)&&(lu=Me()+500,pd(0,!1))}}break;case 31:case 13:s=ni(a,2),s!==null&&Cu(s,a,2),Ou(),mp(a,2)}if(a=xp(r),a===null&&Pd(e,t,r,Sp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Pd(e,t,r,null,n)}}function xp(e){return e=rn(e),Cp(e)}var Sp=null;function Cp(e){if(Sp=null,e=_t(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Sp=e,null}function wp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case eee:return 32;case Le:return 268435456;default:return 32}default:return 32}}var Tp=!1,Ep=null,Dp=null,Op=null,kp=new Map,Ap=new Map,jp=[],Mp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Np(e,t){switch(e){case`focusin`:case`focusout`:Ep=null;break;case`dragenter`:case`dragleave`:Dp=null;break;case`mouseover`:case`mouseout`:Op=null;break;case`pointerover`:case`pointerout`:kp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ap.delete(t.pointerId)}}function Pp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=vt(t),t!==null&&hp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fp(e,t,n,r,i){switch(t){case`focusin`:return Ep=Pp(Ep,e,t,n,r,i),!0;case`dragenter`:return Dp=Pp(Dp,e,t,n,r,i),!0;case`mouseover`:return Op=Pp(Op,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kp.set(a,Pp(kp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ap.set(a,Pp(Ap.get(a)||null,e,t,n,r,i)),!0}return!1}function Ip(e){var t=_t(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ot(e.priority,function(){gp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ot(e.priority,function(){gp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nn=r,n.target.dispatchEvent(r),nn=null}else return t=vt(n),t!==null&&hp(t),e.blockedOn=n,!1;t.shift()}return!0}function Rp(e,t,n){Lp(e)&&n.delete(t)}function zp(){Tp=!1,Ep!==null&&Lp(Ep)&&(Ep=null),Dp!==null&&Lp(Dp)&&(Dp=null),Op!==null&&Lp(Op)&&(Op=null),kp.forEach(Rp),Ap.forEach(Rp)}function Bp(e,n){e.blockedOn===n&&(e.blockedOn=null,Tp||(Tp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,zp)))}var Vp=null;function Hp(e){Vp!==e&&(Vp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Vp===e&&(Vp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Cp(r||n)===null)continue;break}var a=vt(n);a!==null&&(e.splice(t,3),t-=3,Os(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Up(e){function t(t){return Bp(t,e)}Ep!==null&&Bp(Ep,e),Dp!==null&&Bp(Dp,e),Op!==null&&Bp(Op,e),kp.forEach(t),Ap.forEach(t);for(var n=0;n<jp.length;n++){var r=jp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jp.length&&(n=jp[0],n.blockedOn===null);)Ip(n),n.blockedOn===null&&jp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[lt]||null;if(typeof a==`function`)o||Hp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[lt]||null)s=o.formAction;else if(Cp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Hp(n)}}}function Wp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Gp(e){this._internalRoot=e}Kp.prototype.render=Gp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fp(n,xu(),e,t,null,null)},Kp.prototype.unmount=Gp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fp(e.current,2,null,e,null,null),Ou(),t[ut]=null}};function Kp(e){this._internalRoot=e}Kp.prototype.unstable_scheduleHydration=function(e){if(e){var t=at();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jp.length&&t!==0&&t<jp[n].priority;n++);jp.splice(n,0,e),n===0&&Ip(e)}};var qp=n.version;if(qp!==`19.2.4`)throw Error(i(527,qp,`19.2.4`));ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Jp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Yp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yp.isDisabled&&Yp.supportsFiber)try{Re=Yp.inject(Jp),ze=Yp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=see,s=P,c=Zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=up(e,1,!1,null,null,n,r,null,o,s,c,Wp),e[ut]=t.current,Md(e),new Gp(t)}})),y=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=v()})),b,x,S,C,w=o((()=>{b=`modulepreload`,x=function(e){return`/`+e},S={},C=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=x(t,n),t in S)return;S[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:b,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}}));function T(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function E(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return A(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:te(t)}return re(t,n,null,e)}function D(e,t){if(e===!1||e==null)throw Error(t)}function O(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ee(){return Math.random().toString(36).substring(2,10)}function k(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function A(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?ne(t):t,state:n,key:t&&t.key||r||ee(),unstable_mask:i}}function te({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function ne(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function re(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=T(e)?e:A(h.location,e,t);n&&n(r,e),l=u()+1;let d=k(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=T(e)?e:A(h.location,e,t);n&&n(r,e),l=u();let i=k(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ie(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Xt,d),c=e,()=>{i.removeEventListener(Xt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ie(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),D(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:te(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function j(e,t,n=`/`){return ae(e,t,n,!1)}function ae(e,t,n,r){let i=ge((typeof t==`string`?ne(t):t).pathname||`/`,n);if(i==null)return null;let a=se(e);le(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=he(i);o=fe(a[e],t,r)}return o}function oe(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function se(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;D(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=on([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(D(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),se(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ue(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ce(e.path))a(e,t,!0,n)}),t}function ce(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ce(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function le(e){e.sort((e,t)=>e.score===t.score?de(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}function ue(e,t){let n=e.split(`/`),r=n.length;return n.some(rn)&&(r+=nn),t&&(r+=$t),n.filter(e=>!rn(e)).reduce((e,t)=>e+(Zt.test(t)?Qt:t===``?en:tn),r)}function de(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function fe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=pe({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=pe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:on([a,u.pathname]),pathnameBase:sn(on([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=on([a,u.pathnameBase]))}return o}function pe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=me(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function me(e,t=!1,n=!0){O(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function he(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ge(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function _e(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?ne(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?ve(n.substring(1),`/`):ve(n,t)):a=t,{pathname:a,search:cn(r),hash:ln(i)}}function ve(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ye(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function be(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function xe(e){let t=be(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Se(e,t,n,r=!1){let i;typeof e==`string`?i=ne(e):(i={...e},D(!i.pathname||!i.pathname.includes(`?`),ye(`?`,`pathname`,`search`,i)),D(!i.pathname||!i.pathname.includes(`#`),ye(`#`,`pathname`,`hash`,i)),D(!i.search||!i.search.includes(`#`),ye(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=_e(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}function Ce(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function we(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}function Te(e,t){let n=e;if(typeof n!=`string`||!an.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(dn)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=ge(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{O(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}function Ee(){return Wt.useContext(gn)}function De(e){if(e.startsWith(`${wn}:${Tn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Oe(e){if(e.startsWith(`${wn}:${En}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new un(t.status,t.statusText,t.data)}catch{}}function ke(e,{relative:t}={}){D(Ae(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=Gt.useContext(bn),{hash:i,pathname:a,search:o}=Ie(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:on([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Ae(){return Gt.useContext(xn)!=null}function je(){return D(Ae(),`useLocation() may be used only in the context of a <Router> component.`),Gt.useContext(xn).location}function Me(e){Gt.useContext(bn).static||Gt.useLayoutEffect(e)}function Ne(){let{isDataRoute:e}=Gt.useContext(Sn);return e?Je():Pe()}function Pe(){D(Ae(),`useNavigate() may be used only in the context of a <Router> component.`);let e=Gt.useContext(mn),{basename:t,navigator:n}=Gt.useContext(bn),{matches:r}=Gt.useContext(Sn),{pathname:i}=je(),a=JSON.stringify(xe(r)),o=Gt.useRef(!1);return Me(()=>{o.current=!0}),Gt.useCallback((r,s={})=>{if(O(o.current,Dn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Se(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:on([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}function Fe(){let{matches:e}=Gt.useContext(Sn),t=e[e.length-1];return t?t.params:{}}function Ie(e,{relative:t}={}){let{matches:n}=Gt.useContext(Sn),{pathname:r}=je(),i=JSON.stringify(xe(n));return Gt.useMemo(()=>Se(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function eee(e,t){return Le(e,t)}function Le(e,t,n){D(Ae(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=Gt.useContext(bn),{matches:i}=Gt.useContext(Sn),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Ye(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=je(),d;if(t){let e=typeof t==`string`?ne(t):t;D(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=j(e,{pathname:p});O(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=ze(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:on([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:on([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?Gt.createElement(xn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function tee(){let e=qe(),t=Ce(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=Gt.createElement(Gt.Fragment,null,Gt.createElement(`p`,null,`💿 Hey developer 👋`),Gt.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,Gt.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,Gt.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),Gt.createElement(Gt.Fragment,null,Gt.createElement(`h2`,null,`Unexpected Application Error!`),Gt.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?Gt.createElement(`pre`,{style:i},n):null,o)}function nee({children:e,error:t}){let{basename:n}=Gt.useContext(bn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=De(t.digest);if(e){let r=An.get(t);if(r)throw r;let i=Te(e.location,n);if(dn&&!An.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw An.set(t,n),n}return Gt.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Re({routeContext:e,match:t,children:n}){let r=Gt.useContext(mn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),Gt.createElement(Sn.Provider,{value:e},n)}function ze(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);D(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:we(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||On,o&&(s<0&&c===0?(Ye(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?Gt.createElement(n.route.Component,null):n.route.element?n.route.element:e,Gt.createElement(Re,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?Gt.createElement(kn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Be(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ve(e){let t=Gt.useContext(mn);return D(t,Be(e)),t}function He(e){let t=Gt.useContext(hn);return D(t,Be(e)),t}function ree(e){let t=Gt.useContext(Sn);return D(t,Be(e)),t}function Ue(e){let t=ree(e),n=t.matches[t.matches.length-1];return D(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function We(){return Ue(`useRouteId`)}function Ge(){return He(`useNavigation`).navigation}function Ke(){let{matches:e,loaderData:t}=He(`useMatches`);return Gt.useMemo(()=>e.map(e=>oe(e,t)),[e,t])}function qe(){let e=Gt.useContext(Cn),t=He(`useRouteError`),n=Ue(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Je(){let{router:e}=Ve(`useNavigate`),t=Ue(`useNavigate`),n=Gt.useRef(!1);return Me(()=>{n.current=!0}),Gt.useCallback(async(r,i={})=>{O(n.current,Dn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}function Ye(e,t,n){!t&&!jn[e]&&(jn[e]=!0,O(!1,n))}function iee({routes:e,future:t,state:n,isStatic:r,onError:i}){return Le(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function Xe(e){D(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ze({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){D(!Ae(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=Kt.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=ne(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:m}=n,h=Kt.useMemo(()=>{let e=ge(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return O(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:Kt.createElement(bn.Provider,{value:c},Kt.createElement(xn.Provider,{children:t,value:h}))}function Qe({children:e,location:t}){return eee($e(e),t)}function $e(e,t=[]){let n=[];return Kt.Children.forEach(e,(e,r)=>{if(!Kt.isValidElement(e))return;let i=[...t,r];if(e.type===Kt.Fragment){n.push.apply(n,$e(e.props.children,i));return}D(e.type===Xe,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),D(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=$e(e.props.children,i)),n.push(a)}),n}function et(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function tt(e){return et(e)&&e.tagName.toLowerCase()===`button`}function nt(e){return et(e)&&e.tagName.toLowerCase()===`form`}function rt(e){return et(e)&&e.tagName.toLowerCase()===`input`}function it(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function at(e,t){return e.button===0&&(!t||t===`_self`)&&!it(e)}function ot(){if(Pn===null)try{new FormData(document.createElement(`form`),0),Pn=!1}catch{Pn=!0}return Pn}function st(e){return e!=null&&!Fn.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nn}"`),null):e}function ct(e,t){let n,r,i,a,o;if(nt(e)){let o=e.getAttribute(`action`);r=o?ge(o,t):null,n=e.getAttribute(`method`)||Mn,i=st(e.getAttribute(`enctype`))||Nn,a=new FormData(e)}else if(tt(e)||rt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ge(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Mn,i=st(e.getAttribute(`formenctype`))||st(o.getAttribute(`enctype`))||Nn,a=new FormData(o,e),!ot()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(et(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Mn,r=null,i=Nn,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}function lt(e){return e.replace(Ln,e=>In[e])}function ut(e,t){if(e===!1||e==null)throw Error(t)}function dt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&ge(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function ft(e,t){if(e.id in t)return t[e.id];try{let n=await C(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pt(e){return e!=null&&typeof e.page==`string`}function mt(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function ht(e,t,n){return bt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ft(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(mt).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function gt(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function _t(e,t,{includeHydrateFallback:n}={}){return vt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function vt(e){return[...new Set(e)]}function yt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function bt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!pt(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(yt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function xt(){let e=Jt.useContext(mn);return ut(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function St(){let e=Jt.useContext(hn);return ut(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}function Ct(){let e=Jt.useContext(Rn);return ut(e,`You must render this element inside a <HydratedRouter> element`),e}function wt(e,t){let n=Jt.useContext(Rn),[r,i]=Jt.useState(!1),[a,o]=Jt.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=Jt.useRef(null);Jt.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),Jt.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Tt(s,p),onBlur:Tt(c,m),onMouseEnter:Tt(l,p),onMouseLeave:Tt(u,m),onTouchStart:Tt(d,p)}]:[a,f,{}]:[!1,f,{}]}function Tt(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Et({page:e,...t}){let n=Ee(),{router:r}=xt(),i=Jt.useMemo(()=>j(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?Jt.createElement(Ot,{page:e,matches:i,...t}):Jt.createElement(kt,{page:e,matches:i,...t}):null}function Dt(e){let{manifest:t,routeModules:n}=Ct(),[r,i]=Jt.useState([]);return Jt.useEffect(()=>{let r=!1;return ht(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ot({page:e,matches:t,...n}){let r=je(),{future:i}=Ct(),{basename:a}=xt(),o=Jt.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=dt(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return Jt.createElement(Jt.Fragment,null,o.map(e=>Jt.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function kt({page:e,matches:t,...n}){let r=je(),{future:i,manifest:a,routeModules:o}=Ct(),{basename:s}=xt(),{loaderData:c,matches:l}=St(),u=Jt.useMemo(()=>gt(e,t,l,a,r,`data`),[e,t,l,a,r]),d=Jt.useMemo(()=>gt(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=Jt.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=dt(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=Jt.useMemo(()=>_t(d,a),[d,a]),m=Dt(d);return Jt.createElement(Jt.Fragment,null,f.map(e=>Jt.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>Jt.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>Jt.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function At(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}function jt({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=Yt.useRef();i.current??=E({window:r,v5Compat:!0});let a=i.current,[o,s]=Yt.useState({action:a.action,location:a.location}),c=Yt.useCallback(e=>{n===!1?s(e):Yt.startTransition(()=>s(e))},[n]);return Yt.useLayoutEffect(()=>a.listen(c),[a,c]),Yt.createElement(Ze,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function Mt({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=Yt.useState({action:n.action,location:n.location}),o=Yt.useCallback(e=>{r===!1?a(e):Yt.startTransition(()=>a(e))},[r]);return Yt.useLayoutEffect(()=>n.listen(o),[n,o]),Yt.createElement(Ze,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}function Nt({getKey:e,storageKey:t,...n}){let r=Yt.useContext(Rn),{basename:i}=Yt.useContext(bn),a=je(),o=Ke();Vt({getKey:e,storageKey:t});let s=Yt.useMemo(()=>{if(!r||!e)return null;let t=Bt(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return Yt.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${lt(JSON.stringify(t||Kn))}, ${lt(JSON.stringify(s))})`}})}function Pt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ft(e){let t=Yt.useContext(mn);return D(t,Pt(e)),t}function It(e){let t=Yt.useContext(hn);return D(t,Pt(e)),t}function Lt(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=Ne(),d=je(),f=Ie(e,{relative:o});return Yt.useCallback(p=>{if(at(p,t)){p.preventDefault();let t=n===void 0?te(d)===te(f):n,m=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?Yt.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Rt(){let{router:e}=Ft(`useSubmit`),{basename:t}=Yt.useContext(bn),n=We(),r=e.fetch,i=e.navigate;return Yt.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ct(e,t);a.navigate===!1?await r(a.fetcherKey||Gn(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function zt(e,{relative:t}={}){let{basename:n}=Yt.useContext(bn),r=Yt.useContext(Sn);D(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Ie(e||`.`,{relative:t})},o=je();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:on([n,a.pathname])),te(a)}function Bt(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:ge(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Vt({getKey:e,storageKey:t}={}){let{router:n}=Ft(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=It(`useScrollRestoration`),{basename:a}=Yt.useContext(bn),o=je(),s=Ke(),c=Ge();Yt.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ht(Yt.useCallback(()=>{if(c.state===`idle`){let t=Bt(o,s,a,e);qn[t]=window.scrollY}try{sessionStorage.setItem(t||Kn,JSON.stringify(qn))}catch(e){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(Yt.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Kn);e&&(qn=JSON.parse(e))}catch{}},[t]),Yt.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(qn,()=>window.scrollY,e?(t,n)=>Bt(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),Yt.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{O(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Ht(e,t){let{capture:n}=t||{};Yt.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Ut(e,{relative:t}={}){let n=Yt.useContext(_n);D(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ft(`useViewTransitionState`),i=Ie(e,{relative:t});if(!n.isTransitioning)return!1;let a=ge(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ge(n.nextLocation.pathname,r)||n.nextLocation.pathname;return pe(i.pathname,o)!=null||pe(i.pathname,a)!=null}var Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn=o((()=>{Wt=u(p(),1),Gt=u(p(),1),Kt=u(p(),1),p(),qt=u(p(),1),Jt=u(p(),1),p(),p(),p(),Yt=u(p(),1),p(),w(),Xt=`popstate`,Zt=/^:[\w-]+$/,Qt=3,$t=2,en=1,tn=10,nn=-2,rn=e=>e===`*`,an=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,on=e=>e.join(`/`).replace(/\/\/+/g,`/`),sn=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),cn=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ln=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,un=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}},dn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`),fn=[`POST`,`PUT`,`PATCH`,`DELETE`],new Set(fn),pn=[`GET`,...fn],new Set(pn),mn=Wt.createContext(null),mn.displayName=`DataRouter`,hn=Wt.createContext(null),hn.displayName=`DataRouterState`,gn=Wt.createContext(!1),_n=Wt.createContext({isTransitioning:!1}),_n.displayName=`ViewTransition`,vn=Wt.createContext(new Map),vn.displayName=`Fetchers`,yn=Wt.createContext(null),yn.displayName=`Await`,bn=Wt.createContext(null),bn.displayName=`Navigation`,xn=Wt.createContext(null),xn.displayName=`Location`,Sn=Wt.createContext({outlet:null,matches:[],isDataRoute:!1}),Sn.displayName=`Route`,Cn=Wt.createContext(null),Cn.displayName=`RouteError`,wn=`REACT_ROUTER_ERROR`,Tn=`REDIRECT`,En=`ROUTE_ERROR_RESPONSE`,Dn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`,Gt.createContext(null),On=Gt.createElement(tee,null),kn=class extends Gt.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Oe(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:Gt.createElement(Sn.Provider,{value:this.props.routeContext},Gt.createElement(Cn.Provider,{value:e,children:this.props.component}));return this.context?Gt.createElement(nee,{error:e},t):t}},kn.contextType=gn,An=new WeakMap,jn={},Kt.useOptimistic,Kt.memo(iee),Kt.Component,Mn=`get`,Nn=`application/x-www-form-urlencoded`,Pn=null,Fn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]),Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`),In={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ln=/[&><\u2028\u2029]/g,Rn=Jt.createContext(void 0),Rn.displayName=`FrameworkContext`,qt.Component,zn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{zn&&(window.__reactRouterVersion=`7.14.0`)}catch{}Mt.displayName=`unstable_HistoryRouter`,Bn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vn=Yt.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,unstable_useTransitions:_}=Yt.useContext(bn),v=typeof l==`string`&&Bn.test(l),y=Te(l,h);l=y.to;let b=ke(l,{relative:r}),x=je(),S=null;if(o){let e=Se(o,[],x.unstable_mask?x.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:on([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=wt(n,p),E=Lt(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),ee=Yt.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:At(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?Yt.createElement(Yt.Fragment,null,ee,Yt.createElement(Et,{page:b})):ee}),Vn.displayName=`Link`,Hn=Yt.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Ie(a,{relative:c.relative}),d=je(),f=Yt.useContext(hn),{navigator:p,basename:m}=Yt.useContext(bn),h=f!=null&&Ut(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=ge(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return Yt.createElement(Vn,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)}),Hn.displayName=`NavLink`,Un=Yt.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Mn,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=Yt.useContext(bn),g=Rt(),_=zt(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Bn.test(s);return Yt.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?Yt.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})}),Un.displayName=`Form`,Nt.displayName=`ScrollRestoration`,Wn=0,Gn=()=>`__${String(++Wn)}__`,Kn=`react-router-scroll-positions`,qn={}})),Yn=o((()=>{Jn()})),Xn=o((()=>{Yn()}));function Zn(e){return Object.keys(e)}var Qn=o((()=>{}));function $n(e){return e&&typeof e==`object`&&!Array.isArray(e)}function er(e,t){let n={...e},r=t;return $n(e)&&$n(t)&&Object.keys(t).forEach(t=>{$n(r[t])&&t in e?n[t]=er(n[t],r[t]):n[t]=r[t]}),n}var tr=o((()=>{}));function nr(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}var rr=o((()=>{}));function ir(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function ar(e){let t=ir(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}var or=o((()=>{}));function sr(e){return e===`0rem`?`0rem`:`calc(${e} * var(--mantine-scale))`}function cr(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r===`0`)return`0${e}`;if(typeof r==`number`){let n=`${r/16}${e}`;return t?sr(n):n}if(typeof r==`string`){if(r===``||r.startsWith(`calc(`)||r.startsWith(`clamp(`)||r.includes(`rgba(`))return r;if(r.includes(`,`))return r.split(`,`).map(e=>n(e)).join(`,`);if(r.includes(` `))return r.split(` `).map(e=>n(e)).join(` `);let i=r.replace(`px`,``);if(!Number.isNaN(Number(i))){let n=`${Number(i)/16}${e}`;return t?sr(n):n}}return r}return n}var M,lr,ur=o((()=>{M=cr(`rem`,{shouldScale:!0}),lr=cr(`em`)}));function dr(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}var fr=o((()=>{}));function pr(e){if(typeof e==`number`)return!0;if(typeof e==`string`){if(e.startsWith(`calc(`)||e.startsWith(`var(`)||e.includes(` `)&&e.trim()!==``)return!0;let t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(e=>t.test(e))}return!1}var mr=o((()=>{}));function hr(e){return Array.isArray(e)||e===null?!1:typeof e==`object`?e.type!==gr.Fragment:!1}var gr,_r=o((()=>{gr=u(p(),1)})),aee=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),N=s(((e,t)=>{t.exports=aee()}));function vr(e){let t=(0,br.createContext)(null);return[({children:e,value:n})=>(0,yr.jsx)(t.Provider,{value:n,children:e}),()=>{let n=(0,br.useContext)(t);if(n===null)throw Error(e);return n}]}var yr,br,xr=o((()=>{yr=N(),br=u(p(),1)}));function Sr(e=null){let t=(0,wr.createContext)(e);return[({children:e,value:n})=>(0,Cr.jsx)(t.Provider,{value:n,children:e}),()=>(0,wr.useContext)(t)]}var Cr,wr,Tr=o((()=>{Cr=N(),wr=u(p(),1)}));function Er(e,t){return n=>{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var Dr=o((()=>{}));function Or(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}var kr=o((()=>{}));function Ar(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function jr(e,t,n){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(n){for(let e=0;e<t.length;e+=1)if(!t[e].disabled)return e}return e}function Mr(e,t,n){return Or(e,n)===Or(t,n)}function Nr({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:a=`rtl`,orientation:o}){return s=>{n?.(s);let c=Array.from(Or(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>Mr(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=jr(l,c,r),d=Ar(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),!c[0].disabled&&c[0].focus();break;case`End`:{s.stopPropagation(),s.preventDefault();let e=c.length-1;!c[e].disabled&&c[e].focus();break}}}}var Pr=o((()=>{kr()}));function Fr(e){return Ir[e]}var Ir,Lr=o((()=>{Ir={app:100,modal:200,popover:300,overlay:400,max:9999}})),Rr,zr=o((()=>{Rr=()=>{}}));function Br(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Rr:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}var Vr=o((()=>{zr()}));function Hr(e,t=`size`,n=!0){if(e!==void 0)return pr(e)?n?M(e):e:`var(--${t}-${e})`}function Ur(e){return Hr(e,`mantine-spacing`)}function Wr(e){return e===void 0?`var(--mantine-radius-default)`:Hr(e,`mantine-radius`)}function Gr(e){return Hr(e,`mantine-font-size`)}function Kr(e){return Hr(e,`mantine-line-height`,!1)}function qr(e){if(e)return Hr(e,`mantine-shadow`,!1)}var Jr=o((()=>{mr(),ur()}));function Yr(e,t){return n=>{e?.(n),t?.(n)}}var Xr=o((()=>{}));function Zr(e,t,n){return n?Array.from(Or(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}var Qr=o((()=>{kr()}));function $r(e=`mantine-`){return`${e}${Math.random().toString(36).slice(2,11)}`}var ei=o((()=>{}));function ti(e){let t=(0,ni.useRef)(e);return(0,ni.useEffect)(()=>{t.current=e}),(0,ni.useMemo)(()=>((...e)=>t.current?.(...e)),[])}var ni,ri=o((()=>{ni=u(p(),1)}));function ii(e,t,n){let r=(0,ai.useRef)(null),i=t||oi;return(0,ai.useEffect)(()=>{let t=t=>{let{target:i}=t??{};if(Array.isArray(n)){let r=!document.body.contains(i)&&i?.tagName!==`HTML`;n.every(e=>!!e&&!t.composedPath().includes(e))&&!r&&e(t)}else r.current&&!r.current.contains(i)&&e(t)};return i.forEach(e=>document.addEventListener(e,t)),()=>{i.forEach(e=>document.removeEventListener(e,t))}},[r,e,n]),r}var ai,oi,si=o((()=>{ai=u(p(),1),oi=[`mousedown`,`touchstart`]}));function ci(e,t){try{return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function li(e,t){return typeof window<`u`&&`matchMedia`in window?window.matchMedia(e).matches:!1}function ui(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,di.useState)(n?t:li(e));return(0,di.useEffect)(()=>{try{let t=window.matchMedia(e);return i(t.matches),ci(t,e=>i(e.matches))}catch{return}},[e]),r||!1}var di,fi=o((()=>{di=u(p(),1)})),pi,mi,hi=o((()=>{pi=u(p(),1),mi=typeof document<`u`?pi.useLayoutEffect:pi.useEffect}));function gi(e,t){let n=(0,_i.useRef)(!1);(0,_i.useEffect)(()=>()=>{n.current=!1},[]),(0,_i.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}var _i,vi=o((()=>{_i=u(p(),1)}));function yi({opened:e,shouldReturnFocus:t=!0}){let n=(0,bi.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return gi(()=>{let i=-1,a=e=>{e.key===`Tab`&&window.clearTimeout(i)};return document.addEventListener(`keydown`,a),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,a)}},[e,t]),r}var bi,xi=o((()=>{bi=u(p(),1),vi()}));function Si(e){return e.style.display===`none`}function Ci(e){if(e.getAttribute(`aria-hidden`)||e.getAttribute(`hidden`)||e.getAttribute(`type`)===`hidden`)return!1;let t=e;for(;t&&!(t===document.body||t.nodeType===11);){if(Si(t))return!1;t=t.parentNode}return!0}function wi(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function Ti(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(wi(e));return(Oi.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&Ci(e)}function Ei(e){let t=wi(e);return(Number.isNaN(t)||t>=0)&&Ti(e)}function Di(e){return Array.from(e.querySelectorAll(ki)).filter(Ei)}var Oi,ki,Ai=o((()=>{Oi=/input|select|textarea|button|object/,ki=`a, input, select, textarea, button, object, [tabindex]`}));function ji(e,t){let n=Di(e);if(!n.length){t.preventDefault();return}let r=n[t.shiftKey?0:n.length-1],i=e.getRootNode(),a=r===i.activeElement||e===i.activeElement,o=i.activeElement;if(o.tagName===`INPUT`&&o.getAttribute(`type`)===`radio`&&(a=n.filter(e=>e.getAttribute(`type`)===`radio`&&e.getAttribute(`name`)===o.getAttribute(`name`)).includes(r)),!a)return;t.preventDefault();let s=n[t.shiftKey?n.length-1:0];s&&s.focus()}var Mi=o((()=>{Ai()}));function Ni(e=!0){let t=(0,Pi.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(ki));t=n.find(Ei)||n.find(Ti)||null,!t&&Ti(e)&&(t=e)}t&&t.focus({preventScroll:!0})},r=(0,Pi.useCallback)(r=>{e&&r!==null&&t.current!==r&&(r?(setTimeout(()=>{r.getRootNode()&&n(r)}),t.current=r):t.current=null)},[e]);return(0,Pi.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));let r=e=>{e.key===`Tab`&&t.current&&ji(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}var Pi,Fi=o((()=>{Pi=u(p(),1),Mi(),Ai()}));function Ii(){let e=Ri();return e?`mantine-${e.replace(/:/g,``)}`:``}var Li,Ri,zi=o((()=>{Li=u(p(),1),Ri=Li.default.useId||(()=>void 0)}));function Bi(e){let t=Ii(),[n,r]=(0,Vi.useState)(t);return mi(()=>{r($r())},[]),typeof e==`string`?e:typeof window>`u`?t:n}var Vi,Hi=o((()=>{Vi=u(p(),1),hi(),ei(),zi()}));function Ui(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function Wi(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=Ui(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():Ui(e,null)}),t.clear()}}}function Gi(...e){return(0,Ki.useCallback)(Wi(...e),e)}var Ki,qi=o((()=>{Ki=u(p(),1)}));function Ji({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,Yi.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var Yi,Xi=o((()=>{Yi=u(p(),1)}));function Zi(e,t){return ui(`(prefers-reduced-motion: reduce)`,e,t)}var Qi=o((()=>{fi()}));function $i(){let[e,t]=(0,ea.useState)(!1),n=(0,ea.useRef)(null),r=(0,ea.useCallback)(()=>{t(!0)},[]),i=(0,ea.useCallback)(()=>{t(!1)},[]);return{ref:(0,ea.useCallback)(e=>{n.current&&(n.current.removeEventListener(`mouseenter`,r),n.current.removeEventListener(`mouseleave`,i)),e&&(e.addEventListener(`mouseenter`,r),e.addEventListener(`mouseleave`,i)),n.current=e},[r,i]),hovered:e}}var ea,ta=o((()=>{ea=u(p(),1)}));function na(e=!1,t={}){let[n,r]=(0,ra.useState)(e),i=(0,ra.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,ra.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,ra.useCallback)(()=>{n?a():i()},[a,i,n])}]}var ra,ia=o((()=>{ra=u(p(),1)}));function aa(e){return e.currentTarget instanceof HTMLElement&&e.relatedTarget instanceof HTMLElement?e.currentTarget.contains(e.relatedTarget):!1}function oa({onBlur:e,onFocus:t}={}){let[n,r]=(0,sa.useState)(!1),i=(0,sa.useRef)(!1),a=(0,sa.useRef)(null),o=ti(t),s=ti(e),c=(0,sa.useCallback)(e=>{r(e),i.current=e},[]),l=(0,sa.useCallback)(e=>{i.current||(c(!0),o(e))},[]),u=(0,sa.useCallback)(e=>{i.current&&!aa(e)&&(c(!1),s(e))},[]),d=(0,sa.useCallback)(e=>{e&&(a.current&&(a.current.removeEventListener(`focusin`,l),a.current.removeEventListener(`focusout`,u)),e.addEventListener(`focusin`,l),e.addEventListener(`focusout`,u),a.current=e)},[l,u]);return(0,sa.useEffect)(()=>()=>{a.current&&(a.current.removeEventListener(`focusin`,l),a.current.removeEventListener(`focusout`,u))},[]),{ref:d,focused:n}}var sa,ca=o((()=>{sa=u(p(),1),ri()})),la=o((()=>{si(),xi(),vi(),Fi(),Hi(),hi(),qi(),Qi(),Xi(),ta(),ia(),ca()}));function ua(e){return e?.props?.ref}var da=o((()=>{p()}));function fa(e){let t=pa.Children.toArray(e);return t.length!==1||!hr(t[0])?null:t[0]}var pa,ma=o((()=>{pa=u(p(),1),_r()}));function ha(e){return e}var ga=o((()=>{}));function _a(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=_a(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function va(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_a(e))&&(r&&(r+=` `),r+=t);return r}var ya=o((()=>{}));function ba(e){let t={};return e.forEach(e=>{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=va(t[e],n):t[e]=n})}),t}function xa({theme:e,classNames:t,props:n,stylesCtx:r}){return ba((Array.isArray(t)?t:[t]).map(t=>typeof t==`function`?t(e,n,r):t||Sa))}var Sa,Ca=o((()=>{ya(),Sa={}}));function wa({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((t,i)=>typeof i==`function`?{...t,...i(e,n,r)}:{...t,...i},{})}var Ta=o((()=>{}));function Ea(){let e=(0,Fa.useContext)(Ia);if(!e)throw Error(`[@mantine/core] MantineProvider was not found in tree`);return e}function Da(){return Ea().cssVariablesResolver}function Oa(){return Ea().classNamesPrefix}function ka(){return Ea().getStyleNonce}function Aa(){return Ea().withStaticClasses}function ja(){return Ea().headless}function Ma(){return Ea().stylesTransform?.sx}function Na(){return Ea().stylesTransform?.styles}function Pa(){return Ea().env||`default`}var Fa,Ia,La=o((()=>{Fa=u(p(),1),Ia=(0,Fa.createContext)(null)}));function Ra(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function za(e){let t=e.replace(`#`,``);if(t.length===3){let e=t.split(``);t=[e[0],e[0],e[1],e[1],e[2],e[2]].join(``)}if(t.length===8){let e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function Ba(e){let[t,n,r,i]=e.replace(/[^0-9,./]/g,``).split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function Va(e){let t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};let n=parseInt(t[1],10),r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100,a=t[5]?parseFloat(t[5]):void 0,o=(1-Math.abs(2*i-1))*r,s=n/60,c=o*(1-Math.abs(s%2-1)),l=i-o/2,u,d,f;return s>=0&&s<1?(u=o,d=c,f=0):s>=1&&s<2?(u=c,d=o,f=0):s>=2&&s<3?(u=0,d=o,f=c):s>=3&&s<4?(u=0,d=c,f=o):s>=4&&s<5?(u=c,d=0,f=o):(u=o,d=0,f=c),{r:Math.round((u+l)*255),g:Math.round((d+l)*255),b:Math.round((f+l)*255),a:a||1}}function Ha(e){return Ra(e)?za(e):e.startsWith(`rgb`)?Ba(e):e.startsWith(`hsl`)?Va(e):{r:0,g:0,b:0,a:1}}var Ua=o((()=>{}));function Wa(e,t){if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, black ${t*100}%)`;let{r:n,g:r,b:i,a}=Ha(e),o=1-t,s=e=>Math.round(e*o);return`rgba(${s(n)}, ${s(r)}, ${s(i)}, ${a})`}var Ga=o((()=>{Ua()}));function Ka(e,t){return typeof e.primaryShade==`number`?e.primaryShade:t===`dark`?e.primaryShade.dark:e.primaryShade.light}var qa=o((()=>{}));function Ja(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function Ya(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function Xa(e){if(e.startsWith(`oklch(`))return(Ya(e)||0)/100;let{r:t,g:n,b:r}=Ha(e),i=t/255,a=n/255,o=r/255,s=Ja(i),c=Ja(a),l=Ja(o);return .2126*s+.7152*c+.0722*l}function Za(e,t=.179){return e.startsWith(`var(`)?!1:Xa(e)>t}var Qa=o((()=>{Ua()}));function $a({color:e,theme:t,colorScheme:n}){if(typeof e!=`string`)throw Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e===`bright`)return{color:e,value:n===`dark`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Za(n===`dark`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-bright`};if(e===`dimmed`)return{color:e,value:n===`dark`?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Za(n===`dark`?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:`--mantine-color-dimmed`};if(e===`white`||e===`black`)return{color:e,value:e===`white`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Za(e===`white`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};let[r,i]=e.split(`.`),a=i?Number(i):void 0,o=r in t.colors;if(o){let e=a===void 0?t.colors[r][Ka(t,n||`light`)]:t.colors[r][a];return{color:r,value:e,shade:a,isThemeColor:o,isLight:Za(e,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${a}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:Za(e,t.luminanceThreshold),shade:a,variable:void 0}}var eo=o((()=>{qa(),Qa()}));function to(e,t){let n=$a({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}var no=o((()=>{eo()}));function ro(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=to(n.from,t),i=to(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}var io=o((()=>{no()}));function ao(e,t){if(typeof e!=`string`||t>1||t<0)return`rgba(0, 0, 0, 1)`;if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith(`oklch`))return e.includes(`/`)?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(`)`,` / ${t})`);let{r:n,g:r,b:i}=Ha(e);return`rgba(${n}, ${r}, ${i}, ${t})`}var oo,so=o((()=>{Ua(),oo=ao})),co,lo=o((()=>{ur(),p(),N(),Ga(),io(),eo(),so(),co=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{let a=$a({color:e,theme:t}),o=typeof i==`boolean`?i:t.autoContrast;if(n===`none`)return{background:`transparent`,hover:`transparent`,color:`inherit`,border:`none`};if(n===`filled`){let t=o&&a.isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`;return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:t,border:`${M(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:t,border:`${M(1)} solid transparent`}:{background:e,hover:Wa(e,.1),color:t,border:`${M(1)} solid transparent`}}if(n===`light`){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${M(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:ao(n,.1),hover:ao(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${M(1)} solid transparent`}}return{background:ao(e,.1),hover:ao(e,.12),color:e,border:`${M(1)} solid transparent`}}if(n===`outline`)return a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${M(1)} solid var(--mantine-color-${e}-outline)`}:{background:`transparent`,hover:ao(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${M(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:`transparent`,hover:ao(e,.05),color:e,border:`${M(1)} solid ${e}`};if(n===`subtle`){if(a.isThemeColor){if(a.shade===void 0)return{background:`transparent`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${M(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:`transparent`,hover:ao(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${M(1)} solid transparent`}}return{background:`transparent`,hover:ao(e,.12),color:e,border:`${M(1)} solid transparent`}}return n===`transparent`?a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${e}-light-color)`,border:`${M(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${M(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:e,border:`${M(1)} solid transparent`}:n===`white`?a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-white)`,hover:Wa(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${M(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:Wa(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${M(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:Wa(t.white,.01),color:e,border:`${M(1)} solid transparent`}:n===`gradient`?{background:ro(r,t),hover:ro(r,t),color:`var(--mantine-color-white)`,border:`none`}:n===`default`?{background:`var(--mantine-color-default)`,hover:`var(--mantine-color-default-hover)`,color:`var(--mantine-color-default-color)`,border:`${M(1)} solid var(--mantine-color-default-border)`}:{}}})),uo,fo=o((()=>{uo={dark:[`#C9C9C9`,`#b8b8b8`,`#828282`,`#696969`,`#424242`,`#3b3b3b`,`#2e2e2e`,`#242424`,`#1f1f1f`,`#141414`],gray:[`#f8f9fa`,`#f1f3f5`,`#e9ecef`,`#dee2e6`,`#ced4da`,`#adb5bd`,`#868e96`,`#495057`,`#343a40`,`#212529`],red:[`#fff5f5`,`#ffe3e3`,`#ffc9c9`,`#ffa8a8`,`#ff8787`,`#ff6b6b`,`#fa5252`,`#f03e3e`,`#e03131`,`#c92a2a`],pink:[`#fff0f6`,`#ffdeeb`,`#fcc2d7`,`#faa2c1`,`#f783ac`,`#f06595`,`#e64980`,`#d6336c`,`#c2255c`,`#a61e4d`],grape:[`#f8f0fc`,`#f3d9fa`,`#eebefa`,`#e599f7`,`#da77f2`,`#cc5de8`,`#be4bdb`,`#ae3ec9`,`#9c36b5`,`#862e9c`],violet:[`#f3f0ff`,`#e5dbff`,`#d0bfff`,`#b197fc`,`#9775fa`,`#845ef7`,`#7950f2`,`#7048e8`,`#6741d9`,`#5f3dc4`],indigo:[`#edf2ff`,`#dbe4ff`,`#bac8ff`,`#91a7ff`,`#748ffc`,`#5c7cfa`,`#4c6ef5`,`#4263eb`,`#3b5bdb`,`#364fc7`],blue:[`#e7f5ff`,`#d0ebff`,`#a5d8ff`,`#74c0fc`,`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`,`#1864ab`],cyan:[`#e3fafc`,`#c5f6fa`,`#99e9f2`,`#66d9e8`,`#3bc9db`,`#22b8cf`,`#15aabf`,`#1098ad`,`#0c8599`,`#0b7285`],teal:[`#e6fcf5`,`#c3fae8`,`#96f2d7`,`#63e6be`,`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`,`#087f5b`],green:[`#ebfbee`,`#d3f9d8`,`#b2f2bb`,`#8ce99a`,`#69db7c`,`#51cf66`,`#40c057`,`#37b24d`,`#2f9e44`,`#2b8a3e`],lime:[`#f4fce3`,`#e9fac8`,`#d8f5a2`,`#c0eb75`,`#a9e34b`,`#94d82d`,`#82c91e`,`#74b816`,`#66a80f`,`#5c940d`],yellow:[`#fff9db`,`#fff3bf`,`#ffec99`,`#ffe066`,`#ffd43b`,`#fcc419`,`#fab005`,`#f59f00`,`#f08c00`,`#e67700`],orange:[`#fff4e6`,`#ffe8cc`,`#ffd8a8`,`#ffc078`,`#ffa94d`,`#ff922b`,`#fd7e14`,`#f76707`,`#e8590c`,`#d9480f`]}})),po,mo,ho=o((()=>{ur(),p(),N(),lo(),fo(),po=`-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji`,mo={scale:1,fontSmoothing:!0,focusRing:`auto`,white:`#fff`,black:`#000`,colors:uo,primaryShade:{light:6,dark:8},primaryColor:`blue`,variantColorResolver:co,autoContrast:!1,luminanceThreshold:.3,fontFamily:po,fontFamilyMonospace:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace`,respectReducedMotion:!1,cursorType:`default`,defaultGradient:{from:`blue`,to:`cyan`,deg:45},defaultRadius:`sm`,activeClassName:`mantine-active`,focusClassName:``,headings:{fontFamily:po,fontWeight:`700`,textWrap:`wrap`,sizes:{h1:{fontSize:M(34),lineHeight:`1.3`},h2:{fontSize:M(26),lineHeight:`1.35`},h3:{fontSize:M(22),lineHeight:`1.4`},h4:{fontSize:M(18),lineHeight:`1.45`},h5:{fontSize:M(16),lineHeight:`1.5`},h6:{fontSize:M(14),lineHeight:`1.5`}}},fontSizes:{xs:M(12),sm:M(14),md:M(16),lg:M(18),xl:M(20)},lineHeights:{xs:`1.4`,sm:`1.45`,md:`1.55`,lg:`1.6`,xl:`1.65`},radius:{xs:M(2),sm:M(4),md:M(8),lg:M(16),xl:M(32)},spacing:{xs:M(10),sm:M(12),md:M(16),lg:M(20),xl:M(32)},breakpoints:{xs:`36em`,sm:`48em`,md:`62em`,lg:`75em`,xl:`88em`},shadows:{xs:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), 0 ${M(1)} ${M(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${M(10)} ${M(15)} ${M(-5)}, rgba(0, 0, 0, 0.04) 0 ${M(7)} ${M(7)} ${M(-5)}`,md:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${M(20)} ${M(25)} ${M(-5)}, rgba(0, 0, 0, 0.04) 0 ${M(10)} ${M(10)} ${M(-5)}`,lg:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${M(28)} ${M(23)} ${M(-7)}, rgba(0, 0, 0, 0.04) 0 ${M(12)} ${M(12)} ${M(-7)}`,xl:`0 ${M(1)} ${M(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${M(36)} ${M(28)} ${M(-7)}, rgba(0, 0, 0, 0.04) 0 ${M(17)} ${M(17)} ${M(-7)}`},other:{},components:{}}}));function go(e){return e===`auto`||e===`dark`||e===`light`}var _o=o((()=>{}));function vo({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return go(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&go(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}var yo=o((()=>{_o()}));function bo(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function xo(e){if(!(e.primaryColor in e.colors))throw Error(Co);if(typeof e.primaryShade==`object`&&(!bo(e.primaryShade.dark)||!bo(e.primaryShade.light))||typeof e.primaryShade==`number`&&!bo(e.primaryShade))throw Error(wo)}function So(e,t){if(!t)return xo(e),e;let n=er(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),xo(n),n}var Co,wo,To=o((()=>{tr(),p(),N(),Co=`[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color`,wo=`[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }`}));function Eo(){let e=(0,ko.useContext)(Ao);if(!e)throw Error(`@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app`);return e}function Do({theme:e,children:t,inherit:n=!0}){let r=jo(),i=(0,ko.useMemo)(()=>So(n?r:mo,e),[e,r,n]);return(0,Oo.jsx)(Ao.Provider,{value:i,children:t})}var Oo,ko,Ao,jo,Mo=o((()=>{Oo=N(),ko=u(p(),1),ho(),To(),Ao=(0,ko.createContext)(null),jo=()=>(0,ko.useContext)(Ao)||mo,Do.displayName=`@mantine/core/MantineThemeProvider`}));function No(){let e=Eo(),t=ka(),n=Zn(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=ar(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:lr(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:lr(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,Po.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}var Po,Fo=o((()=>{Po=N(),Qn(),or(),ur(),p(),La(),Mo()}));function Io(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}var Lo=o((()=>{}));function Ro(e,t){let n=t?[t]:[`:root`,`:host`],r=Io(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=Io(e.dark),o=Io(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}
|
|
12
|
+
|
|
13
|
+
${a?`${s(`dark`)}{${a}}`:``}
|
|
14
|
+
|
|
15
|
+
${o?`${s(`light`)}{${o}}`:``}`}var zo=o((()=>{Lo()}));function Bo({color:e,theme:t,autoContrast:n}){return(typeof n==`boolean`?n:t.autoContrast)&&$a({color:e||t.primaryColor,theme:t}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function Vo(e,t){return Bo({color:e.colors[e.primaryColor][Ka(e,t)],theme:e,autoContrast:null})}var Ho=o((()=>{qa(),eo()}));function Uo({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=Ka(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:oo(e.colors[t][n],.1),[`--mantine-color-${r}-light-hover`]:oo(e.colors[t][n],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:oo(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=Ka(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:oo(e.colors[t][Math.max(0,a-2)],.15),[`--mantine-color-${r}-light-hover`]:oo(e.colors[t][Math.max(0,a-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(a-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:oo(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}var Wo=o((()=>{qa(),p(),N(),so()}));function Go(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}var Ko=o((()=>{p(),N()}));function qo(e,t,n){Zn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var Jo,Yo=o((()=>{Qn(),ur(),p(),N(),qa(),Ho(),Wo(),Ko(),Jo=e=>{let t=Ka(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:M(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":Vo(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":Vo(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};qo(r.variables,e.breakpoints,`breakpoint`),qo(r.variables,e.spacing,`spacing`),qo(r.variables,e.fontSizes,`font-size`),qo(r.variables,e.lineHeights,`line-height`),qo(r.variables,e.shadows,`shadow`),qo(r.variables,e.radius,`radius`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),Zn(e.colors).forEach(t=>{let n=e.colors[t];if(Go(n)){Object.assign(r.light,Uo({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,Uo({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0}));return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,Uo({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,Uo({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return Zn(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r}}));function Xo({theme:e,generator:t}){let n=Jo(e),r=t?.(e);return r?er(n,r):n}var Zo=o((()=>{tr(),p(),N(),Yo()}));function Qo(e){let t={variables:{},light:{},dark:{}};return Zn(e.variables).forEach(n=>{$o.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Zn(e.light).forEach(n=>{$o.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Zn(e.dark).forEach(n=>{$o.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}var $o,es=o((()=>{Qn(),p(),N(),ho(),Yo(),$o=Jo(mo)}));function ts(e){return Ro({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function ns({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=Eo(),r=ka(),i=Xo({theme:n,generator:Da()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=Ro(a?Qo(i):i,e);return o?(0,rs.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:ts(e)}`}}):null}var rs,is=o((()=>{rs=N(),zo(),La(),Mo(),Zo(),es(),ns.displayName=`@mantine/CssVariables`}));function as(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function ss({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,cs.useRef)(null),[a,o]=(0,cs.useState)(()=>e.get(t)),s=r||a,c=(0,cs.useCallback)(t=>{r||(as(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,cs.useCallback)(()=>{o(t),as(t,n),e.clear()},[e.clear,t]);return(0,cs.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),mi(()=>{as(e.get(t),n)},[]),(0,cs.useEffect)(()=>{if(r)return as(r,n),()=>{};r===void 0&&as(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&as(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}var cs,ls=o((()=>{cs=u(p(),1),la()}));function us({respectReducedMotion:e,getRootElement:t}){mi(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}var ds=o((()=>{la()}));function fs({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:s,classNamesPrefix:c=`mantine`,colorSchemeManager:l=vo(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:p,stylesTransform:m,env:h}){let{colorScheme:g,setColorScheme:_,clearColorScheme:v}=ss({defaultColorScheme:u,forceColorScheme:p,manager:l,getRootElement:d});return us({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,ms.jsx)(Ia.Provider,{value:{colorScheme:g,setColorScheme:_,clearColorScheme:v,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:m,env:h},children:(0,ms.jsxs)(Do,{theme:e,children:[o&&(0,ms.jsx)(ns,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,ms.jsx)(No,{}),t]})})}function ps({children:e,theme:t,env:n}){return(0,ms.jsx)(Ia.Provider,{value:{colorScheme:`auto`,setColorScheme:()=>{},clearColorScheme:()=>{},getRootElement:()=>document.documentElement,classNamesPrefix:`mantine`,cssVariablesSelector:`:root`,withStaticClasses:!1,headless:!0,env:n},children:(0,ms.jsx)(Do,{theme:t,children:e})})}var ms,hs=o((()=>{ms=N(),yo(),La(),Fo(),is(),p(),Mo(),ls(),ds(),fs.displayName=`@mantine/core/MantineProvider`,ps.displayName=`@mantine/core/HeadlessMantineProvider`}));function gs({classNames:e,styles:t,props:n,stylesCtx:r}){let i=Eo();return{resolvedClassNames:xa({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:wa({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}var _s=o((()=>{p(),N(),Mo(),Ca(),Ta()}));function vs({theme:e,options:t,unstyled:n}){return va(t?.focusable&&!n&&(e.focusClassName||ys[e.focusRing]),t?.active&&!n&&e.activeClassName)}var ys,bs=o((()=>{ya(),ys={always:`mantine-focus-always`,auto:`mantine-focus-auto`,never:`mantine-focus-never`}}));function xs({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return xa({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}var Ss=o((()=>{Ca()}));function Cs({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return xa({theme:n,classNames:r,props:i,stylesCtx:t})[e]}var ws=o((()=>{Ca()}));function Ts({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}var Es=o((()=>{}));function Ds({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}var oee=o((()=>{}));function Os({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(e=>`${t}-${e}-${n}`)}var ks=o((()=>{}));function As({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(e=>xa({theme:t,classNames:t.components[e]?.classNames,props:r,stylesCtx:i})?.[n])}var js=o((()=>{Ca()}));function Ms({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}var Ns=o((()=>{}));function Ps({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:a,classes:o,unstyled:s,className:c,rootSelector:l,props:u,stylesCtx:d,withStaticClasses:f,headless:p,transformedStyles:m}){return va(vs({theme:e,options:t,unstyled:s||p}),As({theme:e,themeName:n,selector:r,props:u,stylesCtx:d}),Ms({options:t,classes:o,selector:r,unstyled:s}),Cs({selector:r,stylesCtx:d,theme:e,classNames:a,props:u}),Cs({selector:r,stylesCtx:d,theme:e,classNames:m,props:u}),xs({selector:r,stylesCtx:d,options:t,props:u,theme:e}),Ts({rootSelector:l,selector:r,className:c}),Ds({selector:r,classes:o,unstyled:s||p}),f&&!p&&Os({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}var Fs=o((()=>{ya(),bs(),Ss(),ws(),Es(),oee(),ks(),js(),Ns()}));function Is({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(t=>wa({theme:e,styles:e.components[t]?.styles,props:n,stylesCtx:r})[i]).reduce((e,t)=>({...e,...t}),{})}var Ls=o((()=>{Ta()}));function Rs({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Rs({style:n,theme:t})}),{}):typeof e==`function`?e(t):e??{}}var zs=o((()=>{}));function Bs(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...dr(t[n])}}),e),{})}var Vs=o((()=>{fr(),p(),N()}));function Hs({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:a,themeName:o,headless:s}){return Bs([s?{}:t?.(n,r,i),...o.map(e=>n.components?.[e]?.vars?.(n,r,i)),e?.(n,r,i)])?.[a]}var Us=o((()=>{Vs()}));function Ws({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:a,rootSelector:o,styles:s,style:c,vars:l,varsResolver:u,headless:d,withStylesTransform:f}){return{...!f&&Is({theme:e,themeName:t,props:i,stylesCtx:a,selector:n}),...!f&&wa({theme:e,styles:s,props:i,stylesCtx:a})[n],...!f&&wa({theme:e,styles:r?.styles,props:r?.props||i,stylesCtx:a})[n],...Hs({theme:e,props:i,stylesCtx:a,vars:l,varsResolver:u,selector:n,themeName:t,headless:d}),...o===n?Rs({style:c,theme:e}):null,...Rs({style:r?.style,theme:e})}}var Gs=o((()=>{Ls(),zs(),Ta(),Us()}));function Ks({props:e,stylesCtx:t,themeName:n}){let r=Eo(),i=Na()?.();return{getTransformedStyles:a=>i?[...a.map(n=>i(n,{props:e,theme:r,ctx:t})),...n.map(n=>i(r.components[n]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!i}}var qs=o((()=>{p(),N(),La(),Mo()}));function Js({name:e,classes:t,props:n,stylesCtx:r,className:i,style:a,rootSelector:o=`root`,unstyled:s,classNames:c,styles:l,vars:u,varsResolver:d,attributes:f}){let p=Eo(),m=Oa(),h=Aa(),g=ja(),_=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:v,getTransformedStyles:y}=Ks({props:n,stylesCtx:r,themeName:_});return(e,b)=>({className:Ps({theme:p,options:b,themeName:_,selector:e,classNamesPrefix:m,classNames:c,classes:t,unstyled:s,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:h,headless:g,transformedStyles:y([b?.styles,l])}),style:Ws({theme:p,themeName:_,selector:e,options:b,props:n,stylesCtx:r,rootSelector:o,styles:l,style:a,vars:u,varsResolver:d,headless:g,withStylesTransform:v}),...f?.[e]})}var Ys=o((()=>{p(),N(),La(),Mo(),Fs(),Gs(),qs()}));function Xs(e,t){return typeof e==`boolean`?e:t.autoContrast}var see=o((()=>{}));function P(e,t,n){let r=Eo(),i=r.components[e]?.defaultProps,a=typeof i==`function`?i(r):i;return{...t,...a,...dr(n)}}var Zs=o((()=>{fr(),p(),N(),Mo()}));function Qs(e){return Zn(e).reduce((t,n)=>e[n]===void 0?t:`${t}${nr(n)}:${e[n]};`,``).trim()}var $s=o((()=>{Qn(),rr(),p(),N()}));function ec({selector:e,styles:t,media:n,container:r}){let i=t?Qs(t):``,a=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${Qs(t.styles)}}}`):[],o=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${Qs(t.styles)}}}`):[];return`${i?`${e}{${i}}`:``}${a.join(``)}${o.join(``)}`.trim()}var tc=o((()=>{$s()}));function nc(e){let t=ka();return(0,rc.jsx)(`style`,{"data-mantine-styles":`inline`,nonce:t?.(),dangerouslySetInnerHTML:{__html:ec(e)}})}var rc,ic=o((()=>{rc=N(),p(),La(),tc()}));function ac(e){let{m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bdrs:b,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:ee,fs:k,tt:A,td:te,w:ne,miw:re,maw:ie,h:j,mih:ae,mah:oe,bgsz:se,bgp:ce,bgr:le,bga:ue,pos:de,top:fe,left:pe,bottom:me,right:he,inset:ge,display:_e,flex:ve,hiddenFrom:ye,visibleFrom:be,lightHidden:xe,darkHidden:Se,sx:Ce,...we}=e;return{styleProps:dr({m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,p:u,px:d,py:f,pt:p,pb:m,pl:h,pr:g,pe:_,ps:v,bd:y,bg:x,c:S,opacity:C,ff:w,fz:T,fw:E,lts:D,ta:O,lh:ee,fs:k,tt:A,td:te,w:ne,miw:re,maw:ie,h:j,mih:ae,mah:oe,bgsz:se,bgp:ce,bgr:le,bga:ue,pos:de,top:fe,left:pe,bottom:me,right:he,inset:ge,display:_e,flex:ve,bdrs:b,hiddenFrom:ye,visibleFrom:be,lightHidden:xe,darkHidden:Se,sx:Ce}),rest:we}}var oc=o((()=>{fr(),p(),N()})),sc,cc=o((()=>{sc={m:{type:`spacing`,property:`margin`},mt:{type:`spacing`,property:`marginTop`},mb:{type:`spacing`,property:`marginBottom`},ml:{type:`spacing`,property:`marginLeft`},mr:{type:`spacing`,property:`marginRight`},ms:{type:`spacing`,property:`marginInlineStart`},me:{type:`spacing`,property:`marginInlineEnd`},mx:{type:`spacing`,property:`marginInline`},my:{type:`spacing`,property:`marginBlock`},p:{type:`spacing`,property:`padding`},pt:{type:`spacing`,property:`paddingTop`},pb:{type:`spacing`,property:`paddingBottom`},pl:{type:`spacing`,property:`paddingLeft`},pr:{type:`spacing`,property:`paddingRight`},ps:{type:`spacing`,property:`paddingInlineStart`},pe:{type:`spacing`,property:`paddingInlineEnd`},px:{type:`spacing`,property:`paddingInline`},py:{type:`spacing`,property:`paddingBlock`},bd:{type:`border`,property:`border`},bdrs:{type:`radius`,property:`borderRadius`},bg:{type:`color`,property:`background`},c:{type:`textColor`,property:`color`},opacity:{type:`identity`,property:`opacity`},ff:{type:`fontFamily`,property:`fontFamily`},fz:{type:`fontSize`,property:`fontSize`},fw:{type:`identity`,property:`fontWeight`},lts:{type:`size`,property:`letterSpacing`},ta:{type:`identity`,property:`textAlign`},lh:{type:`lineHeight`,property:`lineHeight`},fs:{type:`identity`,property:`fontStyle`},tt:{type:`identity`,property:`textTransform`},td:{type:`identity`,property:`textDecoration`},w:{type:`spacing`,property:`width`},miw:{type:`spacing`,property:`minWidth`},maw:{type:`spacing`,property:`maxWidth`},h:{type:`spacing`,property:`height`},mih:{type:`spacing`,property:`minHeight`},mah:{type:`spacing`,property:`maxHeight`},bgsz:{type:`size`,property:`backgroundSize`},bgp:{type:`identity`,property:`backgroundPosition`},bgr:{type:`identity`,property:`backgroundRepeat`},bga:{type:`identity`,property:`backgroundAttachment`},pos:{type:`identity`,property:`position`},top:{type:`size`,property:`top`},left:{type:`size`,property:`left`},bottom:{type:`size`,property:`bottom`},right:{type:`size`,property:`right`},inset:{type:`size`,property:`inset`},display:{type:`identity`,property:`display`},flex:{type:`identity`,property:`flex`}}}));function lc(e,t){let n=$a({color:e,theme:t});return n.color===`dimmed`?`var(--mantine-color-dimmed)`:n.color===`bright`?`var(--mantine-color-bright)`:n.variable?`var(${n.variable})`:n.color}function uc(e,t){let n=$a({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:lc(e,t)}var dc=o((()=>{eo(),p(),N()}));function fc(e,t){if(typeof e==`number`)return M(e);if(typeof e==`string`){let[n,r,...i]=e.split(` `).filter(e=>e.trim()!==``),a=`${M(n)}`;return r&&(a+=` ${r}`),i.length>0&&(a+=` ${lc(i.join(` `),t)}`),a.trim()}return e}var pc=o((()=>{ur(),p(),N(),dc()}));function mc(e){return typeof e==`string`&&e in hc?hc[e]:e}var hc,gc=o((()=>{hc={text:`var(--mantine-font-family)`,mono:`var(--mantine-font-family-monospace)`,monospace:`var(--mantine-font-family-monospace)`,heading:`var(--mantine-font-family-headings)`,headings:`var(--mantine-font-family-headings)`}}));function _c(e,t){return typeof e==`string`&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e==`string`&&vc.includes(e)?`var(--mantine-${e}-font-size)`:typeof e==`number`||typeof e==`string`?M(e):e}var vc,yc=o((()=>{ur(),p(),N(),vc=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]}));function bc(e){return e}var xc=o((()=>{}));function Sc(e,t){return typeof e==`string`&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e==`string`&&Cc.includes(e)?`var(--mantine-${e}-line-height)`:e}var Cc,wc=o((()=>{Cc=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]}));function Tc(e,t){return typeof e==`string`&&e in t.radius?`var(--mantine-radius-${e})`:typeof e==`number`||typeof e==`string`?M(e):e}var Ec=o((()=>{ur(),p(),N()}));function Dc(e){return typeof e==`number`?M(e):e}var Oc=o((()=>{ur(),p(),N()}));function kc(e,t){if(typeof e==`number`)return M(e);if(typeof e==`string`){let n=e.replace(`-`,``);if(!(n in t.spacing))return M(e);let r=`--mantine-spacing-${n}`;return e.startsWith(`-`)?`calc(var(${r}) * -1)`:`var(${r})`}return e}var Ac=o((()=>{ur(),p(),N()})),jc,Mc=o((()=>{pc(),dc(),gc(),yc(),xc(),wc(),Ec(),Oc(),Ac(),jc={color:lc,textColor:uc,fontSize:_c,spacing:kc,radius:Tc,identity:bc,size:Dc,lineHeight:Sc,fontFamily:mc,border:fc}}));function Nc(e){return e.replace(`(min-width: `,``).replace(`em)`,``)}function Pc({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(Nc(e))-Number(Nc(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}var Fc=o((()=>{}));function Ic(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return!(t.length===1&&t[0]===`base`)}function Lc(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Rc(e){return typeof e==`object`&&e?Zn(e).filter(e=>e!==`base`):[]}function zc(e,t){return typeof e==`object`&&e&&t in e?e[t]:e}function Bc({styleProps:e,data:t,theme:n}){return Pc(Zn(e).reduce((r,i)=>{if(i===`hiddenFrom`||i===`visibleFrom`||i===`sx`)return r;let a=t[i],o=Array.isArray(a.property)?a.property:[a.property],s=Lc(e[i]);if(!Ic(e[i]))return o.forEach(e=>{r.inlineStyles[e]=jc[a.type](s,n)}),r;r.hasResponsiveStyles=!0;let c=Rc(e[i]);return o.forEach(t=>{s!=null&&(r.styles[t]=jc[a.type](s,n)),c.forEach(o=>{let s=`(min-width: ${n.breakpoints[o]})`;r.media[s]={...r.media[s],[t]:jc[a.type](zc(e[i],o),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}var Vc=o((()=>{Qn(),p(),N(),Mc(),Fc()}));function Hc(){return`__m__-${(0,Uc.useId)().replace(/[:«»]/g,``)}`}var Uc,Wc=o((()=>{Uc=u(p(),1)}));function Gc(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Gc(n,t)}),{}):typeof e==`function`?e(t):e??{}}var Kc=o((()=>{}));function qc(e){return e}var Jc=o((()=>{}));function Yc(e){return e.startsWith(`data-`)?e:`data-${e}`}function Xc(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r===void 0||r===``||r===!1||r===null||(t[Yc(n)]=e[n]),t},{})}function Zc(e){return e?typeof e==`string`?{[Yc(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...Zc(t)}),{}):Xc(e):null}var Qc=o((()=>{}));function $c(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...$c(n,t)}),{}):typeof e==`function`?e(t):e??{}}function el({theme:e,style:t,vars:n,styleProps:r}){let i=$c(t,e),a=$c(n,e);return{...i,...a,...r}}var tl=o((()=>{})),nl,rl,il,al,ol=o((()=>{nl=N(),rl=u(p(),1),ya(),Jc(),ic(),mr(),La(),Mo(),Qc(),tl(),oc(),cc(),Vc(),Wc(),il=(0,rl.forwardRef)(({component:e,style:t,__vars:n,className:r,variant:i,mod:a,size:o,hiddenFrom:s,visibleFrom:c,lightHidden:l,darkHidden:u,renderRoot:d,__size:f,...p},m)=>{let h=Eo(),g=e||`div`,{styleProps:_,rest:v}=ac(p),y=Ma()?.()?.(_.sx),b=Hc(),x=Bc({styleProps:_,theme:h,data:sc}),S={ref:m,style:el({theme:h,style:t,vars:n,styleProps:x.inlineStyles}),className:va(r,y,{[b]:x.hasResponsiveStyles,"mantine-light-hidden":l,"mantine-dark-hidden":u,[`mantine-hidden-from-${s}`]:s,[`mantine-visible-from-${c}`]:c}),"data-variant":i,"data-size":pr(o)?void 0:o||void 0,size:f,...Zc(a),...v};return(0,nl.jsxs)(nl.Fragment,{children:[x.hasResponsiveStyles&&(0,nl.jsx)(nc,{selector:`.${b}`,styles:x.styles,media:x.media}),typeof d==`function`?d(S):(0,nl.jsx)(g,{...S})]})}),il.displayName=`@mantine/core/Box`,al=qc(il)}));function sl(e){return e}function cee(e){let t=e;return e=>{let n=(0,ul.forwardRef)((n,r)=>(0,ll.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n}}function cl(e){let t=(0,ul.forwardRef)(e);return t.extend=sl,t.withProps=e=>{let n=(0,ul.forwardRef)((n,r)=>(0,ll.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}var ll,ul,dl=o((()=>{ll=N(),ul=u(p(),1)}));function fl(e){let t=(0,ml.forwardRef)(e);return t.withProps=e=>{let n=(0,ml.forwardRef)((n,r)=>(0,pl.jsx)(t,{...e,...n,ref:r}));return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=sl,t}var pl,ml,hl=o((()=>{pl=N(),ml=u(p(),1),dl()}));function gl(){return(0,_l.useContext)(vl)}var _l,vl,yl=o((()=>{N(),_l=u(p(),1),vl=(0,_l.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}})}));function bl(){return typeof window<`u`}function xl(e){return wl(e)?(e.nodeName||``).toLowerCase():`#document`}function Sl(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cl(e){return((wl(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function wl(e){return bl()?e instanceof Node||e instanceof Sl(e).Node:!1}function Tl(e){return bl()?e instanceof Element||e instanceof Sl(e).Element:!1}function El(e){return bl()?e instanceof HTMLElement||e instanceof Sl(e).HTMLElement:!1}function Dl(e){return!bl()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Sl(e).ShadowRoot}function Ol(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Fl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function kl(e){return/^(table|td|th)$/.test(xl(e))}function Al(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}function jl(e){let t=Tl(e)?Fl(e):e;return Ul(t.transform)||Ul(t.translate)||Ul(t.scale)||Ul(t.rotate)||Ul(t.perspective)||!Nl()&&(Ul(t.backdropFilter)||Ul(t.filter))||Vl.test(t.willChange||``)||Hl.test(t.contain||``)}function Ml(e){let t=Ll(e);for(;El(t)&&!Pl(t);){if(jl(t))return t;if(Al(t))return null;t=Ll(t)}return null}function Nl(){return Wl??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Wl}function Pl(e){return/^(html|body|#document)$/.test(xl(e))}function Fl(e){return Sl(e).getComputedStyle(e)}function Il(e){return Tl(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ll(e){if(xl(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Dl(e)&&e.host||Cl(e);return Dl(t)?t.host:t}function Rl(e){let t=Ll(e);return Pl(t)?e.ownerDocument?e.ownerDocument.body:e.body:El(t)&&Ol(t)?t:Rl(t)}function zl(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Rl(e),i=r===e.ownerDocument?.body,a=Sl(r);if(i){let e=Bl(a);return t.concat(a,a.visualViewport||[],Ol(r)?r:[],e&&n?zl(e):[])}else return t.concat(r,zl(r,[],n))}function Bl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Vl,Hl,Ul,Wl,Gl=o((()=>{Vl=/transform|translate|scale|rotate|perspective|filter/,Hl=/paint|layout|strict|content/,Ul=e=>!!e&&e!==`none`}));function Kl(e,t,n){return pu(e,fu(t,n))}function ql(e,t){return typeof e==`function`?e(t):e}function Jl(e){return e.split(`-`)[0]}function Yl(e){return e.split(`-`)[1]}function Xl(e){return e===`x`?`y`:`x`}function Zl(e){return e===`y`?`height`:`width`}function Ql(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function $l(e){return Xl(Ql(e))}function eu(e,t,n){n===void 0&&(n=!1);let r=Yl(e),i=$l(e),a=Zl(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=au(o)),[o,au(o)]}function tu(e){let t=au(e);return[nu(e),t,nu(t)]}function nu(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}function ru(e,t,n){switch(e){case`top`:case`bottom`:return n?t?yu:vu:t?vu:yu;case`left`:case`right`:return t?bu:xu;default:return[]}}function iu(e,t,n,r){let i=Yl(e),a=ru(Jl(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(nu)))),a}function au(e){let t=Jl(e);return _u[t]+e.slice(t.length)}function ou(e){return{top:0,right:0,bottom:0,left:0,...e}}function su(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ou(e)}function cu(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var lu,uu,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su=o((()=>{lu=[`top`,`right`,`bottom`,`left`],uu=[`start`,`end`],du=lu.reduce((e,t)=>e.concat(t,t+`-`+uu[0],t+`-`+uu[1]),[]),fu=Math.min,pu=Math.max,mu=Math.round,hu=Math.floor,gu=e=>({x:e,y:e}),_u={left:`right`,right:`left`,bottom:`top`,top:`bottom`},vu=[`left`,`right`],yu=[`right`,`left`],bu=[`top`,`bottom`],xu=[`bottom`,`top`]})),Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed=o((()=>{Cu=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],wu=Cu.join(`,`),Tu=typeof Element>`u`,Eu=Tu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Du=!Tu&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Ou=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):Ou(e.parentNode))},ku=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Au=function(e,t,n){if(Ou(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(wu));return t&&Eu.call(e,wu)&&r.unshift(e),r=r.filter(n),r},ju=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!Ou(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=ju(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Eu.call(a,wu)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!Ou(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=ju(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},Mu=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Nu=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ku(e))&&!Mu(e)?0:e.tabIndex},Pu=function(e,t){var n=Nu(e);return n<0&&t&&!Mu(e)?0:n},Fu=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Iu=function(e){return e.tagName===`INPUT`},Lu=function(e){return Iu(e)&&e.type===`hidden`},Ru=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},zu=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Bu=function(e){if(!e.name)return!0;var t=e.form||Du(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=zu(r,e.form);return!i||i===e},Vu=function(e){return Iu(e)&&e.type===`radio`},Hu=function(e){return Vu(e)&&!Bu(e)},Uu=function(e){var t=e&&Du(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Du(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Wu=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Gu=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Eu.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Eu.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Du(e);if(o&&!o.shadowRoot&&r(o)===!0)return Wu(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Uu(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Wu(e);return!1},Ku=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Eu.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},qu=function(e,t){return!(t.disabled||Lu(t)||Gu(t,e)||Ru(t)||Ku(t))},Ju=function(e,t){return!(Hu(t)||Nu(t)<0||!qu(e,t))},Yu=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Xu=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Pu(a,i),s=i?Xu(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Fu).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Zu=function(e,t){t||={};var n=t.getShadowRoot?ju([e],t.includeContainer,{filter:Ju.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Yu}):Au(e,t.includeContainer,Ju.bind(null,t));return Xu(n)},Qu=function(e,t){return t||={},t.getShadowRoot?ju([e],t.includeContainer,{filter:qu.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Au(e,t.includeContainer,qu.bind(null,t))},$u=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Eu.call(e,wu)===!1?!1:Ju(t,e)}}));function td(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function nd(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function rd(){return/apple/i.test(navigator.vendor)}function id(){let e=/android/i;return e.test(td())||e.test(nd())}function ad(){return td().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function od(){return nd().includes(`jsdom/`)}function sd(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function cd(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Dl(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function ld(e){return`composedPath`in e?e.composedPath()[0]:e.target}function ud(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function dd(e){return e.matches(`html,body`)}function fd(e){return e?.ownerDocument||document}function pd(e){return El(e)&&e.matches(Nd)}function md(e){return e?e.getAttribute(`role`)===`combobox`&&pd(e):!1}function hd(e){if(!e||od())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function gd(e){return e?e.hasAttribute(Md)?e:e.querySelector(`[`+Md+`]`)||e:null}function _d(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,..._d(e,t.id,n)])}function vd(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function yd(e){e.preventDefault(),e.stopPropagation()}function bd(e){return`nativeEvent`in e}function xd(e){return e.mozInputSource===0&&e.isTrusted?!0:id()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Sd(e){return od()?!1:!id()&&e.width===0&&e.height===0||id()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Cd(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function wd(e){let t=Ad.useRef(e);return Pd(()=>{t.current=e}),t}function Td(e){let t=Ad.useRef(()=>{});return Id(()=>{t.current=e}),Ad.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Ed(e,t){let n=Zu(e,Ld()),r=n.length;if(r===0)return;let i=sd(fd(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Dd(e){return Ed(fd(e).body,1)||e}function Od(e){return Ed(fd(e).body,-1)||e}function kd(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!cd(n,r)}var Ad,jd,Md,Nd,Pd,Fd,Id,Ld,Rd=o((()=>{Gl(),Ad=u(p(),1),jd=u(p(),1),ed(),Md=`data-floating-ui-focusable`,Nd=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Pd=typeof document<`u`?jd.useLayoutEffect:function(){},Fd={...Ad},Id=Fd.useInsertionEffect||(e=>e()),Ld=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`})}));function zd(e,t,n){let{reference:r,floating:i}=e,a=Ql(t),o=$l(t),s=Zl(o),c=Jl(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Yl(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function lee(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ql(t,e),p=su(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=cu(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=cu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}function Bd(e,t,n){return(e?[...n.filter(t=>Yl(t)===e),...n.filter(t=>Yl(t)!==e)]:n.filter(e=>Jl(e)===e)).filter(n=>e?Yl(n)===e||(t?nu(n)!==n:!1):!0)}function Vd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Hd(e){return lu.some(t=>e[t]>=0)}function Ud(e){let t=fu(...e.map(e=>e.left)),n=fu(...e.map(e=>e.top)),r=pu(...e.map(e=>e.right)),i=pu(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Wd(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>cu(Ud(e)))}async function Gd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Jl(n),s=Yl(n),c=Ql(n)===`y`,l=$d.has(o)?-1:1,u=a&&c?-1:1,d=ql(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Kd,qd,Jd,Yd,Xd,Zd,Qd,$d,ef,tf,nf,rf,af=o((()=>{Su(),Kd=50,qd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:lee},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=zd(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Kd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=zd(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Jd=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ql(e,t)||{};if(l==null)return{};let d=su(u),f={x:n,y:r},p=$l(i),m=Zl(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=fu(d[_],T),D=fu(d[v],T),O=E,ee=C-h[m]-D,k=C/2-h[m]/2+w,A=Kl(O,k,ee),te=!c.arrow&&Yl(i)!=null&&k!==A&&a.reference[m]/2-(k<O?E:D)-h[m]/2<0,ne=te?k<O?k-O:k-ee:0;return{[p]:f[p]+ne,data:{[p]:A,centerOffset:k-A-ne,...te&&{alignmentOffset:ne}},reset:te}}}),Yd=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=du,autoAlignment:u=!0,...d}=ql(e,t),f=c!==void 0||l===du?Bd(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=eu(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[Jl(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=Yl(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,Yl(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},Xd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ql(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Jl(r),_=Ql(o),v=Jl(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[au(o)]:tu(o)),x=p!==`none`;!d&&x&&b.push(...iu(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=eu(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Ql(t))||T.every(e=>Ql(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Ql(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Zd=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ql(e,t);switch(i){case`referenceHidden`:{let e=Vd(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Hd(e)}}}case`escaped`:{let e=Vd(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Hd(e)}}}default:return{}}}}},Qd=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=ql(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=Wd(u),f=cu(Ud(u)),p=su(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(Ql(n)===`y`){let e=d[0],t=d[d.length-1],r=Jl(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=Jl(n)===`left`,t=pu(...d.map(e=>e.right)),r=fu(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},$d=new Set([`left`,`top`]),ef=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Gd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},tf=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ql(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ql(Jl(i)),p=Xl(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Kl(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Kl(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},nf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ql(e,t),u={x:n,y:r},d=Ql(i),f=Xl(d),p=u[f],m=u[d],h=ql(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=$d.has(Jl(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},rf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ql(e,t),u=await o.detectOverflow(t,l),d=Jl(i),f=Yl(i),p=Ql(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=fu(h-u[g],v),x=fu(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=pu(u.left,0),t=pu(u.right,0),n=pu(u.top,0),r=pu(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:pu(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:pu(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}}}));function of(e){let t=Fl(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=El(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=mu(n)!==a||mu(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function sf(e){return Tl(e)?e:e.contextElement}function cf(e){let t=sf(e);if(!El(t))return gu(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=of(t),o=(a?mu(n.width):n.width)/r,s=(a?mu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}function lf(e){let t=Sl(e);return!Nl()||!t.visualViewport?Mf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Sl(e)?!1:t}function df(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=sf(e),o=gu(1);t&&(r?Tl(r)&&(o=cf(r)):o=cf(e));let s=uf(a,n,r)?lf(a):gu(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Sl(a),t=r&&Tl(r)?Sl(r):r,n=e,i=Bl(n);for(;i&&r&&t!==n;){let e=cf(i),t=i.getBoundingClientRect(),r=Fl(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Sl(i),i=Bl(n)}}return cu({width:u,height:d,x:c,y:l})}function ff(e,t){let n=Il(e).scrollLeft;return t?t.left+n:df(Cl(e)).left+n}function pf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ff(e,n),y:n.top+t.scrollTop}}function mf(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Cl(r),s=t?Al(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=gu(1),u=gu(0),d=El(r);if((d||!d&&!a)&&((xl(r)!==`body`||Ol(o))&&(c=Il(r)),d)){let e=df(r);l=cf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?pf(o,c):gu(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function hf(e){return Array.from(e.getClientRects())}function gf(e){let t=Cl(e),n=Il(e),r=e.ownerDocument.body,i=pu(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=pu(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ff(e),s=-n.scrollTop;return Fl(r).direction===`rtl`&&(o+=pu(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function _f(e,t){let n=Sl(e),r=Cl(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Nl();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ff(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Nf&&(a-=o)}else l<=Nf&&(a+=l);return{width:a,height:o,x:s,y:c}}function vf(e,t){let n=df(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=El(e)?cf(e):gu(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function yf(e,t,n){let r;if(t===`viewport`)r=_f(e,n);else if(t===`document`)r=gf(Cl(e));else if(Tl(t))r=vf(t,n);else{let n=lf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return cu(r)}function bf(e,t){let n=Ll(e);return n===t||!Tl(n)||Pl(n)?!1:Fl(n).position===`fixed`||bf(n,t)}function xf(e,t){let n=t.get(e);if(n)return n;let r=zl(e,[],!1).filter(e=>Tl(e)&&xl(e)!==`body`),i=null,a=Fl(e).position===`fixed`,o=a?Ll(e):e;for(;Tl(o)&&!Pl(o);){let t=Fl(o),n=jl(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Ol(o)&&!n&&bf(e,o))?r=r.filter(e=>e!==o):i=t,o=Ll(o)}return t.set(e,r),r}function Sf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Al(t)?[]:xf(t,this._c):[].concat(n),r],o=yf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=yf(t,a[e],i);s=pu(n.top,s),c=fu(n.right,c),l=fu(n.bottom,l),u=pu(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Cf(e){let{width:t,height:n}=of(e);return{width:t,height:n}}function wf(e,t,n){let r=El(t),i=Cl(t),a=n===`fixed`,o=df(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=gu(0);function l(){c.x=ff(i)}if(r||!r&&!a)if((xl(t)!==`body`||Ol(i))&&(s=Il(t)),r){let e=df(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?pf(i,s):gu(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Tf(e){return Fl(e).position===`static`}function Ef(e,t){if(!El(e)||Fl(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Cl(e)===n&&(n=n.ownerDocument.body),n}function Df(e,t){let n=Sl(e);if(Al(e))return n;if(!El(e)){let t=Ll(e);for(;t&&!Pl(t);){if(Tl(t)&&!Tf(t))return t;t=Ll(t)}return n}let r=Ef(e,t);for(;r&&kl(r)&&Tf(r);)r=Ef(r,t);return r&&Pl(r)&&Tf(r)&&!jl(r)?n:r||Ml(e)||n}function Of(e){return Fl(e).direction===`rtl`}function kf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Af(e,t){let n=null,r,i=Cl(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=hu(d),h=hu(i.clientWidth-(u+f)),g=hu(i.clientHeight-(d+p)),_=hu(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:pu(0,fu(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!kf(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function jf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=sf(e),u=i||a?[...l?zl(l):[],...t?zl(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Af(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?df(e):null;c&&g();function g(){let t=df(e);h&&!kf(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Mf,Nf,Pf,Ff,If,Lf,Rf,zf,Bf,Vf,Hf,Uf,Wf,Gf,Kf=o((()=>{af(),Su(),Gl(),Mf=gu(0),Nf=25,Pf=async function(e){let t=this.getOffsetParent||Df,n=this.getDimensions,r=await n(e.floating);return{reference:wf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},Ff={convertOffsetParentRelativeRectToViewportRelativeRect:mf,getDocumentElement:Cl,getClippingRect:Sf,getOffsetParent:Df,getElementRects:Pf,getClientRects:hf,getDimensions:Cf,getScale:cf,isElement:Tl,isRTL:Of},If=ef,Lf=Yd,Rf=tf,zf=Xd,Bf=rf,Vf=Zd,Hf=Jd,Uf=Qd,Wf=nf,Gf=(e,t,n)=>{let r=new Map,i={platform:Ff,...n},a={...i.platform,_c:r};return qd(e,t,{...i,platform:a})}}));function qf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!qf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Jf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yf(e,t){let n=Jf(e);return Math.round(t*n)/n}function Xf(e){let t=Qf.useRef(e);return tp(()=>{t.current=e}),t}function Zf(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Qf.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Qf.useState(r);qf(f,r)||p(r);let[m,h]=Qf.useState(null),[g,_]=Qf.useState(null),v=Qf.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Qf.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Qf.useRef(null),C=Qf.useRef(null),w=Qf.useRef(u),T=c!=null,E=Xf(c),D=Xf(i),O=Xf(l),ee=Qf.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Gf(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};k.current&&!qf(w.current,t)&&(w.current=t,ep.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);tp(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=Qf.useRef(!1);tp(()=>(k.current=!0,()=>{k.current=!1}),[]),tp(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,ee);ee()}},[b,x,ee,E,T]);let A=Qf.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),te=Qf.useMemo(()=>({reference:b,floating:x}),[b,x]),ne=Qf.useMemo(()=>{let e={position:n,left:0,top:0};if(!te.floating)return e;let t=Yf(te.floating,u.x),r=Yf(te.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Jf(te.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,te.floating,u.x,u.y]);return Qf.useMemo(()=>({...u,update:ee,refs:A,elements:te,floatingStyles:ne}),[u,ee,A,te,ne])}var Qf,$f,ep,tp,np,rp,ip,ap,op,sp,cp,lp,up,dp,fp=o((()=>{Kf(),Qf=u(p(),1),$f=u(p(),1),ep=u(_(),1),tp=typeof document<`u`?$f.useLayoutEffect:function(){},np=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Hf({element:r.current,padding:i}).fn(n):r?Hf({element:r,padding:i}).fn(n):{}}}},rp=(e,t)=>{let n=If(e);return{name:n.name,fn:n.fn,options:[e,t]}},ip=(e,t)=>{let n=Rf(e);return{name:n.name,fn:n.fn,options:[e,t]}},ap=(e,t)=>({fn:Wf(e).fn,options:[e,t]}),op=(e,t)=>{let n=zf(e);return{name:n.name,fn:n.fn,options:[e,t]}},sp=(e,t)=>{let n=Bf(e);return{name:n.name,fn:n.fn,options:[e,t]}},cp=(e,t)=>{let n=Lf(e);return{name:n.name,fn:n.fn,options:[e,t]}},lp=(e,t)=>{let n=Vf(e);return{name:n.name,fn:n.fn,options:[e,t]}},up=(e,t)=>{let n=Uf(e);return{name:n.name,fn:n.fn,options:[e,t]}},dp=(e,t)=>{let n=np(e);return{name:n.name,fn:n.fn,options:[e,t]}}}));function pp(e){let t=F.useRef(void 0),n=F.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return F.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}function mp(){let[e,t]=F.useState(()=>lm?dm():void 0);return Pd(()=>{e??t(dm())},[]),F.useEffect(()=>{lm=!0},[]),e}function hp(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}function gp(e){return`data-floating-ui-`+e}function _p(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}function vp(e,t,n){if(n&&!Cd(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function yp(e){return typeof e==`function`?e():e}function bp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=gm(),m=hm(),h=wd(l),g=wd(c),_=wd(n),v=wd(d),y=F.useRef(),b=F.useRef(-1),x=F.useRef(),S=F.useRef(-1),C=F.useRef(!0),w=F.useRef(!1),T=F.useRef(()=>{}),E=F.useRef(!1),D=Td(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});F.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(_p(b),_p(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),F.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){D()&&r(!1,e,`hover`)}let t=fd(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,D]);let O=F.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=vp(g.current,`close`,y.current);i&&!x.current?(_p(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(_p(b),r(!1,e,n))},[g,r]),ee=Td(()=>{T.current(),x.current=void 0}),k=Td(()=>{if(w.current){let e=fd(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(_m),w.current=!1}}),A=Td(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);F.useEffect(()=>{if(!s)return;function e(e){if(_p(b),C.current=!1,u&&!Cd(y.current)||yp(v.current)>0&&!vp(g.current,`open`))return;let t=vp(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(A()){k();return}T.current();let t=fd(o.floating);if(_p(S),E.current=!1,h.current&&i.current.floatingContext){n||_p(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){k(),ee(),A()||O(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!cd(o.floating,e.relatedTarget))&&O(e)}function a(e){A()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){k(),ee(),A()||O(e)}})(e))}function c(){_p(b)}function l(e){A()||O(e,!1)}if(Tl(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,O,ee,k,r,n,_,p,g,h,i,A,v]),Pd(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&D()){w.current=!0;let e=o.floating;if(Tl(o.domReference)&&e){var t;let n=fd(o.floating).body;n.setAttribute(_m,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,D]),Pd(()=>{n||(y.current=void 0,E.current=!1,ee(),k())},[n,ee,k]),F.useEffect(()=>()=>{ee(),_p(b),_p(S),k()},[s,o.domReference,ee,k]);let te=F.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}u&&!Cd(y.current)||n||yp(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(_p(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,yp(v.current))))}}},[u,r,n,_,v]);return F.useMemo(()=>s?{reference:te}:{},[s,te])}function xp(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=F.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=F.useRef(null),s=F.useCallback(e=>{a({currentId:e})},[]);return Pd(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,Zp.jsx)(ym.Provider,{value:F.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Sp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=bm(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Pd(()=>{o&&l&&(f({delay:{open:1,close:vp(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Pd(()=>{function e(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,f,l,s,r,d,p]),Pd(()=>{o&&(u===vm||!n||u(s))},[o,n,u,s]),c}function Cp(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(xm);let a=()=>e?.focus({preventScroll:n});i?a():xm=requestAnimationFrame(a)}function wp(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Dl(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Tp(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Ep(e){return e?.ownerDocument||document}function Dp(e){return e===`inert`?Sm.inert:e===`aria-hidden`?Sm[`aria-hidden`]:Sm.none}function Op(e){return e?Dl(e)?e.host:Op(e.parentNode):null}function kp(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Dm(t,e),s=new Set,c=new Set(o),l=[];wm[i]||(wm[i]=new WeakMap);let u=wm[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(xl(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Dp(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Cm.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return Tm++,()=>{l.forEach(e=>{let t=Dp(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Cm.has(e)&&a&&e.removeAttribute(a),Cm.delete(e)),r||e.removeAttribute(i)}),Tm--,Tm||(Sm.inert=new WeakMap,Sm[`aria-hidden`]=new WeakMap,Sm.none=new WeakMap,Cm=new WeakSet,wm={})}}function Ap(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Ep(e[0]).body;return kp(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}function jp(e){return F.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}function Mp(){Nm=Nm.filter(e=>e.deref()?.isConnected)}function Np(e){Mp(),e&&xl(e)!==`body`&&(Nm.push(new WeakRef(e)),Nm.length>Mm&&(Nm=Nm.slice(-Mm)))}function Pp(){return Mp(),Nm[Nm.length-1]?.deref()}function Fp(e){let t=Ld();return $u(e,t)?e:Zu(e,t)[0]||e}function Ip(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=Ld(),i=Qu(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return $u(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Lp(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0,outsideElementsInert:f=!1,getInsideElements:p=()=>[]}=e,{open:m,onOpenChange:h,events:g,dataRef:_,elements:{domReference:v,floating:y}}=t,b=Td(()=>_.current.floatingContext?.nodeId),x=Td(p),S=typeof o==`number`&&o<0,C=md(v)&&S,w=Em(),T=w?a:!0,E=!T||w&&f,D=wd(i),O=wd(o),ee=wd(s),k=gm(),A=jm(),te=F.useRef(null),ne=F.useRef(null),re=F.useRef(!1),ie=F.useRef(!1),j=F.useRef(-1),ae=F.useRef(-1),oe=A!=null,se=gd(y),ce=Td(function(e){return e===void 0&&(e=se),e?Zu(e,Ld()):[]}),le=Td(e=>{let t=ce(e);return D.current.map(e=>v&&e===`reference`?v:se&&e===`floating`?se:t).filter(Boolean).flat()});F.useEffect(()=>{if(r||!l)return;function e(e){if(e.key===`Tab`){cd(se,sd(fd(se)))&&ce().length===0&&!C&&yd(e);let t=le(),n=ld(e);D.current[0]===`reference`&&n===v&&(yd(e),e.shiftKey?Cp(t[t.length-1]):Cp(t[1])),D.current[1]===`floating`&&n===se&&e.shiftKey&&(yd(e),Cp(t[0]))}}let t=fd(se);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,v,se,l,D,C,ce,le]),F.useEffect(()=>{if(r||!y)return;function e(e){let t=ld(e),n=ce().indexOf(t);n!==-1&&(j.current=n)}return y.addEventListener(`focusin`,e),()=>{y.removeEventListener(`focusin`,e)}},[r,y,ce]),F.useEffect(()=>{if(r||!d)return;function e(){ie.current=!0,setTimeout(()=>{ie.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=ld(e);queueMicrotask(()=>{let i=b(),a=!(cd(v,t)||cd(y,t)||cd(t,y)||cd(A?.portalNode,t)||t!=null&&t.hasAttribute(gp(`focus-guard`))||k&&(_d(k.nodesRef.current,i).find(e=>cd(e.context?.elements.floating,t)||cd(e.context?.elements.domReference,t))||vd(k.nodesRef.current,i).find(e=>[e.context?.elements.floating,gd(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===v&&se&&Ip(se,D),c&&n!==v&&!(r!=null&&r.isConnected)&&sd(fd(se))===fd(se).body){El(se)&&se.focus();let e=j.current,t=ce(),n=t[e]||t[t.length-1]||se;El(n)&&n.focus()}if(_.current.insideReactTree){_.current.insideReactTree=!1;return}(C||!l)&&t&&a&&!ie.current&&t!==Pp()&&(re.current=!0,h(!1,e,`focus-out`))})}let n=!!(!k&&A);function i(){_p(ae),_.current.insideReactTree=!0,ae.current=window.setTimeout(()=>{_.current.insideReactTree=!1})}if(y&&El(v))return v.addEventListener(`focusout`,t),v.addEventListener(`pointerdown`,e),y.addEventListener(`focusout`,t),n&&y.addEventListener(`focusout`,i,!0),()=>{v.removeEventListener(`focusout`,t),v.removeEventListener(`pointerdown`,e),y.removeEventListener(`focusout`,t),n&&y.removeEventListener(`focusout`,i,!0)}},[r,v,y,se,l,k,A,h,d,c,ce,C,b,D,_]);let ue=F.useRef(null),de=F.useRef(null),fe=jp([ue,A?.beforeInsideRef]),pe=jp([de,A?.afterInsideRef]);F.useEffect(()=>{var e,t;if(r||!y)return;let n=Array.from((A==null||(e=A.portalNode)==null?void 0:e.querySelectorAll(`[`+gp(`portal`)+`]`))||[]),i=[y,(t=(k?vd(k.nodesRef.current,b()):[]).find(e=>md(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,...n,...x(),te.current,ne.current,ue.current,de.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,D.current.includes(`reference`)||C?v:null].filter(e=>e!=null),a=l||C?Ap(i,!E,E):Ap(i);return()=>{a()}},[r,v,y,l,D,A,C,T,E,k,b,x]),Pd(()=>{if(r||!El(se))return;let e=sd(fd(se));queueMicrotask(()=>{let t=le(se),n=O.current,r=(typeof n==`number`?t[n]:n.current)||se,i=cd(se,e);!S&&!i&&m&&Cp(r,{preventScroll:r===se})})},[r,m,se,S,le,O]),Pd(()=>{if(r||!se)return;let e=fd(se);Np(sd(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(re.current=!0),t===`outside-press`)if(r)re.current=!1;else if(xd(n)||Sd(n))re.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?re.current=!1:re.current=!0}}g.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Om),oe&&v&&v.insertAdjacentElement(`afterend`,n);function i(){if(typeof ee.current==`boolean`){let e=v||Pp();return e&&e.isConnected?e:n}return ee.current.current||n}return()=>{g.off(`openchange`,t);let r=sd(e),a=cd(y,r)||k&&_d(k.nodesRef.current,b(),!1).some(e=>cd(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Fp(o);ee.current&&!re.current&&El(t)&&(!(t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,y,se,ee,_,g,k,oe,v,b]),F.useEffect(()=>(queueMicrotask(()=>{re.current=!1}),()=>{queueMicrotask(Mp)}),[r]),Pd(()=>{if(!r&&A)return A.setFocusManagerState({modal:l,closeOnFocusOut:d,open:m,onOpenChange:h,domReference:v}),()=>{A.setFocusManagerState(null)}},[r,A,l,m,h,d,v]),Pd(()=>{r||se&&Ip(se,D)},[r,se,D]);function me(e){return r||!u||!l?null:(0,Zp.jsx)(pee,{ref:e===`start`?te:ne,onClick:e=>h(!1,e.nativeEvent),children:typeof u==`string`?u:`Dismiss`})}let he=!r&&T&&(l?!C:!0)&&(oe||l);return(0,Zp.jsxs)(Zp.Fragment,{children:[he&&(0,Zp.jsx)(km,{"data-type":`inside`,ref:fe,onFocus:e=>{if(l){let e=le();Cp(i[0]===`reference`?e[0]:e[e.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(re.current=!1,kd(e,A.portalNode))Dd(v)?.focus();else{var t;(t=A.beforeOutsideRef.current)==null||t.focus()}}}),!C&&me(`start`),n,me(`end`),he&&(0,Zp.jsx)(km,{"data-type":`inside`,ref:pe,onFocus:e=>{if(l)Cp(le()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(d&&(re.current=!0),kd(e,A.portalNode))Od(v)?.focus();else{var t;(t=A.afterOutsideRef.current)==null||t.focus()}}})]})}function Rp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=gm(),g=Td(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=F.useRef(!1),{escapeKey:y,outsidePress:b}=Pm(p),{escapeKey:x,outsidePress:S}=Pm(m),C=F.useRef(!1),w=Td(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?_d(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,bd(e)?e.nativeEvent:e,`escape-key`)}),T=Td(e=>{var t;let n=()=>{var t;w(e),(t=ld(e))==null||t.removeEventListener(`keydown`,n)};(t=ld(e))==null||t.addEventListener(`keydown`,n)}),E=Td(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=ld(e),s=`[`+gp(`inert`)+`]`,c=fd(i.floating).querySelectorAll(s),u=Tl(o)?o:null;for(;u&&!Pl(u);){let e=Ll(u);if(Pl(e)||!Tl(e))break;u=e}if(c.length&&Tl(o)&&!dd(o)&&!cd(o,i.floating)&&Array.from(c).every(e=>!cd(u,e)))return;if(El(o)&&ee){let t=Pl(o),n=Fl(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&_d(h.nodesRef.current,d).some(t=>ud(e,t.context?.elements.floating));if(ud(e,i.floating)||ud(e,i.domReference)||f)return;let p=h?_d(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),D=Td(e=>{var t;let n=()=>{var t;E(e),(t=ld(e))==null||t.removeEventListener(l,n)};(t=ld(e))==null||t.addEventListener(l,n)});F.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},Nl()?5:0)}let d=fd(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?D:E,S);let p=[];return f&&(Tl(i.domReference)&&(p=zl(i.domReference)),Tl(i.floating)&&(p=p.concat(zl(i.floating))),!Tl(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(zl(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?D:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,D]),F.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let O=F.useMemo(()=>({onKeyDown:w,...u&&{[mee[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),ee=F.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[hee[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return F.useMemo(()=>o?{reference:O,floating:ee}:{},[o,O,ee])}function zp(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=fm(),a=F.useRef({}),[o]=F.useState(()=>hp()),s=hm()!=null,[c,l]=F.useState(r.reference),u=Td((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=F.useMemo(()=>({setPositionReference:l}),[]),f=F.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return F.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Bp(e){e===void 0&&(e={});let{nodeId:t}=e,n=zp({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=F.useState(null),[s,c]=F.useState(null),l=i?.domReference||a,u=F.useRef(null),d=gm();Pd(()=>{l&&(u.current=l)},[l]);let f=Zf({...e,elements:{...i,...s&&{reference:s}}}),p=F.useCallback(e=>{let t=Tl(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),m=F.useCallback(e=>{(Tl(e)||e===null)&&(u.current=e,o(e)),(Tl(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!Tl(e))&&f.refs.setReference(e)},[f.refs]),h=F.useMemo(()=>({...f.refs,setReference:m,setPositionReference:p,domReference:u}),[f.refs,m,p]),g=F.useMemo(()=>({...f.elements,domReference:l}),[f.elements,l]),_=F.useMemo(()=>({...f,...r,refs:h,elements:g,nodeId:t}),[f,h,g,t,r]);return Pd(()=>{r.dataRef.current.floatingContext=_;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=_)}),F.useMemo(()=>({...f,context:_,refs:h,elements:g}),[f,h,g,_])}function Vp(){return ad()&&rd()}function Hp(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=F.useRef(!1),u=F.useRef(-1),d=F.useRef(!0);F.useEffect(()=>{if(!s)return;let e=Sl(o.domReference);function t(){!n&&El(o.domReference)&&o.domReference===sd(fd(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Vp()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Vp()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),F.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),F.useEffect(()=>()=>{_p(u)},[]);let f=F.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=ld(e.nativeEvent);if(c&&Tl(t)){if(Vp()&&!e.relatedTarget){if(!d.current&&!pd(t))return}else if(!hd(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=Tl(t)&&t.hasAttribute(gp(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=sd(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||cd(a.current.floatingContext?.refs.floating.current,e)||cd(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return F.useMemo(()=>s?{reference:f}:{},[s,f])}function Up(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[em]:t,[tm]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[$p]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[em,tm].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function Wp(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=F.useCallback(t=>Up(t,e,`reference`),t),a=F.useCallback(t=>Up(t,e,`floating`),n),o=F.useCallback(t=>Up(t,e,`item`),r);return F.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}function Gp(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=fm(),c=r.domReference?.id||s,l=F.useMemo(()=>gd(r.floating)?.id||i,[r.floating,i]),u=gee.get(o)??o,d=hm()!=null,f=F.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=F.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=F.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return F.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}function Kp(e,t){return typeof e==`function`?e(t):e}function qp(e,t){let[n,r]=F.useState(e);return e&&!n&&r(!0),F.useEffect(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function Jp(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=F.useState(`unmounted`),c=qp(n,a);return!c&&o===`close`&&s(`unmounted`),Pd(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{Qp.flushSync(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function Yp(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=F.useMemo(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=F.useState(()=>({...Kp(a,l),...Kp(n,l)})),{isMounted:h,status:g}=Jp(e,{duration:o}),_=wd(n),v=wd(r),y=wd(i),b=wd(a);return Pd(()=>{let e=Kp(_.current,l),t=Kp(y.current,l),n=Kp(b.current,l),r=Kp(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(Fm).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(Fm).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function uee(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...uee(e,t.id,n)])}function Xp(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function dee(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function fee(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){_p(i),u()}if(_p(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=Tp(e),v=e.type===`mouseleave`,y=wp(c.floating,_),b=wp(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=dee(g,x),D=S.width>x.width,O=S.height>x.height,ee=(D?x:S).left,k=(D?x:S).right,A=(O?x:S).top,te=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&Tl(e.relatedTarget)&&wp(c.floating,e.relatedTarget)||f&&uee(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let ne=[];switch(C){case`top`:ne=[[ee,x.top+1],[ee,S.bottom-1],[k,S.bottom-1],[k,x.top+1]];break;case`bottom`:ne=[[ee,S.top+1],[ee,x.bottom-1],[k,x.bottom-1],[k,S.top+1]];break;case`left`:ne=[[S.right-1,te],[S.right-1,A],[x.left+1,A],[x.left+1,te]];break;case`right`:ne=[[x.right-1,te],[x.right-1,A],[S.left+1,A],[S.left+1,te]];break}function re(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],...[[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],...[[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[...[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom]],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],...[[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]]}}if(!Xp([m,h],ne)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Xp([m,h],re([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var F,Zp,Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm,Nm,pee,mee,hee,Pm,gee,Fm,Im=o((()=>{F=u(p(),1),Rd(),Zp=N(),Gl(),ed(),Qp=u(_(),1),fp(),$p=`data-floating-ui-focusable`,em=`active`,tm=`selected`,nm=`ArrowLeft`,rm=`ArrowRight`,im=`ArrowUp`,am=`ArrowDown`,om=[nm,rm],sm=[im,am],[...om,...sm],cm={...F},lm=!1,um=0,dm=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ um++,fm=cm.useId||mp,pm=F.createContext(null),mm=F.createContext(null),hm=()=>F.useContext(pm)?.id||null,gm=()=>F.useContext(mm),_m=gp(`safe-polygon`),vm=()=>{},ym=F.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:vm,setState:vm,isInstantPhase:!1}),bm=()=>F.useContext(ym),xm=0,Sm={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap},Cm=new WeakSet,wm={},Tm=0,Em=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype,Dm=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Op(t);return e.contains(n)?n:null}).filter(e=>e!=null),Om={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},km=F.forwardRef(function(e,t){let[n,r]=F.useState();Pd(()=>{rd()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[gp(`focus-guard`)]:``,style:Om};return(0,Zp.jsx)(`span`,{...e,...i})}),Am=F.createContext(null),jm=()=>F.useContext(Am),Mm=20,Nm=[],pee=F.forwardRef(function(e,t){return(0,Zp.jsx)(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:Om})}),mee={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},hee={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Pm=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}),gee=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]),Fm=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase())})),Lm,_ee=o((()=>{Lm={root:`m_87cf2631`}})),vee,yee,Rm,zm=o((()=>{vee=N(),p(),Zs(),Ys(),ol(),hl(),_ee(),yee={__staticSelector:`UnstyledButton`},Rm=fl((e,t)=>{let n=P(`UnstyledButton`,yee,e),{className:r,component:i=`button`,__staticSelector:a,unstyled:o,classNames:s,styles:c,style:l,attributes:u,...d}=n;return(0,vee.jsx)(al,{...Js({name:a,props:n,classes:Lm,className:r,style:l,classNames:s,styles:c,unstyled:o,attributes:u})(`root`,{focusable:!0}),component:i,ref:t,type:i===`button`?`button`:void 0,...d})}),Rm.classes=Lm,Rm.displayName=`@mantine/core/UnstyledButton`})),Bm,bee=o((()=>{Bm={root:`m_515a97f8`}})),xee,Vm,See=o((()=>{xee=N(),p(),Zs(),Ys(),ol(),dl(),bee(),Vm=cl((e,t)=>{let n=P(`VisuallyHidden`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,attributes:l,...u}=n;return(0,xee.jsx)(al,{component:`span`,ref:t,...Js({name:`VisuallyHidden`,classes:Bm,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:l})(`root`),...u})}),Vm.classes=Bm,Vm.displayName=`@mantine/core/VisuallyHidden`})),Hm,Cee=o((()=>{Hm={root:`m_1b7284a3`}})),wee,Tee,Um,Eee=o((()=>{wee=N(),p(),Jr(),ga(),Zs(),Ys(),ol(),hl(),Cee(),Tee=ha((e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Wr(t),"--paper-shadow":qr(n)}})),Um=fl((e,t)=>{let n=P(`Paper`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,withBorder:c,vars:l,radius:u,shadow:d,variant:f,mod:p,attributes:m,...h}=n,g=Js({name:`Paper`,props:n,classes:Hm,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:l,varsResolver:Tee});return(0,wee.jsx)(al,{ref:t,mod:[{"data-with-border":c},p],...g(`root`),variant:f,...h})}),Um.classes=Hm,Um.displayName=`@mantine/core/Paper`}));function Dee(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function Oee(e,t,n,r,i){return e===`center`||r===`center`?{left:t}:e===`end`?{[i===`ltr`?`right`:`left`]:n}:e===`start`?{[i===`ltr`?`left`:`right`]:n}:{}}function kee({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){let[c,l=`center`]=e.split(`-`),u={width:t,height:t,transform:`rotate(45deg)`,position:`absolute`,[Aee[c]]:r},d=-t/2;return c===`left`?{...u,...Dee(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...Dee(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...Oee(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...Oee(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}var Aee,jee=o((()=>{Aee={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`}})),Mee,Nee,Wm,Pee=o((()=>{Mee=N(),Nee=u(p(),1),yl(),jee(),Wm=(0,Nee.forwardRef)(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l},u)=>{let{dir:d}=gl();return a?(0,Mee.jsx)(`div`,{...l,ref:u,style:{...c,...kee({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:d,arrowX:o,arrowY:s})}}):null}),Wm.displayName=`@mantine/core/FloatingArrow`}));function Gm(e,t){if(e===`rtl`&&(t.includes(`right`)||t.includes(`left`))){let[e,n]=t.split(`-`),r=e===`right`?`left`:`right`;return n===void 0?r:`${r}-${n}`}return t}var Km=o((()=>{})),qm,Fee=o((()=>{qm={root:`m_9814e45f`}})),Jm,Ym,Xm,Zm,Qm=o((()=>{Jm=N(),ur(),p(),Lr(),Jr(),ga(),so(),Zs(),Ys(),ol(),hl(),Fee(),Ym={zIndex:Fr(`modal`)},Xm=ha((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:a,zIndex:o})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&ao(n||`#000`,r??.6)||void 0,"--overlay-filter":i?`blur(${M(i)})`:void 0,"--overlay-radius":a===void 0?void 0:Wr(a),"--overlay-z-index":o?.toString()}})),Zm=fl((e,t)=>{let n=P(`Overlay`,Ym,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,fixed:l,center:u,children:d,radius:f,zIndex:p,gradient:m,blur:h,color:g,backgroundOpacity:_,mod:v,attributes:y,...b}=n;return(0,Jm.jsx)(al,{ref:t,...Js({name:`Overlay`,props:n,classes:qm,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:y,vars:c,varsResolver:Xm})(`root`),mod:[{center:u,fixed:l},v],...b,children:d})}),Zm.classes=qm,Zm.displayName=`@mantine/core/Overlay`}));function $m(e){let t=document.createElement(`div`);return t.setAttribute(`data-portal`,`true`),typeof e.className==`string`&&t.classList.add(...e.className.split(` `).filter(Boolean)),typeof e.style==`object`&&Object.assign(t.style,e.style),typeof e.id==`string`&&t.setAttribute(`id`,e.id),t}function Iee({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||$m(n):e;if(t){let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return e;let t=$m(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),t}return $m(n)}var eh,th,nh,rh,ih,Lee=o((()=>{eh=N(),th=u(p(),1),nh=u(_(),1),la(),Zs(),dl(),rh={reuseTargetNode:!0},ih=cl((e,t)=>{let{children:n,target:r,reuseTargetNode:i,...a}=P(`Portal`,rh,e),[o,s]=(0,th.useState)(!1),c=(0,th.useRef)(null);return mi(()=>(s(!0),c.current=Iee({target:r,reuseTargetNode:i,...a}),Ui(t,c.current),!r&&!i&&c.current&&document.body.appendChild(c.current),()=>{!r&&!i&&c.current&&document.body.removeChild(c.current)}),[r]),!o||!c.current?null:(0,nh.createPortal)((0,eh.jsx)(eh.Fragment,{children:n}),c.current)}),ih.displayName=`@mantine/core/Portal`})),ah,oh,sh=o((()=>{ah=N(),p(),La(),dl(),Lee(),oh=cl(({withinPortal:e=!0,children:t,...n},r)=>Pa()===`test`||!e?(0,ah.jsx)(ah.Fragment,{children:t}):(0,ah.jsx)(ih,{ref:r,...n,children:t})),oh.displayName=`@mantine/core/OptionalPortal`})),ch,lh,Ree=o((()=>{ch=e=>({in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(.9) translateY(${e===`bottom`?10:-10}px)`},transitionProperty:`transform, opacity`}),lh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:`opacity`},"fade-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(30px)`},transitionProperty:`opacity, transform`},"fade-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-30px)`},transitionProperty:`opacity, transform`},"fade-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(30px)`},transitionProperty:`opacity, transform`},"fade-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-30px)`},transitionProperty:`opacity, transform`},scale:{in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-y":{in:{opacity:1,transform:`scaleY(1)`},out:{opacity:0,transform:`scaleY(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-x":{in:{opacity:1,transform:`scaleX(1)`},out:{opacity:0,transform:`scaleX(0)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"skew-up":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(-20px) skew(-10deg, -5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"skew-down":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(20px) skew(-10deg, -5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-left":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(-5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-right":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-100%)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(100%)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"slide-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"slide-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-100%)`},common:{transformOrigin:`right`},transitionProperty:`transform, opacity`},pop:{...ch(`bottom`),common:{transformOrigin:`center center`}},"pop-bottom-left":{...ch(`bottom`),common:{transformOrigin:`bottom left`}},"pop-bottom-right":{...ch(`bottom`),common:{transformOrigin:`bottom right`}},"pop-top-left":{...ch(`top`),common:{transformOrigin:`top left`}},"pop-top-right":{...ch(`top`),common:{transformOrigin:`top right`}}}}));function zee({transition:e,state:t,duration:n,timingFunction:r}){let i={WebkitBackfaceVisibility:`hidden`,transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e==`string`?e in lh?{transitionProperty:lh[e].transitionProperty,...i,...lh[e].common,...lh[e][uh[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[uh[t]]}}var uh,Bee=o((()=>{Ree(),uh={entering:`in`,entered:`in`,exiting:`out`,exited:`out`,"pre-exiting":`out`,"pre-entering":`out`}}));function Vee({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:a,onEntered:o,onExited:s,enterDelay:c,exitDelay:l}){let u=Eo(),d=Zi(),f=u.respectReducedMotion?d:!1,[p,m]=(0,dh.useState)(f?0:e),[h,g]=(0,dh.useState)(r?`entered`:`exited`),_=(0,dh.useRef)(-1),v=(0,dh.useRef)(-1),y=(0,dh.useRef)(-1);function b(){window.clearTimeout(_.current),window.clearTimeout(v.current),cancelAnimationFrame(y.current)}let x=n=>{b();let r=n?i:a,c=n?o:s,l=f?0:n?e:t;m(l),l===0?(typeof r==`function`&&r(),typeof c==`function`&&c(),g(n?`entered`:`exited`)):y.current=requestAnimationFrame(()=>{fh.flushSync(()=>{g(n?`pre-entering`:`pre-exiting`)}),y.current=requestAnimationFrame(()=>{typeof r==`function`&&r(),g(n?`entering`:`exiting`),_.current=window.setTimeout(()=>{typeof c==`function`&&c(),g(n?`entered`:`exited`)},l)})})},S=e=>{if(b(),typeof(e?c:l)!=`number`){x(e);return}v.current=window.setTimeout(()=>{x(e)},e?c:l)};return gi(()=>{S(r)},[r]),(0,dh.useEffect)(()=>()=>{b()},[]),{transitionDuration:p,transitionStatus:h,transitionTimingFunction:n||`ease`}}var dh,fh,Hee=o((()=>{dh=u(p(),1),fh=u(_(),1),la(),N(),Mo()}));function ph({keepMounted:e,transition:t=`fade`,duration:n=250,exitDuration:r=n,mounted:i,children:a,timingFunction:o=`ease`,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f}){let p=Pa(),{transitionDuration:m,transitionStatus:h,transitionTimingFunction:g}=Vee({mounted:i,exitDuration:r,duration:n,timingFunction:o,onExit:s,onEntered:c,onEnter:l,onExited:u,enterDelay:d,exitDelay:f});return m===0||p===`test`?i?(0,mh.jsx)(mh.Fragment,{children:a({})}):e?a({display:`none`}):null:h===`exited`?e?a({display:`none`}):null:(0,mh.jsx)(mh.Fragment,{children:a(zee({transition:t,duration:m,state:h,timingFunction:g}))})}var mh,hh=o((()=>{mh=N(),p(),La(),Bee(),Hee(),ph.displayName=`@mantine/core/Transition`})),gh,_h,vh=o((()=>{p(),xr(),N(),[gh,_h]=vr(`Popover component was not found in the tree`)})),yh,bh=o((()=>{yh={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`}}));function xh({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=Gi(Ni(t),r),a=fa(e);return a?(0,wh.cloneElement)(a,{[n]:i}):e}function Sh(e){return(0,Ch.jsx)(Vm,{tabIndex:-1,"data-autofocus":!0,...e})}var Ch,wh,Uee=o((()=>{Ch=N(),wh=u(p(),1),la(),ma(),See(),xh.displayName=`@mantine/core/FocusTrap`,Sh.displayName=`@mantine/core/FocusTrapInitialFocus`,xh.InitialFocus=Sh})),Th,Eh,Dh=o((()=>{Th=N(),la(),ur(),p(),Vr(),Zs(),ol(),dl(),Pee(),Uee(),sh(),hh(),vh(),bh(),Eh=cl((e,t)=>{let n=P(`PopoverDropdown`,null,e),{className:r,style:i,vars:a,children:o,onKeyDownCapture:s,variant:c,classNames:l,styles:u,...d}=n,f=_h(),p=yi({opened:f.opened,shouldReturnFocus:f.returnFocus}),m=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:`dialog`,tabIndex:-1}:{},h=Gi(t,f.floating);return f.disabled?null:(0,Th.jsx)(oh,{...f.portalProps,withinPortal:f.withinPortal,children:(0,Th.jsx)(ph,{mounted:f.opened,...f.transitionProps,transition:f.transitionProps?.transition||`fade`,duration:f.transitionProps?.duration??150,keepMounted:f.keepMounted,exitDuration:typeof f.transitionProps?.exitDuration==`number`?f.transitionProps.exitDuration:f.transitionProps?.duration,children:e=>(0,Th.jsx)(xh,{active:f.trapFocus&&f.opened,innerRef:h,children:(0,Th.jsxs)(al,{...m,...d,variant:c,onKeyDownCapture:Br(()=>{f.onClose?.(),f.onDismiss?.()},{active:f.closeOnEscape,onTrigger:p,onKeyDown:s}),"data-position":f.placement,"data-fixed":f.floatingStrategy===`fixed`||void 0,...f.getStyles(`dropdown`,{className:r,props:n,classNames:l,styles:u,style:[{...e,zIndex:f.zIndex,top:f.y??0,left:f.x??0,width:f.width===`target`?void 0:M(f.width),...f.referenceHidden?{display:`none`}:null},f.resolvedStyles.dropdown,u?.dropdown,i]}),children:[o,(0,Th.jsx)(Wm,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,...f.getStyles(`arrow`,{props:n,classNames:l,styles:u})})]})})})})}),Eh.classes=yh,Eh.displayName=`@mantine/core/PopoverDropdown`})),Oh,kh,Ah,jh=o((()=>{Oh=u(p(),1),ya(),la(),N(),da(),ma(),Zs(),dl(),vh(),kh={refProp:`ref`,popupType:`dialog`},Ah=cl((e,t)=>{let{children:n,refProp:r,popupType:i,...a}=P(`PopoverTarget`,kh,e),o=fa(n);if(!o)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let s=a,c=_h(),l=Gi(c.reference,ua(o),t),u=c.withRoles?{"aria-haspopup":i,"aria-expanded":c.opened,"aria-controls":c.opened?c.getDropdownId():void 0,id:c.getTargetId()}:{},d=o.props;return(0,Oh.cloneElement)(o,{...s,...u,...c.targetProps,className:va(c.targetProps.className,s.className,d.className),[r]:l,...c.controlled?null:{onClick:()=>{c.onToggle(),d.onClick?.()}}})}),Ah.displayName=`@mantine/core/PopoverTarget`}));function Wee(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Gee(e,t,n){let r=Wee(e.middlewares),i=[rp(e.offset),lp()];return e.dropdownVisible&&n!==`test`&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.flip&&i.push(typeof r.flip==`boolean`?op():op(r.flip)),r.shift&&i.push(ip(typeof r.shift==`boolean`?{limiter:ap(),padding:5}:{limiter:ap(),padding:5,...r.shift})),r.inline&&i.push(typeof r.inline==`boolean`?up():up(r.inline)),i.push(dp({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width===`target`)&&i.push(sp({...typeof r.size==`boolean`?{}:r.size,apply({rects:n,availableWidth:i,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};r.size&&(typeof r.size==`object`&&r.size.apply?r.size.apply({rects:n,availableWidth:i,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${i}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),i}function Kee(e){let t=Pa(),[n,r]=Ji({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),i=(0,Mh.useRef)(n),a=()=>{n&&!e.disabled&&r(!1)},o=()=>{e.disabled||r(!n)},s=Bp({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:Gee(e,()=>s,t),whileElementsMounted:e.keepMounted?void 0:jf});return(0,Mh.useEffect)(()=>{if(!(!s.refs.reference.current||!s.refs.floating.current)&&n)return jf(s.refs.reference.current,s.refs.floating.current,s.update)},[n,s.update]),gi(()=>{e.onPositionChange?.(s.placement),e.positionRef.current=s.placement},[s.placement,e.preventPositionChangeWhenVisible]),gi(()=>{n!==i.current&&(n?e.onOpen?.():e.onClose?.()),i.current=n},[n,e.onClose,e.onOpen]),mi(()=>{let t=-1;return n&&(t=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(t)}},[n,e.position]),{floating:s,controlled:typeof e.opened==`boolean`,opened:n,onClose:a,onToggle:o}}var Mh,qee=o((()=>{Mh=u(p(),1),Im(),la(),N(),La()}));function Nh(e){let t=P(`Popover`,Ih,e),{children:n,position:r,offset:i,onPositionChange:a,positionDependencies:o,opened:s,transitionProps:c,onExitTransitionEnd:l,onEnterTransitionEnd:u,width:d,middlewares:f,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,unstyled:v,classNames:y,styles:b,closeOnClickOutside:x,withinPortal:S,portalProps:C,closeOnEscape:w,clickOutsideEvents:T,trapFocus:E,onClose:D,onDismiss:O,onOpen:ee,onChange:k,zIndex:A,radius:te,shadow:ne,id:re,defaultOpened:ie,__staticSelector:j,withRoles:ae,disabled:oe,returnFocus:se,variant:ce,keepMounted:le,vars:ue,floatingStrategy:de,withOverlay:fe,overlayProps:pe,hideDetached:me,attributes:he,preventPositionChangeWhenVisible:ge,..._e}=t,ve=Js({name:j,props:t,classes:yh,classNames:y,styles:b,unstyled:v,attributes:he,rootSelector:`dropdown`,vars:ue,varsResolver:Lh}),{resolvedStyles:ye}=gs({classNames:y,styles:b,props:t}),[be,xe]=(0,Fh.useState)(s??ie??!1),Se=(0,Fh.useRef)(r),Ce=(0,Fh.useRef)(null),[we,Te]=(0,Fh.useState)(null),[Ee,De]=(0,Fh.useState)(null),{dir:Oe}=gl(),ke=Pa(),Ae=Bi(re),je=Kee({middlewares:f,width:d,position:Gm(Oe,r),offset:typeof i==`number`?i+(p?m/2:0):i,arrowRef:Ce,arrowOffset:h,onPositionChange:a,positionDependencies:o,opened:s,defaultOpened:ie,onChange:k,onOpen:ee,onClose:D,onDismiss:O,strategy:de,dropdownVisible:be,setDropdownVisible:xe,positionRef:Se,disabled:oe,preventPositionChangeWhenVisible:ge,keepMounted:le});ii(()=>{x&&(je.onClose(),O?.())},T,[we,Ee]);let Me=(0,Fh.useCallback)(e=>{Te(e),je.floating.refs.setReference(e)},[je.floating.refs.setReference]),Ne=(0,Fh.useCallback)(e=>{De(e),je.floating.refs.setFloating(e)},[je.floating.refs.setFloating]),Pe=(0,Fh.useCallback)(()=>{c?.onExited?.(),l?.(),xe(!1),ge||(Se.current=r)},[c?.onExited,l,ge,r]),Fe=(0,Fh.useCallback)(()=>{c?.onEntered?.(),u?.()},[c?.onEntered,u]);return(0,Ph.jsxs)(gh,{value:{returnFocus:se,disabled:oe,controlled:je.controlled,reference:Me,floating:Ne,x:je.floating.x,y:je.floating.y,arrowX:je.floating?.middlewareData?.arrow?.x,arrowY:je.floating?.middlewareData?.arrow?.y,opened:je.opened,arrowRef:Ce,transitionProps:{...c,onExited:Pe,onEntered:Fe},width:d,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,placement:je.floating.placement,trapFocus:E,withinPortal:S,portalProps:C,zIndex:A,radius:te,shadow:ne,closeOnEscape:w,onDismiss:O,onClose:je.onClose,onToggle:je.onToggle,getTargetId:()=>`${Ae}-target`,getDropdownId:()=>`${Ae}-dropdown`,withRoles:ae,targetProps:_e,__staticSelector:j,classNames:y,styles:b,unstyled:v,variant:ce,keepMounted:le,getStyles:ve,resolvedStyles:ye,floatingStrategy:de,referenceHidden:me&&ke!==`test`?je.floating.middlewareData.hide?.referenceHidden:!1},children:[n,fe&&(0,Ph.jsx)(ph,{transition:`fade`,mounted:je.opened,duration:c?.duration||250,exitDuration:c?.exitDuration||250,children:e=>(0,Ph.jsx)(oh,{withinPortal:S,children:(0,Ph.jsx)(Zm,{...pe,...ve(`overlay`,{className:pe?.className,style:[e,pe?.style]})})})})]})}var Ph,Fh,Ih,Lh,Rh=o((()=>{Ph=N(),Fh=u(p(),1),la(),Lr(),Jr(),ga(),_s(),Ys(),La(),Zs(),yl(),Km(),Qm(),sh(),hh(),vh(),bh(),Dh(),jh(),qee(),Ih={position:`bottom`,offset:8,positionDependencies:[],transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:[`mousedown`,`touchstart`],zIndex:Fr(`popover`),__staticSelector:`Popover`,width:`max-content`},Lh=ha((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Wr(t),"--popover-shadow":qr(n)}})),Nh.Target=Ah,Nh.Dropdown=Eh,Nh.displayName=`@mantine/core/Popover`,Nh.extend=e=>e})),zh,Bh=o((()=>{zh={root:`m_5ae2e3c`,barsLoader:`m_7a2bd4cd`,bar:`m_870bb79`,"bars-loader-animation":`m_5d2b3b9d`,dotsLoader:`m_4e3f22d7`,dot:`m_870c4af`,"loader-dots-animation":`m_aac34a1`,ovalLoader:`m_b34414df`,"oval-loader-animation":`m_f8e89c4b`}})),Vh,Hh,Uh,Jee=o((()=>{Vh=N(),Hh=u(p(),1),ya(),ol(),Bh(),Uh=(0,Hh.forwardRef)(({className:e,...t},n)=>(0,Vh.jsxs)(al,{component:`span`,className:va(zh.barsLoader,e),...t,ref:n,children:[(0,Vh.jsx)(`span`,{className:zh.bar}),(0,Vh.jsx)(`span`,{className:zh.bar}),(0,Vh.jsx)(`span`,{className:zh.bar})]})),Uh.displayName=`@mantine/core/Bars`})),Wh,Gh,Kh,Yee=o((()=>{Wh=N(),Gh=u(p(),1),ya(),ol(),Bh(),Kh=(0,Gh.forwardRef)(({className:e,...t},n)=>(0,Wh.jsxs)(al,{component:`span`,className:va(zh.dotsLoader,e),...t,ref:n,children:[(0,Wh.jsx)(`span`,{className:zh.dot}),(0,Wh.jsx)(`span`,{className:zh.dot}),(0,Wh.jsx)(`span`,{className:zh.dot})]})),Kh.displayName=`@mantine/core/Dots`})),qh,Jh,Yh,Xee=o((()=>{qh=N(),Jh=u(p(),1),ya(),ol(),Bh(),Yh=(0,Jh.forwardRef)(({className:e,...t},n)=>(0,qh.jsx)(al,{component:`span`,className:va(zh.ovalLoader,e),...t,ref:n})),Yh.displayName=`@mantine/core/Oval`})),Xh,Zh,Qh,$h,eg,tg=o((()=>{Xh=N(),p(),Jr(),ga(),no(),Zs(),Ys(),ol(),dl(),Bh(),Jee(),Yee(),Xee(),Zh={bars:Uh,oval:Yh,dots:Kh},Qh={loaders:Zh,type:`oval`},$h=ha((e,{size:t,color:n})=>({root:{"--loader-size":Hr(t,`loader-size`),"--loader-color":n?to(n,e):void 0}})),eg=cl((e,t)=>{let n=P(`Loader`,Qh,e),{size:r,color:i,type:a,vars:o,className:s,style:c,classNames:l,styles:u,unstyled:d,loaders:f,variant:p,children:m,attributes:h,...g}=n,_=Js({name:`Loader`,props:n,classes:zh,className:s,style:c,classNames:l,styles:u,unstyled:d,attributes:h,vars:o,varsResolver:$h});return m?(0,Xh.jsx)(al,{..._(`root`),ref:t,...g,children:m}):(0,Xh.jsx)(al,{..._(`root`),ref:t,component:f[a],variant:p,size:r,...g})}),eg.defaultLoaders=Zh,eg.classes=zh,eg.displayName=`@mantine/core/Loader`})),ng,rg=o((()=>{ng={root:`m_8d3f4000`,icon:`m_8d3afb97`,loader:`m_302b9fb1`,group:`m_1a0f1b21`,groupSection:`m_437b6484`}})),Zee,ig,Qee,ag,$ee=o((()=>{Zee=N(),ur(),p(),ga(),Zs(),Ys(),ol(),dl(),rg(),ig={orientation:`horizontal`},Qee=ha((e,{borderWidth:t})=>({group:{"--ai-border-width":M(t)}})),ag=cl((e,t)=>{let n=P(`ActionIconGroup`,ig,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=P(`ActionIconGroup`,ig,e);return(0,Zee.jsx)(al,{...Js({name:`ActionIconGroup`,props:n,classes:ng,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:Qee,rootSelector:`group`})(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})}),ag.classes=ng,ag.displayName=`@mantine/core/ActionIconGroup`})),ete,tte,og,nte=o((()=>{ete=N(),p(),Jr(),ga(),Zs(),Ys(),ol(),dl(),rg(),tte=ha((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":Hr(o,`section-height`),"--section-padding-x":Hr(o,`section-padding-x`),"--section-fz":Gr(o),"--section-radius":t===void 0?void 0:Wr(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),og=cl((e,t)=>{let n=P(`ActionIconGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n;return(0,ete.jsx)(al,{...Js({name:`ActionIconGroupSection`,props:n,classes:ng,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:tte,rootSelector:`groupSection`})(`groupSection`),ref:t,variant:l,...m})}),og.classes=ng,og.displayName=`@mantine/core/ActionIconGroupSection`})),sg,rte,cg,ite=o((()=>{sg=N(),p(),Jr(),ga(),Zs(),Ys(),ol(),hl(),tg(),hh(),zm(),rg(),$ee(),nte(),rte=ha((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ai-size":Hr(t,`ai-size`),"--ai-radius":n===void 0?void 0:Wr(n),"--ai-bg":a||r?s.background:void 0,"--ai-hover":a||r?s.hover:void 0,"--ai-hover-color":a||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":a||r?s.border:void 0}}}),cg=fl((e,t)=>{let n=P(`ActionIcon`,null,e),{className:r,unstyled:i,variant:a,classNames:o,styles:s,style:c,loading:l,loaderProps:u,size:d,color:f,radius:p,__staticSelector:m,gradient:h,vars:g,children:_,disabled:v,"data-disabled":y,autoContrast:b,mod:x,attributes:S,...C}=n,w=Js({name:[`ActionIcon`,m],props:n,className:r,style:c,classes:ng,classNames:o,styles:s,unstyled:i,attributes:S,vars:g,varsResolver:rte});return(0,sg.jsxs)(Rm,{...w(`root`,{active:!v&&!l&&!y}),...C,unstyled:i,variant:a,size:d,disabled:v||l,ref:t,mod:[{loading:l,disabled:v||y},x],children:[typeof l==`boolean`&&(0,sg.jsx)(ph,{mounted:l,transition:`slide-down`,duration:150,children:e=>(0,sg.jsx)(al,{component:`span`,...w(`loader`,{style:e}),"aria-hidden":!0,children:(0,sg.jsx)(eg,{color:`var(--ai-color)`,size:`calc(var(--ai-size) * 0.55)`,...u})})}),(0,sg.jsx)(al,{component:`span`,mod:{loading:l},...w(`icon`),children:_})]})}),cg.classes=ng,cg.displayName=`@mantine/core/ActionIcon`,cg.Group=ag,cg.GroupSection=og})),lg,ate,ug,ote=o((()=>{lg=N(),ate=u(p(),1),ug=(0,ate.forwardRef)(({size:e=`var(--cb-icon-size, 70%)`,style:t,...n},r)=>(0,lg.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...t,width:e,height:e},ref:r,...n,children:(0,lg.jsx)(`path`,{d:`M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})),ug.displayName=`@mantine/core/CloseIcon`})),dg,ste=o((()=>{dg={root:`m_86a44da5`,"root--subtle":`m_220c80f2`}})),fg,cte,lte,pg,ute=o((()=>{fg=N(),ur(),p(),Jr(),ga(),Zs(),Ys(),hl(),zm(),ste(),ote(),cte={variant:`subtle`},lte=ha((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Hr(t,`cb-size`),"--cb-radius":n===void 0?void 0:Wr(n),"--cb-icon-size":M(r)}})),pg=fl((e,t)=>{let n=P(`CloseButton`,cte,e),{iconSize:r,children:i,vars:a,radius:o,className:s,classNames:c,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:p,variant:m,icon:h,mod:g,attributes:_,__staticSelector:v,...y}=n,b=Js({name:v||`CloseButton`,props:n,className:s,style:l,classes:dg,classNames:c,styles:u,unstyled:d,attributes:_,vars:a,varsResolver:lte});return(0,fg.jsxs)(Rm,{ref:t,...y,unstyled:d,variant:m,disabled:p,mod:[{disabled:p||f},g],...b(`root`,{variant:m,active:!p&&!f}),children:[h||(0,fg.jsx)(ug,{}),i]})}),pg.classes=dg,pg.displayName=`@mantine/core/CloseButton`}));function dte(e){return fte.Children.toArray(e).filter(Boolean)}var fte,pte=o((()=>{fte=u(p(),1)})),mg,mte=o((()=>{mg={root:`m_4081bf90`}})),hte,gte,_te,hg,vte=o((()=>{hte=N(),p(),Jr(),ga(),Zs(),Ys(),ol(),dl(),pte(),mte(),gte={preventGrowOverflow:!0,gap:`md`,align:`center`,justify:`flex-start`,wrap:`wrap`},_te=ha((e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:a,wrap:o},{childWidth:s})=>({root:{"--group-child-width":t&&n?s:void 0,"--group-gap":Ur(r),"--group-align":i,"--group-justify":a,"--group-wrap":o}})),hg=cl((e,t)=>{let n=P(`Group`,gte,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,children:c,gap:l,align:u,justify:d,wrap:f,grow:p,preventGrowOverflow:m,vars:h,variant:g,__size:_,mod:v,attributes:y,...b}=n,x=dte(c),S=x.length,C=Ur(l??`md`);return(0,hte.jsx)(al,{...Js({name:`Group`,props:n,stylesCtx:{childWidth:`calc(${100/S}% - (${C} - ${C} / ${S}))`},className:i,style:a,classes:mg,classNames:r,styles:o,unstyled:s,attributes:y,vars:h,varsResolver:_te})(`root`),ref:t,variant:g,mod:[{grow:p},v],size:_,...b,children:x})}),hg.classes=mg,hg.displayName=`@mantine/core/Group`})),yte,bte,xte=o((()=>{p(),N(),Tr(),[yte,bte]=Sr({size:`sm`})})),gg,_g=o((()=>{gg={wrapper:`m_6c018570`,input:`m_8fb7ebe7`,section:`m_82577fc2`,placeholder:`m_88bacfd0`,root:`m_46b77525`,label:`m_8fdc1311`,required:`m_78a94662`,error:`m_8f816625`,description:`m_fe47ce59`}})),Ste,vg,Cte=o((()=>{Ste=N(),p(),_s(),Zs(),dl(),ute(),xte(),vg=cl((e,t)=>{let n=P(`InputClearButton`,null,e),{size:r,variant:i,vars:a,classNames:o,styles:s,...c}=n,l=bte(),{resolvedClassNames:u,resolvedStyles:d}=gs({classNames:o,styles:s,props:n});return(0,Ste.jsx)(pg,{variant:i||`transparent`,ref:t,size:r||l?.size||`sm`,classNames:u,styles:d,__staticSelector:`InputClearButton`,style:{pointerEvents:`all`,background:`var(--input-bg)`,...c.style},...c})}),vg.displayName=`@mantine/core/InputClearButton`}));function wte({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:i=`sm`}){let a=e&&t;return a&&(n||r)?(0,Tte.jsxs)(`div`,{"data-combined-clear-section":!0,style:{display:`flex`,gap:2,alignItems:`center`,paddingInlineEnd:Ete[i]},children:[a,n||r]}):n===null?null:n||a||r}var Tte,Ete,Dte=o((()=>{Tte=N(),Ete={xs:7,sm:8,md:10,lg:12,xl:15}})),Ote,yg,bg=o((()=>{p(),N(),Tr(),[Ote,yg]=Sr({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0})})),kte,Ate,xg,jte=o((()=>{kte=N(),ur(),p(),Jr(),ga(),Zs(),Ys(),ol(),dl(),_g(),bg(),Ate=ha((e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Gr(t)} - ${M(2)})`}})),xg=cl((e,t)=>{let n=P(`InputDescription`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,variant:p,...m}=P(`InputDescription`,null,n),h=yg(),g=Js({name:[`InputWrapper`,u],props:n,classes:gg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:f,rootSelector:`description`,vars:c,varsResolver:Ate});return(0,kte.jsx)(al,{component:`p`,ref:t,variant:p,size:l,...(d&&h?.getStyles||g)(`description`,h?.getStyles?{className:i,style:a}:void 0),...m})}),xg.classes=gg,xg.displayName=`@mantine/core/InputDescription`})),Mte,Nte,Sg,Pte=o((()=>{Mte=N(),ur(),p(),Jr(),ga(),Zs(),Ys(),ol(),dl(),_g(),bg(),Nte=ha((e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Gr(t)} - ${M(2)})`}})),Sg=cl((e,t)=>{let n=P(`InputError`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,variant:p,...m}=n,h=Js({name:[`InputWrapper`,d],props:n,classes:gg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,rootSelector:`error`,vars:c,varsResolver:Nte}),g=yg();return(0,Mte.jsx)(al,{component:`p`,ref:t,variant:p,size:l,...(f&&g?.getStyles||h)(`error`,g?.getStyles?{className:i,style:a}:void 0),...m})}),Sg.classes=gg,Sg.displayName=`@mantine/core/InputError`})),Cg,wg,Fte,Tg,Ite=o((()=>{Cg=N(),p(),Jr(),ga(),Zs(),Ys(),ol(),dl(),_g(),bg(),wg={labelElement:`label`},Fte=ha((e,{size:t})=>({label:{"--input-label-size":Gr(t),"--input-asterisk-color":void 0}})),Tg=cl((e,t)=>{let n=P(`InputLabel`,wg,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,labelElement:l,size:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:h,variant:g,mod:_,attributes:v,...y}=P(`InputLabel`,wg,n),b=Js({name:[`InputWrapper`,h],props:n,classes:gg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:v,rootSelector:`label`,vars:c,varsResolver:Fte}),x=yg(),S=x?.getStyles||b;return(0,Cg.jsxs)(al,{...S(`label`,x?.getStyles?{className:i,style:a}:void 0),component:l,variant:g,size:u,ref:t,htmlFor:l===`label`?f:void 0,mod:[{required:d},_],onMouseDown:e=>{p?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...y,children:[m,d&&(0,Cg.jsx)(`span`,{...S(`required`),"aria-hidden":!0,children:` *`})]})}),Tg.classes=gg,Tg.displayName=`@mantine/core/InputLabel`})),Lte,Eg,Rte=o((()=>{Lte=N(),p(),Zs(),Ys(),ol(),dl(),_g(),Eg=cl((e,t)=>{let n=P(`InputPlaceholder`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,__staticSelector:l,variant:u,error:d,mod:f,attributes:p,...m}=n;return(0,Lte.jsx)(al,{...Js({name:[`InputPlaceholder`,l],props:n,classes:gg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,rootSelector:`placeholder`})(`placeholder`),mod:[{error:!!d},f],component:`span`,variant:u,ref:t,...m})}),Eg.classes=gg,Eg.displayName=`@mantine/core/InputPlaceholder`}));function zte(e,{hasDescription:t,hasError:n}){let r=e.findIndex(e=>e===`input`),i=e.slice(0,r),a=e.slice(r+1),o=t&&i.includes(`description`)||n&&i.includes(`error`);return{offsetBottom:t&&a.includes(`description`)||n&&a.includes(`error`),offsetTop:o}}var Bte=o((()=>{})),Dg,Og,Vte,Hte,kg,Ute=o((()=>{Dg=N(),Og=u(p(),1),la(),ur(),Jr(),ga(),Zs(),Ys(),ol(),dl(),_g(),jte(),Pte(),Ite(),bg(),Bte(),Vte={labelElement:`label`,inputContainer:e=>e,inputWrapperOrder:[`label`,`description`,`input`,`error`]},Hte=ha((e,{size:t})=>({label:{"--input-label-size":Gr(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Gr(t)} - ${M(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Gr(t)} - ${M(2)})`}})),kg=cl((e,t)=>{let n=P(`InputWrapper`,Vte,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,size:l,variant:u,__staticSelector:d,inputContainer:f,inputWrapperOrder:p,label:m,error:h,description:g,labelProps:_,descriptionProps:v,errorProps:y,labelElement:b,children:x,withAsterisk:S,id:C,required:w,__stylesApiProps:T,mod:E,attributes:D,...O}=n,ee=Js({name:[`InputWrapper`,d],props:T||n,classes:gg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:D,vars:c,varsResolver:Hte}),k={size:l,variant:u,__staticSelector:d},A=Bi(C),te=typeof S==`boolean`?S:w,ne=y?.id||`${A}-error`,re=v?.id||`${A}-description`,ie=A,j=!!h&&typeof h!=`boolean`,ae=!!g,oe=`${j?ne:``} ${ae?re:``}`,se=oe.trim().length>0?oe.trim():void 0,ce=_?.id||`${A}-label`,le=m&&(0,Dg.jsx)(Tg,{labelElement:b,id:ce,htmlFor:ie,required:te,...k,..._,children:m},`label`),ue=ae&&(0,Dg.jsx)(xg,{...v,...k,size:v?.size||k.size,id:v?.id||re,children:g},`description`),de=(0,Dg.jsx)(Og.Fragment,{children:f(x)},`input`),fe=j&&(0,Og.createElement)(Sg,{...y,...k,size:y?.size||k.size,key:`error`,id:y?.id||ne},h),pe=p.map(e=>{switch(e){case`label`:return le;case`input`:return de;case`description`:return ue;case`error`:return fe;default:return null}});return(0,Dg.jsx)(Ote,{value:{getStyles:ee,describedBy:se,inputId:ie,labelId:ce,...zte(p,{hasDescription:ae,hasError:j})},children:(0,Dg.jsx)(al,{ref:t,variant:u,size:l,mod:[{error:!!h},E],...ee(`root`),...O,children:pe})})}),kg.classes=gg,kg.displayName=`@mantine/core/InputWrapper`})),Ag,Wte,Gte,jg,Kte=o((()=>{Ag=N(),ur(),p(),Jr(),ga(),Zs(),Ys(),oc(),ol(),hl(),xte(),_g(),Cte(),Dte(),jte(),Pte(),Ite(),Rte(),bg(),Ute(),Wte={variant:`default`,leftSectionPointerEvents:`none`,rightSectionPointerEvents:`none`,withAria:!0,withErrorStyles:!0,size:`sm`},Gte=ha((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-margin-bottom":n.offsetBottom?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-height":Hr(t.size,`input-height`),"--input-fz":Gr(t.size),"--input-radius":t.radius===void 0?void 0:Wr(t.radius),"--input-left-section-width":t.leftSectionWidth===void 0?void 0:M(t.leftSectionWidth),"--input-right-section-width":t.rightSectionWidth===void 0?void 0:M(t.rightSectionWidth),"--input-padding-y":t.multiline?Hr(t.size,`input-padding-y`):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),jg=fl((e,t)=>{let n=P(`Input`,Wte,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,required:c,__staticSelector:l,__stylesApiProps:u,size:d,wrapperProps:f,error:p,disabled:m,leftSection:h,leftSectionProps:g,leftSectionWidth:_,rightSection:v,rightSectionProps:y,rightSectionWidth:b,rightSectionPointerEvents:x,leftSectionPointerEvents:S,variant:C,vars:w,pointer:T,multiline:E,radius:D,id:O,withAria:ee,withErrorStyles:k,mod:A,inputSize:te,attributes:ne,__clearSection:re,__clearable:ie,__defaultRightSection:j,...ae}=n,{styleProps:oe,rest:se}=ac(ae),ce=yg(),le={offsetBottom:ce?.offsetBottom,offsetTop:ce?.offsetTop},ue=Js({name:[`Input`,l],props:u||n,classes:gg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:ne,stylesCtx:le,rootSelector:`wrapper`,vars:w,varsResolver:Gte}),de=ee?{required:c,disabled:m,"aria-invalid":!!p,"aria-describedby":ce?.describedBy,id:ce?.inputId||O}:{},fe=wte({__clearable:ie,__clearSection:re,rightSection:v,__defaultRightSection:j,size:d});return(0,Ag.jsx)(yte,{value:{size:d||`sm`},children:(0,Ag.jsxs)(al,{...ue(`wrapper`),...oe,...f,mod:[{error:!!p&&k,pointer:T,disabled:m,multiline:E,"data-with-right-section":!!fe,"data-with-left-section":!!h},A],variant:C,size:d,children:[h&&(0,Ag.jsx)(`div`,{...g,"data-position":`left`,...ue(`section`,{className:g?.className,style:g?.style}),children:h}),(0,Ag.jsx)(al,{component:`input`,...se,...de,ref:t,required:c,mod:{disabled:m,error:!!p&&k},variant:C,__size:te,...ue(`input`)}),fe&&(0,Ag.jsx)(`div`,{...y,"data-position":`right`,...ue(`section`,{className:y?.className,style:y?.style}),children:fe})]})})}),jg.classes=gg,jg.Wrapper=kg,jg.Label=Tg,jg.Error=Sg,jg.Description=xg,jg.Placeholder=Eg,jg.ClearButton=vg,jg.displayName=`@mantine/core/Input`}));function qte(e,t,n){let r=P(e,t,n),{label:i,description:a,error:o,required:s,classNames:c,styles:l,className:u,unstyled:d,__staticSelector:f,__stylesApiProps:p,errorProps:m,labelProps:h,descriptionProps:g,wrapperProps:_,id:v,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,vars:T,mod:E,attributes:D,...O}=r,{styleProps:ee,rest:k}=ac(O),A={label:i,description:a,error:o,required:s,classNames:c,className:u,__staticSelector:f,__stylesApiProps:p||r,errorProps:m,labelProps:h,descriptionProps:g,unstyled:d,styles:l,size:y,style:b,inputContainer:x,inputWrapperOrder:S,withAsterisk:C,variant:w,id:v,mod:E,attributes:D,..._};return{...k,classNames:c,styles:l,unstyled:d,wrapperProps:{...A,...ee},inputProps:{required:s,classNames:c,styles:l,unstyled:d,size:y,__staticSelector:f,__stylesApiProps:p||r,error:o,variant:w,id:v,attributes:D}}}var Jte=o((()=>{p(),N(),Zs(),oc()})),Mg,Yte,Ng,Xte=o((()=>{Mg=N(),p(),hl(),Kte(),Jte(),Yte={__staticSelector:`InputBase`,withAria:!0,size:`sm`},Ng=fl((e,t)=>{let{inputProps:n,wrapperProps:r,...i}=qte(`InputBase`,Yte,e);return(0,Mg.jsx)(jg.Wrapper,{...r,children:(0,Mg.jsx)(jg,{...n,...i,ref:t})})}),Ng.classes={...jg.classes,...jg.Wrapper.classes},Ng.displayName=`@mantine/core/InputBase`})),Zte,Qte=o((()=>{Zte={gap:{type:`spacing`,property:`gap`},rowGap:{type:`spacing`,property:`rowGap`},columnGap:{type:`spacing`,property:`columnGap`},align:{type:`identity`,property:`alignItems`},justify:{type:`identity`,property:`justifyContent`},wrap:{type:`identity`,property:`flexWrap`},direction:{type:`identity`,property:`flexDirection`}}})),Pg,$te=o((()=>{Pg={root:`m_8bffd616`}})),Fg,Ig,ene=o((()=>{Fg=N(),fr(),p(),Mo(),Zs(),Ys(),ic(),Vc(),Wc(),ol(),hl(),Qte(),$te(),Ig=fl((e,t)=>{let n=P(`Flex`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h,attributes:g,..._}=n,v=Js({name:`Flex`,classes:Pg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c}),y=Eo(),b=Hc(),x=Bc({styleProps:{gap:l,rowGap:u,columnGap:d,align:f,justify:p,wrap:m,direction:h},theme:y,data:Zte});return(0,Fg.jsxs)(Fg.Fragment,{children:[x.hasResponsiveStyles&&(0,Fg.jsx)(nc,{selector:`.${b}`,styles:x.styles,media:x.media}),(0,Fg.jsx)(al,{ref:t,...v(`root`,{className:b,style:dr(x.inlineStyles)}),..._})]})}),Ig.classes=Pg,Ig.displayName=`@mantine/core/Flex`}));function Lg({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,Rg.useRef)(-1),a=(0,Rg.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,Rg.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var Rg,zg=o((()=>{Rg=u(p(),1)}));function Bg({style:e,size:t=16,...n}){return(0,Vg.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:M(t),height:M(t),display:`block`},...n,children:(0,Vg.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var Vg,tne=o((()=>{Vg=N(),ur(),p(),Bg.displayName=`@mantine/core/AccordionChevron`})),Hg,nne=o((()=>{Hg={root:`m_b6d8b162`}}));function rne(e){if(e===`start`)return`start`;if(e===`end`||e)return`end`}var Ug,Wg,Gg,Kg,ine=o((()=>{Ug=N(),p(),Jr(),ga(),no(),io(),Zs(),Ys(),ol(),hl(),nne(),Wg={inherit:!1},Gg=ha((e,{variant:t,lineClamp:n,gradient:r,size:i,color:a})=>({root:{"--text-fz":Gr(i),"--text-lh":Kr(i),"--text-gradient":t===`gradient`?ro(r,e):void 0,"--text-line-clamp":typeof n==`number`?n.toString():void 0,"--text-color":a?to(a,e):void 0}})),Kg=fl((e,t)=>{let n=P(`Text`,Wg,e),{lineClamp:r,truncate:i,inline:a,inherit:o,gradient:s,span:c,__staticSelector:l,vars:u,className:d,style:f,classNames:p,styles:m,unstyled:h,variant:g,mod:_,size:v,attributes:y,...b}=n;return(0,Ug.jsx)(al,{...Js({name:[`Text`,l],props:n,classes:Hg,className:d,style:f,classNames:p,styles:m,unstyled:h,attributes:y,vars:u,varsResolver:Gg})(`root`,{focusable:!0}),ref:t,component:c?`span`:`p`,variant:g,mod:[{"data-truncate":rne(i),"data-line-clamp":typeof r==`number`,"data-inline":a,"data-inherit":o},_],size:v,...b})}),Kg.classes=Hg,Kg.displayName=`@mantine/core/Text`}));function qg({size:e,style:t,...n}){return(0,Jg.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:e===void 0?t:{width:M(e),height:M(e),...t},"aria-hidden":!0,...n,children:(0,Jg.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var Jg,Yg=o((()=>{Jg=N(),ur(),p()})),Xg,Zg=o((()=>{Xg={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`}}));function ane(){return{withinGroup:!!(0,Qg.useContext)($g)}}var Qg,$g,e_,t_=o((()=>{Qg=u(p(),1),$g=(0,Qg.createContext)(null),e_=$g.Provider})),n_,r_,i_,one=o((()=>{n_=N(),p(),Jr(),ga(),Zs(),Ys(),ol(),dl(),Zg(),t_(),r_=ha((e,{spacing:t})=>({group:{"--ag-spacing":Ur(t)}})),i_=cl((e,t)=>{let n=P(`AvatarGroup`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,spacing:l,attributes:u,...d}=n;return(0,n_.jsx)(e_,{value:!0,children:(0,n_.jsx)(al,{ref:t,...Js({name:`AvatarGroup`,classes:Xg,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:u,vars:c,varsResolver:r_,rootSelector:`group`})(`group`),...d})})}),i_.classes=Xg,i_.displayName=`@mantine/core/AvatarGroup`}));function sne(e){return(0,a_.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,a_.jsx)(`path`,{d:`M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var a_,cne=o((()=>{a_=N()}));function lne(e){let t=0;for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function une(e,t=o_){let n=lne(e);return t[Math.abs(n)%t.length]}var o_,dne=o((()=>{o_=[`blue`,`cyan`,`grape`,`green`,`indigo`,`lime`,`orange`,`pink`,`red`,`teal`,`violet`]}));function fne(e,t=2){let n=e.split(` `);return n.length===1?e.slice(0,t).toUpperCase():n.map(e=>e[0]).slice(0,t).join(``).toUpperCase()}var pne=o((()=>{})),s_,c_,l_,u_,mne=o((()=>{s_=N(),c_=u(p(),1),Jr(),ga(),Zs(),Ys(),ol(),hl(),Zg(),one(),t_(),cne(),dne(),pne(),l_=ha((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?une(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":Hr(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:Wr(n),"--avatar-bg":l||r?u.background:void 0,"--avatar-color":l||r?u.color:void 0,"--avatar-bd":l||r?u.border:void 0}}}),u_=fl((e,t)=>{let n=P(`Avatar`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,src:l,alt:u,radius:d,color:f,gradient:p,imageProps:m,children:h,autoContrast:g,mod:_,name:v,allowedInitialsColors:y,attributes:b,...x}=n,S=ane(),[C,w]=(0,c_.useState)(!l),T=Js({name:`Avatar`,props:n,classes:Xg,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:b,vars:c,varsResolver:l_});return(0,c_.useEffect)(()=>w(!l),[l]),(0,s_.jsx)(al,{...T(`root`),mod:[{"within-group":S.withinGroup},_],ref:t,...x,children:C||!l?(0,s_.jsx)(`span`,{...T(`placeholder`),title:u,children:h||typeof v==`string`&&fne(v)||(0,s_.jsx)(sne,{})}):(0,s_.jsx)(`img`,{...m,...T(`image`),src:l,alt:u,onError:e=>{w(!0),m?.onError?.(e)}})})}),u_.classes=Xg,u_.displayName=`@mantine/core/Avatar`,u_.Group=i_})),d_,hne=o((()=>{d_={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`}})),f_,p_,m_,gne=o((()=>{f_=N(),p(),Jr(),ga(),no(),Zs(),Ys(),ol(),hl(),hne(),p_=ha((e,{radius:t,color:n,gradient:r,variant:i,size:a,autoContrast:o,circle:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:o});return{root:{"--badge-height":Hr(a,`badge-height`),"--badge-padding-x":Hr(a,`badge-padding-x`),"--badge-fz":Hr(a,`badge-fz`),"--badge-radius":s||t===void 0?void 0:Wr(t),"--badge-bg":n||i?c.background:void 0,"--badge-color":n||i?c.color:void 0,"--badge-bd":n||i?c.border:void 0,"--badge-dot-color":i===`dot`?to(n,e):void 0}}}),m_=fl((e,t)=>{let n=P(`Badge`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,radius:l,color:u,gradient:d,leftSection:f,rightSection:p,children:m,variant:h,fullWidth:g,autoContrast:_,circle:v,mod:y,attributes:b,...x}=n,S=Js({name:`Badge`,props:n,classes:d_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:b,vars:c,varsResolver:p_});return(0,f_.jsxs)(al,{variant:h,mod:[{block:g,circle:v,"with-right-section":!!p,"with-left-section":!!f},y],...S(`root`,{variant:h}),ref:t,...x,children:[f&&(0,f_.jsx)(`span`,{...S(`section`),"data-position":`left`,children:f}),(0,f_.jsx)(`span`,{...S(`label`),children:m}),p&&(0,f_.jsx)(`span`,{...S(`section`),"data-position":`right`,children:p})]})}),m_.classes=d_,m_.displayName=`@mantine/core/Badge`})),h_,g_=o((()=>{h_={root:`m_77c9d27d`,inner:`m_80f1301b`,label:`m_811560b9`,section:`m_a74036a`,loader:`m_a25b86ee`,group:`m_80d6d844`,groupSection:`m_70be2a01`}})),__,v_,y_,b_,_ne=o((()=>{__=N(),ur(),p(),ga(),Zs(),Ys(),ol(),dl(),g_(),v_={orientation:`horizontal`},y_=ha((e,{borderWidth:t})=>({group:{"--button-border-width":M(t)}})),b_=cl((e,t)=>{let n=P(`ButtonGroup`,v_,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,orientation:c,vars:l,borderWidth:u,variant:d,mod:f,attributes:p,...m}=P(`ButtonGroup`,v_,e);return(0,__.jsx)(al,{...Js({name:`ButtonGroup`,props:n,classes:h_,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:l,varsResolver:y_,rootSelector:`group`})(`group`),ref:t,variant:d,mod:[{"data-orientation":c},f],role:`group`,...m})}),b_.classes=h_,b_.displayName=`@mantine/core/ButtonGroup`})),x_,S_,C_,vne=o((()=>{x_=N(),p(),Jr(),ga(),Zs(),Ys(),ol(),dl(),g_(),S_=ha((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":Hr(o,`section-height`),"--section-padding-x":Hr(o,`section-padding-x`),"--section-fz":o?.includes(`compact`)?Gr(o.replace(`compact-`,``)):Gr(o),"--section-radius":t===void 0?void 0:Wr(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),C_=cl((e,t)=>{let n=P(`ButtonGroupSection`,null,e),{className:r,style:i,classNames:a,styles:o,unstyled:s,vars:c,variant:l,gradient:u,radius:d,autoContrast:f,attributes:p,...m}=n;return(0,x_.jsx)(al,{...Js({name:`ButtonGroupSection`,props:n,classes:h_,className:r,style:i,classNames:a,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:S_,rootSelector:`groupSection`})(`groupSection`),ref:t,variant:l,...m})}),C_.classes=h_,C_.displayName=`@mantine/core/ButtonGroupSection`})),w_,T_,E_,D_,yne=o((()=>{w_=N(),ur(),p(),Jr(),ga(),Zs(),Ys(),ol(),hl(),tg(),hh(),zm(),g_(),_ne(),vne(),T_={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${M(1)}))`},out:{opacity:0,transform:`translate(-50%, -200%)`},common:{transformOrigin:`center`},transitionProperty:`transform, opacity`},E_=ha((e,{radius:t,color:n,gradient:r,variant:i,size:a,justify:o,autoContrast:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:s});return{root:{"--button-justify":o,"--button-height":Hr(a,`button-height`),"--button-padding-x":Hr(a,`button-padding-x`),"--button-fz":a?.includes(`compact`)?Gr(a.replace(`compact-`,``)):Gr(a),"--button-radius":t===void 0?void 0:Wr(t),"--button-bg":n||i?c.background:void 0,"--button-hover":n||i?c.hover:void 0,"--button-color":c.color,"--button-bd":n||i?c.border:void 0,"--button-hover-color":n||i?c.hoverColor:void 0}}}),D_=fl((e,t)=>{let n=P(`Button`,null,e),{style:r,vars:i,className:a,color:o,disabled:s,children:c,leftSection:l,rightSection:u,fullWidth:d,variant:f,radius:p,loading:m,loaderProps:h,gradient:g,classNames:_,styles:v,unstyled:y,"data-disabled":b,autoContrast:x,mod:S,attributes:C,...w}=n,T=Js({name:`Button`,props:n,classes:h_,className:a,style:r,classNames:_,styles:v,unstyled:y,attributes:C,vars:i,varsResolver:E_}),E=!!l,D=!!u;return(0,w_.jsxs)(Rm,{ref:t,...T(`root`,{active:!s&&!m&&!b}),unstyled:y,variant:f,disabled:s||m,mod:[{disabled:s||b,loading:m,block:d,"with-left-section":E,"with-right-section":D},S],...w,children:[typeof m==`boolean`&&(0,w_.jsx)(ph,{mounted:m,transition:T_,duration:150,children:e=>(0,w_.jsx)(al,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,w_.jsx)(eg,{color:`var(--button-color)`,size:`calc(var(--button-height) / 1.8)`,...h})})}),(0,w_.jsxs)(`span`,{...T(`inner`),children:[l&&(0,w_.jsx)(al,{component:`span`,...T(`section`),mod:{position:`left`},children:l}),(0,w_.jsx)(al,{component:`span`,mod:{loading:m},...T(`label`),children:c}),u&&(0,w_.jsx)(al,{component:`span`,...T(`section`),mod:{position:`right`},children:u})]})]})}),D_.classes=h_,D_.displayName=`@mantine/core/Button`,D_.Group=b_,D_.GroupSection=C_})),O_,k_,A_=o((()=>{p(),xr(),N(),[O_,k_]=vr(`Card component was not found in tree`)})),j_,M_=o((()=>{j_={root:`m_e615b15f`,section:`m_599a2148`}})),N_,P_,bne=o((()=>{N_=N(),p(),Zs(),ol(),hl(),A_(),M_(),P_=fl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,withBorder:s,inheritPadding:c,mod:l,...u}=P(`CardSection`,null,e),d=k_();return(0,N_.jsx)(al,{ref:t,mod:[{"with-border":s,"inherit-padding":c},l],...d.getStyles(`section`,{className:r,style:i,styles:a,classNames:n}),...u})}),P_.classes=j_,P_.displayName=`@mantine/core/CardSection`})),F_,I_,L_,R_,xne=o((()=>{F_=N(),I_=u(p(),1),Jr(),ga(),Zs(),Ys(),hl(),Eee(),A_(),M_(),bne(),L_=ha((e,{padding:t})=>({root:{"--card-padding":Ur(t)}})),R_=fl((e,t)=>{let n=P(`Card`,null,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,children:l,padding:u,attributes:d,...f}=n,p=Js({name:`Card`,props:n,classes:j_,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:d,vars:c,varsResolver:L_}),m=I_.Children.toArray(l),h=m.map((e,t)=>typeof e==`object`&&e&&`type`in e&&e.type===P_?(0,I_.cloneElement)(e,{"data-first-section":t===0||void 0,"data-last-section":t===m.length-1||void 0}):e);return(0,F_.jsx)(O_,{value:{getStyles:p},children:(0,F_.jsx)(Um,{ref:t,unstyled:s,...p(`root`),...f,children:h})})}),R_.classes=j_,R_.displayName=`@mantine/core/Card`,R_.Section=P_})),z_,Sne=o((()=>{z_={root:`m_f59ffda3`,label:`m_be049a53`,"label--outline":`m_3904c1af`,"label--filled":`m_fa109255`,"label--light":`m_f7e165c3`,iconWrapper:`m_9ac86df9`,checkIcon:`m_d6d72580`,input:`m_bde07329`}})),B_,V_,H_=o((()=>{p(),N(),Tr(),[B_,V_]=Sr()}));function U_(e){let{value:t,defaultValue:n,onChange:r,multiple:i,children:a}=P(`ChipGroup`,null,e),[o,s]=Ji({value:t,defaultValue:n,finalValue:i?[]:null,onChange:r});return(0,W_.jsx)(B_,{value:{isChipSelected:e=>Array.isArray(o)?o.includes(e):e===o,onChange:e=>{let t=e.currentTarget.value;s(Array.isArray(o)?o.includes(t)?o.filter(e=>e!==t):[...o,t]:t)},multiple:i},children:a})}var W_,Cne=o((()=>{W_=N(),la(),p(),Zs(),H_(),U_.displayName=`@mantine/core/ChipGroup`})),G_,K_,q_,J_,wne=o((()=>{G_=N(),la(),p(),Jr(),ga(),Zs(),Ys(),oc(),ol(),dl(),Yg(),Sne(),H_(),Cne(),K_={type:`checkbox`},q_=ha((e,{size:t,radius:n,variant:r,color:i,autoContrast:a})=>{let o=e.variantColorResolver({color:i||e.primaryColor,theme:e,variant:r||`filled`,autoContrast:a});return{root:{"--chip-fz":Gr(t),"--chip-size":Hr(t,`chip-size`),"--chip-radius":n===void 0?void 0:Wr(n),"--chip-checked-padding":Hr(t,`chip-checked-padding`),"--chip-padding":Hr(t,`chip-padding`),"--chip-icon-size":Hr(t,`chip-icon-size`),"--chip-bg":i||r?o.background:void 0,"--chip-hover":i||r?o.hover:void 0,"--chip-color":i||r?o.color:void 0,"--chip-bd":i||r?o.border:void 0,"--chip-spacing":Hr(t,`chip-spacing`)}}}),J_=cl((e,t)=>{let n=P(`Chip`,K_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,id:l,checked:u,defaultChecked:d,onChange:f,value:p,wrapperProps:m,type:h,disabled:g,children:_,size:v,variant:y,icon:b,rootRef:x,autoContrast:S,mod:C,attributes:w,...T}=n,E=Js({name:`Chip`,classes:z_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:w,vars:c,varsResolver:q_}),D=V_(),O=Bi(l),{styleProps:ee,rest:k}=ac(T),[A,te]=Ji({value:u,defaultValue:d,finalValue:!1,onChange:f}),ne=D?{checked:D.isChipSelected(p),onChange:e=>{D.onChange(e),f?.(e.currentTarget.checked)},type:D.multiple?`checkbox`:`radio`}:{},re=ne.checked||A;return(0,G_.jsxs)(al,{size:v,variant:y,ref:x,mod:C,...E(`root`),...ee,...m,children:[(0,G_.jsx)(`input`,{type:h,...E(`input`),checked:re,onChange:e=>te(e.currentTarget.checked),id:O,disabled:g,ref:t,value:p,...ne,...k}),(0,G_.jsxs)(`label`,{htmlFor:O,"data-checked":re||void 0,"data-disabled":g||void 0,...E(`label`,{variant:y||`filled`}),children:[re&&b!==null&&b!==!1&&(0,G_.jsx)(`span`,{...E(`iconWrapper`),children:b===void 0?(0,G_.jsx)(qg,{...E(`checkIcon`)}):b}),(0,G_.jsx)(`span`,{children:_})]})]})}),J_.classes=z_,J_.displayName=`@mantine/core/Chip`,J_.Group=U_})),Y_,Tne=o((()=>{Y_={root:`m_3eebeb36`,label:`m_9e365f20`}})),X_,Z_,Q_,$_,Ene=o((()=>{X_=N(),p(),Jr(),ga(),no(),Zs(),Ys(),ol(),dl(),Tne(),Z_={orientation:`horizontal`},Q_=ha((e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?to(t,e):void 0,"--divider-border-style":n,"--divider-size":Hr(r,`divider-size`)}})),$_=cl((e,t)=>{let n=P(`Divider`,Z_,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,color:l,orientation:u,label:d,labelPosition:f,mod:p,attributes:m,...h}=n,g=Js({name:`Divider`,classes:Y_,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:Q_});return(0,X_.jsx)(al,{ref:t,mod:[{orientation:u,"with-label":!!d},p],...g(`root`),...h,role:`separator`,children:d&&(0,X_.jsx)(al,{component:`span`,mod:{position:f},...g(`label`),children:d})})}),$_.classes=Y_,$_.displayName=`@mantine/core/Divider`})),ev,tv,nv,rv,Dne=o((()=>{ev=N(),tv=u(p(),1),la(),Zs(),nv={multiple:!1},rv=(0,tv.forwardRef)((e,t)=>{let{onChange:n,children:r,multiple:i,accept:a,name:o,form:s,resetRef:c,disabled:l,capture:u,inputProps:d,...f}=P(`FileButton`,nv,e),p=(0,tv.useRef)(null),m=()=>{!l&&p.current?.click()};return Ui(c,()=>{p.current&&(p.current.value=``)}),(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(`input`,{style:{display:`none`},type:`file`,accept:a,multiple:i,onChange:e=>{if(e.currentTarget.files===null)return n(i?[]:null);n(i?Array.from(e.currentTarget.files):e.currentTarget.files[0]||null)},ref:Gi(t,p),name:o,form:s,capture:u,...d}),r({onClick:m,...f})]})}),rv.displayName=`@mantine/core/FileButton`})),iv,av,ov,sv,cv,lv,One=o((()=>{iv=N(),av=u(p(),1),la(),_s(),Zs(),dl(),ute(),Dne(),Kte(),Xte(),ov=({value:e})=>(0,iv.jsx)(`div`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:Array.isArray(e)?e.map(e=>e.name).join(`, `):e?.name}),sv={valueComponent:ov,size:`sm`},cv=cl((e,t)=>{let n=P(`FileInput`,sv,e),{unstyled:r,vars:i,onChange:a,value:o,defaultValue:s,multiple:c,accept:l,name:u,form:d,valueComponent:f,clearable:p,clearButtonProps:m,readOnly:h,capture:g,fileInputProps:_,rightSection:v,size:y,placeholder:b,component:x,resetRef:S,classNames:C,styles:w,attributes:T,...E}=n,D=(0,av.useRef)(null),{resolvedClassNames:O,resolvedStyles:ee}=gs({classNames:C,styles:w,props:n}),[k,A]=Ji({value:o,defaultValue:s,onChange:a,finalValue:c?[]:null}),te=Array.isArray(k)?k.length!==0:k!==null,ne=v||(p&&te&&!h?(0,iv.jsx)(pg,{...m,variant:`subtle`,onClick:()=>A(c?[]:null),size:y,unstyled:r}):null);return(0,av.useEffect)(()=>{(Array.isArray(k)&&k.length===0||k===null)&&D.current?.()},[k]),(0,iv.jsx)(rv,{onChange:A,multiple:c,accept:l,name:u,form:d,resetRef:Gi(D,S),disabled:h,capture:g,inputProps:_,children:e=>(0,iv.jsx)(Ng,{component:x||`button`,ref:t,rightSection:ne,...e,...E,__staticSelector:`FileInput`,multiline:!0,type:`button`,pointer:!0,__stylesApiProps:n,unstyled:r,size:y,classNames:C,styles:w,attributes:T,children:te?(0,iv.jsx)(f,{value:k}):(0,iv.jsx)(jg.Placeholder,{__staticSelector:`FileInput`,classNames:O,styles:ee,attributes:T,children:b})})})}),cv.classes=Ng.classes,cv.displayName=`@mantine/core/FileInput`,lv=cv})),uv,kne=o((()=>{uv={root:`m_6e45937b`,loader:`m_e8eb006c`,overlay:`m_df587f17`}})),dv,fv,pv,mv,Ane=o((()=>{dv=N(),p(),Lr(),ga(),Mo(),Zs(),Ys(),ol(),dl(),tg(),Qm(),hh(),kne(),fv={transitionProps:{transition:`fade`,duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Fr(`overlay`)},pv=ha((e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}})),mv=cl((e,t)=>{let n=P(`LoadingOverlay`,fv,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,transitionProps:l,loaderProps:u,overlayProps:d,visible:f,zIndex:p,attributes:m,...h}=n,g=Eo(),_=Js({name:`LoadingOverlay`,classes:uv,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:m,vars:c,varsResolver:pv}),v={...fv.overlayProps,...d};return(0,dv.jsx)(ph,{transition:`fade`,...l,mounted:!!f,children:e=>(0,dv.jsxs)(al,{..._(`root`,{style:e}),ref:t,...h,children:[(0,dv.jsx)(eg,{..._(`loader`),unstyled:s,...u}),(0,dv.jsx)(Zm,{...v,..._(`overlay`),darkHidden:!0,unstyled:s,color:d?.color||g.white}),(0,dv.jsx)(Zm,{...v,..._(`overlay`),lightHidden:!0,unstyled:s,color:d?.color||g.colors.dark[5]})]})})}),mv.classes=uv,mv.displayName=`@mantine/core/LoadingOverlay`})),hv,gv,_v=o((()=>{p(),xr(),N(),[hv,gv]=vr(`Menu component was not found in the tree`)})),vv,yv=o((()=>{vv={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,itemLabel:`m_5476e0d3`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`}})),bv,xv,jne=o((()=>{bv=N(),p(),Zs(),ol(),dl(),_v(),yv(),xv=cl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=P(`MenuDivider`,null,e);return(0,bv.jsx)(al,{ref:t,...gv().getStyles(`divider`,{className:r,style:i,styles:a,classNames:n}),...s})}),xv.classes=vv,xv.displayName=`@mantine/core/MenuDivider`})),Sv,Cv,wv,Mne=o((()=>{Sv=N(),Cv=u(p(),1),la(),Xr(),Zs(),dl(),Rh(),_v(),yv(),wv=cl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=P(`MenuDropdown`,null,e),f=(0,Cv.useRef)(null),p=gv(),m=Yr(l,e=>{(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),f.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),h=Yr(s,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.openDropdown()),g=Yr(c,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.closeDropdown());return(0,Sv.jsxs)(Nh.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:Gi(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:m,children:[p.withInitialFocusPlaceholder&&(0,Sv.jsx)(`div`,{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})}),wv.classes=vv,wv.displayName=`@mantine/core/MenuDropdown`})),Tv,Ev,Dv=o((()=>{p(),N(),Tr(),[Tv,Ev]=Sr()})),Ov,kv,Av,Nne=o((()=>{Ov=N(),kv=u(p(),1),la(),Pr(),Xr(),eo(),Mo(),Zs(),hl(),yl(),zm(),_v(),yv(),Dv(),Av=fl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,closeMenuOnClick:c,leftSection:l,rightSection:u,children:d,disabled:f,"data-disabled":p,...m}=P(`MenuItem`,null,e),h=gv(),g=Ev(),_=Eo(),{dir:v}=gl(),y=(0,kv.useRef)(null),b=m,x=Yr(b.onClick,()=>{p||(typeof c==`boolean`?c&&h.closeDropdownImmediately():h.closeOnItemClick&&h.closeDropdownImmediately())}),S=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,C=s?$a({color:s,theme:_}):null,w=Yr(b.onKeyDown,e=>{e.key===`ArrowLeft`&&g&&(g.close(),g.focusParentItem())});return(0,Ov.jsxs)(Rm,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:Gi(y,t),role:`menuitem`,disabled:f,"data-menu-item":!0,"data-disabled":f||p||void 0,"data-mantine-stop-propagation":!0,onClick:x,onKeyDown:Nr({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:w}),__vars:{"--menu-item-color":C?.isThemeColor&&C?.shade===void 0?`var(--mantine-color-${C.color}-6)`:S?.color,"--menu-item-hover":S?.hover},children:[l&&(0,Ov.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:l}),d&&(0,Ov.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:d}),u&&(0,Ov.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:u})]})}),Av.classes=vv,Av.displayName=`@mantine/core/MenuItem`})),jv,Mv,Pne=o((()=>{jv=N(),p(),Zs(),ol(),dl(),_v(),yv(),Mv=cl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,...s}=P(`MenuLabel`,null,e);return(0,jv.jsx)(al,{ref:t,...gv().getStyles(`label`,{className:r,style:i,styles:a,classNames:n}),...s})}),Mv.classes=vv,Mv.displayName=`@mantine/core/MenuLabel`})),Nv,Pv,Fv,Fne=o((()=>{Nv=N(),Pv=u(p(),1),la(),Xr(),Zs(),dl(),Rh(),_v(),yv(),Dv(),Fv=cl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,onMouseEnter:s,onMouseLeave:c,onKeyDown:l,children:u,...d}=P(`MenuSubDropdown`,null,e),f=(0,Pv.useRef)(null),p=gv(),m=Ev(),h=Yr(s,m?.open),g=Yr(c,m?.close);return(0,Nv.jsx)(Nh.Dropdown,{...d,onMouseEnter:h,onMouseLeave:g,role:`menu`,"aria-orientation":`vertical`,ref:Gi(t,f),...p.getStyles(`dropdown`,{className:r,style:i,styles:a,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:u})}),Fv.classes=vv,Fv.displayName=`@mantine/core/MenuSubDropdown`})),Iv,Lv,Rv,Ine=o((()=>{Iv=N(),Lv=u(p(),1),la(),Pr(),Xr(),eo(),Mo(),Zs(),hl(),yl(),tne(),zm(),_v(),yv(),Dv(),Rv=fl((e,t)=>{let{classNames:n,className:r,style:i,styles:a,vars:o,color:s,leftSection:c,rightSection:l,children:u,disabled:d,"data-disabled":f,closeMenuOnClick:p,...m}=P(`MenuSubItem`,null,e),h=gv(),g=Ev(),_=Eo(),{dir:v}=gl(),y=(0,Lv.useRef)(null),b=m,x=s?_.variantColorResolver({color:s,theme:_,variant:`light`}):void 0,S=s?$a({color:s,theme:_}):null,C=Yr(b.onKeyDown,e=>{e.key===`ArrowRight`&&(g?.open(),g?.focusFirstItem()),e.key===`ArrowLeft`&&g?.parentContext&&(g.parentContext.close(),g.parentContext.focusParentItem())}),w=Yr(b.onClick,()=>{!f&&p&&h.closeDropdownImmediately()}),T=Yr(b.onMouseEnter,g?.open),E=Yr(b.onMouseLeave,g?.close);return(0,Iv.jsxs)(Rm,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:r,style:i,styles:a,classNames:n}),ref:Gi(y,t),role:`menuitem`,disabled:d,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":d||f||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:T,onMouseLeave:E,onClick:w,onKeyDown:Nr({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:v,orientation:`vertical`,onKeyDown:C}),__vars:{"--menu-item-color":S?.isThemeColor&&S?.shade===void 0?`var(--mantine-color-${S.color}-6)`:x?.color,"--menu-item-hover":x?.hover},children:[c&&(0,Iv.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`left`,children:c}),u&&(0,Iv.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:a,classNames:n}),children:u}),(0,Iv.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:a,classNames:n}),"data-position":`right`,children:l||(0,Iv.jsx)(Bg,{...h.getStyles(`chevron`),size:14})})]})}),Rv.classes=vv,Rv.displayName=`@mantine/core/MenuSubItem`}));function zv({children:e,refProp:t}){if(!hr(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return gv(),(0,Bv.jsx)(Nh.Target,{refProp:t,popupType:`menu`,children:e})}var Bv,Lne=o((()=>{Bv=N(),_r(),p(),Rh(),_v(),zv.displayName=`@mantine/core/MenuSubTarget`}));function Vv(e){let{children:t,closeDelay:n,openDelay:r,...i}=P(`MenuSub`,Uv,e),a=Bi(),[o,{open:s,close:c}]=na(!1),l=Ev(),{openDropdown:u,closeDropdown:d}=Lg({open:s,close:c,closeDelay:n,openDelay:r});return(0,Hv.jsx)(Tv,{value:{opened:o,close:d,open:u,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${a}-target`)?.focus()},16),parentContext:l},children:(0,Hv.jsx)(Nh,{opened:o,withinPortal:!1,withArrow:!1,id:a,...i,children:t})})}var Hv,Uv,Rne=o((()=>{Hv=N(),la(),p(),Zs(),zg(),Rh(),Fne(),Ine(),Lne(),Dv(),Uv={offset:0,position:`right-start`,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}},Vv.extend=e=>e,Vv.displayName=`@mantine/core/MenuSub`,Vv.Target=zv,Vv.Dropdown=Fv,Vv.Item=Rv})),Wv,Gv,Kv,qv,zne=o((()=>{Wv=N(),Gv=u(p(),1),Xr(),ma(),Zs(),Rh(),_v(),Kv={refProp:`ref`},qv=(0,Gv.forwardRef)((e,t)=>{let{children:n,refProp:r,...i}=P(`MenuTarget`,Kv,e),a=fa(n);if(!a)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let o=gv(),s=a.props,c=Yr(s.onClick,()=>{o.trigger===`click`?o.toggleDropdown():o.trigger===`click-hover`&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),l=Yr(s.onMouseEnter,()=>(o.trigger===`hover`||o.trigger===`click-hover`)&&o.openDropdown()),u=Yr(s.onMouseLeave,()=>{(o.trigger===`hover`||o.trigger===`click-hover`&&!o.openedViaClick)&&o.closeDropdown()});return(0,Wv.jsx)(Nh.Target,{refProp:r,popupType:`menu`,ref:t,...i,children:(0,Gv.cloneElement)(a,{onClick:c,onMouseEnter:l,onMouseLeave:u,"data-expanded":o.opened?!0:void 0})})}),qv.displayName=`@mantine/core/MenuTarget`}));function Jv(e){let t=P(`Menu`,Zv,e),{children:n,onOpen:r,onClose:i,opened:a,defaultOpened:o,trapFocus:s,onChange:c,closeOnItemClick:l,loop:u,closeOnEscape:d,trigger:f,openDelay:p,closeDelay:m,classNames:h,styles:g,unstyled:_,variant:v,vars:y,menuItemTabIndex:b,keepMounted:x,withInitialFocusPlaceholder:S,attributes:C,...w}=t,T=Js({name:`Menu`,classes:vv,props:t,classNames:h,styles:g,unstyled:_,attributes:C}),[E,D]=Ji({value:a,defaultValue:o,finalValue:!1,onChange:c}),[O,ee]=(0,Xv.useState)(!1),k=()=>{D(!1),ee(!1),E&&i?.()},A=()=>{D(!0),!E&&r?.()},te=()=>{E?k():A()},{openDropdown:ne,closeDropdown:re}=Lg({open:A,close:k,closeDelay:m,openDelay:p}),ie=e=>Zr(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:j,resolvedStyles:ae}=gs({classNames:h,styles:g,props:t});return(0,Yv.jsx)(hv,{value:{getStyles:T,opened:E,toggleDropdown:te,getItemIndex:ie,openedViaClick:O,setOpenedViaClick:ee,closeOnItemClick:l,closeDropdown:f===`click`?k:re,openDropdown:f===`click`?A:ne,closeDropdownImmediately:k,loop:u,trigger:f,unstyled:_,menuItemTabIndex:b,withInitialFocusPlaceholder:S},children:(0,Yv.jsx)(Nh,{returnFocus:!0,...w,opened:E,onChange:te,defaultOpened:o,trapFocus:x?!1:s,closeOnEscape:d,__staticSelector:`Menu`,classNames:j,styles:ae,unstyled:_,variant:v,keepMounted:x,children:n})})}var Yv,Xv,Zv,Bne=o((()=>{Yv=N(),Xv=u(p(),1),la(),Qr(),_s(),Ys(),Zs(),dl(),zg(),Rh(),_v(),yv(),jne(),Mne(),Nne(),Pne(),Rne(),zne(),Zv={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1},Jv.extend=e=>e,Jv.withProps=cee(Jv),Jv.classes=vv,Jv.displayName=`@mantine/core/Menu`,Jv.Item=Av,Jv.Label=Mv,Jv.Dropdown=wv,Jv.Target=qv,Jv.Divider=xv,Jv.Sub=Vv}));function Qv(e,t){return{...$v,...t,...e}}var $v,Vne=o((()=>{$v={duration:100,transition:`fade`}})),ey,ty=o((()=>{ey={tooltip:`m_1b3c8819`,arrow:`m_f898399f`}}));function Hne({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,ny.useState)(n),a=(0,ny.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Bp({placement:t,middleware:[ip({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,ny.useCallback)(({clientX:e,clientY:t})=>{l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,ny.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=zl(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var ny,Une=o((()=>{ny=u(p(),1),Im()})),ry,iy,ay,oy,sy,Wne=o((()=>{ry=N(),iy=u(p(),1),la(),Lr(),Jr(),da(),ma(),ga(),no(),Mo(),Zs(),Ys(),Kc(),ol(),dl(),sh(),ty(),Une(),ay={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:Fr(`popover`)},oy=ha((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Wr(t),"--tooltip-bg":n?to(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),sy=cl((e,t)=>{let n=P(`TooltipFloating`,ay,e),{children:r,refProp:i,withinPortal:a,style:o,className:s,classNames:c,styles:l,unstyled:u,radius:d,color:f,label:p,offset:m,position:h,multiline:g,zIndex:_,disabled:v,defaultOpened:y,variant:b,vars:x,portalProps:S,attributes:C,...w}=n,T=Eo(),E=Js({name:`TooltipFloating`,props:n,classes:ey,className:s,style:o,classNames:c,styles:l,unstyled:u,attributes:C,rootSelector:`tooltip`,vars:x,varsResolver:oy}),{handleMouseMove:D,x:O,y:ee,opened:k,boundaryRef:A,floating:te,setOpened:ne}=Hne({offset:m,position:h,defaultOpened:y}),re=fa(r);if(!re)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let ie=Gi(A,ua(re),t),j=re.props,ae=e=>{j.onMouseEnter?.(e),D(e),ne(!0)},oe=e=>{j.onMouseLeave?.(e),ne(!1)};return(0,ry.jsxs)(ry.Fragment,{children:[(0,ry.jsx)(oh,{...S,withinPortal:a,children:(0,ry.jsx)(al,{...w,...E(`tooltip`,{style:{...Gc(o,T),zIndex:_,display:!v&&k?`block`:`none`,top:(ee&&Math.round(ee))??``,left:(O&&Math.round(O))??``}}),variant:b,ref:te,mod:{multiline:g},children:p})}),(0,iy.cloneElement)(re,{...j,[i]:ie,onMouseEnter:ae,onMouseLeave:oe})]})}),sy.classes=ey,sy.displayName=`@mantine/core/TooltipFloating`})),cy,ly,uy,dy,fy=o((()=>{cy=u(p(),1),ly=(0,cy.createContext)(!1),uy=ly.Provider,dy=()=>(0,cy.useContext)(ly)}));function py(e){let{openDelay:t,closeDelay:n,children:r}=P(`TooltipGroup`,hy,e);return(0,my.jsx)(uy,{value:!0,children:(0,my.jsx)(xp,{delay:{open:t,close:n},children:r})})}var my,hy,Gne=o((()=>{my=N(),Im(),p(),Zs(),fy(),hy={openDelay:0,closeDelay:0},py.displayName=`@mantine/core/TooltipGroup`,py.extend=e=>e}));function Kne(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function qne(e){let t=Kne(e.middlewares),n=[rp(e.offset)];return t.shift&&n.push(ip(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?op():op(t.flip)),n.push(dp({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?up():up(t.inline)):e.inline&&n.push(up()),n}function Jne(e){let[t,n]=(0,gy.useState)(e.defaultOpened),r=typeof e.opened==`boolean`?e.opened:t,i=dy(),a=Bi(),o=(0,gy.useCallback)(e=>{n(e),e&&g(a)},[a]),{x:s,y:c,context:l,refs:u,placement:d,middlewareData:{arrow:{x:f,y:p}={}}}=Bp({strategy:e.strategy,placement:e.position,open:r,onOpenChange:o,middleware:qne(e),whileElementsMounted:jf}),{delay:m,currentId:h,setCurrentId:g}=Sp(l,{id:a}),{getReferenceProps:_,getFloatingProps:v}=Wp([bp(l,{enabled:e.events?.hover,delay:i?m:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),Hp(l,{enabled:e.events?.focus,visibleOnly:!0}),Gp(l,{role:`tooltip`}),Rp(l,{enabled:e.opened===void 0})]);gi(()=>{e.onPositionChange?.(d)},[d]);let y=r&&h&&h!==a;return{x:s,y:c,arrowX:f,arrowY:p,reference:u.setReference,floating:u.setFloating,getFloatingProps:v,getReferenceProps:_,isGroupPhase:y,opened:r,placement:d}}var gy,Yne=o((()=>{gy=u(p(),1),Im(),la(),fy()})),_y,vy,yy,by,xy,Xne=o((()=>{_y=N(),vy=u(p(),1),ya(),la(),Lr(),Jr(),da(),ma(),ga(),Zs(),Ys(),ol(),dl(),yl(),Pee(),Km(),sh(),hh(),Vne(),ty(),Wne(),Gne(),Yne(),yy={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:Fr(`popover`),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},by=ha((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:Wr(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),xy=cl((e,t)=>{let n=P(`Tooltip`,yy,e),{children:r,position:i,refProp:a,label:o,openDelay:s,closeDelay:c,onPositionChange:l,opened:u,defaultOpened:d,withinPortal:f,radius:p,color:m,classNames:h,styles:g,unstyled:_,style:v,className:y,withArrow:b,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,offset:T,transitionProps:E,multiline:D,events:O,zIndex:ee,disabled:k,positionDependencies:A,onClick:te,onMouseEnter:ne,onMouseLeave:re,inline:ie,variant:j,keepMounted:ae,vars:oe,portalProps:se,mod:ce,floatingStrategy:le,middlewares:ue,autoContrast:de,attributes:fe,target:pe,...me}=P(`Tooltip`,yy,n),{dir:he}=gl(),ge=(0,vy.useRef)(null),_e=Jne({position:Gm(he,i),closeDelay:c,openDelay:s,onPositionChange:l,opened:u,defaultOpened:d,events:O,arrowRef:ge,arrowOffset:S,offset:typeof T==`number`?T+(b?x/2:0):T,positionDependencies:[...A,pe??r],inline:ie,strategy:le,middlewares:ue});(0,vy.useEffect)(()=>{let e=pe instanceof HTMLElement?pe:typeof pe==`string`?document.querySelector(pe):pe?.current||null;e&&_e.reference(e)},[pe,_e]);let ve=Js({name:`Tooltip`,props:n,classes:ey,className:y,style:v,classNames:h,styles:g,unstyled:_,attributes:fe,rootSelector:`tooltip`,vars:oe,varsResolver:by}),ye=fa(r);if(!pe&&!ye)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);if(pe){let e=Qv(E,{duration:100,transition:`fade`});return(0,_y.jsx)(_y.Fragment,{children:(0,_y.jsx)(oh,{...se,withinPortal:f,children:(0,_y.jsx)(ph,{...e,keepMounted:ae,mounted:!k&&!!_e.opened,duration:_e.isGroupPhase?10:e.duration,children:e=>(0,_y.jsxs)(al,{...me,"data-fixed":le===`fixed`||void 0,variant:j,mod:[{multiline:D},ce],..._e.getFloatingProps({ref:_e.floating,className:ve(`tooltip`).className,style:{...ve(`tooltip`).style,...e,zIndex:ee,top:_e.y??0,left:_e.x??0}}),children:[o,(0,_y.jsx)(Wm,{ref:ge,arrowX:_e.arrowX,arrowY:_e.arrowY,visible:b,position:_e.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...ve(`arrow`)})]})})})})}let be=ye.props,xe=Gi(_e.reference,ua(ye),t),Se=Qv(E,{duration:100,transition:`fade`});return(0,_y.jsxs)(_y.Fragment,{children:[(0,_y.jsx)(oh,{...se,withinPortal:f,children:(0,_y.jsx)(ph,{...Se,keepMounted:ae,mounted:!k&&!!_e.opened,duration:_e.isGroupPhase?10:Se.duration,children:e=>(0,_y.jsxs)(al,{...me,"data-fixed":le===`fixed`||void 0,variant:j,mod:[{multiline:D},ce],..._e.getFloatingProps({ref:_e.floating,className:ve(`tooltip`).className,style:{...ve(`tooltip`).style,...e,zIndex:ee,top:_e.y??0,left:_e.x??0}}),children:[o,(0,_y.jsx)(Wm,{ref:ge,arrowX:_e.arrowX,arrowY:_e.arrowY,visible:b,position:_e.placement,arrowSize:x,arrowOffset:S,arrowRadius:C,arrowPosition:w,...ve(`arrow`)})]})})}),(0,vy.cloneElement)(ye,_e.getReferenceProps({onClick:te,onMouseEnter:ne,onMouseLeave:re,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,...be,className:va(y,be.className),[a]:xe}))]})}),xy.classes=ey,xy.displayName=`@mantine/core/Tooltip`,xy.Floating=sy,xy.Group=py})),Sy,Zne=o((()=>{Sy={root:`m_18320242`,"skeleton-fade":`m_299c329c`}})),Cy,wy,Ty,Ey,Qne=o((()=>{Cy=N(),ur(),p(),Jr(),ga(),Zs(),Ys(),ol(),dl(),Zne(),wy={visible:!0,animate:!0},Ty=ha((e,{width:t,height:n,radius:r,circle:i})=>({root:{"--skeleton-height":M(n),"--skeleton-width":M(i?n:t),"--skeleton-radius":i?`1000px`:r===void 0?void 0:Wr(r)}})),Ey=cl((e,t)=>{let n=P(`Skeleton`,wy,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,width:l,height:u,circle:d,visible:f,radius:p,animate:m,mod:h,attributes:g,..._}=n;return(0,Cy.jsx)(al,{ref:t,...Js({name:`Skeleton`,classes:Sy,props:n,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:g,vars:c,varsResolver:Ty})(`root`),mod:[{visible:f,animate:m},h],..._})}),Ey.classes=Sy,Ey.displayName=`@mantine/core/Skeleton`})),Dy,$ne=o((()=>{Dy={root:`m_6d731127`}})),ere,tre,nre,Oy,rre=o((()=>{ere=N(),p(),Jr(),ga(),Zs(),Ys(),ol(),dl(),$ne(),tre={gap:`md`,align:`stretch`,justify:`flex-start`},nre=ha((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Ur(t),"--stack-align":n,"--stack-justify":r}})),Oy=cl((e,t)=>{let n=P(`Stack`,tre,e),{classNames:r,className:i,style:a,styles:o,unstyled:s,vars:c,align:l,justify:u,gap:d,variant:f,attributes:p,...m}=n;return(0,ere.jsx)(al,{ref:t,...Js({name:`Stack`,props:n,classes:Dy,className:i,style:a,classNames:r,styles:o,unstyled:s,attributes:p,vars:c,varsResolver:nre})(`root`),variant:f,...m})}),Oy.classes=Dy,Oy.displayName=`@mantine/core/Stack`})),ire,ky,Ay=o((()=>{p(),xr(),N(),[ire,ky]=vr(`Tabs component was not found in the tree`)})),jy,My=o((()=>{jy={root:`m_89d60db1`,"list--default":`m_576c9d4`,list:`m_89d33d6d`,tab:`m_4ec4dce6`,panel:`m_b0c91715`,tabSection:`m_fc420b1f`,tabLabel:`m_42bbd1ae`,"tab--default":`m_539e827b`,"list--outline":`m_6772fbd5`,"tab--outline":`m_b59ab47c`,"tab--pills":`m_c3381914`}})),are,Ny,ore=o((()=>{are=N(),p(),Zs(),ol(),dl(),Ay(),My(),Ny=cl((e,t)=>{let n=P(`TabsList`,null,e),{children:r,className:i,grow:a,justify:o,classNames:s,styles:c,style:l,mod:u,...d}=n,f=ky();return(0,are.jsx)(al,{...d,...f.getStyles(`list`,{className:i,style:l,classNames:s,styles:c,props:n,variant:f.variant}),ref:t,role:`tablist`,variant:f.variant,mod:[{grow:a,orientation:f.orientation,placement:f.orientation===`vertical`&&f.placement,inverted:f.inverted},u],"aria-orientation":f.orientation,__vars:{"--tabs-justify":o},children:r})}),Ny.classes=jy,Ny.displayName=`@mantine/core/TabsList`})),sre,Py,cre=o((()=>{sre=N(),p(),Zs(),ol(),dl(),Ay(),My(),Py=cl((e,t)=>{let n=P(`TabsPanel`,null,e),{children:r,className:i,value:a,classNames:o,styles:s,style:c,mod:l,keepMounted:u,...d}=n,f=ky(),p=f.value===a,m=f.keepMounted||u||p?r:null;return(0,sre.jsx)(al,{...f.getStyles(`panel`,{className:i,classNames:o,styles:s,style:[c,p?void 0:{display:`none`}],props:n}),ref:t,mod:[{orientation:f.orientation},l],role:`tabpanel`,id:f.getPanelId(a),"aria-labelledby":f.getTabId(a),...d,children:m})}),Py.classes=jy,Py.displayName=`@mantine/core/TabsPanel`})),Fy,Iy,lre=o((()=>{Fy=N(),p(),Pr(),no(),Mo(),Zs(),dl(),yl(),zm(),Ay(),My(),Iy=cl((e,t)=>{let n=P(`TabsTab`,null,e),{className:r,children:i,rightSection:a,leftSection:o,value:s,onClick:c,onKeyDown:l,disabled:u,color:d,style:f,classNames:p,styles:m,vars:h,mod:g,tabIndex:_,...v}=n,y=Eo(),{dir:b}=gl(),x=ky(),S=s===x.value,C=e=>{x.onChange(x.allowTabDeactivation&&s===x.value?null:s),c?.(e)},w={classNames:p,styles:m,props:n};return(0,Fy.jsxs)(Rm,{...x.getStyles(`tab`,{className:r,style:f,variant:x.variant,...w}),disabled:u,unstyled:x.unstyled,variant:x.variant,mod:[{active:S,disabled:u,orientation:x.orientation,inverted:x.inverted,placement:x.orientation===`vertical`&&x.placement},g],ref:t,role:`tab`,id:x.getTabId(s),"aria-selected":S,tabIndex:_===void 0?S||x.value===null?0:-1:_,"aria-controls":x.getPanelId(s),onClick:C,__vars:{"--tabs-color":d?to(d,y):void 0},onKeyDown:Nr({siblingSelector:`[role="tab"]`,parentSelector:`[role="tablist"]`,activateOnFocus:x.activateTabWithKeyboard,loop:x.loop,orientation:x.orientation||`horizontal`,dir:b,onKeyDown:l}),...v,children:[o&&(0,Fy.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`left`,children:o}),i&&(0,Fy.jsx)(`span`,{...x.getStyles(`tabLabel`,w),children:i}),a&&(0,Fy.jsx)(`span`,{...x.getStyles(`tabSection`,w),"data-position":`right`,children:a})]})}),Iy.classes=jy,Iy.displayName=`@mantine/core/TabsTab`})),Ly,Ry,ure,dre,zy,fre=o((()=>{Ly=N(),la(),p(),Dr(),Jr(),ga(),no(),Ho(),see(),Zs(),Ys(),ol(),dl(),Ay(),My(),ore(),cre(),lre(),Ry=`Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value`,ure={keepMounted:!0,orientation:`horizontal`,loop:!0,activateTabWithKeyboard:!0,variant:`default`,placement:`left`},dre=ha((e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Wr(t),"--tabs-color":to(n,e),"--tabs-text-color":Xs(r,e)?Bo({color:n,theme:e,autoContrast:r}):void 0}})),zy=cl((e,t)=>{let n=P(`Tabs`,ure,e),{defaultValue:r,value:i,onChange:a,orientation:o,children:s,loop:c,id:l,activateTabWithKeyboard:u,allowTabDeactivation:d,variant:f,color:p,radius:m,inverted:h,placement:g,keepMounted:_,classNames:v,styles:y,unstyled:b,className:x,style:S,vars:C,autoContrast:w,mod:T,attributes:E,...D}=n,O=Bi(l),[ee,k]=Ji({value:i,defaultValue:r,finalValue:null,onChange:a}),A=Js({name:`Tabs`,props:n,classes:jy,className:x,style:S,classNames:v,styles:y,unstyled:b,attributes:E,vars:C,varsResolver:dre});return(0,Ly.jsx)(ire,{value:{placement:g,value:ee,orientation:o,id:O,loop:c,activateTabWithKeyboard:u,getTabId:Er(`${O}-tab`,Ry),getPanelId:Er(`${O}-panel`,Ry),onChange:k,allowTabDeactivation:d,variant:f,color:p,radius:m,inverted:h,keepMounted:_,unstyled:b,getStyles:A},children:(0,Ly.jsx)(al,{ref:t,id:O,variant:f,mod:[{orientation:o,inverted:o===`horizontal`&&h,placement:o===`vertical`&&g},T],...A(`root`),...D,children:s})})}),zy.classes=jy,zy.displayName=`@mantine/core/Tabs`,zy.Tab=Iy,zy.Panel=Py,zy.List=Ny})),pre,By,mre=o((()=>{pre=N(),p(),Zs(),dl(),Xte(),By=cl((e,t)=>(0,pre.jsx)(Ng,{component:`input`,ref:t,...P(`TextInput`,null,e),__staticSelector:`TextInput`})),By.classes=Ng.classes,By.displayName=`@mantine/core/TextInput`})),hre=o((()=>{hs(),La(),Rh(),Dh(),jh(),ite(),vte(),tg(),ene(),mne(),gne(),yne(),xne(),Yg(),wne(),Ene(),One(),Ane(),Bne(),Qne(),rre(),fre(),ine(),mre(),Xne()})),gre=o((()=>{}));async function _re(){let e=await fetch(`${Hy}/config`);if(!e.ok)throw Error(`Failed to load config`);return e.json()}async function vre(){let e=await fetch(`${Hy}/tree`);if(!e.ok)throw Error(`Failed to load tree`);return e.json()}async function yre(e){let t=await fetch(`${Hy}/doc/${e}`);if(!t.ok)throw Error(`Failed to load document`);return t.json()}async function Vy(e,t){let n=await fetch(`${Hy}/doc/${e}`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:t})});if(!n.ok)throw Error(`Failed to save document`);return n.json()}async function bre(e){let t=await fetch(`${Hy}/doc/${e}`,{method:`DELETE`});if(!t.ok)throw Error(`Failed to delete document`);return t.json()}async function xre(e){let t=await fetch(`${Hy}/folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})});if(!t.ok)throw Error(`Failed to create folder`);return t.json()}async function Sre(e){let t=await fetch(`${Hy}/folder/${e}`);if(!t.ok)throw Error(`Failed to load folder`);return t.json()}async function Cre(e,t){return Vy(e,t)}async function wre(e){let t=new FormData;t.append(`image`,e);let n=await fetch(`${Hy}/upload`,{method:`POST`,body:t});if(!n.ok)throw Error(`Upload failed`);return n.json()}async function Tre(e){let t=await fetch(`${Hy}/search?q=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Search failed`);return t.json()}var Hy,Uy=o((()=>{Hy=`/api`})),Ere,Wy,Dre=o((()=>{Ere=u(p(),1),Wy=(0,Ere.createContext)({})}));function Ore(e){let t=(0,kre.useRef)(null);return t.current===null&&(t.current=e()),t.current}var kre,Are=o((()=>{kre=u(p(),1)})),jre,Mre=o((()=>{jre=typeof window<`u`})),Gy,Ky,Nre=o((()=>{Gy=u(p(),1),Mre(),Ky=jre?Gy.useLayoutEffect:Gy.useEffect})),Pre,qy,Jy=o((()=>{Pre=u(p(),1),qy=(0,Pre.createContext)(null)}));function Yy(e,t){e.indexOf(t)===-1&&e.push(t)}function Xy(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Fre=o((()=>{})),Zy,Ire=o((()=>{Zy=(e,t,n)=>n>t?t:n<e?e:n})),Qy,$y,Lre=o((()=>{Qy=()=>{},$y=()=>{}})),eb,Rre=o((()=>{eb={}})),tb,zre=o((()=>{tb=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e)}));function Bre(e){return typeof e==`object`&&!!e}var Vre=o((()=>{})),nb,Hre=o((()=>{nb=e=>/^0[^.\s]+$/u.test(e)}));function Ure(e){let t;return()=>(t===void 0&&(t=e()),t)}var Wre=o((()=>{})),rb,ib=o((()=>{rb=e=>e})),Gre,ab,Kre=o((()=>{Gre=(e,t)=>n=>t(e(n)),ab=(...e)=>e.reduce(Gre)})),ob,qre=o((()=>{ob=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r}})),sb,Jre=o((()=>{Fre(),sb=class{constructor(){this.subscriptions=[]}add(e){return Yy(this.subscriptions,e),()=>Xy(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}})),cb,lb,Yre=o((()=>{cb=e=>e*1e3,lb=e=>e/1e3}));function Xre(e,t){return t?1e3/t*e:0}var Zre=o((()=>{}));function Qre(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=db(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>$re&&++s<eie);return o}function ub(e,t,n,r){if(e===t&&n===r)return rb;let i=t=>Qre(t,0,1,e,n);return e=>e===0||e===1?e:db(i(e),t,r)}var db,$re,eie,fb=o((()=>{ib(),db=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,$re=1e-7,eie=12})),pb,tie=o((()=>{pb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2})),mb,nie=o((()=>{mb=e=>t=>1-e(1-t)})),hb,gb,_b,vb=o((()=>{fb(),tie(),nie(),hb=ub(.33,1.53,.69,.99),gb=mb(hb),_b=pb(gb)})),yb,rie=o((()=>{vb(),yb=e=>e>=1?1:(e*=2)<1?.5*gb(e):.5*(2-2**(-10*(e-1)))})),bb,xb,Sb,iie=o((()=>{tie(),nie(),bb=e=>1-Math.sin(Math.acos(e)),xb=mb(bb),Sb=pb(bb)})),aie,oie,Cb,sie=o((()=>{fb(),aie=ub(.42,0,1,1),oie=ub(0,0,.58,1),Cb=ub(.42,0,.58,1)})),cie,lie=o((()=>{cie=e=>Array.isArray(e)&&typeof e[0]!=`number`})),wb,uie=o((()=>{wb=e=>Array.isArray(e)&&typeof e[0]==`number`})),Tb,die,Eb,fie=o((()=>{Lre(),ib(),rie(),vb(),iie(),fb(),sie(),uie(),Tb={linear:rb,easeIn:aie,easeInOut:Cb,easeOut:oie,circIn:bb,circInOut:Sb,circOut:xb,backIn:gb,backInOut:_b,backOut:hb,anticipate:yb},die=e=>typeof e==`string`,Eb=e=>{if(wb(e)){$y(e.length===4,`Cubic bezier arrays must contain four numerical values.`,`cubic-bezier-length`);let[t,n,r,i]=e;return ub(t,n,r,i)}else if(die(e))return $y(Tb[e]!==void 0,`Invalid easing type '${e}'`,`invalid-easing-type`),Tb[e];return e}})),Db=o((()=>{Fre(),Ire(),Lre(),Rre(),zre(),Vre(),Hre(),Wre(),ib(),Kre(),qre(),Jre(),Yre(),Zre(),rie(),vb(),iie(),sie(),uie(),lie(),fie()})),Ob,pie=o((()=>{Ob=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`]})),kb,Ab=o((()=>{kb={value:null,addProjectionMetrics:null}}));function mie(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&kb.value&&kb.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var hie=o((()=>{Ab()}));function gie(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Ob.reduce((e,n)=>(e[n]=mie(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=eb.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,_ie),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Ob.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Ob.length;t++)o[Ob[t]].cancel(e)},state:i,steps:o}}var _ie,vie=o((()=>{Db(),pie(),hie(),_ie=40})),jb,Mb,Nb,Pb,Fb=o((()=>{Db(),vie(),{schedule:jb,cancel:Mb,state:Nb,steps:Pb}=gie(typeof requestAnimationFrame<`u`?requestAnimationFrame:rb,!0)}));function yie(){Ib=void 0}var Ib,Lb,Rb=o((()=>{Db(),Fb(),Lb={now:()=>(Ib===void 0&&Lb.set(Nb.isProcessing||eb.useManualTiming?Nb.timestamp:performance.now()),Ib),set:e=>{Ib=e,queueMicrotask(yie)}}})),zb,Bb=o((()=>{zb={layout:0,mainThread:0,waapi:0}}));function bie(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var Vb,Hb,xie,Ub,Sie,Wb=o((()=>{Vb=e=>t=>typeof t==`string`&&t.startsWith(e),Hb=Vb(`--`),xie=Vb(`var(--`),Ub=e=>xie(e)?Sie.test(e.split(`/*`)[0].trim()):!1,Sie=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu})),Gb,Kb,qb,Jb=o((()=>{Db(),Gb={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Kb={...Gb,transform:e=>Zy(0,1,e)},qb={...Gb,default:1}})),Yb,Xb=o((()=>{Yb=e=>Math.round(e*1e5)/1e5})),Zb,Qb=o((()=>{Zb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu}));function Cie(e){return e==null}var wie=o((()=>{})),Tie,Eie=o((()=>{Tie=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu})),$b,ex,tx=o((()=>{Qb(),wie(),Eie(),$b=(e,t)=>n=>!!(typeof n==`string`&&Tie.test(n)&&n.startsWith(e)||t&&!Cie(n)&&Object.prototype.hasOwnProperty.call(n,t)),ex=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Zb);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}}})),Die,nx,rx,ix=o((()=>{Db(),Jb(),Xb(),tx(),Die=e=>Zy(0,255,e),nx={...Gb,transform:e=>Math.round(Die(e))},rx={test:$b(`rgb`,`red`),parse:ex(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+nx.transform(e)+`, `+nx.transform(t)+`, `+nx.transform(n)+`, `+Yb(Kb.transform(r))+`)`}}));function Oie(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var ax,kie=o((()=>{ix(),tx(),ax={test:$b(`#`),parse:Oie,transform:rx.transform}})),ox,sx,cx,I,Aie,jie,lx,ux=o((()=>{ox=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),sx=ox(`deg`),cx=ox(`%`),I=ox(`px`),Aie=ox(`vh`),jie=ox(`vw`),lx={...cx,parse:e=>cx.parse(e)/100,transform:e=>cx.transform(e*100)}})),dx,fx=o((()=>{Jb(),ux(),Xb(),tx(),dx={test:$b(`hsl`,`hue`),parse:ex(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+cx.transform(Yb(t))+`, `+cx.transform(Yb(n))+`, `+Yb(Kb.transform(r))+`)`}})),px,mx=o((()=>{kie(),fx(),ix(),px={test:e=>rx.test(e)||ax.test(e)||dx.test(e),parse:e=>rx.test(e)?rx.parse(e):dx.test(e)?dx.parse(e):ax.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?rx.transform(e):dx.transform(e),getAnimatableNone:e=>{let t=px.parse(e);return t.alpha=0,px.transform(t)}}})),hx,Mie=o((()=>{hx=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu}));function Nie(e){return isNaN(e)&&typeof e==`string`&&(e.match(Zb)?.length||0)+(e.match(hx)?.length||0)>0}function gx(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Cx,e=>(px.test(e)?(r.color.push(a),i.push(yx),n.push(px.parse(e))):e.startsWith(xx)?(r.var.push(a),i.push(bx),n.push(e)):(r.number.push(a),i.push(vx),n.push(parseFloat(e))),++a,Sx)).split(Sx),indexes:r,types:i}}function Pie(e){return gx(e).values}function _x({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];e===vx?i+=Yb(r[a]):e===yx?i+=px.transform(r[a]):i+=r[a]}return i}}function Fie(e){return _x(gx(e))}function Iie(e){let t=gx(e);return _x(t)(t.values.map((e,n)=>Tx(e,t.split[n])))}var vx,yx,bx,xx,Sx,Cx,wx,Tx,Ex,Dx=o((()=>{mx(),Mie(),Qb(),Xb(),vx=`number`,yx=`color`,bx=`var`,xx=`var(`,Sx="${}",Cx=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu,wx=e=>typeof e==`number`?0:px.test(e)?px.getAnimatableNone(e):e,Tx=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:wx(e),Ex={test:Nie,parse:Pie,createTransformer:Fie,getAnimatableNone:Iie}}));function Ox(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Lie({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Ox(s,r,e+1/3),a=Ox(s,r,e),o=Ox(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}var Rie=o((()=>{}));function kx(e,t){return n=>n>0?t:e}var Ax=o((()=>{})),jx,Mx=o((()=>{jx=(e,t,n)=>e+(t-e)*n}));function Nx(e){let t=Ix(e);if(Qy(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,`color-not-animatable`),!t)return!1;let n=t.parse(e);return t===dx&&(n=Lie(n)),n}var Px,Fx,Ix,Lx,zie=o((()=>{Db(),kie(),fx(),Rie(),ix(),Ax(),Mx(),Px=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Fx=[ax,rx,dx],Ix=e=>Fx.find(t=>t.test(e)),Lx=(e,t)=>{let n=Nx(e),r=Nx(t);if(!n||!r)return kx(e,t);let i={...n};return e=>(i.red=Px(n.red,r.red,e),i.green=Px(n.green,r.green,e),i.blue=Px(n.blue,r.blue,e),i.alpha=jx(n.alpha,r.alpha,e),rx.transform(i))}}));function Bie(e,t){return Rx.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}var Rx,Vie=o((()=>{Rx=new Set([`none`,`hidden`])}));function Hie(e,t){return n=>jx(e,t,n)}function zx(e){return typeof e==`number`?Hie:typeof e==`string`?Ub(e)?kx:px.test(e)?Lx:Vx:Array.isArray(e)?Bx:typeof e==`object`?px.test(e)?Lx:Uie:kx}function Bx(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>zx(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Uie(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=zx(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Wie(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]];n[i]=e.values[o]??0,r[a]++}return n}var Vx,Gie=o((()=>{Db(),Wb(),mx(),Dx(),zie(),Ax(),Mx(),Vie(),Vx=(e,t)=>{let n=Ex.createTransformer(t),r=gx(e),i=gx(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Rx.has(e)&&!i.values.length||Rx.has(t)&&!r.values.length?Bie(e,t):ab(Bx(Wie(r,i),i.values),n):(Qy(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,`complex-values-different`),kx(e,t))}}));function Hx(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?jx(e,t,n):zx(e)(e,t)}var Ux=o((()=>{Gie(),Mx()})),Wx,Kie=o((()=>{Rb(),Fb(),Wx=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>jb.update(t,e),stop:()=>Mb(t),now:()=>Nb.isProcessing?Nb.timestamp:Lb.now()}}})),Gx,Kx=o((()=>{Gx=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`}}));function qx(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}var Jx,Yx=o((()=>{Jx=2e4}));function qie(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(qx(r),Jx);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:lb(i)}}var Jie=o((()=>{Db(),Yx()}));function Xx(e,t){return e*Math.sqrt(1-t*t)}function Yie(e,t,n){let r=n;for(let n=1;n<eS;n++)r-=e(r)/t(r);return r}function Xie({duration:e=$x.duration,bounce:t=$x.bounce,velocity:n=$x.velocity,mass:r=$x.mass}){let i,a;Qy(e<=cb($x.maxDuration),`Spring duration must be 10 seconds or less`,`spring-duration-limit`);let o=1-t;o=Zy($x.minDamping,$x.maxDamping,o),e=Zy($x.minDuration,$x.maxDuration,lb(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Xx(t,o),c=Math.exp(-i);return tS-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Xx(t**2,o);return(-i(t)+tS>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-tS+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Yie(i,a,s);if(e=cb(e),isNaN(c))return{stiffness:$x.stiffness,damping:$x.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}function Zx(e,t){return t.some(t=>e[t]!==void 0)}function Zie(e){let t={velocity:$x.velocity,stiffness:$x.stiffness,damping:$x.damping,mass:$x.mass,isResolvedFromDuration:!1,...e};if(!Zx(e,rS)&&Zx(e,nS))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Zy(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:$x.mass,stiffness:i,damping:a}}else{let n=Xie({...e,velocity:0});t={...t,...n,mass:$x.mass},t.isResolvedFromDuration=!0}return t}function Qx(e=$x.visualDuration,t=$x.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Zie({...n,velocity:-lb(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=lb(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?$x.restSpeed.granular:$x.restSpeed.default,i||=v?$x.restDelta.granular:$x.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Xx(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(S*Math.sin(x*e)+g*Math.cos(x*e)),C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>cb(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=cb(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=cb(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(qx(T),Jx),t=Gx(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}var $x,eS,tS,nS,rS,iS=o((()=>{Db(),Kx(),Yx(),Jie(),$x={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},eS=12,tS=.001,nS=[`duration`,`bounce`],rS=[`stiffness`,`damping`,`mass`],Qx.applyToOptions=e=>{let t=qie(e,100,Qx);return e.ease=t.ease,e.duration=cb(t.duration),e.type=`keyframes`,e}}));function aS(e,t,n){let r=Math.max(t-oS,0);return Xre(n-e(r),t-r)}var oS,sS=o((()=>{Db(),oS=5}));function cS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Qx({keyframes:[f.value,m(f.value)],velocity:aS(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}var lS=o((()=>{iS(),sS()}));function Qie(e,t,n){let r=[],i=n||eb.mix||Hx,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=ab(Array.isArray(t)?t[n]||rb:t,a)),r.push(a)}return r}function $ie(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if($y(a===t.length,`Both input and output ranges must be the same length`,`range-length`),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Qie(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=ob(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Zy(e[0],e[a-1],t)):l}var eae=o((()=>{Db(),Ux()}));function tae(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=ob(0,t,r);e.push(jx(n,1,i))}}var nae=o((()=>{Db(),Mx()}));function rae(e){let t=[0];return tae(t,e.length-1),t}var iae=o((()=>{nae()}));function aae(e,t){return e.map(e=>e*t)}var oae=o((()=>{}));function sae(e,t){return e.map(()=>t||Cb).splice(0,e.length-1)}function uS({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=cie(r)?r.map(Eb):Eb(r),a={done:!1,value:t[0]},o=$ie(aae(n&&n.length===t.length?n:rae(t),e),t,{ease:Array.isArray(i)?i:sae(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var dS=o((()=>{Db(),eae(),iae(),oae()}));function fS(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(pS),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var pS,mS=o((()=>{pS=e=>e!==null}));function hS(e){typeof e.type==`string`&&(e.type=gS[e.type])}var gS,_S=o((()=>{lS(),dS(),iS(),gS={decay:cS,inertia:cS,tween:uS,keyframes:uS,spring:Qx}})),vS,yS=o((()=>{vS=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}})),bS,xS,SS=o((()=>{Db(),Rb(),Bb(),Ux(),Kie(),lS(),dS(),Yx(),sS(),mS(),_S(),yS(),bS=e=>e/100,xS=class extends vS{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Lb.now()&&this.tick(Lb.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},zb.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;hS(e);let{type:t=uS,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||uS;s!==uS&&typeof o[0]!=`number`&&(this.mixKeyframes=ab(bS,Hx(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=qx(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime===null?this.currentTime=t:this.currentTime=this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Zy(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==cS&&(b.value=fS(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return lb(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+lb(e)}get time(){return lb(this.currentTime)}set time(e){e=cb(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return aS(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Lb.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=lb(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Wx,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Lb.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null,zb.mainThread--}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}}}));function cae(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var lae=o((()=>{}));function CS(e){return e.includes(`scale`)?1:0}function wS(e,t){if(!e||e===`none`)return CS(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=MS,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=DS,i=t}if(!i)return CS(t);let a=r[t],o=i[1].split(`,`).map(uae);return typeof a==`function`?a(o):o[a]}function uae(e){return parseFloat(e.trim())}var TS,ES,DS,OS,kS,AS,jS,MS,NS,PS=o((()=>{TS=e=>e*180/Math.PI,ES=e=>OS(TS(Math.atan2(e[1],e[0]))),DS={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:ES,rotateZ:ES,skewX:e=>TS(Math.atan(e[1])),skewY:e=>TS(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},OS=e=>(e%=360,e<0&&(e+=360),e),kS=ES,AS=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),jS=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),MS={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:AS,scaleY:jS,scale:e=>(AS(e)+jS(e))/2,rotateX:e=>OS(TS(Math.atan2(e[6],e[5]))),rotateY:e=>OS(TS(Math.atan2(-e[2],e[0]))),rotateZ:kS,rotate:kS,skewX:e=>TS(Math.atan(e[4])),skewY:e=>TS(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2},NS=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wS(n,t)}})),FS,IS,LS=o((()=>{FS=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],IS=new Set(FS)}));function dae(e){let t=[];return BS.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith(`scale`)?1:0))}),t}var RS,zS,BS,VS,HS=o((()=>{PS(),LS(),Jb(),ux(),RS=e=>e===Gb||e===I,zS=new Set([`x`,`y`,`z`]),BS=FS.filter(e=>!zS.has(e)),VS={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>wS(t,`x`),y:(e,{transform:t})=>wS(t,`y`)},VS.translateX=VS.x,VS.translateY=VS.y}));function US(){if(qS){let e=Array.from(GS).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=dae(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}qS=!1,KS=!1,GS.forEach(e=>e.complete(JS)),GS.clear()}function WS(){GS.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(qS=!0)})}function fae(){JS=!0,WS(),US(),JS=!1}var GS,KS,qS,JS,YS,XS=o((()=>{lae(),HS(),Fb(),GS=new Set,KS=!1,qS=!1,JS=!1,YS=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(GS.add(this),KS||(KS=!0,jb.read(WS),jb.resolveKeyframes(US))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}cae(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),GS.delete(this)}cancel(){this.state===`scheduled`&&(GS.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}}})),ZS,pae=o((()=>{ZS=e=>e.startsWith(`--`)}));function QS(e,t,n){ZS(t)?e.style.setProperty(t,n):e.style[t]=n}var $S=o((()=>{pae()})),eC,mae=o((()=>{eC={}}));function tC(e,t){let n=Ure(e);return()=>eC[t]??n()}var nC=o((()=>{Db(),mae()})),rC,hae=o((()=>{nC(),rC=tC(()=>window.ScrollTimeline!==void 0,`scrollTimeline`)})),iC,aC=o((()=>{nC(),iC=tC(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`)})),oC,sC=o((()=>{oC=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`})),cC,gae=o((()=>{sC(),cC={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:oC([0,.65,.55,1]),circOut:oC([.55,0,1,.45]),backIn:oC([.31,.01,.66,-.59]),backOut:oC([.33,1.53,.69,.99])}}));function lC(e,t){if(e)return typeof e==`function`?iC()?Gx(e,t):`ease-out`:wb(e)?oC(e):Array.isArray(e)?e.map(e=>lC(e,t)||cC.easeOut):cC[e]}var _ae=o((()=>{Db(),aC(),Kx(),sC(),gae()}));function vae(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=lC(s,i);Array.isArray(d)&&(u.easing=d),kb.value&&zb.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return kb.value&&p.finished.finally(()=>{zb.waapi--}),p}var yae=o((()=>{Bb(),Ab(),_ae()}));function uC(e){return typeof e==`function`&&`applyToOptions`in e}var dC=o((()=>{}));function bae({type:e,...t}){return uC(e)&&iC()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var xae=o((()=>{aC(),dC()})),fC,pC=o((()=>{Db(),$S(),hae(),mS(),yS(),yae(),xae(),fC=class extends vS{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,$y(typeof e.type!=`string`,`Mini animate() doesn't support "type" as a string.`,`mini-spring`);let c=bae(e);this.animation=vae(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=fS(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),QS(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e===`idle`||e===`finished`||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return lb(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+lb(e)}get time(){return lb(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=cb(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&rC()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),rb):r(this)}}}));function Sae(e){return e in mC}function Cae(e){typeof e.ease==`string`&&Sae(e.ease)&&(e.ease=mC[e.ease])}var mC,wae=o((()=>{Db(),mC={anticipate:yb,backInOut:_b,circInOut:Sb}})),hC,gC,Tae=o((()=>{Db(),Rb(),$S(),SS(),pC(),_S(),wae(),hC=10,gC=class extends fC{constructor(e){Cae(e),hS(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new xS({...a,autoplay:!1}),s=Math.max(hC,Lb.now()-this.startTime),c=Zy(0,hC,s-hC),l=o.sample(s).value,{name:u}=this.options;i&&u&&QS(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}}})),_C,Eae=o((()=>{Dx(),_C=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(Ex.test(e)||e===`0`)&&!e.startsWith(`url(`))}));function Dae(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Oae(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=_C(i,t),s=_C(a,t);return Qy(o===s,`You are trying to animate ${t} from "${i}" to "${a}". "${o?a:i}" is not an animatable value.`,`value-not-animatable`),!o||!s?!1:Dae(e)||(n===`spring`||uC(n))&&r}var kae=o((()=>{Db(),dC(),Eae()}));function vC(e){e.duration=0,e.type=`keyframes`}var yC=o((()=>{})),bC,xC=o((()=>{bC=new Set([`opacity`,`clipPath`,`filter`,`transform`])}));function Aae(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&SC.test(e[t]))return!0;return!1}var SC,jae=o((()=>{SC=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/}));function Mae(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return wC()&&n&&(bC.has(n)||CC.has(n)&&Aae(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var CC,wC,Nae=o((()=>{Db(),xC(),jae(),CC=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),wC=Ure(()=>Object.hasOwnProperty.call(Element.prototype,`animate`))})),TC,EC,Pae=o((()=>{Db(),Rb(),SS(),mS(),XS(),Tae(),kae(),yC(),yS(),Nae(),TC=40,EC=class extends vS{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Lb.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||YS)(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Lb.now();let u=!0;Oae(e,i,a,o)||(u=!1,(eb.instantAnimations||!s)&&l?.(fS(e,n,t)),e[0]=e[e.length-1],vC(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>TC?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Mae(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new gC({...d,element:p})}catch{m=new xS(d)}else m=new xS(d);m.finished.then(()=>{this.notifyFinished()}).catch(rb),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),fae()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}}));function DC(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var OC=o((()=>{}));function Fae(e){let t=AC.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function kC(e,t,n=1){$y(n<=jC,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,`max-css-var-depth`);let[r,i]=Fae(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return tb(e)?parseFloat(e):e}return Ub(i)?kC(i,t,n+1):i}var AC,jC,Iae=o((()=>{Db(),Wb(),AC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,jC=4})),MC,NC,PC,FC,IC,Lae=o((()=>{LS(),MC={type:`spring`,stiffness:500,damping:25,restSpeed:10},NC=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),PC={type:`keyframes`,duration:.8},FC={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},IC=(e,{keyframes:t})=>t.length>2?PC:IS.has(e)?e.startsWith(`scale`)?NC(t[1]):MC:FC}));function LC(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}var RC=o((()=>{}));function zC(e,t){let n=e?.[t]??e?.default??e;return n===e?n:LC(n,e)}var BC=o((()=>{RC()}));function Rae(e){for(let t in e)if(!VC.has(t))return!0;return!1}var VC,zae=o((()=>{VC=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`])})),HC,UC=o((()=>{Db(),Pae(),SS(),BC(),yC(),Lae(),mS(),zae(),Fb(),HC=(e,t,n,r={},i,a)=>o=>{let s=zC(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=cb(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};Rae(s)||Object.assign(u,IC(e,u)),u.duration&&=cb(u.duration),u.repeatDelay&&=cb(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(vC(u),u.delay===0&&(d=!0)),(eb.instantAnimations||eb.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,vC(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=fS(u.keyframes,s);if(e!==void 0){jb.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new xS(u):new EC(u)}}));function WC(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function GC(e,t,n,r){if(typeof t==`function`){let[i,a]=WC(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=WC(r);t=t(n===void 0?e.custom:n,i,a)}return t}var KC=o((()=>{}));function qC(e,t,n){let r=e.getProps();return GC(r,t,n===void 0?r.custom:n,e)}var JC=o((()=>{KC()})),YC,XC=o((()=>{LS(),YC=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...FS])}));function ZC(e,t){return new tw(e,t)}var QC,$C,ew,tw,nw=o((()=>{Db(),Rb(),Fb(),QC=30,$C=e=>!isNaN(parseFloat(e)),ew={current:void 0},tw=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Lb.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Lb.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=$C(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new sb);let n=this.events[e].add(t);return e===`change`?()=>{n(),jb.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return ew.current&&ew.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Lb.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>QC)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,QC);return Xre(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}})),rw,iw=o((()=>{rw=e=>Array.isArray(e)}));function Bae(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ZC(n))}function Vae(e){return rw(e)?e[e.length-1]||0:e}function aw(e,t){let{transitionEnd:n={},transition:r={},...i}=qC(e,t)||{};i={...i,...n};for(let t in i)Bae(e,t,Vae(i[t]))}var ow=o((()=>{nw(),JC(),iw()})),sw,cw=o((()=>{sw=e=>!!(e&&e.getVelocity)}));function Hae(e){return!!(sw(e)&&e.add)}var Uae=o((()=>{cw()}));function lw(e,t){let n=e.getValue(`willChange`);if(Hae(n))return n.add(t);if(!n&&eb.WillChange){let n=new eb.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}var uw=o((()=>{Db(),Uae()}));function dw(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var fw=o((()=>{})),pw,mw,hw=o((()=>{fw(),pw=`framerAppearId`,mw=`data-`+dw(pw)}));function gw(e){return e.props[mw]}var _w=o((()=>{hw()}));function Wae({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function vw(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?LC(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&Wae(d,t))continue;let o={delay:n,...zC(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){jb.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=gw(e);if(n){let e=window.MotionHandoffAnimation(n,t,jb);e!==null&&(o.startTime=e,f=!0)}}lw(e,t);let p=l??e.shouldReduceMotion;r.start(HC(t,r,i,p&&YC.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>jb.update(()=>{o&&aw(e,o)});u.length?Promise.all(u).then(t):t()}return u}var yw=o((()=>{BC(),RC(),XC(),ow(),uw(),_w(),UC(),Fb()}));function bw(e,t,n={}){let r=qC(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(vw(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Gae(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function Gae(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(bw(c,t,{...o,delay:n+(typeof r==`function`?0:r)+DC(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}var Kae=o((()=>{JC(),OC(),yw()}));function xw(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>bw(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=bw(e,t,n);else{let i=typeof t==`function`?qC(e,t,n.custom):t;r=Promise.all(vw(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Sw=o((()=>{JC(),yw(),Kae()})),Cw,qae=o((()=>{Cw={test:e=>e===`auto`,parse:e=>e}})),ww,Tw=o((()=>{ww=e=>t=>t.test(e)})),Ew,Dw,Ow=o((()=>{qae(),Jb(),ux(),Tw(),Ew=[Gb,I,cx,sx,jie,Aie,Cw],Dw=e=>Ew.find(ww(e))}));function Jae(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||nb(e)}var Yae=o((()=>{Db()}));function Xae(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Zb)||[];if(!r)return e;let i=n.replace(r,``),a=kw.has(t)?1:0;return r!==n&&(a*=100),t+`(`+a+i+`)`}var kw,Aw,jw,Mw=o((()=>{Dx(),Qb(),kw=new Set([`brightness`,`contrast`,`saturate`,`opacity`]),Aw=/\b([a-z-]*)\(.*?\)/gu,jw={...Ex,getAnimatableNone:e=>{let t=e.match(Aw);return t?t.map(Xae).join(` `):e}}})),Nw,Pw=o((()=>{Dx(),Nw={...Ex,getAnimatableNone:e=>{let t=Ex.parse(e);return Ex.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}}})),Fw,Zae=o((()=>{Jb(),Fw={...Gb,transform:Math.round}})),Iw,Qae=o((()=>{Jb(),ux(),Iw={rotate:sx,rotateX:sx,rotateY:sx,rotateZ:sx,scale:qb,scaleX:qb,scaleY:qb,scaleZ:qb,skew:sx,skewX:sx,skewY:sx,distance:I,translateX:I,translateY:I,translateZ:I,x:I,y:I,z:I,perspective:I,transformPerspective:I,opacity:Kb,originX:lx,originY:lx,originZ:I}})),Lw,Rw=o((()=>{Zae(),Jb(),ux(),Qae(),Lw={borderWidth:I,borderTopWidth:I,borderRightWidth:I,borderBottomWidth:I,borderLeftWidth:I,borderRadius:I,borderTopLeftRadius:I,borderTopRightRadius:I,borderBottomRightRadius:I,borderBottomLeftRadius:I,width:I,maxWidth:I,height:I,maxHeight:I,top:I,right:I,bottom:I,left:I,inset:I,insetBlock:I,insetBlockStart:I,insetBlockEnd:I,insetInline:I,insetInlineStart:I,insetInlineEnd:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,paddingBlock:I,paddingBlockStart:I,paddingBlockEnd:I,paddingInline:I,paddingInlineStart:I,paddingInlineEnd:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,marginBlock:I,marginBlockStart:I,marginBlockEnd:I,marginInline:I,marginInlineStart:I,marginInlineEnd:I,fontSize:I,backgroundPositionX:I,backgroundPositionY:I,...Iw,zIndex:Fw,fillOpacity:Kb,strokeOpacity:Kb,numOctaves:Fw}})),zw,Bw,Vw=o((()=>{mx(),Mw(),Pw(),Rw(),zw={...Lw,color:px,backgroundColor:px,outlineColor:px,fill:px,stroke:px,borderColor:px,borderTopColor:px,borderRightColor:px,borderBottomColor:px,borderLeftColor:px,filter:jw,WebkitFilter:jw,mask:Nw,WebkitMask:Nw},Bw=e=>zw[e]}));function Hw(e,t){let n=Bw(e);return Uw.has(n)||(n=Ex),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var Uw,Ww=o((()=>{Dx(),Mw(),Pw(),Vw(),Uw=new Set([jw,Nw])}));function $ae(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Gw.has(t)&&gx(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Hw(n,i)}var Gw,eoe=o((()=>{Dx(),Ww(),Gw=new Set([`auto`,`none`,`0`])})),Kw,toe=o((()=>{XC(),Ow(),Iae(),Wb(),XS(),Yae(),eoe(),HS(),Kw=class extends YS{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Ub(r))){let i=kC(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!YC.has(n)||e.length!==2)return;let[r,i]=e,a=Dw(r),o=Dw(i);if(bie(r)!==bie(i)&&VS[n]){this.needsMeasurement=!0;return}if(a!==o)if(RS(a)&&RS(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else VS[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Jae(e[t]))&&n.push(t);n.length&&$ae(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=VS[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=VS[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}}));function qw(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var Jw=o((()=>{})),Yw,Xw=o((()=>{Yw=(e,t)=>t&&typeof e==`number`?t.transform(e):e}));function noe(e){return Bre(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var roe=o((()=>{Db()})),Zw,ioe,Qw=o((()=>{vie(),{schedule:Zw,cancel:ioe}=gie(queueMicrotask,!1)}));function $w(){return eT.x||eT.y}var eT,tT=o((()=>{eT={x:!1,y:!1}}));function aoe(e){return e===`x`||e===`y`?eT[e]?null:(eT[e]=!0,()=>{eT[e]=!1}):eT.x||eT.y?null:(eT.x=eT.y=!0,()=>{eT.x=eT.y=!1})}var ooe=o((()=>{tT()}));function nT(e,t){let n=qw(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}var rT=o((()=>{Jw()}));function soe(e){return!(e.pointerType===`touch`||$w())}function coe(e,t,n={}){let[r,i,a]=nT(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!soe(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var loe=o((()=>{tT(),rT()})),iT,uoe=o((()=>{iT=(e,t)=>t?e===t?!0:iT(e,t.parentElement):!1})),aT,oT=o((()=>{aT=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1}));function doe(e){return sT.has(e.tagName)||e.isContentEditable===!0}function foe(e){return cT.has(e.tagName)||e.isContentEditable===!0}var sT,cT,lT=o((()=>{sT=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]),cT=new Set([`INPUT`,`SELECT`,`TEXTAREA`])})),uT,dT=o((()=>{uT=new WeakSet}));function fT(e){return t=>{t.key===`Enter`&&e(t)}}function pT(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var mT,poe=o((()=>{dT(),mT=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=fT(()=>{if(uT.has(n))return;pT(n,`down`);let e=fT(()=>{pT(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>pT(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)}}));function hT(e){return aT(e)&&!$w()}function moe(e,t,n={}){let[r,i,a]=nT(e,n),o=e=>{let r=e.currentTarget;if(!hT(e)||gT.has(e))return;uT.add(r),n.stopPropagation&&gT.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),uT.has(r)&&uT.delete(r),hT(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||iT(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),noe(e)&&(e.addEventListener(`focus`,e=>mT(e,i)),!doe(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}var gT,hoe=o((()=>{roe(),tT(),uoe(),oT(),rT(),lT(),poe(),dT(),gT=new WeakSet}));function _T(e){return Bre(e)&&`ownerSVGElement`in e}var vT=o((()=>{Db()}));function goe({target:e,borderBoxSize:t}){yT.get(e)?.forEach(n=>{n(e,{get width(){return ST(e,t)},get height(){return CT(e,t)}})})}function _oe(e){e.forEach(goe)}function voe(){typeof ResizeObserver>`u`||(bT=new ResizeObserver(_oe))}function yoe(e,t){bT||voe();let n=qw(e);return n.forEach(e=>{let n=yT.get(e);n||(n=new Set,yT.set(e,n)),n.add(t),bT?.observe(e)}),()=>{n.forEach(e=>{let n=yT.get(e);n?.delete(t),n?.size||bT?.unobserve(e)})}}var yT,bT,xT,ST,CT,boe=o((()=>{vT(),Jw(),yT=new WeakMap,xT=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:_T(r)&&`getBBox`in r?r.getBBox()[t]:r[n],ST=xT(`inline`,`width`,`offsetWidth`),CT=xT(`block`,`height`,`offsetHeight`)}));function xoe(){TT=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};wT.forEach(t=>t(e))},window.addEventListener(`resize`,TT)}function Soe(e){return wT.add(e),TT||xoe(),()=>{wT.delete(e),!wT.size&&typeof TT==`function`&&(window.removeEventListener(`resize`,TT),TT=void 0)}}var wT,TT,Coe=o((()=>{wT=new Set}));function ET(e,t){return typeof e==`function`?Soe(e):yoe(e,t)}var woe=o((()=>{boe(),Coe()}));function Toe(e){return _T(e)&&e.tagName===`svg`}var Eoe=o((()=>{vT()})),DT,OT,Doe=o((()=>{mx(),Dx(),Ow(),Tw(),DT=[...Ew,px,Ex],OT=e=>DT.find(ww(e))})),kT,AT,jT,MT,NT=o((()=>{kT=()=>({translate:0,scale:1,origin:0,originPoint:0}),AT=()=>({x:kT(),y:kT()}),jT=()=>({min:0,max:0}),MT=()=>({x:jT(),y:jT()})})),PT,Ooe=o((()=>{PT=new WeakMap}));function FT(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}var IT=o((()=>{}));function LT(e){return typeof e==`string`||Array.isArray(e)}var RT=o((()=>{})),zT,BT,VT=o((()=>{zT=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],BT=[`initial`,...zT]}));function HT(e){return FT(e.animate)||BT.some(t=>LT(e[t]))}function UT(e){return!!(HT(e)||e.variants)}var WT=o((()=>{IT(),RT(),VT()}));function koe(e,t,n){for(let r in t){let i=t[r],a=n[r];if(sw(i))e.addValue(r,i);else if(sw(a))e.addValue(r,ZC(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,ZC(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Aoe=o((()=>{nw(),cw()})),GT,KT,qT=o((()=>{GT={current:null},KT={current:!1}}));function joe(){if(KT.current=!0,JT)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>GT.current=e.matches;e.addEventListener(`change`,t),t()}else GT.current=!1}var JT,Moe=o((()=>{qT(),JT=typeof window<`u`}));function YT(e){ZT=e}function Noe(){return ZT}var XT,ZT,QT,$T=o((()=>{Db(),XS(),pC(),xC(),Qw(),Rb(),NT(),nw(),Dx(),Ww(),Doe(),cw(),Ooe(),WT(),LS(),Aoe(),Moe(),KC(),qT(),Fb(),XT=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],ZT={},QT=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=YS,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Lb.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,jb.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=HT(t),this.isVariantNode=UT(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&sw(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,PT.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(KT.current||joe(),this.shouldReduceMotion=GT.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Mb(this.notifyUpdate),Mb(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&bC.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new fC({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:cb(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=IS.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&jb.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in ZT){let t=ZT[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):MT()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<XT.length;t++){let n=XT[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=koe(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=ZC(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(tb(n)||nb(n))?n=parseFloat(n):!OT(n)&&Ex.test(t)&&(n=Hw(e,t)),this.setBaseTarget(e,sw(n)?n.get():n)),sw(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=GC(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!sw(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new sb),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Zw.render(this.render)}}})),eE,tE=o((()=>{cw(),toe(),$T(),eE=class extends QT{constructor(){super(...arguments),this.KeyframeResolver=Kw}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;sw(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}}})),nE,Poe=o((()=>{nE=class{constructor(e){this.isMounted=!1,this.node=e}update(){}}}));function rE({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Foe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ioe(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}var iE=o((()=>{}));function aE(e){return e===void 0||e===1}function oE({scale:e,scaleX:t,scaleY:n}){return!aE(e)||!aE(t)||!aE(n)}function sE(e){return oE(e)||cE(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function cE(e){return lE(e.x)||lE(e.y)}function lE(e){return e&&e!==`0%`}var uE=o((()=>{}));function dE(e,t,n){return n+t*(e-n)}function fE(e,t,n,r,i){return i!==void 0&&(e=dE(e,i,r)),dE(e,n,r)+t}function pE(e,t=0,n=1,r,i){e.min=fE(e.min,t,n,r,i),e.max=fE(e.max,t,n,r,i)}function mE(e,{x:t,y:n}){pE(e.x,t.translate,t.scale,t.originPoint),pE(e.y,n.translate,n.scale,n.originPoint)}function Loe(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(hE(e.x,-a.scroll.offset.x),hE(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,mE(e,o)),r&&sE(a.latestValues)&&vE(e,a.latestValues,a.layout?.layoutBox))}t.x<bE&&t.x>yE&&(t.x=1),t.y<bE&&t.y>yE&&(t.y=1)}function hE(e,t){e.min+=t,e.max+=t}function gE(e,t,n,r,i=.5){pE(e,t,n,jx(e.min,e.max,i),r)}function _E(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function vE(e,t,n){let r=n??e;gE(e.x,_E(t.x,r.x),t.scaleX,t.scale,t.originX),gE(e.y,_E(t.y,r.y),t.scaleY,t.scale,t.originY)}var yE,bE,xE=o((()=>{Mx(),uE(),yE=.999999999999,bE=1.0000000000001}));function SE(e,t){return rE(Ioe(e.getBoundingClientRect(),t))}function Roe(e,t,n){let r=SE(e,n),{scroll:i}=t;return i&&(hE(r.x,i.offset.x),hE(r.y,i.offset.y)),r}var CE=o((()=>{iE(),xE()}));function zoe(e,t,n){let r=``,i=!0;for(let a=0;a<TE;a++){let o=FS[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===(o.startsWith(`scale`)?1:0);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Yw(s,Lw[o]);if(!c){i=!1;let t=wE[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}var wE,TE,Boe=o((()=>{Xw(),Rw(),LS(),wE={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},TE=FS.length}));function EE(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(IS.has(e)){o=!0;continue}else if(Hb(e)){i[e]=n;continue}else{let t=Yw(n,Lw[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=zoe(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}var DE=o((()=>{Xw(),Rw(),LS(),Wb(),Boe()}));function OE(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}var kE=o((()=>{}));function AE(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var jE,Voe=o((()=>{ux(),jE={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(I.test(e))e=parseFloat(e);else return e;return`${AE(e,t.target.x)}% ${AE(e,t.target.y)}%`}}})),ME,Hoe=o((()=>{Dx(),Mx(),ME={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=Ex.parse(e);if(i.length>5)return r;let a=Ex.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=jx(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}}})),NE,PE=o((()=>{Voe(),Hoe(),NE={borderRadius:{...jE,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:jE,borderTopRightRadius:jE,borderBottomLeftRadius:jE,borderBottomRightRadius:jE,boxShadow:ME}}));function FE(e,{layout:t,layoutId:n}){return IS.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!NE[e]||e===`opacity`)}var IE=o((()=>{LS(),PE()}));function LE(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(sw(r[t])||i&&sw(i[t])||FE(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}var RE=o((()=>{cw(),IE()}));function Uoe(e){return window.getComputedStyle(e)}var zE,Woe=o((()=>{Wb(),LS(),PS(),CE(),tE(),DE(),kE(),RE(),zE=class extends eE{constructor(){super(...arguments),this.type=`html`,this.renderInstance=OE}readValueFromInstance(e,t){if(IS.has(t))return this.projection?.isProjecting?CS(t):NS(e,t);{let n=Uoe(e),r=(Hb(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return SE(e,t)}build(e,t,n){EE(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return LE(e,t,n)}}}));function Goe(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?BE:VE;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var BE,VE,Koe=o((()=>{BE={offset:`stroke-dashoffset`,array:`stroke-dasharray`},VE={offset:`strokeDashoffset`,array:`strokeDasharray`}}));function HE(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(EE(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of UE)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Goe(d,i,a,o,!1)}var UE,WE=o((()=>{DE(),Koe(),UE=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`]})),GE,KE=o((()=>{GE=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`])})),qE,JE=o((()=>{qE=e=>typeof e==`string`&&e.toLowerCase()===`svg`}));function qoe(e,t,n,r){OE(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(GE.has(n)?n:dw(n),t.attrs[n])}var Joe=o((()=>{fw(),kE(),KE()}));function YE(e,t,n){let r=LE(e,t,n);for(let n in e)if(sw(e[n])||sw(t[n])){let t=FS.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var XE=o((()=>{cw(),LS(),RE()})),ZE,Yoe=o((()=>{LS(),Vw(),NT(),tE(),fw(),WE(),KE(),JE(),Joe(),XE(),ZE=class extends eE{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=MT}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(IS.has(t)){let e=Bw(t);return e&&e.default||0}return t=GE.has(t)?t:dw(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return YE(e,t,n)}build(e,t,n){HE(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){qoe(e,t,n,r)}mount(e){this.isSVGTag=qE(e.tagName),super.mount(e)}}}));function QE(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&QE(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<$E;n++){let r=BT[n],i=e.props[r];(LT(i)||i===!1)&&(t[r]=i)}return t}var $E,Xoe=o((()=>{RT(),VT(),$E=BT.length}));function eD(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Zoe=o((()=>{}));function Qoe(e){return t=>Promise.all(t.map(({animation:t,options:n})=>xw(e,t,n)))}function $oe(e){let t=Qoe(e),n=nD(),r=!0,i=!1,a=t=>(n,r)=>{let i=qC(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=QE(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<iD;t++){let p=rD[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=LT(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||FT(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=ese(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=rw(t)&&rw(n)?!eD(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=qC(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=DC(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=qC(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=nD(),i=!0}}}function ese(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!eD(t,e):!1}function tD(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nD(){return{animate:tD(!0),whileInView:tD(),whileHover:tD(),whileTap:tD(),whileDrag:tD(),whileFocus:tD(),exit:tD()}}var rD,iD,tse=o((()=>{Sw(),OC(),Xoe(),IT(),iw(),RT(),JC(),Zoe(),VT(),rD=[...zT].reverse(),iD=zT.length}));function aD(e,t){e.min=t.min,e.max=t.max}function oD(e,t){aD(e.x,t.x),aD(e.y,t.y)}function sD(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var nse=o((()=>{}));function cD(e){return e.max-e.min}function rse(e,t,n){return Math.abs(e-t)<=n}function lD(e,t,n,r=.5){e.origin=r,e.originPoint=jx(t.min,t.max,e.origin),e.scale=cD(n)/cD(t),e.translate=jx(n.min,n.max,e.origin)-e.originPoint,(e.scale>=hD&&e.scale<=gD||isNaN(e.scale))&&(e.scale=1),(e.translate>=vD&&e.translate<=yD||isNaN(e.translate))&&(e.translate=0)}function uD(e,t,n,r){lD(e.x,t.x,n.x,r?r.originX:void 0),lD(e.y,t.y,n.y,r?r.originY:void 0)}function dD(e,t,n,r=0){e.min=(r?jx(n.min,n.max,r):n.min)+t.min,e.max=e.min+cD(t)}function ise(e,t,n,r){dD(e.x,t.x,n.x,r?.x),dD(e.y,t.y,n.y,r?.y)}function fD(e,t,n,r=0){let i=r?jx(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+cD(t)}function pD(e,t,n,r){fD(e.x,t.x,n.x,r?.x),fD(e.y,t.y,n.y,r?.y)}var mD,hD,gD,_D,vD,yD,bD=o((()=>{Mx(),mD=1e-4,hD=1-mD,gD=1+mD,_D=.01,vD=0-_D,yD=0+_D}));function xD(e,t,n,r,i){return e-=t,e=dE(e,1/n,r),i!==void 0&&(e=dE(e,1/i,r)),e}function ase(e,t=0,n=1,r=.5,i,a=e,o=e){if(cx.test(t)&&(t=parseFloat(t),t=jx(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=jx(a.min,a.max,r);e===a&&(s-=t),e.min=xD(e.min,t,n,s,i),e.max=xD(e.max,t,n,s,i)}function SD(e,t,[n,r,i],a,o){ase(e,t[n],t[r],t[i],t.scale,a,o)}function CD(e,t,n,r){SD(e.x,t,wD,n?n.x:void 0,r?r.x:void 0),SD(e.y,t,TD,n?n.y:void 0,r?r.y:void 0)}var wD,TD,ose=o((()=>{Mx(),ux(),xE(),wD=[`x`,`scaleX`,`originX`],TD=[`y`,`scaleY`,`originY`]}));function ED(e){return e.translate===0&&e.scale===1}function DD(e){return ED(e.x)&&ED(e.y)}function OD(e,t){return e.min===t.min&&e.max===t.max}function sse(e,t){return OD(e.x,t.x)&&OD(e.y,t.y)}function kD(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function AD(e,t){return kD(e.x,t.x)&&kD(e.y,t.y)}function jD(e){return cD(e.x)/cD(e.y)}function MD(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}var cse=o((()=>{bD()}));function ND(e){return[e(`x`),e(`y`)]}var PD=o((()=>{}));function lse(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var use=o((()=>{}));function dse(e,t,n,r,i,a){i?(e.opacity=jx(0,n.opacity??1,VD(r)),e.opacityExit=jx(t.opacity??1,0,HD(r))):a&&(e.opacity=jx(t.opacity??1,n.opacity??1,r));for(let i=0;i<RD;i++){let a=LD[i],o=FD(t,a),s=FD(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||BD(o)===BD(s)?(e[a]=Math.max(jx(zD(o),zD(s),r),0),(cx.test(s)||cx.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=jx(t.rotate||0,n.rotate||0,r))}function FD(e,t){return e[t]===void 0?e.borderRadius:e[t]}function ID(e,t,n){return r=>r<e?0:r>t?1:n(ob(e,t,r))}var LD,RD,zD,BD,VD,HD,fse=o((()=>{Mx(),ux(),Db(),LD=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],RD=LD.length,zD=e=>typeof e==`string`?parseFloat(e):e,BD=e=>typeof e==`number`||I.test(e),VD=ID(0,.5,xb),HD=ID(.5,.95,rb)}));function pse(e,t,n){let r=sw(e)?e:ZC(e);return r.start(HC(``,r,t,n)),r.animation}var mse=o((()=>{UC(),nw(),cw()}));function UD(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var WD=o((()=>{})),GD,hse=o((()=>{GD=(e,t)=>e.depth-t.depth})),KD,gse=o((()=>{Db(),hse(),KD=class{constructor(){this.children=[],this.isDirty=!1}add(e){Yy(this.children,e),this.isDirty=!0}remove(e){Xy(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(GD),this.isDirty=!1,this.children.forEach(e)}}}));function _se(e,t){let n=Lb.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Mb(r),e(a-t))};return jb.setup(r,!0),()=>Mb(r)}var vse=o((()=>{Rb(),Fb()}));function qD(e){return sw(e)?e.get():e}var JD=o((()=>{cw()})),YD,yse=o((()=>{Db(),YD=class{constructor(){this.members=[]}add(e){Yy(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Xy(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Xy(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}})),XD,ZD=o((()=>{XD={hasAnimatedSinceResize:!0,hasEverUpdated:!1}}));function QD(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function $D(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=gw(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,jb,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&$D(r)}function eO({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=dO++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,kb.value&&(cO.nodes=cO.calculatedTargetDeltas=cO.calculatedProjections=0),this.nodes.forEach(Sse),this.nodes.forEach(Ose),this.nodes.forEach(kse),this.nodes.forEach(Cse),kb.addProjectionMetrics&&kb.addProjectionMetrics(cO)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new KD)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new sb),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=_T(t)&&!Toe(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;jb.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=_se(i,250),XD.hasAnimatedSinceResize&&(XD.hasAnimatedSinceResize=!1,this.nodes.forEach(rO)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||fO,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!AD(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...zC(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||rO(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Mb(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ase),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&$D(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(Tse),this.nodes.forEach(tO);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(nO);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ese),this.nodes.forEach(Dse),this.nodes.forEach(bse),this.nodes.forEach(xse)):this.nodes.forEach(nO),this.clearAllSnapshots();let e=Lb.now();Nb.delta=Zy(0,1e3/60,e-Nb.timestamp),Nb.timestamp=e,Nb.isProcessing=!0,Pb.update.process(Nb),Pb.preRender.process(Nb),Pb.render.process(Nb),Nb.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(wse),this.sharedNodes.forEach(jse)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,jb.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){jb.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!cD(this.snapshot.measuredBox.x)&&!cD(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=MT(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!DD(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||sE(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Pse(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return MT();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Fse))){let{scroll:e}=this.root;e&&(hE(t.x,e.offset.x),hE(t.y,e.offset.y))}return t}removeElementScroll(e){let t=MT();if(oD(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&oD(t,e),hE(t.x,i.offset.x),hE(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||MT();oD(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(hE(r.x,-n.scroll.offset.x),hE(r.y,-n.scroll.offset.y)),sE(n.latestValues)&&vE(r,n.latestValues,n.layout?.layoutBox)}return sE(this.latestValues)&&vE(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=MT();oD(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!sE(n.latestValues))continue;let r;n.instance&&(oE(n.latestValues)&&n.updateSnapshot(),r=MT(),oD(r,n.measurePageBox())),CD(t,n.latestValues,n.snapshot?.layoutBox,r)}return sE(this.latestValues)&&CD(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Nb.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Nb.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=MT(),this.targetWithTransforms=MT()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ise(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):oD(this.target,this.layout.layoutBox),mE(this.target,this.targetDelta)):oD(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),kb.value&&cO.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||oE(this.parent.latestValues)||cE(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=MT(),this.relativeTargetOrigin=MT(),pD(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),oD(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Nb.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;oD(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Loe(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=MT());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(sD(this.prevProjectionDelta.x,this.projectionDelta.x),sD(this.prevProjectionDelta.y,this.projectionDelta.y)),uD(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!MD(this.projectionDelta.x,this.prevProjectionDelta.x)||!MD(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),kb.value&&cO.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=AT(),this.projectionDelta=AT(),this.projectionDeltaWithTransform=AT()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=AT();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=MT(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some(Nse));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;iO(a.x,e.x,n),iO(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pD(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Mse(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&sse(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=MT(),oD(d,this.relativeTarget)),s&&(this.animationValues=i,dse(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Mb(this.pendingAnimation),void 0),this.pendingAnimation=jb.update(()=>{XD.hasAnimatedSinceResize=!0,zb.layout++,this.motionValue||=ZC(0),this.motionValue.jump(0,!1),this.currentAnimation=pse(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{zb.layout--},onComplete:()=>{zb.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(uO),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&sO(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||MT();let t=cD(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=cD(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}oD(t,n),vE(t,i),uD(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new YD),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&QD(`z`,e,r,this.animationValues);for(let t=0;t<lO.length;t++)QD(`rotate${lO[t]}`,e,r,this.animationValues),QD(`skew${lO[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=qD(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=qD(t?.pointerEvents)||``),this.hasProjected&&!sE(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=lse(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in NE){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=NE[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?qD(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(tO),this.root.sharedNodes.clear()}}}function bse(e){e.updateLayout()}function xse(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)ND(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=cD(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;aD(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else sO(i,t.layoutBox,n)&&ND(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=cD(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=AT();uD(o,n,t.layoutBox);let s=AT();a?uD(s,e.applyTransform(r,!0),t.measuredBox):uD(s,n,t.layoutBox);let c=!DD(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=MT();pD(s,t.layoutBox,i.layoutBox,o);let c=MT();pD(c,n,a.layoutBox,o),AD(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Sse(e){kb.value&&cO.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Cse(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function wse(e){e.clearSnapshot()}function tO(e){e.clearMeasurements()}function Tse(e){e.isLayoutDirty=!0,e.updateLayout()}function nO(e){e.isLayoutDirty=!1}function Ese(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Dse(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function rO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ose(e){e.resolveTargetDelta()}function kse(e){e.calcProjection()}function Ase(e){e.resetSkewAndRotation()}function jse(e){e.removeLeadSnapshot()}function iO(e,t,n){e.translate=jx(t.translate,0,n),e.scale=jx(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function aO(e,t,n,r){e.min=jx(t.min,n.min,r),e.max=jx(t.max,n.max,r)}function Mse(e,t,n,r){aO(e.x,t.x,n.x,r),aO(e.y,t.y,n.y,r)}function Nse(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}function oO(e){e.min=mO(e.min),e.max=mO(e.max)}function Pse(e){oO(e.x),oO(e.y)}function sO(e,t,n){return e===`position`||e===`preserve-aspect`&&!rse(jD(t),jD(n),.2)}function Fse(e){return e!==e.root&&e.scroll?.wasRoot}var cO,lO,uO,dO,fO,pO,mO,hO=o((()=>{Db(),mse(),_w(),BC(),Qw(),Rb(),PE(),Bb(),Ab(),vse(),vT(),Eoe(),Mx(),nw(),JD(),fse(),nse(),xE(),bD(),ose(),NT(),cse(),yse(),use(),PD(),gse(),uE(),ZD(),Fb(),cO={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},lO=[``,`X`,`Y`,`Z`],uO=1e3,dO=0,fO={duration:.45,ease:[.4,0,.1,1]},pO=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),mO=pO(`applewebkit/`)&&!pO(`chrome/`)?Math.round:rb})),gO,Ise=o((()=>{WD(),hO(),gO=eO({attachResizeListener:(e,t)=>UD(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0})})),_O,vO,Lse=o((()=>{hO(),Ise(),_O={current:void 0},vO=eO({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_O.current){let e=new gO({});e.mount(window),e.setOptions({layoutScroll:!0}),_O.current=e}return _O.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`})})),yO=o((()=>{UC(),Sw(),hw(),Qw(),ooe(),loe(),hoe(),lT(),oT(),woe(),Mx(),ux(),cw(),uw(),Poe(),Woe(),Yoe(),$T(),tse(),IT(),WT(),IE(),RT(),JC(),KC(),ow(),iE(),bD(),NT(),PD(),CE(),WD(),JD(),Lse(),ZD(),DE(),RE(),WE(),JE(),XE(),Fb()})),bO,xO,SO=o((()=>{bO=u(p(),1),xO=(0,bO.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`})}));function Rse(e=!0){let t=(0,CO.useContext)(qy);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,CO.useId)();(0,CO.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,CO.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var CO,zse=o((()=>{CO=u(p(),1),Jy()})),wO,TO,EO=o((()=>{wO=u(p(),1),TO=(0,wO.createContext)({strict:!1})}));function Bse(){if(kO)return;let e={};for(let t in OO)e[t]={isEnabled:e=>OO[t].some(t=>!!e[t])};YT(e),kO=!0}function DO(){return Bse(),Noe()}var OO,kO,AO=o((()=>{yO(),OO={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},kO=!1}));function Vse(e){let t=DO();for(let n in e)t[n]={...t[n],...e[n]};YT(t)}var Hse=o((()=>{yO(),AO()}));function jO(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||MO.has(e)}var MO,Use=o((()=>{MO=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`))})),Wse=c({default:()=>NO}),NO,Gse=o((()=>{throw NO={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)}));function Kse(e){typeof e==`function`&&(PO=t=>t.startsWith(`on`)?!jO(t):e(t))}function qse(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||sw(e[i])||(PO(i)||n===!0&&jO(i)||!t&&!jO(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var PO,Jse=o((()=>{yO(),Use(),PO=e=>!jO(e);try{Kse((Gse(),d(Wse)).default)}catch{}})),FO,IO,LO=o((()=>{FO=u(p(),1),IO=(0,FO.createContext)({})}));function Yse(e,t){if(HT(e)){let{initial:t,animate:n}=e;return{initial:t===!1||LT(t)?t:void 0,animate:LT(n)?n:void 0}}return e.inherit===!1?{}:t}var Xse=o((()=>{yO()}));function Zse(e){let{initial:t,animate:n}=Yse(e,(0,zO.useContext)(IO));return(0,zO.useMemo)(()=>({initial:t,animate:n}),[RO(t),RO(n)])}function RO(e){return Array.isArray(e)?e.join(` `):e}var zO,Qse=o((()=>{zO=u(p(),1),LO(),Xse()})),BO,VO=o((()=>{BO=()=>({style:{},transform:{},transformOrigin:{},vars:{}})}));function HO(e,t,n){for(let r in t)!sw(t[r])&&!FE(r,n)&&(e[r]=t[r])}function $se({transformTemplate:e},t){return(0,UO.useMemo)(()=>{let n=BO();return EE(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ece(e,t){let n=e.style||{},r={};return HO(r,n,e),Object.assign(r,$se(e,t)),r}function tce(e,t){let n={},r=ece(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var UO,WO=o((()=>{yO(),UO=u(p(),1),VO()})),GO,KO=o((()=>{VO(),GO=()=>({...BO(),attrs:{}})}));function nce(e,t,n,r){let i=(0,qO.useMemo)(()=>{let n=GO();return HE(n,t,qE(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};HO(t,e.style,e),i.style={...t,...i.style}}return i}var qO,rce=o((()=>{yO(),qO=u(p(),1),WO(),KO()})),JO,ice=o((()=>{JO=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`]}));function YO(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(JO.indexOf(e)>-1||/[A-Z]/u.test(e))}var XO=o((()=>{ice()}));function ace(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??YO(e)?nce:tce)(t,r,i,e),c=qse(t,typeof e==`string`,a),l=e===ZO.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,ZO.useMemo)(()=>sw(u)?u.get():u,[u]);return(0,ZO.createElement)(e,{...l,children:d})}var ZO,oce=o((()=>{yO(),ZO=u(p(),1),WO(),rce(),Jse(),XO()}));function sce({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:cce(n,r,i,e),renderState:t()}}function cce(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=qD(a[e]);let{initial:o,animate:s}=e,c=HT(e),l=UT(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!FT(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=GC(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var QO,$O,ek=o((()=>{yO(),QO=u(p(),1),LO(),Jy(),Are(),$O=e=>(t,n)=>{let r=(0,QO.useContext)(IO),i=(0,QO.useContext)(qy),a=()=>sce(e,t,r,i);return n?a():Ore(a)}})),tk,lce=o((()=>{yO(),ek(),VO(),tk=$O({scrapeMotionValuesFromProps:LE,createRenderState:BO})})),nk,uce=o((()=>{yO(),ek(),KO(),nk=$O({scrapeMotionValuesFromProps:YE,createRenderState:GO})})),rk,dce=o((()=>{rk=Symbol.for(`motionComponentSymbol`)}));function fce(e,t,n){let r=(0,ik.useRef)(n);(0,ik.useInsertionEffect)(()=>{r.current=n});let i=(0,ik.useRef)(null);return(0,ik.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var ik,pce=o((()=>{ik=u(p(),1)})),ak,ok,sk=o((()=>{ak=u(p(),1),ok=(0,ak.createContext)({})}));function ck(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}var lk=o((()=>{}));function mce(e,t,n,r,i,a){let{visualElement:o}=(0,dk.useContext)(IO),s=(0,dk.useContext)(TO),c=(0,dk.useContext)(qy),l=(0,dk.useContext)(xO),u=l.reducedMotion,d=l.skipAnimations,f=(0,dk.useRef)(null),p=(0,dk.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,dk.useContext)(ok);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&hce(f.current,n,i,h);let g=(0,dk.useRef)(!1);(0,dk.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[mw],v=(0,dk.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Ky(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,dk.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function hce(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:uk(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&ck(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function uk(e){if(e)return e.options.allowProjection===!1?uk(e.parent):e.projection}var dk,gce=o((()=>{yO(),dk=u(p(),1),EO(),SO(),LO(),Jy(),sk(),lk(),Nre()}));function fk(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Vse(r);let a=n?n===`svg`:YO(e),o=a?nk:tk;function s(n,s){let c,l={...(0,mk.useContext)(xO),...n,layoutId:_ce(n)},{isStatic:u}=l,d=Zse(n),f=o(n,u);if(!u&&typeof window<`u`){vce(l,r);let t=yce(l);c=t.MeasureLayout,d.visualElement=mce(e,f,l,i,t.ProjectionNode,a)}return(0,pk.jsxs)(IO.Provider,{value:d,children:[c&&d.visualElement?(0,pk.jsx)(c,{visualElement:d.visualElement,...l}):null,ace(e,n,fce(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,mk.forwardRef)(s);return c[rk]=e,c}function _ce({layoutId:e}){let t=(0,mk.useContext)(Wy).id;return t&&e!==void 0?t+`-`+e:e}function vce(e,t){(0,mk.useContext)(TO).strict}function yce(e){let{drag:t,layout:n}=DO();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}var pk,mk,bce=o((()=>{pk=N(),mk=u(p(),1),Dre(),EO(),SO(),LO(),Qse(),oce(),XO(),lce(),uce(),AO(),Hse(),dce(),pce(),gce()}));function xce(e,t){if(typeof Proxy>`u`)return fk;let n=new Map,r=(n,r)=>fk(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,fk(a,void 0,e,t)),n.get(a))})}var Sce=o((()=>{bce()})),hk,gk,Cce=o((()=>{yO(),hk=u(p(),1),XO(),gk=(e,t)=>t.isSVG??YO(e)?new ZE(t):new zE(t,{allowProjection:e!==hk.Fragment})})),_k,wce=o((()=>{yO(),_k=class extends nE{constructor(e){super(e),e.animationState||=$oe(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();FT(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}})),vk,yk,Tce=o((()=>{yO(),vk=0,yk=class extends nE{constructor(){super(...arguments),this.id=vk++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=qC(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}})),bk,Ece=o((()=>{wce(),Tce(),bk={animation:{Feature:_k},exit:{Feature:yk}}}));function xk(e){return{point:{x:e.pageX,y:e.pageY}}}var Sk,Ck=o((()=>{yO(),Sk=e=>t=>aT(t)&&e(t,xk(t))}));function wk(e,t,n,r){return UD(e,t,Sk(n),r)}var Tk=o((()=>{yO(),Ck()})),Ek,Dk=o((()=>{Ek=({current:e})=>e?e.ownerDocument.defaultView:null}));function Dce(e,t){let n=Ok(e.x,t.x),r=Ok(e.y,t.y);return Math.sqrt(n**2+r**2)}var Ok,Oce=o((()=>{Ok=(e,t)=>Math.abs(e-t)}));function kk(e,t){return t?{point:t(e.point)}:e}function Ak(e,t){return{x:e.x-t.x,y:e.y-t.y}}function jk({point:e},t){return{point:e,delta:Ak(e,Mk(t)),offset:Ak(e,kce(t)),velocity:Ace(t,.1)}}function kce(e){return e[0]}function Mk(e){return e[e.length-1]}function Ace(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Mk(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>cb(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>cb(t)*2&&(r=e[1]);let a=lb(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}var Nk,Pk,jce=o((()=>{yO(),Db(),Tk(),Ck(),Oce(),Nk=new Set([`auto`,`scroll`]),Pk=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=kk(this.lastRawMoveEventInfo,this.transformPagePoint));let e=jk(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Dce(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=Nb;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=kk(t,this.transformPagePoint),jb.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=jk(e.type===`pointercancel`?this.lastMoveEventInfo:kk(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!aT(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=kk(xk(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Nb;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,jk(s,this.history)),this.removeListeners=ab(wk(this.contextWindow,`pointermove`,this.handlePointerMove),wk(this.contextWindow,`pointerup`,this.handlePointerUp),wk(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Nk.has(e.overflowX)||Nk.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),jb.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Mb(this.updatePoint)}}}));function Mce(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?jx(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?jx(n,e,r.max):Math.min(e,n)),e}function Nce(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Pce(e,{top:t,left:n,bottom:r,right:i}){return{x:Nce(e.x,n,i),y:Nce(e.y,t,r)}}function Fce(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Ice(e,t){return{x:Fce(e.x,t.x),y:Fce(e.y,t.y)}}function Lce(e,t){let n=.5,r=cD(e),i=cD(t);return i>r?n=ob(t.min,t.max-r,e.min):r>i&&(n=ob(e.min,e.max-i,t.min)),Zy(0,1,n)}function Rce(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}function zce(e=Fk){return e===!1?e=0:e===!0&&(e=Fk),{x:Bce(e,`left`,`right`),y:Bce(e,`top`,`bottom`)}}function Bce(e,t,n){return{min:Vce(e,t),max:Vce(e,n)}}function Vce(e,t){return typeof e==`number`?e:e[t]||0}var Fk,Hce=o((()=>{yO(),Db(),Fk=.35}));function Uce(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Wce(e,t,n){let r=ET(e,Uce(n)),i=ET(t,Uce(n));return()=>{r(),i()}}function Ik(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Gce(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Kce,qce,Jce=o((()=>{yO(),Db(),Tk(),Ck(),Dk(),lk(),jce(),Hce(),Kce=new WeakMap,qce=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=MT(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(xk(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=aoe(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ND(e=>{let t=this.getAxisMotionValue(e).get()||0;if(cx.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=cD(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&jb.update(()=>i(e,t),!1,!0),lw(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Gce(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&jb.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Pk(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Ek(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&jb.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Ik(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Mce(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&ck(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Pce(n.layoutBox,e):this.constraints=!1,this.elastic=zce(t),r!==this.constraints&&!ck(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&ND(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Rce(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!ck(e))return!1;let n=e.current;$y(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.",`drag-constraints-ref`);let{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=Roe(n,r.root,this.visualElement.getTransformPagePoint()),a=Ice(r.layout.layoutBox,i);if(t){let e=t(Foe(a));this.hasMutatedConstraints=!!e,e&&(a=rE(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=ND(o=>{if(!Ik(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return lw(this.visualElement,e),n.start(HC(e,n,0,t,this.visualElement,!1))}stopAnimation(){ND(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){ND(t=>{let{drag:n}=this.getProps();if(!Ik(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-jx(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!ck(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};ND(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Lce({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ND(t=>{if(!Ik(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(jx(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Kce.set(this.visualElement,this);let e=this.visualElement.current,t=wk(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&foe(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();ck(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Wce(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),jb.read(r);let o=UD(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(ND(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Fk,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}}})),Yce,Xce=o((()=>{yO(),Db(),Jce(),Yce=class extends nE{constructor(e){super(e),this.removeGroupControls=rb,this.removeListeners=rb,this.controls=new qce(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rb}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}})),Lk,Zce,Qce=o((()=>{yO(),Db(),Tk(),Dk(),jce(),Lk=e=>(t,n)=>{e&&jb.update(()=>e(t,n),!1,!0)},Zce=class extends nE{constructor(){super(...arguments),this.removePointerDownListener=rb}onPointerDown(e){this.session=new Pk(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ek(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lk(e),onStart:Lk(t),onMove:Lk(n),onEnd:(e,t)=>{delete this.session,r&&jb.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=wk(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}}));function $ce(e){let[t,n]=Rse(),r=(0,Rk.useContext)(Wy);return(0,ele.jsx)(tle,{...e,layoutGroup:r,switchLayoutGroup:(0,Rk.useContext)(ok),isPresent:t,safeToRemove:n})}var ele,Rk,zk,tle,nle=o((()=>{ele=N(),yO(),Rk=u(p(),1),zse(),Dre(),sk(),zk=!1,tle=class extends Rk.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),zk&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),XD.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),zk=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||jb.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Zw.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;zk=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}})),rle,ile=o((()=>{Xce(),Qce(),nle(),yO(),rle={pan:{Feature:Zce},drag:{Feature:Yce,ProjectionNode:vO,MeasureLayout:$ce}}}));function ale(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&jb.postRender(()=>i(t,xk(t)))}var ole,sle=o((()=>{yO(),Ck(),ole=class extends nE{mount(){let{current:e}=this.node;e&&(this.unmount=coe(e,(e,t)=>(ale(this.node,t,`Start`),e=>ale(this.node,e,`End`))))}unmount(){}}})),cle,lle=o((()=>{yO(),Db(),cle=class extends nE{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=ab(UD(this.node.current,`focus`,()=>this.onFocus()),UD(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}}}));function ule(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&jb.postRender(()=>i(t,xk(t)))}var dle,fle=o((()=>{yO(),Ck(),dle=class extends nE{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=moe(e,(e,t)=>(ule(this.node,t,`Start`),(e,{success:t})=>ule(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}}}));function ple({root:e,...t}){let n=e||document;Vk.has(n)||Vk.set(n,{});let r=Vk.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(gle,{root:e,...t})),r[i]}function mle(e,t,n){let r=ple(t);return Bk.set(e,n),r.observe(e),()=>{Bk.delete(e),r.unobserve(e)}}var Bk,Vk,hle,gle,_le=o((()=>{Bk=new WeakMap,Vk=new WeakMap,hle=e=>{let t=Bk.get(e.target);t&&t(e)},gle=e=>{e.forEach(hle)}}));function vle({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var yle,ble,xle=o((()=>{yO(),_le(),yle={some:0,all:1},ble=class extends nE{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:yle[r]};this.stopObserver=mle(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(vle(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}})),Sle,Cle=o((()=>{sle(),lle(),fle(),xle(),Sle={inView:{Feature:ble},tap:{Feature:dle},focus:{Feature:cle},hover:{Feature:ole}}})),wle,Tle=o((()=>{yO(),nle(),wle={layout:{ProjectionNode:vO,MeasureLayout:$ce}}})),Ele,Dle=o((()=>{Ece(),ile(),Cle(),Tle(),Ele={...bk,...Sle,...rle,...wle}})),Hk,Ole=o((()=>{Cce(),Sce(),Dle(),Hk=xce(Ele,gk)}));function kle(e){e.values.forEach(e=>e.stop())}function Uk(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&aw(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{Uk(e,t)})})}function Ale(e,t){if(Array.isArray(t))return Uk(e,t);if(typeof t==`string`)return Uk(e,[t]);aw(e,t)}function jle(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){$y(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(xw(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return $y(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{Ale(e,n)})},stop(){t.forEach(e=>{kle(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}var Mle=o((()=>{yO(),Db()}));function Nle(){let e=Ore(jle);return Ky(e.mount,[]),e}var Wk,Ple=o((()=>{Are(),Nre(),Mle(),Wk=Nle})),Fle=o((()=>{Ole(),yO(),Db(),Ple()})),Gk=o((()=>{Fle(),Fle()}));function Kk(...e){return e.filter(Boolean).join(` `)}var qk=o((()=>{})),Jk,Yk,Xk,Ile=o((()=>{Gk(),Jk=u(p()),qk(),Yk=N(),Xk=(0,Jk.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,Jk.useRef)(!1);(0,Jk.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,Jk.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,Jk.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,Yk.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,Yk.jsxs)(Hk.svg,{animate:o,fill:`none`,height:r,initial:`normal`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,variants:{normal:{scale:1},animate:{scale:1.05,transition:{duration:.3,ease:`easeOut`}}},viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,Yk.jsx)(`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`}),(0,Yk.jsx)(`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`}),(0,Yk.jsx)(Hk.path,{d:`M10 9H8`,stroke:`currentColor`,strokeWidth:`2`,variants:{normal:{pathLength:1,x1:8,x2:10},animate:{pathLength:[1,0,1],x1:[8,10,8],x2:[10,10,10],transition:{duration:.7,delay:.3}}}}),(0,Yk.jsx)(Hk.path,{d:`M16 13H8`,stroke:`currentColor`,strokeWidth:`2`,variants:{normal:{pathLength:1,x1:8,x2:16},animate:{pathLength:[1,0,1],x1:[8,16,8],x2:[16,16,16],transition:{duration:.7,delay:.5}}}}),(0,Yk.jsx)(Hk.path,{d:`M16 17H8`,stroke:`currentColor`,strokeWidth:`2`,variants:{normal:{pathLength:1,x1:8,x2:16},animate:{pathLength:[1,0,1],x1:[8,16,8],x2:[16,16,16],transition:{duration:.7,delay:.7}}}})]})})}),Xk.displayName=`FileTextIcon`})),Zk,Qk,Lle,$k,Rle=o((()=>{Gk(),Zk=u(p()),qk(),Qk=N(),Lle={normal:{rotate:0},animate:{rotate:[0,-8,6,-4,0],transition:{ease:`easeInOut`,rotate:{duration:.6}}}},$k=(0,Zk.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,Zk.useRef)(!1);(0,Zk.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,Zk.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,Zk.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,Qk.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,Qk.jsx)(Hk.svg,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:(0,Qk.jsx)(Hk.path,{animate:o,d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,initial:`normal`,style:{transformOrigin:`12px 12px`},variants:Lle})})})}),$k.displayName=`FolderOpenIcon`})),eA,tA,nA,zle=o((()=>{Gk(),eA=u(p()),qk(),tA=N(),nA=(0,eA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,eA.useRef)(!1);(0,eA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,eA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,eA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,tA.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,tA.jsxs)(Hk.svg,{animate:o,fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,transition:{type:`spring`,stiffness:100,damping:15},variants:{normal:{rotate:0},animate:{rotate:180}},viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,tA.jsx)(`path`,{d:`M5 12h14`}),(0,tA.jsx)(`path`,{d:`M12 5v14`})]})})}),nA.displayName=`PlusIcon`})),rA,iA,aA,Ble=o((()=>{Gk(),rA=u(p()),qk(),iA=N(),aA=(0,rA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,rA.useRef)(!1);(0,rA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,rA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,rA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,iA.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,iA.jsxs)(Hk.svg,{animate:o,fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,transition:{duration:1,bounce:.3},variants:{normal:{x:0,y:0},animate:{x:[0,0,-3,0],y:[0,-4,0,0]}},viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,iA.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,iA.jsx)(`path`,{d:`m21 21-4.3-4.3`})]})})}),aA.displayName=`SearchIcon`})),oA,sA,Vle,cA,lA,Hle=o((()=>{Gk(),oA=u(p()),qk(),sA=N(),Vle={normal:{y:0},animate:{y:-1.1}},cA={type:`spring`,stiffness:500,damping:30},lA=(0,oA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,oA.useRef)(!1);(0,oA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,oA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,oA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,sA.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,sA.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,sA.jsxs)(Hk.g,{animate:o,transition:cA,variants:Vle,children:[(0,sA.jsx)(`path`,{d:`M3 6h18`}),(0,sA.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`})]}),(0,sA.jsx)(Hk.path,{animate:o,d:`M19 8v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V8`,transition:cA,variants:{normal:{d:`M19 8v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V8`},animate:{d:`M19 9v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V9`}}}),(0,sA.jsx)(Hk.line,{animate:o,transition:cA,variants:{normal:{y1:11,y2:17},animate:{y1:11.5,y2:17.5}},x1:`10`,x2:`10`,y1:`11`,y2:`17`}),(0,sA.jsx)(Hk.line,{animate:o,transition:cA,variants:{normal:{y1:11,y2:17},animate:{y1:11.5,y2:17.5}},x1:`14`,x2:`14`,y1:`11`,y2:`17`})]})})}),lA.displayName=`DeleteIcon`})),uA,dA,Ule,fA,Wle=o((()=>{Gk(),uA=u(p()),qk(),dA=N(),Ule={times:[0,.4,1],duration:.5},fA=(0,uA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,uA.useRef)(!1);(0,uA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,uA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,uA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,dA.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,dA.jsx)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:(0,dA.jsx)(Hk.path,{animate:o,d:`m9 18 6-6-6-6`,transition:Ule,variants:{normal:{x:0},animate:{x:[0,2,0]}}})})})}),fA.displayName=`ChevronRightIcon`})),pA,mA,hA,Gle,Kle=o((()=>{Gk(),pA=u(p()),qk(),mA=N(),hA={normal:{opacity:1,pathLength:1},animate:{opacity:[0,1],pathLength:[0,1]}},Gle=(0,pA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,pA.useRef)(!1);(0,pA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,pA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,pA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,mA.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,mA.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,mA.jsx)(Hk.path,{animate:o,d:`M18 6 6 18`,variants:hA}),(0,mA.jsx)(Hk.path,{animate:o,d:`m6 6 12 12`,transition:{delay:.2},variants:hA})]})})}),Gle.displayName=`XIcon`})),gA,_A,qle,vA,Jle=o((()=>{Gk(),gA=u(p()),qk(),_A=N(),qle={normal:{opacity:1},animate:e=>({opacity:[0,1],transition:{delay:e*.1,duration:.3}})},vA=(0,gA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,gA.useRef)(!1);(0,gA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,gA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,gA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,_A.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,_A.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,_A.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),[`M12 2v2`,`m19.07 4.93-1.41 1.41`,`M20 12h2`,`m17.66 17.66 1.41 1.41`,`M12 20v2`,`m6.34 17.66-1.41 1.41`,`M2 12h2`,`m4.93 4.93 1.41 1.41`].map((e,t)=>(0,_A.jsx)(Hk.path,{animate:o,custom:t+1,d:e,variants:qle},e))]})})}),vA.displayName=`SunIcon`})),yA,bA,Yle,Xle,xA,Zle=o((()=>{Gk(),yA=u(p()),qk(),bA=N(),Yle={normal:{rotate:0},animate:{rotate:[0,-10,10,-5,5,0]}},Xle={duration:1.2,ease:`easeInOut`},xA=(0,yA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,yA.useRef)(!1);(0,yA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,yA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,yA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,bA.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,bA.jsx)(Hk.svg,{animate:o,fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,transition:Xle,variants:Yle,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:(0,bA.jsx)(`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`})})})}),xA.displayName=`MoonIcon`})),SA,CA,wA,TA,Qle=o((()=>{Gk(),SA=u(p()),qk(),CA=N(),wA={type:`spring`,stiffness:250,damping:25},TA=(0,SA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,SA.useRef)(!1);(0,SA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,SA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,SA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,CA.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,CA.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,CA.jsx)(Hk.path,{animate:o,d:`M8 3H5a2 2 0 0 0-2 2v3`,transition:wA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`-2px`,translateY:`-2px`}}}),(0,CA.jsx)(Hk.path,{animate:o,d:`M21 8V5a2 2 0 0 0-2-2h-3`,transition:wA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`2px`,translateY:`-2px`}}}),(0,CA.jsx)(Hk.path,{animate:o,d:`M3 16v3a2 2 0 0 0 2 2h3`,transition:wA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`-2px`,translateY:`2px`}}}),(0,CA.jsx)(Hk.path,{animate:o,d:`M16 21h3a2 2 0 0 0 2-2v-3`,transition:wA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`2px`,translateY:`2px`}}})]})})}),TA.displayName=`MaximizeIcon`})),EA,DA,OA,kA,$le=o((()=>{Gk(),EA=u(p()),qk(),DA=N(),OA={type:`spring`,stiffness:250,damping:25},kA=(0,EA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,EA.useRef)(!1);(0,EA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:()=>o.start(`animate`),stopAnimation:()=>o.start(`normal`)}));let c=(0,EA.useCallback)(t=>{s.current?e?.(t):o.start(`animate`)},[o,e]),l=(0,EA.useCallback)(e=>{s.current?t?.(e):o.start(`normal`)},[o,t]);return(0,DA.jsx)(`div`,{className:Kk(n),onMouseEnter:c,onMouseLeave:l,...i,children:(0,DA.jsxs)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:[(0,DA.jsx)(Hk.path,{animate:o,d:`M8 3v3a2 2 0 0 1-2 2H3`,transition:OA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`2px`,translateY:`2px`}}}),(0,DA.jsx)(Hk.path,{animate:o,d:`M21 8h-3a2 2 0 0 1-2-2V3`,transition:OA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`-2px`,translateY:`2px`}}}),(0,DA.jsx)(Hk.path,{animate:o,d:`M3 16h3a2 2 0 0 1 2 2v3`,transition:OA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`2px`,translateY:`-2px`}}}),(0,DA.jsx)(Hk.path,{animate:o,d:`M16 21v-3a2 2 0 0 1 2-2h3`,transition:OA,variants:{normal:{translateX:`0%`,translateY:`0%`},animate:{translateX:`-2px`,translateY:`-2px`}}})]})})}),kA.displayName=`MinimizeIcon`})),AA,jA,eue,MA,tue,nue,rue=o((()=>{Gk(),AA=u(p()),qk(),jA=N(),eue=[{cx:9,cy:5},{cx:9,cy:12},{cx:9,cy:19},{cx:15,cy:5},{cx:15,cy:12},{cx:15,cy:19}],MA=3,tue={normal:{opacity:1,scale:1,transition:{duration:.25,ease:`easeOut`}},animate:e=>{let t=e.index%MA,n=Math.floor(e.index/MA);return{opacity:[1,.4,1],scale:[1,.85,1],transition:{delay:t*.15+n*(MA*.15-.2),duration:1,ease:`easeInOut`}}}},nue=(0,AA.forwardRef)(({onMouseEnter:e,onMouseLeave:t,className:n,size:r=28,...i},a)=>{let o=Wk(),s=(0,AA.useRef)(!1),c=(0,AA.useRef)(!1),l=(0,AA.useCallback)(async()=>{c.current||=(c.current=!0,await o.start(`animate`),await o.start(`normal`),!1)},[o]),u=(0,AA.useCallback)(async()=>{c.current&&=(await o.start(`normal`),!1)},[o]);(0,AA.useImperativeHandle)(a,()=>(s.current=!0,{startAnimation:l,stopAnimation:u}));let d=(0,AA.useCallback)(t=>{s.current||l(),e?.(t)},[l,e]),f=(0,AA.useCallback)(e=>{s.current||u(),t?.(e)},[u,t]);return(0,jA.jsx)(`div`,{className:Kk(`inline-flex items-center justify-center`,n),onMouseEnter:d,onMouseLeave:f,...i,children:(0,jA.jsx)(`svg`,{fill:`none`,height:r,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,width:r,xmlns:`http://www.w3.org/2000/svg`,children:eue.map((e,t)=>(0,jA.jsx)(Hk.circle,{animate:o,custom:{index:t},cx:e.cx,cy:e.cy,initial:`normal`,r:`1`,variants:tue},`${e.cx}-${e.cy}`))})})}),nue.displayName=`GripVerticalIcon`})),NA=o((()=>{Ile(),Rle(),zle(),Ble(),Hle(),Wle(),Kle(),Jle(),Zle(),Qle(),$le(),rue()})),iue=o((()=>{}));function aue({onSelect:e}){let[t,n]=(0,PA.useState)(``),[r,i]=(0,PA.useState)([]),[a,o]=(0,PA.useState)(!1),[s,c]=(0,PA.useState)(0),l=(0,PA.useRef)(null),u=(0,PA.useRef)(null);(0,PA.useEffect)(()=>{function e(e){u.current&&!u.current.contains(e.target)&&o(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);function d(e){let t=e.target.value;if(n(t),c(0),clearTimeout(l.current),t.trim().length<2){i([]),o(!1);return}l.current=setTimeout(async()=>{let e=await Tre(t.trim());i(e),o(e.length>0)},200)}function f(e){a&&(e.key===`ArrowDown`?(e.preventDefault(),c(e=>Math.min(e+1,r.length-1))):e.key===`ArrowUp`?(e.preventDefault(),c(e=>Math.max(e-1,0))):e.key===`Enter`&&r[s]?(e.preventDefault(),p(r[s])):e.key===`Escape`&&o(!1))}function p(t){o(!1),n(``),i([]),e(t.path)}function m(e){if(!e||!t.trim())return e;let n=RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)})`,`gi`);return e.replace(n,`<mark>$1</mark>`)}return(0,FA.jsxs)(`div`,{className:`search-wrapper`,ref:u,children:[(0,FA.jsx)(`span`,{className:`search-icon`,children:(0,FA.jsx)(aA,{size:14})}),(0,FA.jsx)(`input`,{type:`text`,className:`search-input`,placeholder:`Search... (Ctrl+K)`,value:t,onChange:d,onKeyDown:f,onFocus:()=>r.length>0&&o(!0)}),a&&(0,FA.jsx)(`div`,{className:`search-results`,children:r.map((e,t)=>(0,FA.jsxs)(`div`,{className:`search-result ${t===s?`selected`:``}`,onClick:()=>p(e),onMouseEnter:()=>c(t),children:[(0,FA.jsx)(`div`,{className:`search-result-title`,children:e.title}),(0,FA.jsx)(`div`,{className:`search-result-path`,children:e.path}),e.snippet&&(0,FA.jsx)(`div`,{className:`search-result-snippet`,dangerouslySetInnerHTML:{__html:m(e.snippet)}})]},e.path))})]})}var PA,FA,oue=o((()=>{PA=u(p()),Uy(),NA(),iue(),FA=N()})),sue=o((()=>{}));function cue({item:e,onNewDoc:t}){let[n,r]=(0,IA.useState)(!0),i=je(),a=Ne();if(e.type===`file`){let n=i.pathname===`/doc/${e.path}`;return(0,LA.jsxs)(Hn,{to:`/doc/${e.path}`,className:`tree-file ${n?`active`:``}`,title:e.title||e.name,children:[(0,LA.jsx)(`span`,{className:`tree-icon`,children:(0,LA.jsx)(Xk,{size:RA})}),(0,LA.jsx)(`span`,{className:`tree-label`,children:e.title||e.name}),(0,LA.jsx)(`span`,{className:`tree-new-doc-btn`,title:`New child document`,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(e.path)},children:(0,LA.jsx)(nA,{size:14})})]})}return(0,LA.jsxs)(`div`,{className:`tree-folder`,children:[(0,LA.jsxs)(`div`,{className:`tree-folder-header ${i.pathname===`/doc/${e.path}`?`active`:``}`,children:[(0,LA.jsx)(`span`,{className:`tree-arrow ${n?`expanded`:``}`,onClick:e=>{e.stopPropagation(),r(!n)},children:(0,LA.jsx)(fA,{size:14})}),(0,LA.jsxs)(`span`,{className:`tree-folder-link`,onClick:()=>{a(`/doc/${e.path}`),n||r(!0)},children:[(0,LA.jsx)(`span`,{className:`tree-icon`,children:(0,LA.jsx)($k,{size:RA})}),(0,LA.jsx)(`span`,{className:`tree-label`,children:e.title||e.name})]}),(0,LA.jsx)(`span`,{className:`tree-new-doc-btn`,title:`New child document`,onClick:n=>{n.stopPropagation(),t(e.path)},children:(0,LA.jsx)(nA,{size:14})})]}),n&&e.children&&(0,LA.jsx)(`div`,{className:`tree-children`,children:e.children.map(e=>(0,LA.jsx)(cue,{item:e,onNewDoc:t},e.path))})]})}function lue(){let[e,t]=(0,IA.useState)(()=>{let e=localStorage.getItem(`doku-theme`);return e?e===`dark`:window.matchMedia(`(prefers-color-scheme: dark)`).matches});return(0,IA.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e?`dark`:`light`),localStorage.setItem(`doku-theme`,e?`dark`:`light`)},[e]),(0,LA.jsx)(`button`,{className:`dark-mode-toggle`,onClick:()=>t(e=>!e),title:e?`Switch to light mode`:`Switch to dark mode`,children:e?(0,LA.jsx)(vA,{size:16}):(0,LA.jsx)(xA,{size:16})})}function uue({tree:e,projectName:t,onNewDoc:n,onSearchSelect:r,sidebarWidth:i,onResize:a}){let o=(0,IA.useRef)(!1);(0,IA.useEffect)(()=>{function e(e){o.current&&a(Math.max(200,e.clientX))}function t(){o.current=!1,document.body.style.cursor=``,document.body.style.userSelect=``}return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}},[a]);function s(e){e.preventDefault(),o.current=!0,document.body.style.cursor=`col-resize`,document.body.style.userSelect=`none`}return(0,LA.jsxs)(`aside`,{className:`sidebar`,style:{width:i,minWidth:200},children:[(0,LA.jsx)(`div`,{className:`sidebar-header`,children:(0,LA.jsx)(`h2`,{className:`sidebar-title`,children:t||`Doku`})}),(0,LA.jsx)(`div`,{className:`sidebar-search`,children:(0,LA.jsx)(aue,{onSelect:r})}),(0,LA.jsxs)(`nav`,{className:`sidebar-tree`,children:[e.length===0&&(0,LA.jsx)(`div`,{className:`sidebar-empty`,children:`No documents yet.`}),e.map(e=>(0,LA.jsx)(cue,{item:e,onNewDoc:n},e.path)),(0,LA.jsx)(`button`,{className:`sidebar-new-root-btn`,onClick:()=>n(``),children:(0,LA.jsx)(nA,{size:14})})]}),(0,LA.jsx)(`div`,{className:`sidebar-bottom`,children:(0,LA.jsx)(lue,{})}),(0,LA.jsx)(`div`,{className:`sidebar-resize-handle`,onMouseDown:s})]})}var IA,LA,RA,due=o((()=>{IA=u(p()),Xn(),oue(),NA(),sue(),LA=N(),RA=16}));function zA(e){this.content=e}var fue=o((()=>{zA.prototype={constructor:zA,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new zA(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new zA(n)},addToStart:function(e,t){return new zA([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new zA(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new zA(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=zA.from(e),e.size?new zA(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=zA.from(e),e.size?new zA(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=zA.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},zA.from=function(e){if(e instanceof zA)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new zA(t)}}));function pue(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=pue(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function mue(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=mue(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}function BA(e,t){return YA.index=e,YA.offset=t,YA}function VA(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!VA(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!VA(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}function hue(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(hue(a.content,t-i-1,n-i-1)))}function gue(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=gue(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function _ue(e,t,n){if(n.openStart>e.depth)throw new ZA(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ZA(`Inconsistent open depths`);return vue(e,t,n,0)}function vue(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=vue(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return GA(a,KA(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return GA(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=xue(n,e);return GA(a,bue(e,i,o,t,r))}}function yue(e,t){if(!t.type.compatibleContent(e.type))throw new ZA(`Cannot join `+t.type.name+` onto `+e.type.name)}function HA(e,t,n){let r=e.node(n);return yue(r,t.node(n)),r}function UA(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function WA(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(UA(e.nodeAfter,r),a++));for(let e=a;e<o;e++)UA(i.child(e),r);t&&t.depth==n&&t.textOffset&&UA(t.nodeBefore,r)}function GA(e,t){return e.type.checkContent(t),e.copy(t)}function bue(e,t,n,r,i){let a=e.depth>i&&HA(e,t,i+1),o=r.depth>i&&HA(n,r,i+1),s=[];return WA(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(yue(a,o),UA(GA(a,bue(e,t,n,r,i+1)),s)):(a&&UA(GA(a,KA(e,t,i+1)),s),WA(t,n,i,s),o&&UA(GA(o,KA(n,r,i+1)),s)),WA(r,null,i,s),new L(s)}function KA(e,t,n){let r=[];return WA(null,e,n,r),e.depth>n&&UA(GA(HA(e,t,n+1),KA(e,t,n+1)),r),WA(t,null,n,r),new L(r)}function xue(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(L.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}function Sue(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Cue(e){let t=[];do t.push(wue(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function wue(e){let t=[];do t.push(Tue(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Tue(e){let t=kue(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=Due(e,t);else break;return t}function Eue(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function Due(e,t){let n=Eue(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Eue(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Oue(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function kue(e){if(e.eat(`(`)){let t=Cue(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}else if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Oue(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Aue(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function jue(e,t){return t-e}function Mue(e,t){let n=[];return r(t),n.sort(jue);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Nue(e){let t=Object.create(null);return n(Mue(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Mue(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new nj(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(jue);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Pue(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Fue(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Iue(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function Lue(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Rue(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new nde(e,r,t[r]);return n}function zue(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}function Bue(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Vue(e){return e.tag!=null}function Hue(e){return e.style!=null}function Uue(e,t,n){return t==null?e&&e.whitespace==`pre`?lj|uj:n&~dj:(t?lj:0)|(t===`full`?uj:0)}function Wue(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&cj.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Gue(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Kue(e){let t={};for(let n in e)t[n]=e[n];return t}function que(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}function Jue(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function qA(e){return e.document||window.document}function Yue(e){let t=hj.get(e);return t===void 0&&hj.set(e,t=Xue(e)),t}function Xue(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function JA(e,t,n,r){if(typeof t==`string`)return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Yue(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=JA(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var L,YA,XA,ZA,R,QA,Zue,Que,$A,ej,$ue,tj,ede,nj,tde,rj,nde,ij,aj,oj,sj,rde,cj,lj,uj,dj,fj,pj,mj,hj,gj=o((()=>{fue(),L=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return pue(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return mue(this,e,t,n)}findIndex(e){if(e==0)return BA(0,e);if(e==this.size)return BA(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?BA(t+1,i):BA(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}},L.empty=new L([],0),YA={index:0,offset:0},XA=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&VA(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}},XA.none=[],ZA=class extends Error{},R=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=gue(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(hue(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(L.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}},R.empty=new R(L.empty,0,0),QA=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return XA.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ej(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=$A.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else $A.set(t,r=new Zue);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Que,i}},Zue=class{constructor(){this.elts=[],this.i=0}},Que=12,$A=new WeakMap,ej=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},$ue=Object.create(null),tj=class e{constructor(e,t,n,r=XA.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||L.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&VA(this.attrs,t||e.defaultAttrs||$ue)&&XA.sameSet(this.marks,n||XA.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return R.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new R(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return _ue(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return QA.resolveCached(this,e)}resolveNoCache(e){return QA.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Sue(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=L.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=XA.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!XA.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=L.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}},tj.prototype.text=void 0,ede=class e extends tj{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Sue(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}},nj=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new tde(t,n);if(r.next==null)return e.empty;let i=Cue(r);r.next&&r.err(`Unexpected trailing text`);let a=Nue(Aue(i));return Pue(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return L.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
16
|
+
`)}},nj.empty=new nj(!0),tde=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}},rj=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Rue(e,n.attrs),this.defaultAttrs=Fue(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==nj.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Iue(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new tj(this,this.computeAttrs(e),L.from(t),XA.setFrom(n))}createChecked(e=null,t,n){return t=L.from(t),this.checkContent(t),new tj(this,this.computeAttrs(e),t,XA.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=L.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(L.empty,!0);return i?new tj(this,e,t.append(i),XA.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Lue(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:XA.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}},nde=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?zue(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},ij=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Rue(e,r.attrs),this.excluded=null;let i=Fue(this.attrs);this.instance=i?new XA(this,i):null}create(e=null){return!e&&this.instance?this.instance:new XA(this,Iue(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Lue(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},aj=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=zA.from(e.nodes),t.marks=zA.from(e.marks||{}),this.nodes=rj.compile(this.spec.nodes,this),this.marks=ij.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=nj.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Bue(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Bue(this,n.split(` `))}this.nodeFromJSON=e=>tj.fromJSON(this,e),this.markFromJSON=e=>XA.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof rj))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ede(n,n.defaultAttrs,e,XA.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}},oj=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Vue(e))this.tags.push(e);else if(Hue(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new pj(this,t,!1);return n.addAll(e,XA.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new pj(this,t,!0);return n.addAll(e,XA.none,t.from,t.to),R.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Gue(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Kue(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Kue(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},sj={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},rde={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},cj={ol:!0,ul:!0},lj=1,uj=2,dj=4,fj=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=XA.none,this.match=i||(a&dj?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(L.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&lj)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=L.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(L.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!sj.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},pj=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Uue(null,t.preserveWhitespace,0)|(n?dj:0);i=r?new fj(r.type,r.attrs,XA.none,!0,t.topMatch||r.type.contentMatch,a):n?new fj(null,null,XA.none,!0,null,a):new fj(e.schema.topNodeType,null,XA.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&uj?`full`:this.localPreserveWS||(r.options&lj)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
17
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;cj.hasOwnProperty(a)&&this.parser.normalizeLists&&Wue(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:rde.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(sj.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
18
|
+
`),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=XA.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):que(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Uue(e,i,a.options);a.options&dj&&a.content.length==0&&(o|=dj);let s=XA.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):que(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new fj(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=lj);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}},mj=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=qA(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=JA(qA(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&JA(qA(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return JA(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Jue(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Jue(e.marks)}},hj=new WeakMap}));function ide(e,t){return e+t*Aj}function ade(e){return e&kj}function ode(e){return(e-(e&kj))/Aj}function _j(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(_j(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return L.fromArray(r)}function vj(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function sde(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Hj(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new Vj(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function cde(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof ij){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Hj(t.from,t.to,t.style)))}function yj(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Gj(s,l,R.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Hj(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new R(L.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Gj(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(L.empty,!0);e.replace(s,s,new R(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function lde(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function bj(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!lde(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function ude(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=L.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=L.from(r.node(e).copy(u)),d++):c--;let f=L.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=L.from(i.node(e).copy(f)),p++):l++;e.step(new Kj(c,l,o,s,new R(u.append(f),d,p),u.size-d,!0))}function dde(e,t,n=null,r=e){let i=pde(e,t),a=i&&mde(r,t);return a?i.map(fde).concat({type:t,attrs:n}).concat(a.map(fde)):null}function fde(e){return{type:e,attrs:null}}function pde(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function mde(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function hde(e,t,n){let r=L.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=L.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Kj(i,a,i,a,new R(r,0,0),n.length,!0))}function gde(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&yde(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&vde(e,t,n,a),yj(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Kj(c,l,c+1,l-1,new R(L.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&_de(e,t,n,a),!1}})}function _de(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function vde(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
19
|
+
`))}})}function yde(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function bde(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Kj(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new R(L.from(o),0,0),1,!0))}function xj(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function xde(e,t,n=1,r){let i=e.doc.resolve(t),a=L.empty,o=L.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=L.from(i.node(e).copy(a));let t=r&&r[s];o=L.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Gj(t,t,new R(a.append(o),n,n),!0))}function Sj(e,t){let n=e.resolve(t),r=n.index();return Cde(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Sde(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Cde(e,t){return!!(e&&t&&!e.isLeaf&&Sde(e,t))}function Cj(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Cde(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function wde(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);vde(e,r.node(),r.before(),s)}o.inlineContent&&yj(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Gj(l,c.map(t+n,-1),R.empty,!0)),r===!0){let t=e.doc.resolve(l);_de(e,t.node(),t.before(),e.steps.length)}return e}function Tde(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Ede(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+(n>0?1:0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function wj(e,t,n=t,r=R.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Dde(i,a,r)?new Gj(t,n,r):new Ide(i,a,r).fit()}function Dde(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}function Tj(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Tj(e.firstChild.content,t-1,n)))}function Ej(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ej(e.lastChild.content,t-1,n)))}function Dj(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Ode(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Ode(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(L.empty,!0)))),e.copy(r)}function Oj(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!kde(n,a.content,o)?s:null}function kde(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Ade(e){return e.spec.defining||e.spec.definingForContent}function jde(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Dde(i,a,r))return e.step(new Gj(t,n,r));let o=Fde(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Ade(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new R(Mde(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function Mde(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Mde(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(L.empty,!0))}return e}function Nde(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Tde(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new R(L.from(r),0,0))}function Pde(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Fde(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Fde(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,Wj,Gj,Kj,Ide,qj,Jj,Yj,Xj,Zj=o((()=>{gj(),kj=65535,Aj=2**16,jj=1,Mj=2,Nj=4,Pj=8,Fj=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Pj)>0}get deletedBefore(){return(this.delInfo&(jj|Nj))>0}get deletedAfter(){return(this.delInfo&(Mj|Nj))>0}get deletedAcross(){return(this.delInfo&Nj)>0}},Ij=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=ade(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+ode(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:ide(o/3,e-s),f=e==s?Mj:e==u?jj:Nj;return(t<0?e!=s:e!=u)&&(f|=Pj),new Fj(a,f,d)}r+=l-c}return n?e+r:new Fj(e+r,0,null)}touches(e,t){let n=0,r=ade(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}},Ij.empty=new Ij([]),Lj=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Fj(e,r,null)}},Rj=Object.create(null),zj=class{getMap(){return Ij.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Rj[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Rj)throw RangeError(`Duplicate use of step JSON ID `+e);return Rj[e]=t,t.prototype.jsonID=e,t}},Bj=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof ZA)return e.fail(t.message);throw t}}},Vj=class e extends zj{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new R(_j(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Bj.fromReplace(e,this.from,this.to,i)}invert(){return new Hj(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},zj.jsonID(`addMark`,Vj),Hj=class e extends zj{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new R(_j(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Bj.fromReplace(e,this.from,this.to,n)}invert(){return new Vj(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}},zj.jsonID(`removeMark`,Hj),Uj=class e extends zj{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Bj.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Bj.fromReplace(e,this.pos,this.pos+1,new R(L.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Wj(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},zj.jsonID(`addNodeMark`,Uj),Wj=class e extends zj{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Bj.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Bj.fromReplace(e,this.pos,this.pos+1,new R(L.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Uj(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}},zj.jsonID(`removeNodeMark`,Wj),Gj=class e extends zj{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&vj(e,this.from,this.to)?Bj.fail(`Structure replace would overwrite content`):Bj.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ij([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?R.empty:new R(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?R.empty:new R(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,R.fromJSON(t,n.slice),!!n.structure)}},Gj.MAP_BIAS=1,zj.jsonID(`replace`,Gj),Kj=class e extends zj{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(vj(e,this.from,this.gapFrom)||vj(e,this.gapTo,this.to)))return Bj.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Bj.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Bj.fromReplace(e,this.from,this.to,n):Bj.fail(`Content does not fit in gap`)}getMap(){return new Ij([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,R.fromJSON(t,n.slice),n.insert,!!n.structure)}},zj.jsonID(`replaceAround`,Kj),Ide=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=L.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=L.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new R(i,a,o);return e>-1?new Kj(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Gj(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Dj(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(L.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Dj(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new R(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Dj(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new R(Tj(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new R(Tj(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Ode(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Ej(this.placed,t,L.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?R.empty:new R(Tj(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new R(Tj(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Oj(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Oj(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Oj(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ej(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Ej(this.placed,this.depth,L.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(L.empty,!0);e.childCount&&(this.placed=Ej(this.placed,this.frontier.length,e))}},qj=class e extends zj{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Bj.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Bj.fromReplace(e,this.pos,this.pos+1,new R(L.from(r),0,t.isLeaf?0:1))}getMap(){return Ij.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}},zj.jsonID(`attr`,qj),Jj=class e extends zj{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Bj.ok(n)}getMap(){return Ij.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}},zj.jsonID(`docAttr`,Jj),Yj=class extends Error{},Yj=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Yj.prototype=Object.create(Error.prototype),Yj.prototype.constructor=Yj,Yj.prototype.name=`TransformError`,Xj=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Lj}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Yj(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=R.empty){let r=wj(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new R(L.from(n),0,0))}delete(e,t){return this.replace(e,t,R.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return jde(this,e,t,n),this}replaceRangeWith(e,t,n){return Nde(this,e,t,n),this}deleteRange(e,t){return Pde(this,e,t),this}lift(e,t){return ude(this,e,t),this}join(e,t=1){return wde(this,e,t),this}wrap(e,t){return hde(this,e,t),this}setBlockType(e,t=e,n,r=null){return gde(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return bde(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new qj(e,t,n)),this}setDocAttribute(e,t){return this.step(new Jj(e,t)),this}addNodeMark(e,t){return this.step(new Uj(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof XA)t.isInSet(n.marks)&&this.step(new Wj(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Wj(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return xde(this,e,t,n),this}addMark(e,t,n){return sde(this,e,t,n),this}removeMark(e,t,n){return cde(this,e,t,n),this}clearIncompatible(e,t,n){return yj(this,e,t,n),this}}}));function Lde(e){!nM&&!e.parent.inlineContent&&(nM=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}function Qj(e,t,n,r,i,a=!1){if(t.inlineContent)return z.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Qj(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&iM.isSelectable(r))return iM.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Rde(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Gj||i instanceof Kj))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(eM.near(e.doc.resolve(o),n))}function zde(e,t){return!t||!e?e:e.bind(t)}function Bde(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Bde(i,t,{})),n[r]=i}return n}function Vde(e){return e in fM?e+`$`+ ++fM[e]:(fM[e]=0,e+`$`)}var $j,eM,tM,nM,z,rM,iM,Hde,aM,Ude,oM,sM,cM,Wde,lM,Gde,uM,Kde,dM,fM,pM,mM=o((()=>{gj(),Zj(),$j=Object.create(null),eM=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new tM(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=R.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?R.empty:t),o==0&&Rde(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Rde(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new z(e):Qj(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Qj(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Qj(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new aM(e.node(0))}static atStart(e){return Qj(e,e,0,0,1)||new aM(e)}static atEnd(e){return Qj(e,e,e.content.size,e.childCount,-1)||new aM(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=$j[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in $j)throw RangeError(`Duplicate use of selection JSON ID `+e);return $j[e]=t,t.prototype.jsonID=e,t}getBookmark(){return z.between(this.$anchor,this.$head).getBookmark()}},eM.prototype.visible=!0,tM=class{constructor(e,t){this.$from=e,this.$to=t}},nM=!1,z=class e extends eM{constructor(e,t=e){Lde(e),Lde(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return eM.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=R.empty){if(super.replace(e,t),t==R.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new rM(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=eM.findFrom(n,r,!0)||eM.findFrom(n,-r,!0);if(e)n=e.$head;else return eM.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(eM.findFrom(t,-r,!0)||eM.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}},eM.jsonID(`text`,z),rM=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return z.between(e.resolve(this.anchor),e.resolve(this.head))}},iM=class e extends eM{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?eM.near(a):new e(a)}content(){return new R(L.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Hde(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}},iM.prototype.visible=!1,eM.jsonID(`node`,iM),Hde=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new rM(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&iM.isSelectable(n)?new iM(t):eM.near(t)}},aM=class e extends eM{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=R.empty){if(t==R.empty){e.delete(0,e.doc.content.size);let t=eM.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Ude}},eM.jsonID(`all`,aM),Ude={map(){return this},resolve(e){return new aM(e)}},oM=1,sM=2,cM=4,Wde=class extends Xj{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|oM)&~sM,this.storedMarks=null,this}get selectionSet(){return(this.updated&oM)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=sM,this}ensureMarks(e){return XA.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&sM)>0}addStep(e,t){super.addStep(e,t),this.updated&=~sM,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||XA.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(eM.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=cM,this}get scrolledIntoView(){return(this.updated&cM)>0}},lM=class{constructor(e,t,n){this.name=e,this.init=zde(t.init,n),this.apply=zde(t.apply,n)}},Gde=[new lM(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new lM(`selection`,{init(e,t){return e.selection||eM.atStart(t.doc)},apply(e){return e.selection}}),new lM(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new lM(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],uM=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Gde.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new lM(e.key,e.spec.state,e))})}},Kde=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Wde(this)}static create(t){let n=new uM(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new uM(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new uM(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=tj.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=eM.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}},dM=class{constructor(e){this.spec=e,this.props={},e.props&&Bde(e.props,this,this.props),this.key=e.key?e.key.key:Vde(`plugin`)}getState(e){return e[this.key]}},fM=Object.create(null),pM=class{constructor(e=`key`){this.key=Vde(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}}));function qde(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:hM(e))){let n=e.parentNode;if(!n||n.nodeType!=1||gM(e)||yN.test(e.nodeName)||e.contentEditable==`false`)return!1;t=pN(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?hM(e):0}else return!1}}function hM(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Jde(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=hM(e)}else if(e.parentNode&&!gM(e))t=pN(e),e=e.parentNode;else return null}}function Yde(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!gM(e))t=pN(e)+1,e=e.parentNode;else return null}}function Xde(e,t,n){for(let r=t==0,i=t==hM(e);r||i;){if(e==n)return!0;let t=pN(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==hM(e)}}function gM(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}function _M(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Zde(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Qde(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(hM(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(hM(r.startContainer),r.startOffset)}}}function $de(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function vM(e,t){return typeof e==`number`?e:e[t]}function efe(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function tfe(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=mN(o);continue}let e=o,n=e==a.body,s=n?$de(a):efe(e),c=0,l=0;if(t.top<s.top+vM(r,`top`)?l=-(s.top-t.top+vM(i,`top`)):t.bottom>s.bottom-vM(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+vM(i,`top`)-s.top:t.bottom-s.bottom+vM(i,`bottom`)),t.left<s.left+vM(r,`left`)?c=-(s.left-t.left+vM(i,`left`)):t.right>s.right-vM(r,`right`)&&(c=t.right-s.right+vM(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:mN(o)}}function nfe(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:rfe(e.dom)}}function rfe(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=mN(r));return t}function ife({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;afe(n,r==0?0:r-t)}function afe(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}function ofe(e){if(e.setActive)return e.setActive();if(BN)return e.focus(BN);let t=rfe(e);e.focus(BN==null?{get preventScroll(){return BN={preventScroll:!0},!0}}:void 0),BN||(BN=!1,afe(t,0))}function sfe(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=gN(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?cfe(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:sfe(n,i)}function cfe(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=bM(r,1);if(n.top!=n.bottom&&yM(t,n)){i={node:e,offset:a+(t.left>=(n.left+n.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function yM(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function lfe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function ufe(e,t,n){let{node:r,offset:i}=sfe(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function dfe(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function ffe(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(yM(t,i))return ffe(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function pfe(e,t){let n=e.dom.ownerDocument,r,i=0,a=Qde(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!yM(t,n)||(o=ffe(e.dom,t,n),!o))return null}if(NN)for(let e=o;r&&e;e=mN(e))e.draggable&&(r=void 0);if(o=lfe(o,t),r){if(kN&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;RN&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=dfe(e,r,i,t))}s??=ufe(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function mfe(e){return e.top<e.bottom||e.left<e.right}function bM(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(mfe(e))return e}return Array.prototype.find.call(n,mfe)||e.getBoundingClientRect()}function hfe(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=RN||kN;if(r.nodeType==3)if(o&&(VN.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=bM(gN(r,i,i),n);if(kN&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=bM(gN(r,i-1,i-1),-1);if(t.top==e.top){let n=bM(gN(r,i,i+1),-1);if(n.top!=e.top)return xM(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,xM(bM(gN(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==hM(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return SM(e.getBoundingClientRect(),!1)}if(a==null&&i<hM(r)){let e=r.childNodes[i];if(e.nodeType==1)return SM(e.getBoundingClientRect(),!0)}return SM(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==hM(r))){let e=r.childNodes[i-1],t=e.nodeType==3?gN(e,hM(e)-(o?0:1)):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return xM(bM(t,1),!1)}if(a==null&&i<hM(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?gN(e,0,o?0:1):e.nodeType==1?e:null:null;if(t)return xM(bM(t,-1),!0)}return xM(bM(r.nodeType==3?gN(r):r,-n),n>=0)}function xM(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function SM(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function gfe(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function _fe(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return gfe(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=hfe(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=gN(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}function vfe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!HN.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:gfe(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}function yfe(e,t,n){return UN==t&&WN==n?GN:(UN=t,WN=n,GN=n==`up`||n==`down`?_fe(e,t,n):vfe(e,t,n))}function bfe(e,t,n,r,i){wfe(r,t,e);let a=new eP(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}function xfe(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Tfe(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof $N){let t=r?r.previousSibling:e.lastChild;xfe(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Tfe(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}function CM(e,t,n){if(e.length==0)return aP;let r=n?aP[0]:new iP,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new iP(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new iP(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function Sfe(e,t,n,r){if(n==aP&&r==aP)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=aP[0],i=t)}Cfe(i,o||aP[0],a)}return i}function Cfe(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function wfe(e,t,n){return Sfe(e,e,aP,CM(t,n,e.nodeType!=1))}function wM(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Tfe(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}function Efe(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof $N)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Dfe(e,t){return e.type.side-t.type.side}function Ofe(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(Dfe);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function kfe(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Afe(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function TM(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function EM(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(bN(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&iM.isSelectable(e)&&i.parent&&!(e.isInline&&Xde(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new iM(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=kM(e,u,s,n)}return l}function jfe(e){return e.editable?e.hasFocus():zfe(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function DM(e,t=!1){let n=e.state.selection;if(Ife(e,n),jfe(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&jN){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&vN(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Ffe(e);else{let{anchor:r,head:i}=n,a,o;sP&&!(n instanceof z)&&(n.$from.parent.inlineContent||(a=Mfe(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Mfe(e,n.to))),e.docView.setSelection(r,i,e,t),sP&&(a&&Nfe(a),o&&Nfe(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Pfe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}function Mfe(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(NN&&i&&i.contentEditable==`false`)return OM(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return OM(i);if(a)return OM(a)}}function OM(e){return e.contentEditable=`true`,NN&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Nfe(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Pfe(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!jfe(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Ffe(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,pN(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&DN&&ON<=11&&(n.disabled=!0,n.disabled=!1)}function Ife(e,t){if(t instanceof iM){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Lfe(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Lfe(e)}function Lfe(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function kM(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||z.between(t,n,r)}function Rfe(e){return e.editable&&!e.hasFocus()?!1:zfe(e)}function zfe(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Bfe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return vN(t.node,t.offset,n.anchorNode,n.anchorOffset)}function AM(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&eM.findFrom(a,t)}function jM(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Vfe(e,t,n){let r=e.state.selection;if(r instanceof z){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return jM(e,new z(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=AM(e.state,t);return n&&n instanceof iM?jM(e,n):!1}else if(!(FN&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?iM.isSelectable(i)?jM(e,new iM(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):RN?jM(e,new z(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof iM&&r.node.isInline)return jM(e,new z(t>0?r.$to:r.$from));else{let n=AM(e.state,t);return n?jM(e,n):!1}}function MM(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function NM(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function PM(e,t){return t<0?Hfe(e):Ufe(e)}function Hfe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(kN&&n.nodeType==1&&r<MM(n)&&NM(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(NM(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Wfe(n))break;else{let t=n.previousSibling;for(;t&&NM(t,-1);)i=n.parentNode,a=pN(t),t=t.previousSibling;if(t)n=t,r=MM(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?FM(e,n,r):i&&FM(e,i,a)}function Ufe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=MM(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(NM(e,1))a=n,o=++r;else break}else if(Wfe(n))break;else{let t=n.nextSibling;for(;t&&NM(t,1);)a=t.parentNode,o=pN(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=MM(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&FM(e,a,o)}function Wfe(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Gfe(e,t){for(;e&&t==e.childNodes.length&&!gM(e);)t=pN(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=0}}function Kfe(e,t){for(;e&&!t&&!gM(e);)t=pN(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function FM(e,t,n){if(t.nodeType!=3){let e,r;(r=Gfe(t,n))?(t=r,n=0):(e=Kfe(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(bN(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&DM(e)},50)}function qfe(e,t){let n=e.state.doc.resolve(t);if(!(jN||IN)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Jfe(e,t,n){let r=e.state.selection;if(r instanceof z&&!r.empty||n.indexOf(`s`)>-1||FN&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=AM(e.state,t);if(n&&n instanceof iM)return jM(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof aM?eM.near(n,t):eM.findFrom(n,t);return o?jM(e,o):!1}return!1}function Yfe(e,t){if(!(e.state.selection instanceof z))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Xfe(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Zfe(e){if(!NN||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Xfe(e,n,`true`),setTimeout(()=>Xfe(e,n,`false`),20)}return!1}function Qfe(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function $fe(e,t){let n=t.keyCode,r=Qfe(t);if(n==8||FN&&n==72&&r==`c`)return Yfe(e,-1)||PM(e,-1);if(n==46&&!t.shiftKey||FN&&n==68&&r==`c`)return Yfe(e,1)||PM(e,1);if(n==13||n==27)return!0;if(n==37||FN&&n==66&&r==`c`){let t=n==37?qfe(e,e.state.selection.from)==`ltr`?-1:1:-1;return Vfe(e,t,r)||PM(e,t)}else if(n==39||FN&&n==70&&r==`c`){let t=n==39?qfe(e,e.state.selection.from)==`ltr`?1:-1:1;return Vfe(e,t,r)||PM(e,t)}else if(n==38||FN&&n==80&&r==`c`)return Jfe(e,-1,r)||PM(e,-1);else if(n==40||FN&&n==78&&r==`c`)return Zfe(e)||Jfe(e,1,r)||PM(e,1);else if(r==(FN?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function IM(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||mj.fromSchema(e.state.schema),s=ope(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=lP[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
20
|
+
|
|
21
|
+
`),slice:t}}function epe(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new R(L.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
22
|
+
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=mj.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=cpe(n),RN&&lpe(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||oj.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!cP.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=upe(ape(s,+u[1],+u[2]),u[4]);else if(s=R.maxOpen(tpe(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=ape(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}function tpe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&rpe(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=ipe(a[a.length-1],i.length));let n=npe(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return L.from(a)}return e}function npe(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,L.from(e));return e}function rpe(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=rpe(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(L.from(npe(n,e,i+1))))}}function ipe(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,ipe(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(L.empty,!0);return e.copy(n.append(r))}function LM(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=LM(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(L.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function ape(e,t,n){return t<e.openStart&&(e=new R(LM(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new R(LM(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}function ope(){return uP||=document.implementation.createHTMLDocument(`title`)}function spe(e){let t=window.trustedTypes;return t?(dP||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),dP.createHTML(e)):e}function cpe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=ope().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&lP[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=spe(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function lpe(e){let t=e.querySelectorAll(jN?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function upe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=L.from(t.create(r[e+1],i)),a++,o++}return new R(i,a,o)}function dpe(e){for(let t in fP){let n=fP[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{ppe(e,t)&&!BM(e,t)&&(e.editable||!(t.type in pP))&&n(e,t)},mP[t]?{passive:!0}:void 0)}NN&&e.dom.addEventListener(`input`,()=>null),zM(e)}function RM(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function fpe(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function zM(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>BM(e,t))})}function BM(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function ppe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function mpe(e,t){!BM(e,t)&&fP[t.type]&&(e.editable||!(t.type in pP))&&fP[t.type](e,t)}function VM(e){return{left:e.clientX,top:e.clientY}}function hpe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function HM(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function UM(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function gpe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&iM.isSelectable(r)?(UM(e,new iM(n),`pointer`),!0):!1}function _pe(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof iM&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(iM.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(UM(e,iM.create(e.state.doc,i),`pointer`),!0)}function vpe(e,t,n,r,i){return HM(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?_pe(e,n):gpe(e,n))}function ype(e,t,n,r){return HM(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function bpe(e,t,n,r){return HM(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||xpe(e,n,r)}function xpe(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(UM(e,z.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)UM(e,z.create(r,a+1,a+1+n.content.size),`pointer`);else if(iM.isSelectable(n))UM(e,iM.create(r,a),`pointer`);else continue;return!0}}function WM(e){return GM(e)}function Spe(e,t){return e.composing?!0:NN&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}function Cpe(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable==`false`}function wpe(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>GM(e),t))}function Tpe(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Dpe());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Epe(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Jde(t.focusNode,t.focusOffset),r=Yde(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function Dpe(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function GM(e,t=!1){if(!(LN&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Tpe(e),t||e.docView&&e.docView.dirty){let n=EM(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Ope(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}function kpe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Ape(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?KM(e,r.value,null,i,t):KM(e,r.textContent,r.innerHTML,i,t)},50)}function KM(e,t,n,r,i){let a=epe(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||R.empty)))return!0;if(!a)return!1;let o=kpe(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function qM(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}function JM(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[xP]:!n}function jpe(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(VM(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=epe(e,qM(t.dataTransfer),yP?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&JM(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||R.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Ede(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&iM.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new iM(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(kM(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}function YM(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}function Mpe(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==kP?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=$M(Npe(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new OP(t.sort(eN),s)}function XM(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new TP(i.from+t,i.to+t,i.type))}return n}function Npe(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function ZM(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function QM(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function $M(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=ZM(e,t,o+n);if(s){a=!0;let e=$M(s,t,n+o+1,r);e!=kP&&i.push(o,o+t.nodeSize,e)}});let o=XM(a?QM(e):e,-n).sort(eN);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new OP(o,i):kP}function eN(e,t){return e.from-t.from||e.to-t.to}function tN(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),nN(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),nN(t,i,r.copy(a.from,r.to)));break}}}return t}function nN(e,t,n){for(;t<e.length&&eN(n,e[t])>0;)t++;e.splice(t,0,n)}function rN(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=kP&&t.push(r)}),e.cursorWrapper&&t.push(OP.create(e.state.doc,[e.cursorWrapper.deco])),AP.from(t)}function Ppe(e){if(!FP.has(e)&&(FP.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=kN,IP)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),IP=!0}}function iN(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return vN(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Fpe(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return iN(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?iN(e,n):null}function Ipe(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Lpe(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Rpe(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],bN(c)||l.push({node:c.focusNode,offset:c.focusOffset})),jN&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||oj.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:zpe,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function zpe(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(NN&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||NN&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}function Bpe(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=EM(e,t);if(n&&!e.state.selection.eq(n)){if(jN&&LN&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,_M(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Rpe(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Upe(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(PN&&e.input.lastIOSEnter>Date.now()-225||LN)&&i.some(e=>e.nodeType==1&&!LP.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,_M(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof z&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=aN(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof z&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),DN&&ON<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((PN&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,_M(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Hpe(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,_M(8,`Backspace`)))){LN&&jN&&e.domObserver.suppressSelectionUpdates();return}jN&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),LN&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,_M(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=aN(e,n.doc,l.sel);t&&!(jN&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||DN&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){DN&&ON<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>DM(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=Vpe(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-(g.textOffset?0:1)){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function aN(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:kM(e,t.resolve(n.anchor),t.resolve(n.head))}function Vpe(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(L.from(l).eq(e))return{mark:s,type:o}}function Hpe(e,t,n,r,i){if(n-t<=i.pos-r.pos||oN(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(oN(a,!0,!0));return!o.parent.isTextblock||o.pos>n||oN(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function oN(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Upe(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&sN(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&sN(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function sN(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}function cN(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[TP.node(0,e.state.doc.content.size,t)]}function lN(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:TP.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function uN(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Wpe(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function dN(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Gpe(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function fN(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var pN,mN,hN,gN,_N,vN,yN,bN,xN,SN,CN,wN,TN,EN,DN,ON,kN,AN,jN,MN,NN,PN,FN,IN,LN,RN,zN,BN,VN,HN,UN,WN,GN,KN,qN,JN,YN,XN,ZN,QN,$N,eP,tP,nP,rP,iP,aP,oP,sP,cP,lP,uP,dP,fP,pP,mP,hP,gP,_P,vP,yP,bP,xP,SP,CP,wP,TP,EP,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP,zP=o((()=>{mM(),gj(),Zj(),pN=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},mN=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},hN=null,gN=function(e,t,n){let r=hN||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},_N=function(){hN=null},vN=function(e,t,n,r){return n&&(qde(e,t,n,r,-1)||qde(e,t,n,r,1))},yN=/^(img|br|input|textarea|hr)$/i,bN=function(e){return e.focusNode&&vN(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)},xN=typeof navigator<`u`?navigator:null,SN=typeof document<`u`?document:null,CN=xN&&xN.userAgent||``,wN=/Edge\/(\d+)/.exec(CN),TN=/MSIE \d/.exec(CN),EN=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(CN),DN=!!(TN||EN||wN),ON=TN?document.documentMode:EN?+EN[1]:wN?+wN[1]:0,kN=!DN&&/gecko\/(\d+)/i.test(CN),kN&&+(/Firefox\/(\d+)/.exec(CN)||[0,0])[1],AN=!DN&&/Chrome\/(\d+)/.exec(CN),jN=!!AN,MN=AN?+AN[1]:0,NN=!DN&&!!xN&&/Apple Computer/.test(xN.vendor),PN=NN&&(/Mobile\/\w+/.test(CN)||!!xN&&xN.maxTouchPoints>2),FN=PN||(xN?/Mac/.test(xN.platform):!1),IN=xN?/Win/.test(xN.platform):!1,LN=/Android \d/.test(CN),RN=!!SN&&`webkitFontSmoothing`in SN.documentElement.style,zN=RN?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,BN=null,VN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,HN=/[\u0590-\u08ac]/,UN=null,WN=null,GN=!1,KN=0,qN=1,JN=2,YN=3,XN=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=KN,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>pN(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof nP){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof ZN&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?pN(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?pN(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=pN(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=pN(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((kN||NN)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
23
|
+
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:pN(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(kN&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&NN)&&vN(o.node,o.offset,l.anchorNode,l.anchorOffset)&&vN(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&kN)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?JN:qN,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=YN:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?JN:YN}n=a}this.dirty=JN}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?JN:qN;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},ZN=class extends XN{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==KN&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},QN=class extends XN{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},$N=class e extends XN{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=mj.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&YN||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=YN&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=KN){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=KN}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=TM(a,n,o,r)),t>0&&(a=TM(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},eP=class e extends XN{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=mj.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=wfe(u,r,n),l?c=new rP(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new tP(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>L.empty)}return e}matchesNode(e,t,n){return this.dirty==KN&&e.eq(this.node)&&wM(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new oP(this,a&&a.node,e);Ofe(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?XA.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==JN)&&(a&&this.protectLocalComposition(e,a),xfe(this.contentDOM,this.children,e),PN&&kfe(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof z)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Afe(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new QN(this,i,t,r);e.input.compositionNodes.push(a),this.children=TM(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==YN||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=KN}updateOuterDeco(e){if(wM(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Sfe(this.dom,this.nodeDOM,CM(this.outerDeco,this.node,t),CM(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}},tP=class e extends eP{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==YN||this.dirty!=KN&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=KN||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=KN,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=YN)}get domAtom(){return!1}isText(e){return this.node.text==e}},nP=class extends XN{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==KN&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},rP=class extends eP{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==YN)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}},iP=function(e){e&&(this.nodeName=e)},iP.prototype=Object.create(null),aP=[new iP],oP=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Efe(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=KN,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=$N.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==YN&&a.dom==a.contentDOM&&(a.dirty=JN),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof eP){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=YN&&wM(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=JN,u.updateChildren(r,a+1),u.dirty=KN),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!wM(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=eP.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=eP.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new ZN(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof $N;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof tP)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((NN||jN)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new nP(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}},sP=NN||jN&&MN<63,cP=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i,lP={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},uP=null,dP=null,fP={},pP={},mP={touchstart:!0,touchmove:!0},hP=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}},pP.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Spe(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(LN&&jN&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),PN&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,_M(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||$fe(e,n)?n.preventDefault():RM(e,`key`)},pP.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},pP.keypress=(e,t)=>{let n=t;if(Spe(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||FN&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof z)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}},gP=FN?`metaKey`:`ctrlKey`,fP.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=WM(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&hpe(n,e.input.lastClick)&&!n[gP]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(VM(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new _P(e,o,n,!!r)):(a==`doubleClick`?ype:bpe)(e,o.pos,o.inside,n)?n.preventDefault():RM(e,`pointer`))},_P=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[gP],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof iM&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&kN&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),RM(e,`pointer`)}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>DM(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(VM(e))),this.updateAllowDefault(e),this.allowDefault||!t?RM(this.view,`pointer`):vpe(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||NN&&this.mightDrag&&!this.mightDrag.node.isAtom||jN&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(UM(this.view,eM.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):RM(this.view,`pointer`)}move(e){this.updateAllowDefault(e),RM(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}},fP.touchstart=e=>{e.input.lastTouch=Date.now(),WM(e),RM(e,`pointer`)},fP.touchmove=e=>{e.input.lastTouch=Date.now(),RM(e,`pointer`)},fP.contextmenu=e=>WM(e),vP=LN?5e3:-1,pP.compositionstart=pP.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof z&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||jN&&IN&&Cpe(e)))e.markCursor=e.state.storedMarks||n.marks(),GM(e,!0),e.markCursor=null;else if(GM(e,!t.selection.empty),kN&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}wpe(e,vP)},pP.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,wpe(e,20))},yP=DN&&ON<15||PN&&zN<604,fP.copy=pP.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=yP?null:n.clipboardData,{dom:o,text:s}=IM(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Ope(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))},pP.paste=(e,t)=>{let n=t;if(e.composing&&!LN)return;let r=yP?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&KM(e,qM(r),r.getData(`text/html`),i,n)?n.preventDefault():Ape(e,n)},bP=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},xP=FN?`altKey`:`ctrlKey`,fP.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(VM(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof iM?i.to-1:i.to))){if(r&&r.mightDrag)o=iM.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=iM.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=IM(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!jN||MN>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(yP?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,yP||n.dataTransfer.setData(`text/plain`,c),e.dragging=new bP(l,JM(e,n),o)},fP.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},pP.dragover=pP.dragenter=(e,t)=>t.preventDefault(),pP.drop=(e,t)=>{try{jpe(e,t,e.dragging)}finally{e.dragging=null}},fP.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&DM(e)},20))},fP.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},fP.beforeinput=(e,t)=>{if(jN&&LN&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,_M(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in pP)fP[e]=pP[e];SP=class e{constructor(e,t){this.toDOM=e,this.spec=t||DP,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new TP(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&YM(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},CP=class e{constructor(e,t){this.attrs=e,this.spec=t||DP}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new TP(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&YM(this.attrs,t.attrs)&&YM(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},wP=class e{constructor(e,t){this.attrs=e,this.spec=t||DP}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new TP(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&YM(this.attrs,t.attrs)&&YM(this.spec,t.spec)}destroy(){}},TP=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new SP(n,r))}static inline(t,n,r,i){return new e(t,n,new CP(r,i))}static node(t,n,r,i){return new e(t,n,new wP(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof CP}get widget(){return this.type instanceof SP}},EP=[],DP={},OP=class e{constructor(e,t){this.local=e.length?e:EP,this.children=t.length?t:EP}static create(e,t){return t.length?$M(t,e,0,DP):kP}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==kP||e.maps.length==0?this:this.mapInner(e,t,0,0,n||DP)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?Mpe(this.children,o||[],t,n,r,i,a):o?new e(o.sort(eN),EP):kP}add(t,n){return n.length?this==kP?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=ZM(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,$M(s,e,o+1,DP)),a+=3}});let o=XM(a?QM(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(eN):this.local,i||this.children)}remove(e){return e.length==0||this==kP?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==kP?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):kP}forChild(t,n){if(this==kP)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof CP){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(eN),EP);return r?new AP([t,r]):t}return r||kP}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return tN(this.localsInner(e))}localsInner(e){if(this==kP)return EP;if(e.inlineContent||!this.local.some(CP.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof CP||t.push(this.local[e]);return t}forEachSet(e){e(this)}},OP.empty=new OP([],[]),OP.removeOverlap=tN,kP=OP.empty,AP=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,DP));return e.from(r)}forChild(t,n){if(n.isLeaf)return OP.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=kP&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?tN(n?t:t.sort(eN)):EP}static from(t){switch(t.length){case 0:return kP;case 1:return t[0];default:return new e(t.every(e=>e instanceof OP)?t:t.reduce((e,t)=>e.concat(t instanceof OP?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}},jP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},MP=DN&&ON<=11,NP=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},PP=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new NP,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);DN&&ON<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():NN&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),MP&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,jP)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Rfe(this.view)){if(this.suppressingSelectionUpdates)return DM(this.view);if(DN&&ON<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vN(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=mN(n))t.add(n);for(let r=e.anchorNode;r;r=mN(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Rfe(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(kN&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Ipe(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&bN(n)&&(c=EM(e))&&c.eq(eM.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,DM(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Ppe(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Lpe(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||DM(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(DN&&ON<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?pN(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?pN(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},FP=new WeakMap,IP=!1,LP=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i,RP=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new hP,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(fN),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=uN(this),lN(this),this.nodeViews=dN(this),this.docView=bfe(this.state.doc,cN(this),rN(this),this.dom,this),this.domObserver=new PP(this,(e,t,n,r)=>Bpe(this,e,t,n,r)),this.domObserver.start(),dpe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&zM(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(fN),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Tpe(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=dN(this);Gpe(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&zM(this),this.editable=uN(this),lN(this);let o=rN(this),s=cN(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&nfe(this);if(i){this.domObserver.stop();let t=l&&(DN||jN)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Wpe(n.selection,e.selection);if(l){let n=jN?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Epe(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=bfe(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Bfe(this))?DM(this,t):(Ife(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&ife(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof iM){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&tfe(this,t.getBoundingClientRect(),e)}else tfe(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new bP(e.slice,e.move,r<0?void 0:iM.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(DN){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&ofe(this.dom),DM(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return pfe(this,e)}coordsAtPos(e,t=1){return hfe(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return yfe(this,t||this.state,e)}pasteHTML(e,t){return KM(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return KM(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return IM(this,e)}destroy(){this.docView&&(fpe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rN(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,_N())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return mpe(this,e)}domSelectionRange(){let e=this.domSelection();return e?NN&&this.root.nodeType===11&&Zde(this.dom.ownerDocument)==this.dom&&Fpe(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}},RP.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}})),BP,VP,HP,UP,WP,GP=o((()=>{BP=()=>new Map,VP=e=>{let t=BP();return e.forEach((e,n)=>{t.set(n,e)}),t},HP=(e,t,n)=>{let r=e.get(t);return r===void 0&&e.set(t,r=n()),r},UP=(e,t)=>{let n=[];for(let[r,i]of e)n.push(t(i,r));return n},WP=(e,t)=>{for(let[n,r]of e)if(t(r,n))return!0;return!1}})),KP,qP=o((()=>{KP=()=>new Set})),JP,YP,XP,ZP,QP,$P,eF,tF=o((()=>{JP=e=>e[e.length-1],YP=(e,t)=>{for(let n=0;n<t.length;n++)e.push(t[n])},XP=Array.from,ZP=(e,t)=>{for(let n=0;n<e.length;n++)if(!t(e[n],n,e))return!1;return!0},QP=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n],n,e))return!0;return!1},$P=(e,t)=>{let n=Array(e);for(let r=0;r<e;r++)n[r]=t(r,n);return n},eF=Array.isArray})),nF,Kpe=o((()=>{GP(),qP(),tF(),nF=class{constructor(){this._observers=BP()}on(e,t){return HP(this._observers,e,KP).add(t),t}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};this.on(e,n)}off(e,t){let n=this._observers.get(e);n!==void 0&&(n.delete(t),n.size===0&&this._observers.delete(e))}emit(e,t){return XP((this._observers.get(e)||BP()).values()).forEach(e=>e(...t))}destroy(){this._observers=BP()}}})),rF,iF,aF,oF,sF,cF=o((()=>{rF=Math.floor,iF=Math.abs,aF=(e,t)=>e<t?e:t,oF=(e,t)=>e>t?e:t,Number.isNaN,sF=e=>e===0?1/e<0:e<0})),lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF=o((()=>{lF=1<<17,uF=1<<18,dF=1<<19,fF=1<<20,pF=1<<21,mF=1<<22,hF=1<<23,gF=1<<24,_F=1<<25,vF=1<<26,yF=1<<27,bF=1<<28,xF=1<<29,SF=1<<30,lF-1,uF-1,dF-1,fF-1,pF-1,mF-1,hF-1,gF-1,_F-1,vF-1,yF-1,bF-1,xF-1,SF-1})),wF,TF,EF,DF=o((()=>{cF(),CF(),wF=2**53-1,TF=-(2**53-1),EF=Number.isInteger||(e=>typeof e==`number`&&isFinite(e)&&rF(e)===e),Number.isNaN,Number.parseInt})),OF,kF,AF,jF,MF,NF,PF,FF,IF,LF,RF,zF,BF=o((()=>{tF(),OF=String.fromCharCode,String.fromCodePoint,OF(65535),kF=e=>e.toLowerCase(),AF=/^\s*/g,jF=e=>e.replace(AF,``),MF=/([A-Z])/g,NF=(e,t)=>jF(e.replace(MF,e=>`${t}${kF(e)}`)),PF=e=>{let t=unescape(encodeURIComponent(e)),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.codePointAt(e);return r},FF=typeof TextEncoder<`u`?new TextEncoder:null,IF=e=>FF.encode(e),LF=FF?IF:PF,RF=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}),RF&&RF.decode(new Uint8Array).length===1&&(RF=null),zF=(e,t)=>$P(t,()=>e).join(``)})),VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI,_I=o((()=>{cF(),DF(),CF(),BF(),tF(),VF=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},HF=()=>new VF,UF=e=>{let t=HF();return e(t),GF(t)},WF=e=>{let t=e.cpos;for(let n=0;n<e.bufs.length;n++)t+=e.bufs[n].length;return t},GF=e=>{let t=new Uint8Array(WF(e)),n=0;for(let r=0;r<e.bufs.length;r++){let i=e.bufs[r];t.set(i,n),n+=i.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),n),t},KF=(e,t)=>{let n=e.cbuf.length;n-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(oF(n,t)*2),e.cpos=0)},qF=(e,t)=>{let n=e.cbuf.length;e.cpos===n&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(n*2),e.cpos=0),e.cbuf[e.cpos++]=t},JF=qF,YF=(e,t)=>{for(;t>127;)qF(e,128|127&t),t=rF(t/128);qF(e,127&t)},XF=(e,t)=>{let n=sF(t);for(n&&(t=-t),qF(e,(t>63?128:0)|(n?64:0)|63&t),t=rF(t/64);t>0;)qF(e,(t>127?128:0)|127&t),t=rF(t/128)},ZF=new Uint8Array(3e4),QF=ZF.length/3,$F=(e,t)=>{if(t.length<QF){let n=FF.encodeInto(t,ZF).written||0;YF(e,n);for(let t=0;t<n;t++)qF(e,ZF[t])}else rI(e,LF(t))},eI=(e,t)=>{let n=unescape(encodeURIComponent(t)),r=n.length;YF(e,r);for(let t=0;t<r;t++)qF(e,n.codePointAt(t))},tI=FF&&FF.encodeInto?$F:eI,nI=(e,t)=>{let n=e.cbuf.length,r=e.cpos,i=aF(n-r,t.length),a=t.length-i;e.cbuf.set(t.subarray(0,i),r),e.cpos+=i,a>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(oF(n*2,a)),e.cbuf.set(t.subarray(i)),e.cpos=a)},rI=(e,t)=>{YF(e,t.byteLength),nI(e,t)},iI=(e,t)=>{KF(e,t);let n=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,n},aI=(e,t)=>iI(e,4).setFloat32(0,t,!1),oI=(e,t)=>iI(e,8).setFloat64(0,t,!1),sI=(e,t)=>iI(e,8).setBigInt64(0,t,!1),cI=new DataView(new ArrayBuffer(4)),lI=e=>(cI.setFloat32(0,e),cI.getFloat32(0)===e),uI=(e,t)=>{switch(typeof t){case`string`:qF(e,119),tI(e,t);break;case`number`:EF(t)&&iF(t)<=2147483647?(qF(e,125),XF(e,t)):lI(t)?(qF(e,124),aI(e,t)):(qF(e,123),oI(e,t));break;case`bigint`:qF(e,122),sI(e,t);break;case`object`:if(t===null)qF(e,126);else if(eF(t)){qF(e,117),YF(e,t.length);for(let n=0;n<t.length;n++)uI(e,t[n])}else if(t instanceof Uint8Array)qF(e,116),rI(e,t);else{qF(e,118);let n=Object.keys(t);YF(e,n.length);for(let r=0;r<n.length;r++){let i=n[r];tI(e,i),uI(e,t[i])}}break;case`boolean`:qF(e,t?120:121);break;default:qF(e,127)}},dI=class extends VF{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&YF(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}},fI=e=>{e.count>0&&(XF(e.encoder,e.count===1?e.s:-e.s),e.count>1&&YF(e.encoder,e.count-2))},pI=class{constructor(){this.encoder=new VF,this.s=0,this.count=0}write(e){this.s===e?this.count++:(fI(this),this.count=1,this.s=e)}toUint8Array(){return fI(this),GF(this.encoder)}},mI=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);XF(e.encoder,t),e.count>1&&YF(e.encoder,e.count-2)}},hI=class{constructor(){this.encoder=new VF,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(mI(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return mI(this),GF(this.encoder)}},gI=class{constructor(){this.sarr=[],this.s=``,this.lensE=new pI}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=``),this.lensE.write(e.length)}toUint8Array(){let e=new VF;return this.sarr.push(this.s),this.s=``,tI(e,this.sarr.join(``)),nI(e,this.lensE.toUint8Array()),GF(e)}}})),vI,yI,bI,xI=o((()=>{vI=e=>Error(e),yI=()=>{throw vI(`Method unimplemented`)},bI=()=>{throw vI(`Unexpected case`)}})),SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI,VI,HI,UI,WI,qpe=o((()=>{CF(),cF(),DF(),BF(),xI(),SI=vI(`Unexpected end of array`),CI=vI(`Integer out of Range`),wI=class{constructor(e){this.arr=e,this.pos=0}},TI=e=>new wI(e),EI=e=>e.pos!==e.arr.length,DI=(e,t)=>{let n=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,n},OI=e=>DI(e,AI(e)),kI=e=>e.arr[e.pos++],AI=e=>{let t=0,n=1,r=e.arr.length;for(;e.pos<r;){let r=e.arr[e.pos++];if(t+=(r&127)*n,n*=128,r<128)return t;if(t>wF)throw CI}throw SI},jI=e=>{let t=e.arr[e.pos++],n=t&63,r=64,i=(t&64)>0?-1:1;if(!(t&128))return i*n;let a=e.arr.length;for(;e.pos<a;){if(t=e.arr[e.pos++],n+=(t&127)*r,r*=128,t<128)return i*n;if(n>wF)throw CI}throw SI},MI=e=>{let t=AI(e);if(t===0)return``;{let n=String.fromCodePoint(kI(e));if(--t<100)for(;t--;)n+=String.fromCodePoint(kI(e));else for(;t>0;){let r=t<1e4?t:1e4,i=e.arr.subarray(e.pos,e.pos+r);e.pos+=r,n+=String.fromCodePoint.apply(null,i),t-=r}return decodeURIComponent(escape(n))}},NI=e=>RF.decode(OI(e)),PI=RF?NI:MI,FI=(e,t)=>{let n=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,n},II=e=>FI(e,4).getFloat32(0,!1),LI=e=>FI(e,8).getFloat64(0,!1),RI=e=>FI(e,8).getBigInt64(0,!1),zI=[e=>void 0,e=>null,jI,II,LI,RI,e=>!1,e=>!0,PI,e=>{let t=AI(e),n={};for(let r=0;r<t;r++){let t=PI(e);n[t]=BI(e)}return n},e=>{let t=AI(e),n=[];for(let r=0;r<t;r++)n.push(BI(e));return n},OI],BI=e=>zI[127-kI(e)](e),VI=class extends wI{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),EI(this)?this.count=AI(this)+1:this.count=-1),this.count--,this.s}},HI=class extends wI{constructor(e){super(e),this.s=0,this.count=0}read(){if(this.count===0){this.s=jI(this);let e=sF(this.s);this.count=1,e&&(this.s=-this.s,this.count=AI(this)+2)}return this.count--,this.s}},UI=class extends wI{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let e=jI(this),t=e&1;this.diff=rF(e/2),this.count=1,t&&(this.count=AI(this)+2)}return this.s+=this.diff,this.count--,this.s}},WI=class{constructor(e){this.decoder=new HI(e),this.str=PI(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}})),GI,Jpe=o((()=>{crypto.subtle,GI=crypto.getRandomValues.bind(crypto)})),KI,qI,JI,YI,XI,ZI=o((()=>{cF(),Jpe(),KI=Math.random,qI=()=>GI(new Uint32Array(1))[0],JI=e=>e[rF(KI()*e.length)],YI=`10000000-1000-4000-8000-100000000000`,XI=()=>YI.replace(/[018]/g,e=>(e^qI()&15>>e/4).toString(16))})),QI,$I=o((()=>{QI=Date.now})),eL,Ype=o((()=>{eL=e=>new Promise(e),Promise.all.bind(Promise)})),tL,Xpe=o((()=>{tL=e=>e===void 0?null:e})),nL,rL,iL,Zpe=o((()=>{nL=class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}},rL=new nL;try{typeof localStorage<`u`&&localStorage&&(rL=localStorage)}catch{}iL=rL})),aL,oL,sL=o((()=>{aL=Symbol(`Equality`),oL=(e,t)=>e===t||!!e?.[aL]?.(t)||!1})),cL,lL,uL,dL,fL,pL,mL,hL,gL,_L,vL,yL=o((()=>{sL(),cL=e=>typeof e==`object`,lL=Object.assign,uL=Object.keys,dL=(e,t)=>{for(let n in e)t(e[n],n)},fL=e=>uL(e).length,pL=e=>{for(let t in e)return!1;return!0},mL=(e,t)=>{for(let n in e)if(!t(e[n],n))return!1;return!0},hL=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),gL=(e,t)=>e===t||fL(e)===fL(t)&&mL(e,(e,n)=>(e!==void 0||hL(t,n))&&oL(t[n],e)),_L=Object.freeze,vL=e=>{for(let t in e){let n=e[t];(typeof n==`object`||typeof n==`function`)&&vL(e[t])}return _L(e)}})),bL,xL,SL,CL,wL=o((()=>{tF(),yL(),sL(),bL=(e,t,n=0)=>{try{for(;n<e.length;n++)e[n](...t)}finally{n<e.length&&bL(e,t,n+1)}},xL=e=>e,SL=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[aL]!=null)return e[aL](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:if(e.byteLength!==t.byteLength)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;break;case Set:if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;break;case Map:if(e.size!==t.size)return!1;for(let n of e.keys())if(!t.has(n)||!SL(e.get(n),t.get(n)))return!1;break;case void 0:case Object:if(fL(e)!==fL(t))return!1;for(let n in e)if(!hL(e,n)||!SL(e[n],t[n]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!SL(e[n],t[n]))return!1;break;default:return!1}return!0},CL=(e,t)=>t.includes(e)})),TL,EL,DL,OL,kL,AL,jL,ML,NL,PL,FL,IL=o((()=>{GP(),BF(),Xpe(),Zpe(),wL(),TL=typeof process<`u`&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`,EL=typeof window<`u`&&typeof document<`u`&&!TL,typeof navigator<`u`&&/Mac/.test(navigator.platform),OL=[],kL=()=>{if(DL===void 0)if(TL){DL=BP();let e=process.argv,t=null;for(let n=0;n<e.length;n++){let r=e[n];r[0]===`-`?(t!==null&&DL.set(t,``),t=r):t===null?OL.push(r):(DL.set(t,r),t=null)}t!==null&&DL.set(t,``)}else typeof location==`object`?(DL=BP(),(location.search||`?`).slice(1).split(`&`).forEach(e=>{if(e.length!==0){let[t,n]=e.split(`=`);DL.set(`--${NF(t,`-`)}`,n),DL.set(`-${NF(t,`-`)}`,n)}})):DL=BP();return DL},AL=e=>kL().has(e),jL=e=>tL(TL?{}[e.toUpperCase().replaceAll(`-`,`_`)]:iL.getItem(e)),ML=e=>AL(`--`+e)||jL(e)!==null,NL=ML(`production`),PL=TL&&CL({}.FORCE_COLOR,[`true`,`1`,`2`]),FL=PL||!AL(`--no-colors`)&&!ML(`no-color`)&&(!TL||process.stdout.isTTY)&&(!TL||AL(`--color`)||jL(`COLORTERM`)!==null||(jL(`TERM`)||``).includes(`color`))})),LL,RL,zL,BL,VL,HL,UL=o((()=>{BF(),IL(),_I(),LL=e=>new Uint8Array(e),RL=e=>{let t=``;for(let n=0;n<e.byteLength;n++)t+=OF(e[n]);return btoa(t)},zL=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`),BL=EL?RL:zL,VL=e=>{let t=LL(e.byteLength);return t.set(e),t},HL=e=>UF(t=>uI(t,e))})),WL,GL,Qpe=o((()=>{WL=class{constructor(e,t){this.left=e,this.right=t}},GL=(e,t)=>new WL(e,t)})),KL,qL,JL,YL,XL,ZL,QL,$pe=o((()=>{BF(),cF(),KL=e=>e.next()>=.5,qL=(e,t,n)=>rF(e.next()*(n+1-t)+t),JL=(e,t,n)=>rF(e.next()*(n+1-t)+t),YL=(e,t,n)=>JL(e,t,n),XL=e=>OF(YL(e,97,122)),ZL=(e,t=0,n=20)=>{let r=YL(e,t,n),i=``;for(let t=0;t<r;t++)i+=XL(e);return i},QL=(e,t)=>t[YL(e,0,t.length-1)]})),$L,eR,tR,nR,rR,iR,aR,oR,sR,cR,lR,uR,dR,fR,pR,mR,hR,gR,_R,vR,yR,bR,xR,SR,CR,wR,TR,ER,DR,OR,kR,AR,jR,MR,NR,PR,FR,IR,LR,RR,zR,BR,VR,HR,UR,WR,GR,KR,qR,JR,YR,XR,ZR,QR,$R,ez,tz,nz,rz,iz,az,oz,sz,eme=o((()=>{yL(),tF(),xI(),IL(),sL(),wL(),BF(),$pe(),DF(),$L=Symbol(`0schema`),eR=class{constructor(){this._rerrs=[]}extend(e,t,n,r=null){this._rerrs.push({path:e,expected:t,has:n,message:r})}toString(){let e=[];for(let t=this._rerrs.length-1;t>0;t--){let n=this._rerrs[t];e.push(zF(` `,(this._rerrs.length-t)*2)+`${n.path==null?``:`[${n.path}] `}${n.has} doesn't match ${n.expected}. ${n.message}`)}return e.join(`
|
|
24
|
+
`)}},tR=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[aL]?oL(e,t):eF(e)?ZP(e,e=>QP(t,t=>tR(e,t))):cL(e)?mL(e,(e,n)=>tR(e,t[n])):!1,nR=class{static _dilutes=!1;extends(e){let[t,n]=[this.shape,e.shape];return this.constructor._dilutes&&([n,t]=[t,n]),tR(t,n)}equals(e){return this.constructor===e.constructor&&SL(this.shape,e.shape)}[$L](){return!0}[aL](e){return this.equals(e)}validate(e){return this.check(e)}check(e,t){yI()}get nullable(){return RR(this,$R)}get optional(){return new mR(this)}cast(e){return rz(e,this),e}expect(e){return rz(e,this),e}},rR=class extends nR{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t=void 0){let n=e?.constructor===this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name,e?.constructor===this.shape?`Check failed`:`Constructor match failed`),n}},iR=(e,t=null)=>new rR(e,t),iR(rR),aR=class extends nR{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape(e);return!n&&t?.extend(null,`custom prop`,e?.constructor.name,`failed to check custom prop`),n}},oR=e=>new aR(e),iR(aR),sR=class extends nR{constructor(e){super(),this.shape=e}check(e,t){let n=this.shape.some(t=>t===e);return!n&&t?.extend(null,this.shape.join(` | `),e.toString()),n}},cR=(...e)=>new sR(e),lR=iR(sR),uR=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,e=>`\\`+e)),dR=e=>{if(JR.check(e))return[uR(e)];if(lR.check(e))return e.shape.map(e=>e+``);if(qR.check(e))return[`[+-]?\\d+.?\\d*`];if(YR.check(e))return[`.*`];if(zR.check(e))return e.shape.map(dR).flat(1);bI()},fR=class extends nR{constructor(e){super(),this.shape=e,this._r=RegExp(`^`+e.map(dR).map(e=>`(${e.join(`|`)})`).join(``)+`$`)}check(e,t){let n=this._r.exec(e)!=null;return!n&&t?.extend(null,this._r.toString(),e.toString(),`String doesn't match string template.`),n}},iR(fR),pR=Symbol(`optional`),mR=class extends nR{constructor(e){super(),this.shape=e}check(e,t){let n=e===void 0||this.shape.check(e);return!n&&t?.extend(null,`undefined (optional)`,`()`),n}get[pR](){return!0}},hR=iR(mR),gR=class extends nR{check(e,t){return t?.extend(null,`never`,typeof e),!1}},new gR,iR(gR),_R=class e extends nR{constructor(e,t=!1){super(),this.shape=e,this._isPartial=t}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(e,t){return e==null?(t?.extend(null,`object`,`null`),!1):mL(this.shape,(n,r)=>{let i=this._isPartial&&!hL(e,r)||n.check(e[r],t);return!i&&t?.extend(r.toString(),n.toString(),typeof e[r],`Object property does not match`),i})}},vR=e=>new _R(e),yR=iR(_R),bR=oR(e=>e!=null&&(e.constructor===Object||e.constructor==null)),xR=class extends nR{constructor(e,t){super(),this.shape={keys:e,values:t}}check(e,t){return e!=null&&mL(e,(n,r)=>{let i=this.shape.keys.check(r,t);return!i&&t?.extend(r+``,`Record`,typeof e,i?`Key doesn't match schema`:`Value doesn't match value`),i&&this.shape.values.check(n,t)})}},SR=(e,t)=>new xR(e,t),CR=iR(xR),wR=class extends nR{constructor(e){super(),this.shape=e}check(e,t){return e!=null&&mL(this.shape,(n,r)=>{let i=n.check(e[r],t);return!i&&t?.extend(r.toString(),`Tuple`,typeof n),i})}},TR=(...e)=>new wR(e),iR(wR),ER=class extends nR{constructor(e){super(),this.shape=e.length===1?e[0]:new LR(e)}check(e,t){let n=eF(e)&&ZP(e,e=>this.shape.check(e));return!n&&t?.extend(null,`Array`,``),n}},DR=(...e)=>new ER(e),OR=iR(ER),kR=oR(e=>eF(e)),AR=class extends nR{constructor(e,t){super(),this.shape=e,this._c=t}check(e,t){let n=e instanceof this.shape&&(this._c==null||this._c(e));return!n&&t?.extend(null,this.shape.name,e?.constructor.name),n}},jR=(e,t=null)=>new AR(e,t),iR(AR),MR=jR(nR),NR=class extends nR{constructor(e){super(),this.len=e.length-1,this.args=TR(...e.slice(-1)),this.res=e[this.len]}check(e,t){let n=e.constructor===Function&&e.length<=this.len;return!n&&t?.extend(null,`function`,typeof e),n}},PR=iR(NR),FR=oR(e=>typeof e==`function`),IR=class extends nR{constructor(e){super(),this.shape=e}check(e,t){let n=ZP(this.shape,n=>n.check(e,t));return!n&&t?.extend(null,`Intersectinon`,typeof e),n}},iR(IR,e=>e.shape.length>0),LR=class extends nR{static _dilutes=!0;constructor(e){super(),this.shape=e}check(e,t){let n=QP(this.shape,n=>n.check(e,t));return t?.extend(null,`Union`,typeof e),n}},RR=(...e)=>e.findIndex(e=>zR.check(e))>=0?RR(...e.map(e=>nz(e)).map(e=>zR.check(e)?e.shape:[e]).flat(1)):e.length===1?e[0]:new LR(e),zR=iR(LR),BR=()=>!0,VR=oR(BR),HR=iR(aR,e=>e.shape===BR),UR=oR(e=>typeof e==`bigint`),WR=oR(e=>e===UR),GR=oR(e=>typeof e==`symbol`),oR(e=>e===GR),KR=oR(e=>typeof e==`number`),qR=oR(e=>e===KR),JR=oR(e=>typeof e==`string`),YR=oR(e=>e===JR),XR=oR(e=>typeof e==`boolean`),ZR=oR(e=>e===XR),QR=cR(void 0),iR(sR,e=>e.shape.length===1&&e.shape[0]===void 0),cR(void 0),$R=cR(null),ez=iR(sR,e=>e.shape.length===1&&e.shape[0]===null),iR(Uint8Array),iR(rR,e=>e.shape===Uint8Array),tz=RR(KR,JR,$R,QR,UR,XR,GR),(()=>{let e=DR(VR),t=SR(JR,VR),n=RR(KR,JR,$R,XR,e,t);return e.shape=n,t.shape.values=n,n})(),nz=e=>{if(MR.check(e))return e;if(bR.check(e)){let t={};for(let n in e)t[n]=nz(e[n]);return vR(t)}else if(kR.check(e))return RR(...e.map(nz));else if(tz.check(e))return cR(e);else if(FR.check(e))return iR(e);bI()},rz=NL?()=>{}:(e,t)=>{let n=new eR;if(!t.check(e,n))throw vI(`Expected value to be of type ${t.constructor.name}.\n${n.toString()}`)},iz=class{constructor(e){this.patterns=[],this.$state=e}if(e,t){return this.patterns.push({if:nz(e),h:t}),this}else(e){return this.if(VR,e)}done(){return(e,t)=>{for(let n=0;n<this.patterns.length;n++){let r=this.patterns[n];if(r.if.check(e))return r.h(e,t)}throw vI(`Unhandled pattern`)}}},az=e=>new iz(e),oz=az(VR).if(qR,(e,t)=>qL(t,TF,wF)).if(YR,(e,t)=>ZL(t)).if(ZR,(e,t)=>KL(t)).if(WR,(e,t)=>BigInt(qL(t,TF,wF))).if(zR,(e,t)=>sz(t,QL(t,e.shape))).if(yR,(e,t)=>{let n={};for(let r in e.shape){let i=e.shape[r];if(hR.check(i)){if(KL(t))continue;i=i.shape}n[r]=oz(i,t)}return n}).if(OR,(e,t)=>{let n=[],r=JL(t,0,42);for(let i=0;i<r;i++)n.push(sz(t,e.shape));return n}).if(lR,(e,t)=>QL(t,e.shape)).if(ez,(e,t)=>null).if(PR,(e,t)=>{let n=sz(t,e.res);return()=>n}).if(HR,(e,t)=>sz(t,QL(t,[KR,JR,$R,QR,UR,XR,DR(KR),SR(RR(`a`,`b`,`c`),KR)]))).if(CR,(e,t)=>{let n={},r=qL(t,0,3);for(let i=0;i<r;i++){let r=sz(t,e.shape.keys);n[r]=sz(t,e.shape.values)}return n}).done(),sz=(e,t)=>oz(nz(t),e)})),cz,lz,uz,dz,fz,pz,mz=o((()=>{GP(),eme(),cz=typeof document<`u`?document:{},oR(e=>e.nodeType===pz),typeof DOMParser<`u`&&new DOMParser,oR(e=>e.nodeType===uz),oR(e=>e.nodeType===dz),lz=e=>UP(e,(e,t)=>`${t}:${e};`).join(``),uz=cz.ELEMENT_NODE,dz=cz.TEXT_NODE,cz.CDATA_SECTION_NODE,cz.COMMENT_NODE,fz=cz.DOCUMENT_NODE,cz.DOCUMENT_TYPE_NODE,pz=cz.DOCUMENT_FRAGMENT_NODE,oR(e=>e.nodeType===fz)})),hz,gz,_z,vz=o((()=>{hz=e=>class{constructor(e){this._=e}destroy(){e(this._)}},gz=hz(clearTimeout),_z=(e,t)=>new gz(setTimeout(t,e)),hz(clearInterval),hz(e=>typeof requestAnimationFrame<`u`&&cancelAnimationFrame(e)),hz(e=>typeof cancelIdleCallback<`u`&&cancelIdleCallback(e))})),yz,tme=o((()=>{yz=Symbol})),bz,xz,Sz,Cz,wz,Tz,Ez,Dz,Oz,kz,nme=o((()=>{tme(),$I(),bz=yz(),xz=yz(),Sz=yz(),Cz=yz(),wz=yz(),Tz=yz(),Ez=yz(),Dz=yz(),Oz=yz(),kz=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=0;for(;r<e.length;r++){let n=e[r];if(n===void 0)break;if(n.constructor===String||n.constructor===Number)t.push(n);else if(n.constructor===Object)break}for(r>0&&n.push(t.join(``));r<e.length;r++){let t=e[r];t instanceof Symbol||n.push(t)}return n},QI()})),Az,jz,Mz,Nz,Pz,Fz,rme=o((()=>{IL(),qP(),Qpe(),mz(),GP(),nme(),Az={[bz]:GL(`font-weight`,`bold`),[xz]:GL(`font-weight`,`normal`),[Sz]:GL(`color`,`blue`),[wz]:GL(`color`,`green`),[Cz]:GL(`color`,`grey`),[Tz]:GL(`color`,`red`),[Ez]:GL(`color`,`purple`),[Dz]:GL(`color`,`orange`),[Oz]:GL(`color`,`black`)},jz=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],n=[],r=BP(),i=[],a=0;for(;a<e.length;a++){let i=e[a],o=Az[i];if(o!==void 0)r.set(o.left,o.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let e=lz(r);a>0||e.length>0?(t.push(`%c`+i),n.push(e)):t.push(i)}else break}}for(a>0&&(i=n,i.unshift(t.join(``)));a<e.length;a++){let t=e[a];t instanceof Symbol||i.push(t)}return i},Mz=FL?jz:kz,Nz=(...e)=>{console.log(...Mz(e)),Fz.forEach(t=>t.print(e))},Pz=(...e)=>{console.warn(...Mz(e)),e.unshift(Dz),Fz.forEach(t=>t.print(e))},Fz=KP()})),Iz,Lz,Rz,ime=o((()=>{Iz=e=>({[Symbol.iterator](){return this},next:e}),Lz=(e,t)=>Iz(()=>{let n;do n=e.next();while(!n.done&&!t(n.value));return n}),Rz=(e,t)=>Iz(()=>{let{done:n,value:r}=e.next();return{done:n,value:n?void 0:t(r)}})}));function*ame(e){let t=AI(e.restDecoder);for(let n=0;n<t;n++){let t=AI(e.restDecoder),n=e.readClient(),r=AI(e.restDecoder);for(let i=0;i<t;i++){let t=e.readInfo();if(t===10){let t=AI(e.restDecoder);yield new kU(MB(n,r),t),r+=t}else if(31&t){let i=(t&192)==0,a=new TU(MB(n,r),null,(t&128)==128?e.readLeftID():null,null,(t&64)==64?e.readRightID():null,i?e.readParentInfo()?e.readString():e.readLeftID():null,i&&(t&32)==32?e.readString():null,EU(e,t));yield a,r+=a.length}else{let t=e.readLen();yield new GH(MB(n,r),t),r+=t}}}}var zz,Bz,Vz,Hz,Uz,Wz,Gz,Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB,aB,oB,sB,cB,lB,uB,dB,fB,pB,mB,hB,gB,_B,vB,yB,bB,xB,SB,CB,wB,TB,EB,DB,OB,kB,AB,jB,MB,NB,PB,FB,IB,LB,RB,zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB,XB,ZB,QB,$B,eV,tV,nV,rV,iV,aV,oV,sV,cV,lV,uV,dV,fV,pV,mV,hV,gV,_V,vV,yV,bV,xV,SV,CV,wV,TV,EV,DV,OV,kV,AV,jV,MV,NV,PV,FV,IV,LV,RV,zV,BV,VV,HV,UV,WV,GV,KV,qV,JV,YV,XV,ZV,QV,$V,eH,tH,nH,rH,iH,aH,oH,sH,cH,lH,uH,dH,fH,pH,mH,hH,gH,_H,vH,yH,bH,xH,SH,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU,jU,MU=o((()=>{Kpe(),tF(),cF(),GP(),_I(),qpe(),ZI(),Ype(),UL(),xI(),CF(),wL(),qP(),rme(),$I(),ime(),yL(),IL(),zz=class{constructor(e,t){this.clock=e,this.len=t}},Bz=class{constructor(){this.clients=new Map}},Vz=(e,t,n)=>t.clients.forEach((t,r)=>{let i=e.doc.store.clients.get(r);if(i!=null){let r=i[i.length-1],a=r.id.clock+r.length;for(let r=0,o=t[r];r<t.length&&o.clock<a;o=t[++r])oV(e,i,o.clock,o.len,n)}}),Hz=(e,t)=>{let n=0,r=e.length-1;for(;n<=r;){let i=rF((n+r)/2),a=e[i],o=a.clock;if(o<=t){if(t<o+a.len)return i;n=i+1}else r=i-1}return null},Uz=(e,t)=>{let n=e.clients.get(t.client);return n!==void 0&&Hz(n,t.clock)!==null},Wz=e=>{e.clients.forEach(e=>{e.sort((e,t)=>e.clock-t.clock);let t,n;for(t=1,n=1;t<e.length;t++){let r=e[n-1],i=e[t];r.clock+r.len>=i.clock?e[n-1]=new zz(r.clock,oF(r.len,i.clock+i.len-r.clock)):(n<t&&(e[n]=i),n++)}e.length=n})},Gz=e=>{let t=new Bz;for(let n=0;n<e.length;n++)e[n].clients.forEach((r,i)=>{if(!t.clients.has(i)){let a=r.slice();for(let t=n+1;t<e.length;t++)YP(a,e[t].clients.get(i)||[]);t.clients.set(i,a)}});return Wz(t),t},Kz=(e,t,n,r)=>{HP(e.clients,t,()=>[]).push(new zz(n,r))},qz=()=>new Bz,Jz=e=>{let t=qz();return e.clients.forEach((e,n)=>{let r=[];for(let t=0;t<e.length;t++){let n=e[t];if(n.deleted){let i=n.id.clock,a=n.length;if(t+1<e.length)for(let n=e[t+1];t+1<e.length&&n.deleted;n=e[++t+1])a+=n.length;r.push(new zz(i,a))}}r.length>0&&t.clients.set(n,r)}),t},Yz=(e,t)=>{YF(e.restEncoder,t.clients.size),XP(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{e.resetDsCurVal(),YF(e.restEncoder,t);let r=n.length;YF(e.restEncoder,r);for(let t=0;t<r;t++){let r=n[t];e.writeDsClock(r.clock),e.writeDsLen(r.len)}})},Xz=e=>{let t=new Bz,n=AI(e.restDecoder);for(let r=0;r<n;r++){e.resetDsCurVal();let n=AI(e.restDecoder),r=AI(e.restDecoder);if(r>0){let i=HP(t.clients,n,()=>[]);for(let t=0;t<r;t++)i.push(new zz(e.readDsClock(),e.readDsLen()))}}return t},Zz=(e,t,n)=>{let r=new Bz,i=AI(e.restDecoder);for(let a=0;a<i;a++){e.resetDsCurVal();let i=AI(e.restDecoder),a=AI(e.restDecoder),o=n.clients.get(i)||[],s=ZB(n,i);for(let n=0;n<a;n++){let n=e.readDsClock(),a=n+e.readDsLen();if(n<s){s<a&&Kz(r,i,s,a-s);let e=$B(o,n),c=o[e];for(!c.deleted&&c.id.clock<n&&(o.splice(e+1,0,SU(t,c,n-c.id.clock)),e++);e<o.length&&(c=o[e++],c.id.clock<a);)c.deleted||(a<c.id.clock+c.length&&o.splice(e,0,SU(t,c,a-c.id.clock)),c.delete(t))}else Kz(r,i,n,a-n)}}if(r.clients.size>0){let e=new sB;return YF(e.restEncoder,0),Yz(e,r),e.toUint8Array()}return null},Qz=qI,$z=class e extends nF{constructor({guid:e=XI(),collectionid:t=null,gc:n=!0,gcFilter:r=()=>!0,meta:i=null,autoLoad:a=!1,shouldLoad:o=!0}={}){super(),this.gc=n,this.gcFilter=r,this.clientID=Qz(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new YB,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=a,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=eL(e=>{this.on(`load`,()=>{this.isLoaded=!0,e(this)})});let s=()=>eL(e=>{let t=n=>{(n===void 0||n===!0)&&(this.off(`sync`,t),e())};this.on(`sync`,t)});this.on(`sync`,e=>{e===!1&&this.isSynced&&(this.whenSynced=s()),this.isSynced=e===void 0||e===!0,this.isSynced&&!this.isLoaded&&this.emit(`load`,[this])}),this.whenSynced=s()}load(){let e=this._item;e!==null&&!this.shouldLoad&&mV(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(XP(this.subdocs).map(e=>e.guid))}transact(e,t=null){return mV(this,e,t)}get(e,t=UV){let n=HP(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),r=n.constructor;if(t!==UV&&r!==t)if(r===UV){let r=new t;r._map=n._map,n._map.forEach(e=>{for(;e!==null;e=e.left)e.parent=r}),r._start=n._start;for(let e=r._start;e!==null;e=e.right)e.parent=r;return r._length=n._length,this.share.set(e,r),r._integrate(this,null),r}else throw Error(`Type with the name ${e} has already been defined with a different constructor`);return n}getArray(e=``){return this.get(e,uH)}getText(e=``){return this.get(e,jH)}getMap(e=``){return this.get(e,pH)}getXmlElement(e=``){return this.get(e,IH)}getXmlFragment(e=``){return this.get(e,PH)}toJSON(){let e={};return this.share.forEach((t,n)=>{e[n]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,XP(this.subdocs).forEach(e=>e.destroy());let t=this._item;if(t!==null){this._item=null;let n=t.content;n.doc=new e({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=t,mV(t.parent.doc,e=>{let r=n.doc;t.deleted||e.subdocsAdded.add(r),e.subdocsRemoved.add(this)},null,!0)}this.emit(`destroyed`,[!0]),this.emit(`destroy`,[this]),super.destroy()}},eB=class{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return AI(this.restDecoder)}readDsLen(){return AI(this.restDecoder)}},tB=class extends eB{readLeftID(){return MB(AI(this.restDecoder),AI(this.restDecoder))}readRightID(){return MB(AI(this.restDecoder),AI(this.restDecoder))}readClient(){return AI(this.restDecoder)}readInfo(){return kI(this.restDecoder)}readString(){return PI(this.restDecoder)}readParentInfo(){return AI(this.restDecoder)===1}readTypeRef(){return AI(this.restDecoder)}readLen(){return AI(this.restDecoder)}readAny(){return BI(this.restDecoder)}readBuf(){return VL(OI(this.restDecoder))}readJSON(){return JSON.parse(PI(this.restDecoder))}readKey(){return PI(this.restDecoder)}},nB=class{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=AI(this.restDecoder),this.dsCurrVal}readDsLen(){let e=AI(this.restDecoder)+1;return this.dsCurrVal+=e,e}},rB=class extends nB{constructor(e){super(e),this.keys=[],AI(e),this.keyClockDecoder=new UI(OI(e)),this.clientDecoder=new HI(OI(e)),this.leftClockDecoder=new UI(OI(e)),this.rightClockDecoder=new UI(OI(e)),this.infoDecoder=new VI(OI(e),kI),this.stringDecoder=new WI(OI(e)),this.parentInfoDecoder=new VI(OI(e),kI),this.typeRefDecoder=new HI(OI(e)),this.lenDecoder=new HI(OI(e))}readLeftID(){return new AB(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new AB(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return BI(this.restDecoder)}readBuf(){return OI(this.restDecoder)}readJSON(){return BI(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e<this.keys.length)return this.keys[e];{let e=this.stringDecoder.read();return this.keys.push(e),e}}},iB=class{constructor(){this.restEncoder=HF()}toUint8Array(){return GF(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){YF(this.restEncoder,e)}writeDsLen(e){YF(this.restEncoder,e)}},aB=class extends iB{writeLeftID(e){YF(this.restEncoder,e.client),YF(this.restEncoder,e.clock)}writeRightID(e){YF(this.restEncoder,e.client),YF(this.restEncoder,e.clock)}writeClient(e){YF(this.restEncoder,e)}writeInfo(e){JF(this.restEncoder,e)}writeString(e){tI(this.restEncoder,e)}writeParentInfo(e){YF(this.restEncoder,e?1:0)}writeTypeRef(e){YF(this.restEncoder,e)}writeLen(e){YF(this.restEncoder,e)}writeAny(e){uI(this.restEncoder,e)}writeBuf(e){rI(this.restEncoder,e)}writeJSON(e){tI(this.restEncoder,JSON.stringify(e))}writeKey(e){tI(this.restEncoder,e)}},oB=class{constructor(){this.restEncoder=HF(),this.dsCurrVal=0}toUint8Array(){return GF(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){let t=e-this.dsCurrVal;this.dsCurrVal=e,YF(this.restEncoder,t)}writeDsLen(e){e===0&&bI(),YF(this.restEncoder,e-1),this.dsCurrVal+=e}},sB=class extends oB{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new hI,this.clientEncoder=new pI,this.leftClockEncoder=new hI,this.rightClockEncoder=new hI,this.infoEncoder=new dI(JF),this.stringEncoder=new gI,this.parentInfoEncoder=new dI(JF),this.typeRefEncoder=new pI,this.lenEncoder=new pI}toUint8Array(){let e=HF();return YF(e,0),rI(e,this.keyClockEncoder.toUint8Array()),rI(e,this.clientEncoder.toUint8Array()),rI(e,this.leftClockEncoder.toUint8Array()),rI(e,this.rightClockEncoder.toUint8Array()),rI(e,GF(this.infoEncoder)),rI(e,this.stringEncoder.toUint8Array()),rI(e,GF(this.parentInfoEncoder)),rI(e,this.typeRefEncoder.toUint8Array()),rI(e,this.lenEncoder.toUint8Array()),nI(e,GF(this.restEncoder)),GF(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){uI(this.restEncoder,e)}writeBuf(e){rI(this.restEncoder,e)}writeJSON(e){uI(this.restEncoder,e)}writeKey(e){let t=this.keyMap.get(e);t===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(t)}},cB=(e,t,n,r)=>{r=oF(r,t[0].id.clock);let i=$B(t,r);YF(e.restEncoder,t.length-i),e.writeClient(n),YF(e.restEncoder,r);let a=t[i];a.write(e,r-a.id.clock);for(let n=i+1;n<t.length;n++)t[n].write(e,0)},lB=(e,t,n)=>{let r=new Map;n.forEach((e,n)=>{ZB(t,n)>e&&r.set(n,e)}),XB(t).forEach((e,t)=>{n.has(t)||r.set(t,0)}),YF(e.restEncoder,r.size),XP(r.entries()).sort((e,t)=>t[0]-e[0]).forEach(([n,r])=>{cB(e,t.clients.get(n),n,r)})},uB=(e,t)=>{let n=BP(),r=AI(e.restDecoder);for(let i=0;i<r;i++){let r=AI(e.restDecoder),i=Array(r),a=e.readClient(),o=AI(e.restDecoder);n.set(a,{i:0,refs:i});for(let n=0;n<r;n++){let r=e.readInfo();switch(31&r){case 0:{let t=e.readLen();i[n]=new GH(MB(a,o),t),o+=t;break}case 10:{let t=AI(e.restDecoder);i[n]=new kU(MB(a,o),t),o+=t;break}default:{let s=(r&192)==0,c=new TU(MB(a,o),null,(r&128)==128?e.readLeftID():null,null,(r&64)==64?e.readRightID():null,s?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,s&&(r&32)==32?e.readString():null,EU(e,r));i[n]=c,o+=c.length}}}}return n},dB=(e,t,n)=>{let r=[],i=XP(n.keys()).sort((e,t)=>e-t);if(i.length===0)return null;let a=()=>{if(i.length===0)return null;let e=n.get(i[i.length-1]);for(;e.refs.length===e.i;)if(i.pop(),i.length>0)e=n.get(i[i.length-1]);else return null;return e},o=a();if(o===null)return null;let s=new YB,c=new Map,l=(e,t)=>{let n=c.get(e);(n==null||n>t)&&c.set(e,t)},u=o.refs[o.i++],d=new Map,f=()=>{for(let e of r){let t=e.id.client,r=n.get(t);r?(r.i--,s.clients.set(t,r.refs.slice(r.i)),n.delete(t),r.i=0,r.refs=[]):s.clients.set(t,[e]),i=i.filter(e=>e!==t)}r.length=0};for(;;){if(u.constructor!==kU){let i=HP(d,u.id.client,()=>ZB(t,u.id.client))-u.id.clock;if(i<0)r.push(u),l(u.id.client,u.id.clock-1),f();else{let a=u.getMissing(e,t);if(a!==null){r.push(u);let e=n.get(a)||{refs:[],i:0};if(e.refs.length===e.i)l(a,ZB(t,a)),f();else{u=e.refs[e.i++];continue}}else (i===0||i<u.length)&&(u.integrate(e,i),d.set(u.id.client,u.id.clock+u.length))}}if(r.length>0)u=r.pop();else if(o!==null&&o.i<o.refs.length)u=o.refs[o.i++];else{if(o=a(),o===null)break;u=o.refs[o.i++]}}if(s.clients.size>0){let e=new sB;return lB(e,s,new Map),YF(e.restEncoder,0),{missing:c,update:e.toUint8Array()}}return null},fB=(e,t)=>lB(e,t.doc.store,t.beforeState),pB=(e,t,n,r=new rB(e))=>mV(t,e=>{e.local=!1;let t=!1,n=e.doc,i=n.store,a=dB(e,i,uB(r,n)),o=i.pendingStructs;if(o){for(let[e,n]of o.missing)if(n<ZB(i,e)){t=!0;break}if(a){for(let[e,t]of a.missing){let n=o.missing.get(e);(n==null||n>t)&&o.missing.set(e,t)}o.update=CV([o.update,a.update])}}else i.pendingStructs=a;let s=Zz(r,e,i);if(i.pendingDs){let t=new rB(TI(i.pendingDs));AI(t.restDecoder);let n=Zz(t,e,i);s&&n?i.pendingDs=CV([s,n]):i.pendingDs=s||n}else i.pendingDs=s;if(t){let t=i.pendingStructs.update;i.pendingStructs=null,mB(e.doc,t)}},n,!1),mB=(e,t,n,r=rB)=>{let i=TI(t);pB(i,e,n,new r(i))},hB=(e,t,n)=>mB(e,t,n,tB),gB=(e,t,n=new Map)=>{lB(e,t.store,n),Yz(e,Jz(t.store))},_B=(e,t=new Uint8Array([0]),n=new sB)=>{gB(n,e,bB(t));let r=[n.toUint8Array()];if(e.store.pendingDs&&r.push(e.store.pendingDs),e.store.pendingStructs&&r.push(wV(e.store.pendingStructs.update,t)),r.length>1){if(n.constructor===aB)return xV(r.map((e,t)=>t===0?e:kV(e)));if(n.constructor===sB)return CV(r)}return r[0]},vB=(e,t)=>_B(e,t,new aB),yB=e=>{let t=new Map,n=AI(e.restDecoder);for(let r=0;r<n;r++){let n=AI(e.restDecoder),r=AI(e.restDecoder);t.set(n,r)}return t},bB=e=>yB(new eB(TI(e))),xB=(e,t)=>(YF(e.restEncoder,t.size),XP(t.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,n])=>{YF(e.restEncoder,t),YF(e.restEncoder,n)}),e),SB=(e,t)=>xB(e,XB(t.store)),CB=(e,t=new oB)=>(e instanceof Map?xB(t,e):SB(t,e),t.toUint8Array()),wB=e=>CB(e,new iB),TB=class{constructor(){this.l=[]}},EB=()=>new TB,DB=(e,t)=>e.l.push(t),OB=(e,t)=>{let n=e.l,r=n.length;e.l=n.filter(e=>t!==e),r===e.l.length&&console.error(`[yjs] Tried to remove event handler that doesn't exist.`)},kB=(e,t,n)=>bL(e.l,[t,n]),AB=class{constructor(e,t){this.client=e,this.clock=t}},jB=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,MB=(e,t)=>new AB(e,t),NB=e=>{for(let[t,n]of e.doc.share.entries())if(n===e)return t;throw bI()},PB=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},FB=class{constructor(e,t,n,r=0){this.type=e,this.tname=t,this.item=n,this.assoc=r}},IB=e=>new FB(e.type==null?null:MB(e.type.client,e.type.clock),e.tname??null,e.item==null?null:MB(e.item.client,e.item.clock),e.assoc==null?0:e.assoc),LB=class{constructor(e,t,n=0){this.type=e,this.index=t,this.assoc=n}},RB=(e,t,n=0)=>new LB(e,t,n),zB=(e,t,n)=>{let r=null,i=null;return e._item===null?i=NB(e):r=MB(e._item.id.client,e._item.id.clock),new FB(r,i,t,n)},BB=(e,t,n=0)=>{let r=e._start;if(n<0){if(t===0)return zB(e,null,n);t--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>t)return zB(e,MB(r.id.client,r.id.clock+t),n);t-=r.length}if(r.right===null&&n<0)return zB(e,r.lastId,n);r=r.right}return zB(e,null,n)},VB=(e,t)=>{let n=tV(e,t);return{item:n,diff:t.clock-n.id.clock}},HB=(e,t,n=!0)=>{let r=t.store,i=e.item,a=e.type,o=e.tname,s=e.assoc,c=null,l=0;if(i!==null){if(ZB(r,i.client)<=i.clock)return null;let e=n?bU(r,i):VB(r,i),t=e.item;if(!(t instanceof TU))return null;if(c=t.parent,c._item===null||!c._item.deleted){l=t.deleted||!t.countable?0:e.diff+(s>=0?0:1);let n=t.left;for(;n!==null;)!n.deleted&&n.countable&&(l+=n.length),n=n.left}}else{if(o!==null)c=t.get(o);else if(a!==null){if(ZB(r,a.client)<=a.clock)return null;let{item:e}=n?bU(r,a):{item:tV(r,a)};if(e instanceof TU&&e.content instanceof vU)c=e.content.type;else return null}else throw bI();l=s>=0?c._length:0}return RB(c,l,e.assoc)},UB=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&jB(e.item,t.item)&&jB(e.type,t.type)&&e.assoc===t.assoc,WB=class{constructor(e,t){this.ds=e,this.sv=t}},GB=(e,t)=>new WB(e,t),GB(qz(),new Map),KB=e=>GB(Jz(e.store),XB(e.store)),qB=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!Uz(t.ds,e.id),JB=(e,t)=>{let n=HP(e.meta,JB,KP),r=e.doc.store;n.has(t)||(t.sv.forEach((t,n)=>{t<ZB(r,n)&&rV(e,MB(n,t))}),Vz(e,t.ds,e=>{}),n.add(t))},YB=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},XB=e=>{let t=new Map;return e.clients.forEach((e,n)=>{let r=e[e.length-1];t.set(n,r.id.clock+r.length)}),t},ZB=(e,t)=>{let n=e.clients.get(t);if(n===void 0)return 0;let r=n[n.length-1];return r.id.clock+r.length},QB=(e,t)=>{let n=e.clients.get(t.id.client);if(n===void 0)n=[],e.clients.set(t.id.client,n);else{let e=n[n.length-1];if(e.id.clock+e.length!==t.id.clock)throw bI()}n.push(t)},$B=(e,t)=>{let n=0,r=e.length-1,i=e[r],a=i.id.clock;if(a===t)return r;let o=rF(t/(a+i.length-1)*r);for(;n<=r;){if(i=e[o],a=i.id.clock,a<=t){if(t<a+i.length)return o;n=o+1}else r=o-1;o=rF((n+r)/2)}throw bI()},eV=(e,t)=>{let n=e.clients.get(t.client);return n[$B(n,t.clock)]},tV=eV,nV=(e,t,n)=>{let r=$B(t,n),i=t[r];return i.id.clock<n&&i instanceof TU?(t.splice(r+1,0,SU(e,i,n-i.id.clock)),r+1):r},rV=(e,t)=>{let n=e.doc.store.clients.get(t.client);return n[nV(e,n,t.clock)]},iV=(e,t,n)=>{let r=t.clients.get(n.client),i=$B(r,n.clock),a=r[i];return n.clock!==a.id.clock+a.length-1&&a.constructor!==GH&&r.splice(i+1,0,SU(e,a,n.clock-a.id.clock+1)),a},aV=(e,t,n)=>{let r=e.clients.get(t.id.client);r[$B(r,t.id.clock)]=n},oV=(e,t,n,r,i)=>{if(r===0)return;let a=n+r,o=nV(e,t,n),s;do s=t[o++],a<s.id.clock+s.length&&nV(e,t,a),i(s);while(o<t.length&&t[o].id.clock<a)},sV=class{constructor(e,t,n){this.doc=e,this.deleteSet=new Bz,this.beforeState=XB(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=t,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},cV=(e,t)=>t.deleteSet.clients.size===0&&!WP(t.afterState,(e,n)=>t.beforeState.get(n)!==e)?!1:(Wz(t.deleteSet),fB(e,t),Yz(e,t.deleteSet),!0),lV=(e,t,n)=>{let r=t._item;(r===null||r.id.clock<(e.beforeState.get(r.id.client)||0)&&!r.deleted)&&HP(e.changed,t,KP).add(n)},uV=(e,t)=>{let n=e[t],r=e[t-1],i=t;for(;i>0;n=r,r=e[--i-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof TU&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}let a=t-i;return a&&e.splice(t+1-a,a),a},dV=(e,t,n)=>{for(let[r,i]of e.clients.entries()){let e=t.clients.get(r);for(let r=i.length-1;r>=0;r--){let a=i[r],o=a.clock+a.len;for(let r=$B(e,a.clock),i=e[r];r<e.length&&i.id.clock<o;i=e[++r]){let i=e[r];if(a.clock+a.len<=i.id.clock)break;i instanceof TU&&i.deleted&&!i.keep&&n(i)&&i.gc(t,!1)}}}},fV=(e,t)=>{e.clients.forEach((e,n)=>{let r=t.clients.get(n);for(let t=e.length-1;t>=0;t--){let n=e[t],i=aF(r.length-1,1+$B(r,n.clock+n.len-1));for(let e=i,t=r[e];e>0&&t.id.clock>=n.clock;t=r[e])e-=1+uV(r,e)}})},pV=(e,t)=>{if(t<e.length){let n=e[t],r=n.doc,i=r.store,a=n.deleteSet,o=n._mergeStructs;try{Wz(a),n.afterState=XB(n.doc.store),r.emit(`beforeObserverCalls`,[n,r]);let e=[];n.changed.forEach((t,r)=>e.push(()=>{(r._item===null||!r._item.deleted)&&r._callObserver(n,t)})),e.push(()=>{n.changedParentTypes.forEach((t,r)=>{r._dEH.l.length>0&&(r._item===null||!r._item.deleted)&&(t=t.filter(e=>e.target._item===null||!e.target._item.deleted),t.forEach(e=>{e.currentTarget=r,e._path=null}),t.sort((e,t)=>e.path.length-t.path.length),e.push(()=>{kB(r._dEH,t,n)}))}),e.push(()=>r.emit(`afterTransaction`,[n,r])),e.push(()=>{n._needFormattingCleanup&&OH(n)})}),bL(e,[])}finally{r.gc&&dV(a,i,r.gcFilter),fV(a,i),n.afterState.forEach((e,t)=>{let r=n.beforeState.get(t)||0;if(r!==e){let e=i.clients.get(t),n=oF($B(e,r),1);for(let t=e.length-1;t>=n;)t-=1+uV(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:n}=o[e].id,r=i.clients.get(t),a=$B(r,n);a+1<r.length&&uV(r,a+1)>1||a>0&&uV(r,a)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(Nz(Dz,bz,`[yjs] `,xz,Tz,`Changed the client-id because another client seems to be using it.`),r.clientID=Qz()),r.emit(`afterTransactionCleanup`,[n,r]),r._observers.has(`update`)){let e=new aB;cV(e,n)&&r.emit(`update`,[e.toUint8Array(),n.origin,r,n])}if(r._observers.has(`updateV2`)){let e=new sB;cV(e,n)&&r.emit(`updateV2`,[e.toUint8Array(),n.origin,r,n])}let{subdocsAdded:s,subdocsLoaded:c,subdocsRemoved:l}=n;(s.size>0||l.size>0||c.size>0)&&(s.forEach(e=>{e.clientID=r.clientID,e.collectionid??=r.collectionid,r.subdocs.add(e)}),l.forEach(e=>r.subdocs.delete(e)),r.emit(`subdocs`,[{loaded:c,added:s,removed:l},r,n]),l.forEach(e=>e.destroy())),e.length<=t+1?(r._transactionCleanups=[],r.emit(`afterAllTransactions`,[r,e])):pV(e,t+1)}}},mV=(e,t,n=null,r=!0)=>{let i=e._transactionCleanups,a=!1,o=null;e._transaction===null&&(a=!0,e._transaction=new sV(e,n,r),i.push(e._transaction),i.length===1&&e.emit(`beforeAllTransactions`,[e]),e.emit(`beforeTransaction`,[e._transaction,e]));try{o=t(e._transaction)}finally{if(a){let t=e._transaction===i[0];e._transaction=null,t&&pV(i,0)}}return o},hV=class{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}},gV=(e,t,n)=>{Vz(e,n.deletions,n=>{n instanceof TU&&t.scope.some(t=>t===e.doc||PB(t,n))&&xU(n,!1)})},_V=(e,t,n)=>{let r=null,i=e.doc,a=e.scope;mV(i,n=>{for(;t.length>0&&e.currStackItem===null;){let r=i.store,o=t.pop(),s=new Set,c=[],l=!1;Vz(n,o.insertions,e=>{if(e instanceof TU){if(e.redone!==null){let{item:t,diff:i}=bU(r,e.id);i>0&&(t=rV(n,MB(t.id.client,t.id.clock+i))),e=t}!e.deleted&&a.some(t=>t===n.doc||PB(t,e))&&c.push(e)}}),Vz(n,o.deletions,e=>{e instanceof TU&&a.some(t=>t===n.doc||PB(t,e))&&!Uz(o.insertions,e.id)&&s.add(e)}),s.forEach(t=>{l=wU(n,t,s,o.insertions,e.ignoreRemoteMapChanges,e)!==null||l});for(let t=c.length-1;t>=0;t--){let r=c[t];e.deleteFilter(r)&&(r.delete(n),l=!0)}e.currStackItem=l?o:null}n.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),r=n},e);let o=e.currStackItem;if(o!=null){let t=r.changedParentTypes;e.emit(`stack-item-popped`,[{stackItem:o,type:n,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return o},vV=class extends nF{constructor(e,{captureTimeout:t=500,captureTransaction:n=e=>!0,deleteFilter:r=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:a=!1,doc:o=eF(e)?e[0].doc:e instanceof $z?e:e.doc}={}){super(),this.scope=[],this.doc=o,this.addToScope(e),this.deleteFilter=r,i.add(this),this.trackedOrigins=i,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=a,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!this.captureTransaction(e)||!this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)||!this.trackedOrigins.has(e.origin)&&(!e.origin||!this.trackedOrigins.has(e.origin.constructor)))return;let t=this.undoing,n=this.redoing,r=t?this.redoStack:this.undoStack;t?this.stopCapturing():n||this.clear(!1,!0);let i=new Bz;e.afterState.forEach((t,n)=>{let r=e.beforeState.get(n)||0,a=t-r;a>0&&Kz(i,n,r,a)});let a=QI(),o=!1;if(this.lastChange>0&&a-this.lastChange<this.captureTimeout&&r.length>0&&!t&&!n){let t=r[r.length-1];t.deletions=Gz([t.deletions,e.deleteSet]),t.insertions=Gz([t.insertions,i])}else r.push(new hV(e.deleteSet,i)),o=!0;!t&&!n&&(this.lastChange=a),Vz(e,e.deleteSet,t=>{t instanceof TU&&this.scope.some(n=>n===e.doc||PB(n,t))&&xU(t,!0)});let s=[{stackItem:r[r.length-1],origin:e.origin,type:t?`redo`:`undo`,changedParentTypes:e.changedParentTypes},this];o?this.emit(`stack-item-added`,s):this.emit(`stack-item-updated`,s)},this.doc.on(`afterTransaction`,this.afterTransactionHandler),this.doc.on(`destroy`,()=>{this.destroy()})}addToScope(e){let t=new Set(this.scope);e=eF(e)?e:[e],e.forEach(e=>{t.has(e)||(t.add(e),(e instanceof UV?e.doc!==this.doc:e!==this.doc)&&Pz(`[yjs#509] Not same Y.Doc`),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(n=>{e&&(this.undoStack.forEach(e=>gV(n,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>gV(n,this,e)),this.redoStack=[]),this.emit(`stack-cleared`,[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=_V(this,this.undoStack,`undo`)}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=_V(this,this.redoStack,`redo`)}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off(`afterTransaction`,this.afterTransactionHandler),super.destroy()}},yV=class{constructor(e,t){this.gen=ame(e),this.curr=null,this.done=!1,this.filterSkips=t,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===kU);return this.curr}},bV=class{constructor(e){this.currClient=0,this.startClock=0,this.written=0,this.encoder=e,this.clientStructs=[]}},xV=e=>CV(e,tB,aB),SV=(e,t)=>{if(e.constructor===GH){let{client:n,clock:r}=e.id;return new GH(MB(n,r+t),e.length-t)}else if(e.constructor===kU){let{client:n,clock:r}=e.id;return new kU(MB(n,r+t),e.length-t)}else{let n=e,{client:r,clock:i}=n.id;return new TU(MB(r,i+t),null,MB(r,i+t-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(t))}},CV=(e,t=rB,n=sB)=>{if(e.length===1)return e[0];let r=e.map(e=>new t(TI(e))),i=r.map(e=>new yV(e,!0)),a=null,o=new n,s=new bV(o);for(;i=i.filter(e=>e.curr!==null),i.sort((e,t)=>{if(e.curr.id.client===t.curr.id.client){let n=e.curr.id.clock-t.curr.id.clock;return n===0?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===kU?1:-1:n}else return t.curr.id.client-e.curr.id.client}),i.length!==0;){let e=i[0],t=e.curr.id.client;if(a!==null){let n=e.curr,r=!1;for(;n!==null&&n.id.clock+n.length<=a.struct.id.clock+a.struct.length&&n.id.client>=a.struct.id.client;)n=e.next(),r=!0;if(n===null||n.id.client!==t||r&&n.id.clock>a.struct.id.clock+a.struct.length)continue;if(t!==a.struct.id.client)EV(s,a.struct,a.offset),a={struct:n,offset:0},e.next();else if(a.struct.id.clock+a.struct.length<n.id.clock)if(a.struct.constructor===kU)a.struct.length=n.id.clock+n.length-a.struct.id.clock;else{EV(s,a.struct,a.offset);let e=n.id.clock-a.struct.id.clock-a.struct.length;a={struct:new kU(MB(t,a.struct.id.clock+a.struct.length),e),offset:0}}else{let t=a.struct.id.clock+a.struct.length-n.id.clock;t>0&&(a.struct.constructor===kU?a.struct.length-=t:n=SV(n,t)),a.struct.mergeWith(n)||(EV(s,a.struct,a.offset),a={struct:n,offset:0},e.next())}}else a={struct:e.curr,offset:0},e.next();for(let n=e.curr;n!==null&&n.id.client===t&&n.id.clock===a.struct.id.clock+a.struct.length&&n.constructor!==kU;n=e.next())EV(s,a.struct,a.offset),a={struct:n,offset:0}}return a!==null&&(EV(s,a.struct,a.offset),a=null),DV(s),Yz(o,Gz(r.map(e=>Xz(e)))),o.toUint8Array()},wV=(e,t,n=rB,r=sB)=>{let i=bB(t),a=new r,o=new bV(a),s=new n(TI(e)),c=new yV(s,!1);for(;c.curr;){let e=c.curr,t=e.id.client,n=i.get(t)||0;if(c.curr.constructor===kU){c.next();continue}if(e.id.clock+e.length>n)for(EV(o,e,oF(n-e.id.clock,0)),c.next();c.curr&&c.curr.id.client===t;)EV(o,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===t&&c.curr.id.clock+c.curr.length<=n;)c.next()}return DV(o),Yz(a,Xz(s)),a.toUint8Array()},TV=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:GF(e.encoder.restEncoder)}),e.encoder.restEncoder=HF(),e.written=0)},EV=(e,t,n)=>{e.written>0&&e.currClient!==t.id.client&&TV(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),YF(e.encoder.restEncoder,t.id.clock+n)),t.write(e.encoder,n),e.written++},DV=e=>{TV(e);let t=e.encoder.restEncoder;YF(t,e.clientStructs.length);for(let n=0;n<e.clientStructs.length;n++){let r=e.clientStructs[n];YF(t,r.written),nI(t,r.restEncoder)}},OV=(e,t,n,r)=>{let i=new n(TI(e)),a=new yV(i,!1),o=new r,s=new bV(o);for(let e=a.curr;e!==null;e=a.next())EV(s,t(e),0);return DV(s),Yz(o,Xz(i)),o.toUint8Array()},kV=e=>OV(e,xL,rB,aB),AV=`You must not compute changes after the event-handler fired.`,jV=class{constructor(e,t){this.target=e,this.currentTarget=e,this.transaction=t,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||=MV(this.currentTarget,this.target)}deletes(e){return Uz(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw vI(AV);let e=new Map,t=this.target;this.transaction.changed.get(t).forEach(n=>{if(n!==null){let r=t._map.get(n),i,a;if(this.adds(r)){let e=r.left;for(;e!==null&&this.adds(e);)e=e.left;if(this.deletes(r))if(e!==null&&this.deletes(e))i=`delete`,a=JP(e.content.getContent());else return;else e!==null&&this.deletes(e)?(i=`update`,a=JP(e.content.getContent())):(i=`add`,a=void 0)}else if(this.deletes(r))i=`delete`,a=JP(r.content.getContent());else return;e.set(n,{action:i,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw vI(AV);let t=this.target,n=KP(),r=KP(),i=[];if(e={added:n,deleted:r,delta:i,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,a=()=>{e&&i.push(e)};for(let i=t._start;i!==null;i=i.right)i.deleted?this.deletes(i)&&!this.adds(i)&&((e===null||e.delete===void 0)&&(a(),e={delete:0}),e.delete+=i.length,r.add(i)):this.adds(i)?((e===null||e.insert===void 0)&&(a(),e={insert:[]}),e.insert=e.insert.concat(i.content.getContent()),n.add(i)):((e===null||e.retain===void 0)&&(a(),e={retain:0}),e.retain+=i.length);e!==null&&e.retain===void 0&&a()}this._changes=e}return e}},MV=(e,t)=>{let n=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)n.unshift(t._item.parentSub);else{let e=0,r=t._item.parent._start;for(;r!==t._item&&r!==null;)!r.deleted&&r.countable&&(e+=r.length),r=r.right;n.unshift(e)}t=t._item.parent}return n},NV=()=>{Pz(`Invalid access: Add Yjs type to a document before reading data.`)},PV=80,FV=0,IV=class{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=FV++}},LV=e=>{e.timestamp=FV++},RV=(e,t,n)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=n,e.timestamp=FV++},zV=(e,t,n)=>{if(e.length>=PV){let r=e.reduce((e,t)=>e.timestamp<t.timestamp?e:t);return RV(r,t,n),r}else{let r=new IV(t,n);return e.push(r),r}},BV=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let n=e._searchMarker.length===0?null:e._searchMarker.reduce((e,n)=>iF(t-e.index)<iF(t-n.index)?e:n),r=e._start,i=0;for(n!==null&&(r=n.p,i=n.index,LV(n));r.right!==null&&i<t;){if(!r.deleted&&r.countable){if(t<i+r.length)break;i+=r.length}r=r.right}for(;r.left!==null&&i>t;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(i-=r.length);return n!==null&&iF(n.index-i)<r.parent.length/PV?(RV(n,r,i),n):zV(e._searchMarker,r,i)},VV=(e,t,n)=>{for(let r=e.length-1;r>=0;r--){let i=e[r];if(n>0){let t=i.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)t=t.left,t&&!t.deleted&&t.countable&&(i.index-=t.length);if(t===null||t.marker===!0){e.splice(r,1);continue}i.p=t,t.marker=!0}(t<i.index||n>0&&t===i.index)&&(i.index=oF(t,i.index+n))}},HV=(e,t,n)=>{let r=e,i=t.changedParentTypes;for(;HP(i,e,()=>[]).push(n),e._item!==null;)e=e._item.parent;kB(r._eH,n,t)},UV=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=EB(),this._dEH=EB(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw yI()}clone(){throw yI()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){DB(this._eH,e)}observeDeep(e){DB(this._dEH,e)}unobserve(e){OB(this._eH,e)}unobserveDeep(e){OB(this._dEH,e)}toJSON(){}},WV=(e,t,n)=>{e.doc??NV(),t<0&&(t=e._length+t),n<0&&(n=e._length+n);let r=n-t,i=[],a=e._start;for(;a!==null&&r>0;){if(a.countable&&!a.deleted){let e=a.content.getContent();if(e.length<=t)t-=e.length;else{for(let n=t;n<e.length&&r>0;n++)i.push(e[n]),r--;t=0}}a=a.right}return i},GV=e=>{e.doc??NV();let t=[],n=e._start;for(;n!==null;){if(n.countable&&!n.deleted){let e=n.content.getContent();for(let n=0;n<e.length;n++)t.push(e[n])}n=n.right}return t},KV=(e,t)=>{let n=[],r=e._start;for(;r!==null;){if(r.countable&&qB(r,t)){let e=r.content.getContent();for(let t=0;t<e.length;t++)n.push(e[t])}r=r.right}return n},qV=(e,t)=>{let n=0,r=e._start;for(e.doc??NV();r!==null;){if(r.countable&&!r.deleted){let i=r.content.getContent();for(let r=0;r<i.length;r++)t(i[r],n++,e)}r=r.right}},JV=(e,t)=>{let n=[];return qV(e,(r,i)=>{n.push(t(r,i,e))}),n},YV=e=>{let t=e._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};n=t.content.getContent(),r=0,t=t.right}let e=n[r++];return n.length<=r&&(n=null),{done:!1,value:e}}}},XV=(e,t)=>{e.doc??NV();let n=BV(e,t),r=e._start;for(n!==null&&(r=n.p,t-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(t<r.length)return r.content.getContent()[t];t-=r.length}},ZV=(e,t,n,r)=>{let i=n,a=e.doc,o=a.clientID,s=a.store,c=n===null?t._start:n.right,l=[],u=()=>{l.length>0&&(i=new TU(MB(o,ZB(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new oU(l)),i.integrate(e,0),l=[])};r.forEach(n=>{if(n===null)l.push(n);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(n);break;default:switch(u(),n.constructor){case Uint8Array:case ArrayBuffer:i=new TU(MB(o,ZB(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new KH(new Uint8Array(n))),i.integrate(e,0);break;case $z:i=new TU(MB(o,ZB(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new ZH(n)),i.integrate(e,0);break;default:if(n instanceof UV)i=new TU(MB(o,ZB(s,o)),i,i&&i.lastId,c,c&&c.id,t,null,new vU(n)),i.integrate(e,0);else throw Error(`Unexpected content type in insert operation`)}}}),u()},QV=()=>vI(`Length exceeded!`),$V=(e,t,n,r)=>{if(n>t._length)throw QV();if(n===0)return t._searchMarker&&VV(t._searchMarker,n,r.length),ZV(e,t,null,r);let i=n,a=BV(t,n),o=t._start;for(a!==null&&(o=a.p,n-=a.index,n===0&&(o=o.prev,n+=o&&o.countable&&!o.deleted?o.length:0));o!==null;o=o.right)if(!o.deleted&&o.countable){if(n<=o.length){n<o.length&&rV(e,MB(o.id.client,o.id.clock+n));break}n-=o.length}return t._searchMarker&&VV(t._searchMarker,i,r.length),ZV(e,t,o,r)},eH=(e,t,n)=>{let r=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(r)for(;r.right;)r=r.right;return ZV(e,t,r,n)},tH=(e,t,n,r)=>{if(r===0)return;let i=n,a=r,o=BV(t,n),s=t._start;for(o!==null&&(s=o.p,n-=o.index);s!==null&&n>0;s=s.right)!s.deleted&&s.countable&&(n<s.length&&rV(e,MB(s.id.client,s.id.clock+n)),n-=s.length);for(;r>0&&s!==null;)s.deleted||(r<s.length&&rV(e,MB(s.id.client,s.id.clock+r)),s.delete(e),r-=s.length),s=s.right;if(r>0)throw QV();t._searchMarker&&VV(t._searchMarker,i,-a+r)},nH=(e,t,n)=>{let r=t._map.get(n);r!==void 0&&r.delete(e)},rH=(e,t,n,r)=>{let i=t._map.get(n)||null,a=e.doc,o=a.clientID,s;if(r==null)s=new oU([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:s=new oU([r]);break;case Uint8Array:s=new KH(r);break;case $z:s=new ZH(r);break;default:if(r instanceof UV)s=new vU(r);else throw Error(`Unexpected content type`)}new TU(MB(o,ZB(a.store,o)),i,i&&i.lastId,null,null,t,n,s).integrate(e,0)},iH=(e,t)=>{e.doc??NV();let n=e._map.get(t);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},aH=e=>{let t={};return e.doc??NV(),e._map.forEach((e,n)=>{e.deleted||(t[n]=e.content.getContent()[e.length-1])}),t},oH=(e,t)=>{e.doc??NV();let n=e._map.get(t);return n!==void 0&&!n.deleted},sH=(e,t)=>{let n={};return e._map.forEach((e,r)=>{let i=e;for(;i!==null&&(!t.sv.has(i.id.client)||i.id.clock>=(t.sv.get(i.id.client)||0));)i=i.left;i!==null&&qB(i,t)&&(n[r]=i.content.getContent()[i.length-1])}),n},cH=e=>(e.doc??NV(),Lz(e._map.entries(),e=>!e[1].deleted)),lH=class extends jV{},uH=class e extends UV{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let n=new e;return n.push(t),n}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof UV?e.clone():e)),t}get length(){return this.doc??NV(),this._length}_callObserver(e,t){super._callObserver(e,t),HV(this,e,new lH(this,e))}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):mV(this.doc,n=>{$V(n,this,e,t)})}push(e){this.doc===null?this._prelimContent.push(...e):mV(this.doc,t=>{eH(t,this,e)})}unshift(e){this.insert(0,e)}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):mV(this.doc,n=>{tH(n,this,e,t)})}get(e){return XV(this,e)}toArray(){return GV(this)}slice(e=0,t=this.length){return WV(this,e,t)}toJSON(){return this.map(e=>e instanceof UV?e.toJSON():e)}map(e){return JV(this,e)}forEach(e){qV(this,e)}[Symbol.iterator](){return YV(this)}_write(e){e.writeTypeRef(dU)}},dH=e=>new uH,fH=class extends jV{constructor(e,t,n){super(e,t),this.keysChanged=n}},pH=class e extends UV{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((e,n)=>{t.set(n,e instanceof UV?e.clone():e)}),t}_callObserver(e,t){HV(this,e,new fH(this,e,t))}toJSON(){this.doc??NV();let e={};return this._map.forEach((t,n)=>{if(!t.deleted){let r=t.content.getContent()[t.length-1];e[n]=r instanceof UV?r.toJSON():r}}),e}get size(){return[...cH(this)].length}keys(){return Rz(cH(this),e=>e[0])}values(){return Rz(cH(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Rz(cH(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??NV(),this._map.forEach((t,n)=>{t.deleted||e(t.content.getContent()[t.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc===null?this._prelimContent.delete(e):mV(this.doc,t=>{nH(t,this,e)})}set(e,t){return this.doc===null?this._prelimContent.set(e,t):mV(this.doc,n=>{rH(n,this,e,t)}),t}get(e){return iH(this,e)}has(e){return oH(this,e)}clear(){this.doc===null?this._prelimContent.clear():mV(this.doc,e=>{this.forEach(function(t,n,r){nH(e,r,n)})})}_write(e){e.writeTypeRef(fU)}},mH=e=>new pH,hH=(e,t)=>e===t||typeof e==`object`&&typeof t==`object`&&e&&t&&gL(e,t),gH=class{constructor(e,t,n,r){this.left=e,this.right=t,this.index=n,this.currentAttributes=r}forward(){switch(this.right===null&&bI(),this.right.content.constructor){case tU:this.right.deleted||bH(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}},_H=(e,t,n)=>{for(;t.right!==null&&n>0;){switch(t.right.content.constructor){case tU:t.right.deleted||bH(t.currentAttributes,t.right.content);break;default:t.right.deleted||(n<t.right.length&&rV(e,MB(t.right.id.client,t.right.id.clock+n)),t.index+=t.right.length,n-=t.right.length);break}t.left=t.right,t.right=t.right.right}return t},vH=(e,t,n,r)=>{let i=new Map,a=r?BV(t,n):null;return a?_H(e,new gH(a.p.left,a.p,a.index,i),n-a.index):_H(e,new gH(null,t._start,0,i),n)},yH=(e,t,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===tU&&hH(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();let i=e.doc,a=i.clientID;r.forEach((r,o)=>{let s=n.left,c=n.right,l=new TU(MB(a,ZB(i.store,a)),s,s&&s.lastId,c,c&&c.id,t,null,new tU(o,r));l.integrate(e,0),n.right=l,n.forward()})},bH=(e,t)=>{let{key:n,value:r}=t;r===null?e.delete(n):e.set(n,r)},xH=(e,t)=>{for(;e.right!==null&&(e.right.deleted||e.right.content.constructor===tU&&hH(t[e.right.content.key]??null,e.right.content.value));)e.forward()},SH=(e,t,n,r)=>{let i=e.doc,a=i.clientID,o=new Map;for(let s in r){let c=r[s],l=n.currentAttributes.get(s)??null;if(!hH(l,c)){o.set(s,l);let{left:r,right:u}=n;n.right=new TU(MB(a,ZB(i.store,a)),r,r&&r.lastId,u,u&&u.id,t,null,new tU(s,c)),n.right.integrate(e,0),n.forward()}}return o},CH=(e,t,n,r,i)=>{n.currentAttributes.forEach((e,t)=>{i[t]===void 0&&(i[t]=null)});let a=e.doc,o=a.clientID;xH(n,i);let s=SH(e,t,n,i),c=r.constructor===String?new cU(r):r instanceof UV?new vU(r):new $H(r),{left:l,right:u,index:d}=n;t._searchMarker&&VV(t._searchMarker,n.index,c.getLength()),u=new TU(MB(o,ZB(a.store,o)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),n.right=u,n.index=d,n.forward(),yH(e,t,n,s)},wH=(e,t,n,r,i)=>{let a=e.doc,o=a.clientID;xH(n,i);let s=SH(e,t,n,i);iterationLoop:for(;n.right!==null&&(r>0||s.size>0&&(n.right.deleted||n.right.content.constructor===tU));){if(!n.right.deleted)switch(n.right.content.constructor){case tU:{let{key:t,value:a}=n.right.content,o=i[t];if(o!==void 0){if(hH(o,a))s.delete(t);else{if(r===0)break iterationLoop;s.set(t,a)}n.right.delete(e)}else n.currentAttributes.set(t,a);break}default:r<n.right.length&&rV(e,MB(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let i=``;for(;r>0;r--)i+=`
|
|
25
|
+
`;n.right=new TU(MB(o,ZB(a.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,t,null,new cU(i)),n.right.integrate(e,0),n.forward()}yH(e,t,n,s)},TH=(e,t,n,r,i)=>{let a=t,o=BP();for(;a&&(!a.countable||a.deleted);){if(!a.deleted&&a.content.constructor===tU){let e=a.content;o.set(e.key,e)}a=a.right}let s=0,c=!1;for(;t!==a;){if(n===t&&(c=!0),!t.deleted){let n=t.content;switch(n.constructor){case tU:{let{key:a,value:l}=n,u=r.get(a)??null;(o.get(a)!==n||u===l)&&(t.delete(e),s++,!c&&(i.get(a)??null)===l&&u!==l&&(u===null?i.delete(a):i.set(a,u))),!c&&!t.deleted&&bH(i,n);break}}}t=t.right}return s},EH=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let n=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===tU){let r=t.content.key;n.has(r)?t.delete(e):n.add(r)}t=t.left}},DH=e=>{let t=0;return mV(e.doc,n=>{let r=e._start,i=e._start,a=BP(),o=VP(a);for(;i;){if(i.deleted===!1)switch(i.content.constructor){case tU:bH(o,i.content);break;default:t+=TH(n,r,i,a,o),a=VP(o),r=i;break}i=i.right}}),t},OH=e=>{let t=new Set,n=e.doc;for(let[r,i]of e.afterState.entries()){let a=e.beforeState.get(r)||0;i!==a&&oV(e,n.store.clients.get(r),a,i,e=>{!e.deleted&&e.content.constructor===tU&&e.constructor!==GH&&t.add(e.parent)})}mV(n,n=>{Vz(e,e.deleteSet,e=>{if(e instanceof GH||!e.parent._hasFormatting||t.has(e.parent))return;let r=e.parent;e.content.constructor===tU?t.add(r):EH(n,e)});for(let e of t)DH(e)})},kH=(e,t,n)=>{let r=n,i=VP(t.currentAttributes),a=t.right;for(;n>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case vU:case $H:case cU:n<t.right.length&&rV(e,MB(t.right.id.client,t.right.id.clock+n)),n-=t.right.length,t.right.delete(e);break}t.forward()}a&&TH(e,a,t.right,i,t.currentAttributes);let o=(t.left||t.right).parent;return o._searchMarker&&VV(o._searchMarker,t.index,-r+n),t},AH=class extends jV{constructor(e,t,n){super(e,t),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(e=>{e===null?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){return this._changes===null&&(this._changes={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set}),this._changes}get delta(){if(this._delta===null){let e=this.target.doc,t=[];mV(e,e=>{let n=new Map,r=new Map,i=this.target._start,a=null,o={},s=``,c=0,l=0,u=()=>{if(a!==null){let e=null;switch(a){case`delete`:l>0&&(e={delete:l}),l=0;break;case`insert`:(typeof s==`object`||s.length>0)&&(e={insert:s},n.size>0&&(e.attributes={},n.forEach((t,n)=>{t!==null&&(e.attributes[n]=t)}))),s=``;break;case`retain`:c>0&&(e={retain:c},pL(o)||(e.attributes=lL({},o))),c=0;break}e&&t.push(e),a=null}};for(;i!==null;){switch(i.content.constructor){case vU:case $H:this.adds(i)?this.deletes(i)||(u(),a=`insert`,s=i.content.getContent()[0],u()):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=1):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=1);break;case cU:this.adds(i)?this.deletes(i)||(a!==`insert`&&(u(),a=`insert`),s+=i.content.str):this.deletes(i)?(a!==`delete`&&(u(),a=`delete`),l+=i.length):i.deleted||(a!==`retain`&&(u(),a=`retain`),c+=i.length);break;case tU:{let{key:t,value:s}=i.content;if(this.adds(i))this.deletes(i)||(hH(n.get(t)??null,s)?s!==null&&i.delete(e):(a===`retain`&&u(),hH(s,r.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(i)){r.set(t,s);let e=n.get(t)??null;hH(e,s)||(a===`retain`&&u(),o[t]=e)}else if(!i.deleted){r.set(t,s);let n=o[t];n!==void 0&&(hH(n,s)?n!==null&&i.delete(e):(a===`retain`&&u(),s===null?delete o[t]:o[t]=s))}i.deleted||(a===`insert`&&u(),bH(n,i.content));break}}i=i.right}for(u();t.length>0;){let e=t[t.length-1];if(e.retain!==void 0&&e.attributes===void 0)t.pop();else break}}),this._delta=t}return this._delta}},jH=class e extends UV{constructor(e){super(),this._pending=e===void 0?[]:[()=>this.insert(0,e)],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??NV(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(e,t){super._callObserver(e,t);let n=new AH(this,e,t);HV(this,e,n),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??NV();let e=``,t=this._start;for(;t!==null;)!t.deleted&&t.countable&&t.content.constructor===cU&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){this.doc===null?this._pending.push(()=>this.applyDelta(e)):mV(this.doc,n=>{let r=new gH(null,this._start,0,new Map);for(let i=0;i<e.length;i++){let a=e[i];if(a.insert!==void 0){let o=!t&&typeof a.insert==`string`&&i===e.length-1&&r.right===null&&a.insert.slice(-1)===`
|
|
26
|
+
`?a.insert.slice(0,-1):a.insert;(typeof o!=`string`||o.length>0)&&CH(n,this,r,o,a.attributes||{})}else a.retain===void 0?a.delete!==void 0&&kH(n,r,a.delete):wH(n,this,r,a.retain,a.attributes||{})}})}toDelta(e,t,n){this.doc??NV();let r=[],i=new Map,a=this.doc,o=``,s=this._start;function c(){if(o.length>0){let e={},t=!1;i.forEach((n,r)=>{t=!0,e[r]=n});let n={insert:o};t&&(n.attributes=e),r.push(n),o=``}}let l=()=>{for(;s!==null;){if(qB(s,e)||t!==void 0&&qB(s,t))switch(s.content.constructor){case cU:{let r=i.get(`ychange`);e!==void 0&&!qB(s,e)?(r===void 0||r.user!==s.id.client||r.type!==`removed`)&&(c(),i.set(`ychange`,n?n(`removed`,s.id):{type:`removed`})):t!==void 0&&!qB(s,t)?(r===void 0||r.user!==s.id.client||r.type!==`added`)&&(c(),i.set(`ychange`,n?n(`added`,s.id):{type:`added`})):r!==void 0&&(c(),i.delete(`ychange`)),o+=s.content.str;break}case vU:case $H:{c();let e={insert:s.content.getContent()[0]};if(i.size>0){let t={};e.attributes=t,i.forEach((e,n)=>{t[n]=e})}r.push(e);break}case tU:qB(s,e)&&(c(),bH(i,s.content));break}s=s.right}c()};return e||t?mV(a,n=>{e&&JB(n,e),t&&JB(n,t),l()},`cleanup`):l(),r}insert(e,t,n){if(t.length<=0)return;let r=this.doc;r===null?this._pending.push(()=>this.insert(e,t,n)):mV(r,r=>{let i=vH(r,this,e,!n);n||(n={},i.currentAttributes.forEach((e,t)=>{n[t]=e})),CH(r,this,i,t,n)})}insertEmbed(e,t,n){let r=this.doc;r===null?this._pending.push(()=>this.insertEmbed(e,t,n||{})):mV(r,r=>{let i=vH(r,this,e,!n);CH(r,this,i,t,n||{})})}delete(e,t){if(t===0)return;let n=this.doc;n===null?this._pending.push(()=>this.delete(e,t)):mV(n,n=>{kH(n,vH(n,this,e,!0),t)})}format(e,t,n){if(t===0)return;let r=this.doc;r===null?this._pending.push(()=>this.format(e,t,n)):mV(r,r=>{let i=vH(r,this,e,!1);i.right!==null&&wH(r,this,i,t,n)})}removeAttribute(e){this.doc===null?this._pending.push(()=>this.removeAttribute(e)):mV(this.doc,t=>{nH(t,this,e)})}setAttribute(e,t){this.doc===null?this._pending.push(()=>this.setAttribute(e,t)):mV(this.doc,n=>{rH(n,this,e,t)})}getAttribute(e){return iH(this,e)}getAttributes(){return aH(this)}_write(e){e.writeTypeRef(pU)}},MH=e=>new jH,NH=class{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??NV()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,!e.deleted&&(t.constructor===IH||t.constructor===PH)&&t._start!==null)e=t._start;else for(;e!==null;){let t=e.next;if(t!==null){e=t;break}else e=e.parent===this._root?null:e.parent._item}while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}},PH=class e extends UV{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(e=>e instanceof UV?e.clone():e)),t}get length(){return this.doc??NV(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new NH(this,e)}querySelector(e){e=e.toUpperCase();let t=new NH(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),XP(new NH(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){HV(this,e,new RH(this,t,e))}toString(){return JV(this,e=>e.toString()).join(``)}toJSON(){return this.toString()}toDOM(e=document,t={},n){let r=e.createDocumentFragment();return n!==void 0&&n._createAssociation(r,this),qV(this,i=>{r.insertBefore(i.toDOM(e,t,n),null)}),r}insert(e,t){this.doc===null?this._prelimContent.splice(e,0,...t):mV(this.doc,n=>{$V(n,this,e,t)})}insertAfter(e,t){if(this.doc!==null)mV(this.doc,n=>{let r=e&&e instanceof UV?e._item:e;ZV(n,this,r,t)});else{let n=this._prelimContent,r=e===null?0:n.findIndex(t=>t===e)+1;if(r===0&&e!==null)throw vI(`Reference item not found`);n.splice(r,0,...t)}}delete(e,t=1){this.doc===null?this._prelimContent.splice(e,t):mV(this.doc,n=>{tH(n,this,e,t)})}toArray(){return GV(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return XV(this,e)}slice(e=0,t=this.length){return WV(this,e,t)}forEach(e){qV(this,e)}_write(e){e.writeTypeRef(hU)}},FH=e=>new PH,IH=class e extends PH{constructor(e=`UNDEFINED`){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName),n=this.getAttributes();return dL(n,(e,n)=>{t.setAttribute(n,e)}),t.insert(0,this.toArray().map(e=>e instanceof UV?e.clone():e)),t}toString(){let e=this.getAttributes(),t=[],n=[];for(let t in e)n.push(t);n.sort();let r=n.length;for(let i=0;i<r;i++){let r=n[i];t.push(r+`="`+e[r]+`"`)}let i=this.nodeName.toLocaleLowerCase();return`<${i}${t.length>0?` `+t.join(` `):``}>${super.toString()}</${i}>`}removeAttribute(e){this.doc===null?this._prelimAttrs.delete(e):mV(this.doc,t=>{nH(t,this,e)})}setAttribute(e,t){this.doc===null?this._prelimAttrs.set(e,t):mV(this.doc,n=>{rH(n,this,e,t)})}getAttribute(e){return iH(this,e)}hasAttribute(e){return oH(this,e)}getAttributes(e){return e?sH(this,e):aH(this)}toDOM(e=document,t={},n){let r=e.createElement(this.nodeName),i=this.getAttributes();for(let e in i){let t=i[e];typeof t==`string`&&r.setAttribute(e,t)}return qV(this,i=>{r.appendChild(i.toDOM(e,t,n))}),n!==void 0&&n._createAssociation(r,this),r}_write(e){e.writeTypeRef(mU),e.writeKey(this.nodeName)}},LH=e=>new IH(e.readKey()),RH=class extends jV{constructor(e,t,n){super(e,n),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{e===null?this.childListChanged=!0:this.attributesChanged.add(e)})}},zH=class e extends pH{constructor(e){super(),this.hookName=e}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((e,n)=>{t.set(n,e)}),t}toDOM(e=document,t={},n){let r=t[this.hookName],i;return i=r===void 0?document.createElement(this.hookName):r.createDom(this),i.setAttribute(`data-yjs-hook`,this.hookName),n!==void 0&&n._createAssociation(i,this),i}_write(e){e.writeTypeRef(gU),e.writeKey(this.hookName)}},BH=e=>new zH(e.readKey()),VH=class e extends jH{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(e=document,t,n){let r=e.createTextNode(this.toString());return n!==void 0&&n._createAssociation(r,this),r}toString(){return this.toDelta().map(e=>{let t=[];for(let n in e.attributes){let r=[];for(let t in e.attributes[n])r.push({key:t,value:e.attributes[n][t]});r.sort((e,t)=>e.key<t.key?-1:1),t.push({nodeName:n,attrs:r})}t.sort((e,t)=>e.nodeName<t.nodeName?-1:1);let n=``;for(let e=0;e<t.length;e++){let r=t[e];n+=`<${r.nodeName}`;for(let e=0;e<r.attrs.length;e++){let t=r.attrs[e];n+=` ${t.key}="${t.value}"`}n+=`>`}n+=e.insert;for(let e=t.length-1;e>=0;e--)n+=`</${t[e].nodeName}>`;return n}).join(``)}toJSON(){return this.toString()}_write(e){e.writeTypeRef(_U)}},HH=e=>new VH,UH=class{constructor(e,t){this.id=e,this.length=t}get deleted(){throw yI()}mergeWith(e){return!1}write(e,t,n){throw yI()}integrate(e,t){throw yI()}},WH=0,GH=class extends UH{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),QB(e.doc.store,this)}write(e,t){e.writeInfo(WH),e.writeLen(this.length-t)}getMissing(e,t){return null}},KH=class e{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(e){throw yI()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}},qH=e=>new KH(e.readBuf()),JH=class e{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let n=new e(this.len-t);return this.len=t,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){Kz(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}},YH=e=>new JH(e.readLen()),XH=(e,t)=>new $z({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),ZH=class e{constructor(e){e._item&&console.error(`This document was already integrated as a sub-document. You should create a second instance instead with the same guid.`),this.doc=e;let t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),e.meta!==null&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(XH(this.doc.guid,this.opts))}splice(e){throw yI()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}},QH=e=>new ZH(XH(e.readString(),e.readAny())),$H=class e{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(e){throw yI()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}},eU=e=>new $H(e.readJSON()),tU=class e{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(e){throw yI()}mergeWith(e){return!1}integrate(e,t){let n=t.parent;n._searchMarker=null,n._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}},nU=e=>new tU(e.readKey(),e.readJSON()),rU=class e{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeString(t===void 0?`undefined`:JSON.stringify(t))}}getRef(){return 2}},iU=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++){let t=e.readString();t===`undefined`?n.push(void 0):n.push(JSON.parse(t))}return new rU(n)},aU=jL(`node_env`)===`development`,oU=class e{constructor(e){this.arr=e,aU&&vL(e)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let n=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let n=this.arr.length;e.writeLen(n-t);for(let r=t;r<n;r++){let t=this.arr[r];e.writeAny(t)}}getRef(){return 8}},sU=e=>{let t=e.readLen(),n=[];for(let r=0;r<t;r++)n.push(e.readAny());return new oU(n)},cU=class e{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split(``)}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let n=new e(this.str.slice(t));this.str=this.str.slice(0,t);let r=this.str.charCodeAt(t-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,t-1)+`�`,n.str=`�`+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(t===0?this.str:this.str.slice(t))}getRef(){return 4}},lU=e=>new cU(e.readString()),uU=[dH,mH,MH,LH,FH,BH,HH],dU=0,fU=1,pU=2,mU=3,hU=4,gU=5,_U=6,vU=class e{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(e){throw yI()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;t!==null;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;t!==null;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;t!==null;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}},yU=e=>new vU(uU[e.readTypeRef()](e)),bU=(e,t)=>{let n=t,r=0,i;do r>0&&(n=MB(n.client,n.clock+r)),i=tV(e,n),r=n.clock-i.id.clock,n=i.redone;while(n!==null&&i instanceof TU);return{item:i,diff:r}},xU=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},SU=(e,t,n)=>{let{client:r,clock:i}=t.id,a=new TU(MB(r,i+n),t,MB(r,i+n-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(n));return t.deleted&&a.markDeleted(),t.keep&&(a.keep=!0),t.redone!==null&&(a.redone=MB(t.redone.client,t.redone.clock+n)),t.right=a,a.right!==null&&(a.right.left=a),e._mergeStructs.push(a),a.parentSub!==null&&a.right===null&&a.parent._map.set(a.parentSub,a),t.length=n,a},CU=(e,t)=>QP(e,e=>Uz(e.deletions,t)),wU=(e,t,n,r,i,a)=>{let o=e.doc,s=o.store,c=o.clientID,l=t.redone;if(l!==null)return rV(e,l);let u=t.parent._item,d=null,f;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||wU(e,u,n,r,i,a)===null))return null;for(;u.redone!==null;)u=rV(e,u.redone)}let p=u===null?t.parent:u.content.type;if(t.parentSub===null){for(d=t.left,f=t;d!==null;){let t=d;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:rV(e,t.redone);if(t!==null&&t.parent._item===u){d=t;break}d=d.left}for(;f!==null;){let t=f;for(;t!==null&&t.parent._item!==u;)t=t.redone===null?null:rV(e,t.redone);if(t!==null&&t.parent._item===u){f=t;break}f=f.right}}else if(f=null,t.right&&!i){for(d=t;d!==null&&d.right!==null&&(d.right.redone||Uz(r,d.right.id)||CU(a.undoStack,d.right.id)||CU(a.redoStack,d.right.id));)for(d=d.right;d.redone;)d=rV(e,d.redone);if(d&&d.right!==null)return null}else d=p._map.get(t.parentSub)||null;let m=MB(c,ZB(s,c)),h=new TU(m,d,d&&d.lastId,f,f&&f.id,p,t.parentSub,t.content.copy());return t.redone=m,xU(h,!0),h.integrate(e,0),h},TU=class e extends UH{constructor(e,t,n,r,i,a,o,s){super(e,s.getLength()),this.origin=n,this.left=t,this.right=r,this.rightOrigin=i,this.parent=a,this.parentSub=o,this.redone=null,this.content=s,this.info=this.content.isCountable()?2:0}set marker(e){(this.info&8)>0!==e&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=ZB(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=ZB(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===AB&&this.id.client!==this.parent.client&&this.parent.clock>=ZB(n,this.parent.client))return this.parent.client;if(this.origin&&=(this.left=iV(t,n,this.origin),this.left.lastId),this.rightOrigin&&=(this.right=rV(t,this.rightOrigin),this.right.id),this.left&&this.left.constructor===GH||this.right&&this.right.constructor===GH)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===AB){let e=tV(n,this.parent);e.constructor===GH?this.parent=null:this.parent=e.content.type}return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=iV(e,e.doc.store,MB(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let t=this.left,n;if(t!==null)n=t.right;else if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start;let r=new Set,i=new Set;for(;n!==null&&n!==this.right;){if(i.add(n),r.add(n),jB(this.origin,n.origin)){if(n.id.client<this.id.client)t=n,r.clear();else if(jB(this.rightOrigin,n.rightOrigin))break}else if(n.origin!==null&&i.has(tV(e.doc.store,n.origin)))r.has(tV(e.doc.store,n.origin))||(t=n,r.clear());else break;n=n.right}this.left=t}if(this.left!==null)this.right=this.left.right,this.left.right=this;else{let e;if(this.parentSub!==null)for(e=this.parent._map.get(this.parentSub)||null;e!==null&&e.left!==null;)e=e.left;else e=this.parent._start,this.parent._start=this;this.right=e}this.right===null?this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)):this.right.left=this,this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),QB(e.doc.store,this),this.content.integrate(e,this),lV(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new GH(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:MB(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&jB(e.origin,this.lastId)&&this.right===e&&jB(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){let t=this.parent._searchMarker;return t&&t.forEach(t=>{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&this.parentSub===null&&(t._length-=this.length),this.markDeleted(),Kz(e.deleteSet,this.id.client,this.id.clock,this.length),lV(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw bI();this.content.gc(e),t?aV(e,this,new GH(this.id,this.length)):this.content=new JH(this.length)}write(e,t){let n=t>0?MB(this.id.client,this.id.clock+t-1):this.origin,r=this.rightOrigin,i=this.parentSub,a=this.content.getRef()&31|(n===null?0:128)|(r===null?0:64)|(i===null?0:32);if(e.writeInfo(a),n!==null&&e.writeLeftID(n),r!==null&&e.writeRightID(r),n===null&&r===null){let t=this.parent;if(t._item!==void 0){let n=t._item;if(n===null){let n=NB(t);e.writeParentInfo(!0),e.writeString(n)}else e.writeParentInfo(!1),e.writeLeftID(n.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===AB?(e.writeParentInfo(!1),e.writeLeftID(t)):bI();i!==null&&e.writeString(i)}this.content.write(e,t)}},EU=(e,t)=>DU[t&31](e),DU=[()=>{bI()},YH,iU,qH,lU,eU,nU,yU,sU,QH,()=>{bI()}],OU=10,kU=class extends UH{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor?(this.length+=e.length,!0):!1}integrate(e,t){bI()}write(e,t){e.writeInfo(OU),YF(e.restEncoder,this.length-t)}getMissing(e,t){return null}},AU=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:{},jU=`__ $YJS$ __`,AU[jU]===!0&&console.error(`Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438`),AU[jU]=!0})),NU,ome=o((()=>{NU=()=>{let e=!0;return(t,n)=>{if(e){e=!1;try{t()}finally{e=!0}}else n!==void 0&&n()}}})),PU,FU,IU,LU,sme=o((()=>{PU=/[\uD800-\uDBFF]/,FU=/[\uDC00-\uDFFF]/,IU=(e,t)=>{let n=0,r=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;for(n>0&&PU.test(e[n-1])&&n--;r+n<e.length&&r+n<t.length&&e[e.length-r-1]===t[t.length-r-1];)r++;return r>0&&FU.test(e[e.length-r])&&r--,{index:n,remove:e.length-n-r,insert:t.slice(n,t.length-r)}},LU=IU})),RU,zU,BU,VU=o((()=>{mM(),RU=new pM(`y-sync`),zU=new pM(`y-undo`),BU=new pM(`yjs-cursor`)})),HU,UU,WU,GU,KU,qU,JU,YU,XU,cme=o((()=>{CF(),HU=(e,t)=>e>>>t|e<<32-t,UU=e=>HU(e,2)^HU(e,13)^HU(e,22),WU=e=>HU(e,6)^HU(e,11)^HU(e,25),GU=e=>HU(e,7)^HU(e,18)^e>>>3,KU=e=>HU(e,17)^HU(e,19)^e>>>10,qU=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),JU=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),YU=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(JU),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,t=this._W;for(let e=16;e<64;e++)t[e]=KU(t[e-2])+t[e-7]+GU(t[e-15])+t[e-16];let n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7];for(let e=0,u,d;e<64;e++)u=l+WU(o)+(o&s^~o&c)+qU[e]+t[e]>>>0,d=UU(n)+(n&r^n&i^r&i)>>>0,l=c,c=s,s=o,o=a+u>>>0,a=i,i=r,r=n,n=u+d>>>0;e[0]+=n,e[1]+=r,e[2]+=i,e[3]+=a,e[4]+=o,e[5]+=s,e[6]+=c,e[7]+=l}digest(e){let t=0;for(;t+56<=e.length;){let n=0;for(;n<16&&t+3<e.length;n++)this._W[n]=e[t++]<<24|e[t++]<<16|e[t++]<<8|e[t++];if(t%64!=0){for(this._W.fill(0,n,16);t<e.length;)this._W[n]|=e[t]<<(3-t%4)*8,t++;this._W[n]|=128<<(3-t%4)*8}this._updateHash()}let n=t%64!=0;this._W.fill(0,0,16);let r=0;for(;t<e.length;r++)for(let n=3;n>=0&&t<e.length;n--)this._W[r]|=e[t++]<<n*8;n||(this._W[r-(t%4==0?0:1)]|=128<<(3-t%4)*8),this._W[14]=e.byteLength/xF,this._W[15]=e.byteLength*8,this._updateHash();let i=new Uint8Array(32);for(let e=0;e<this._H.length;e++)for(let t=0;t<4;t++)i[e*4+t]=this._H[e]>>>(3-t)*8;return i}},XU=e=>new YU().digest(e)})),ZU,QU,lme=o((()=>{cme(),UL(),ZU=e=>{for(let t=6;t<e.length;t++)e[t%6]=e[t%6]^e[t];return e.slice(0,6)},QU=e=>BL(ZU(XU(HL(e))))})),$U,eW,tW,nW,rW,iW,aW,oW,sW,cW,lW,uW,dW,fW,pW,mW,hW,gW,_W,vW,yW,bW,xW,SW,CW,wW,TW,EW,DW=o((()=>{ome(),gj(),mM(),cF(),yL(),qP(),sme(),xI(),VU(),MU(),PW(),ZI(),IL(),mz(),vz(),GP(),lme(),$U=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&t.sv.get(e.id.client)>e.id.clock&&!Uz(t.ds,e.id),eW=[{light:`#ecd44433`,dark:`#ecd444`}],tW=(e,t,n)=>{if(!e.has(n)){if(e.size<t.length){let n=KP();e.forEach(e=>n.add(e)),t=t.filter(e=>!n.has(e))}e.set(n,JI(t))}return e.get(n)},nW=(e,{colors:t=eW,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:i=()=>{},mapping:a}={})=>{let o=!1,s=new aW(e,a),c=new dM({props:{editable:e=>{let t=RU.getState(e);return t.snapshot==null&&t.prevSnapshot==null}},key:RU,state:{init:(i,a)=>({type:e,doc:e.doc,binding:s,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:t,colorMapping:n,permanentUserData:r}),apply:(e,t)=>{let n=e.getMeta(RU);if(n!==void 0){t=Object.assign({},t);for(let e in n)t[e]=n[e]}return t.addToHistory=e.getMeta(`addToHistory`)!==!1,t.isChangeOrigin=n!==void 0&&!!n.isChangeOrigin,t.isUndoRedoOperation=n!==void 0&&!!n.isChangeOrigin&&!!n.isUndoRedoOperation,s.prosemirrorView!==null&&n!==void 0&&(n.snapshot!=null||n.prevSnapshot!=null)&&_z(0,()=>{s.prosemirrorView!=null&&(n.restore==null?s._renderSnapshot(n.snapshot,n.prevSnapshot,t):(s._renderSnapshot(n.snapshot,n.snapshot,t),delete t.restore,delete t.snapshot,delete t.prevSnapshot,s.mux(()=>{s._prosemirrorChanged(s.prosemirrorView.state.doc)})))}),t}},view:e=>(s.initView(e),a??s._forceRerender(),i(),{update:()=>{let t=c.getState(e.state);if(t.snapshot==null&&t.prevSnapshot==null&&(o||e.state.doc.content.findDiffStart(e.state.doc.type.createAndFill().content)!==null)){if(o=!0,t.addToHistory===!1&&!t.isChangeOrigin){let t=zU.getState(e.state),n=t&&t.undoManager;n&&n.stopCapturing()}s.mux(()=>{t.doc.transact(n=>{n.meta.set(`addToHistory`,t.addToHistory),s._prosemirrorChanged(e.state.doc)},RU)})}},destroy:()=>{s.destroy()}})});return c},rW=(e,t,n)=>{if(t!==null&&t.anchor!==null&&t.head!==null)if(t.type===`all`)e.setSelection(new aM(e.doc));else if(t.type===`node`){let r=NW(n.doc,n.type,t.anchor,n.mapping);e.setSelection(iM.create(e.doc,r))}else{let r=NW(n.doc,n.type,t.anchor,n.mapping),i=NW(n.doc,n.type,t.head,n.mapping);if(r!==null&&i!==null){let t=z.between(e.doc.resolve(r),e.doc.resolve(i));e.setSelection(t)}}},iW=(e,t)=>({type:t.selection.jsonID,anchor:jW(t.selection.anchor,e.type,e.mapping),head:jW(t.selection.head,e.type,e.mapping)}),aW=class{constructor(e,t=new Map){this.type=e,this.prosemirrorView=null,this.mux=NU(),this.mapping=t,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=iW(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta(`addToHistory`,!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(EL&&this._domSelectionInView===null&&(_z(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let t=this.prosemirrorView._root.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.getClientRects().length===0&&t.startContainer&&t.collapsed&&t.selectNodeContents(t.startContainer);let n=t.getBoundingClientRect(),r=cz.documentElement;return n.bottom>=0&&n.right>=0&&n.left<=(window.innerWidth||r.clientWidth||0)&&n.top<=(window.innerHeight||r.clientHeight||0)}renderSnapshot(e,t){t||=GB(qz(),new Map),this.prosemirrorView.dispatch(this._tr.setMeta(RU,{snapshot:e,prevSnapshot:t}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(e=>sW(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),t=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new R(L.from(e),0,0));t.setMeta(RU,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(t)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection===null?this.prosemirrorView.state.selection:null,t=this.type.toArray().map(e=>sW(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new R(L.from(t),0,0));if(e){let t=aF(oF(e.anchor,0),n.doc.content.size),r=aF(oF(e.head,0),n.doc.content.size);n.setSelection(z.create(n.doc,t,r))}this.prosemirrorView.dispatch(n.setMeta(RU,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,t,n){let r=this.doc,i=this.type;if(e||=KB(this.doc),e instanceof Uint8Array||t instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(t instanceof Uint8Array))&&bI(),r=new $z({gc:!1}),mB(r,t),t=KB(r),mB(r,e),e=KB(r),i._item===null){let e=Array.from(this.doc.share.keys()).find(e=>this.doc.share.get(e)===this.type);i=r.getXmlFragment(e)}else{let e=r.store.clients.get(i._item.id.client)??[];i=e[$B(e,i._item.id.clock)].content.type}this.mapping.clear(),this.mux(()=>{r.transact(r=>{let a=n.permanentUserData;a&&a.dss.forEach(e=>{Vz(r,e,e=>{})});let o=(e,t)=>{let r=e===`added`?a.getUserByClientId(t.client):a.getUserByDeletedId(t);return{user:r,type:e,color:tW(n.colorMapping,n.colors,r)}},s=KV(i,new WB(t.ds,e.sv)).map(n=>!n._item.deleted||$U(n._item,e)||$U(n._item,t)?sW(n,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,t,o):null).filter(e=>e!==null),c=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new R(L.from(s),0,0));this.prosemirrorView.dispatch(c.setMeta(RU,{isChangeOrigin:!0}))},RU)})}_typeChanged(e,t){if(this.prosemirrorView==null)return;let n=RU.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let e=(e,t)=>this.mapping.delete(t);Vz(t,t.deleteSet,e=>{if(e.constructor===TU){let t=e.content.type;t&&this.mapping.delete(t)}}),t.changed.forEach(e),t.changedParentTypes.forEach(e);let n=this.type.toArray().map(e=>oW(e,this.prosemirrorView.state.schema,this)).filter(e=>e!==null),r=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new R(L.from(n),0,0));rW(r,this.beforeTransactionSelection,this),r=r.setMeta(RU,{isChangeOrigin:!0,isUndoRedoOperation:t.origin instanceof vV}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&r.scrollIntoView(),this.prosemirrorView.dispatch(r)})}_prosemirrorChanged(e){this.doc.transact(()=>{TW(this.doc,this.type,e,this),this.beforeTransactionSelection=iW(this,this.prosemirrorView.state)},RU)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.on(`afterAllTransactions`,this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off(`beforeAllTransactions`,this.beforeAllTransactions),this.doc.off(`afterAllTransactions`,this.afterAllTransactions))}},oW=(e,t,n,r,i,a)=>{let o=n.mapping.get(e);if(o===void 0){if(e instanceof IH)return sW(e,t,n,r,i,a);throw yI()}return o},sW=(e,t,n,r,i,a)=>{let o=[],s=e=>{if(e instanceof IH){let s=oW(e,t,n,r,i,a);s!==null&&o.push(s)}else{let s=e._item.right?.content?.type;s instanceof jH&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(e.applyDelta([{retain:e.length},...s.toDelta()]),s.doc.transact(e=>{s._item.delete(e)}));let c=cW(e,t,n,r,i,a);c!==null&&c.forEach(e=>{e!==null&&o.push(e)})}};r===void 0||i===void 0?e.toArray().forEach(s):KV(e,new WB(i.ds,r.sv)).forEach(s);try{let s=e.getAttributes(r);r!==void 0&&($U(e._item,r)?$U(e._item,i)||(s.ychange=a?a(`added`,e._item.id):{type:`added`}):s.ychange=a?a(`removed`,e._item.id):{type:`removed`});let c=t.node(e.nodeName,s,o);return n.mapping.set(e,c),c}catch{return e.doc.transact(t=>{e._item.delete(t)},RU),n.mapping.delete(e),null}},cW=(e,t,n,r,i,a)=>{let o=[],s=e.toDelta(r,i,a);try{for(let e=0;e<s.length;e++){let n=s[e];o.push(t.text(n.insert,CW(n.attributes,t)))}}catch{return e.doc.transact(t=>{e._item.delete(t)},RU),null}return o},lW=(e,t)=>{let n=new VH,r=e.map(e=>({insert:e.text,attributes:wW(e.marks,t)}));return n.applyDelta(r),t.mapping.set(n,e),n},uW=(e,t)=>{let n=new IH(e.type.name);for(let t in e.attrs){let r=e.attrs[t];r!==null&&t!==`ychange`&&n.setAttribute(t,r)}return n.insert(0,mW(e).map(e=>dW(e,t))),t.mapping.set(n,e),n},dW=(e,t)=>e instanceof Array?lW(e,t):uW(e,t),fW=e=>typeof e==`object`&&!!e,pW=(e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==null),r=n.length===(t==null?0:Object.keys(t).filter(e=>t[e]!==null).length);for(let i=0;i<n.length&&r;i++){let a=n[i],o=e[a],s=t[a];r=a===`ychange`||o===s||fW(o)&&fW(s)&&pW(o,s)}return r},mW=e=>{let t=e.content.content,n=[];for(let e=0;e<t.length;e++){let r=t[e];if(r.isText){let r=[];for(let n=t[e];e<t.length&&n.isText;n=t[++e])r.push(n);e--,n.push(r)}else n.push(r)}return n},hW=(e,t)=>{let n=e.toDelta();return n.length===t.length&&n.every((e,n)=>e.insert===t[n].text&&uL(e.attributes||{}).length===t[n].marks.length&&mL(e.attributes,(e,r)=>{let i=SW(r),a=t[n].marks;return pW(e,a.find(e=>e.type.name===i)?.attrs)}))},gW=(e,t)=>{if(e instanceof IH&&!(t instanceof Array)&&EW(e,t)){let n=mW(t);return e._length===n.length&&pW(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>gW(e,n[t]))}return e instanceof VH&&t instanceof Array&&hW(e,t)},_W=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,n)=>t[n]===e),vW=(e,t,n)=>{let r=e.toArray(),i=mW(t),a=i.length,o=r.length,s=aF(o,a),c=0,l=0,u=!1;for(;c<s;c++){let e=r[c],t=i[c];if(_W(n.mapping.get(e),t))u=!0;else if(!gW(e,t))break}for(;c+l<s;l++){let e=r[o-l-1],t=i[a-l-1];if(_W(n.mapping.get(e),t))u=!0;else if(!gW(e,t))break}return{equalityFactor:c+l,foundMappedChild:u}},yW=e=>{let t=``,n=e._start,r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof cU?t+=n.content.str:n.content instanceof tU&&(r[n.content.key]=null)),n=n.right;return{str:t,nAttrs:r}},bW=(e,t,n)=>{n.mapping.set(e,t);let{nAttrs:r,str:i}=yW(e),a=t.map(e=>({insert:e.text,attributes:Object.assign({},r,wW(e.marks,n))})),{insert:o,remove:s,index:c}=LU(i,a.map(e=>e.insert).join(``));e.delete(c,s),e.insert(c,o),e.applyDelta(a.map(e=>({retain:e.insert.length,attributes:e.attributes})))},xW=/(.*)(--[a-zA-Z0-9+/=]{8})$/,SW=e=>xW.exec(e)?.[1]??e,CW=(e,t)=>{let n=[];for(let r in e)n.push(t.mark(SW(r),e[r]));return n},wW=(e,t)=>{let n={};return e.forEach(e=>{if(e.type.name!==`ychange`){let r=HP(t.isOMark,e.type,()=>!e.type.excludes(e.type));n[r?`${e.type.name}--${QU(e.toJSON())}`:e.type.name]=e.attrs}}),n},TW=(e,t,n,r)=>{if(t instanceof IH&&t.nodeName!==n.type.name)throw Error(`node name mismatch!`);if(r.mapping.set(t,n),t instanceof IH){let e=t.getAttributes(),r=n.attrs;for(let n in r)r[n]===null?t.removeAttribute(n):e[n]!==r[n]&&n!==`ychange`&&t.setAttribute(n,r[n]);for(let n in e)r[n]===void 0&&t.removeAttribute(n)}let i=mW(n),a=i.length,o=t.toArray(),s=o.length,c=aF(a,s),l=0,u=0;for(;l<c;l++){let e=o[l],t=i[l];if(!_W(r.mapping.get(e),t))if(gW(e,t))r.mapping.set(e,t);else break}for(;u+l<c;u++){let e=o[s-u-1],t=i[a-u-1];if(!_W(r.mapping.get(e),t))if(gW(e,t))r.mapping.set(e,t);else break}e.transact(()=>{for(;s-l-u>0&&a-l-u>0;){let n=o[l],c=i[l],d=o[s-u-1],f=i[a-u-1];if(n instanceof VH&&c instanceof Array)hW(n,c)||bW(n,c,r),l+=1;else{let i=n instanceof IH&&EW(n,c),a=d instanceof IH&&EW(d,f);if(i&&a){let e=vW(n,c,r),t=vW(d,f,r);e.foundMappedChild&&!t.foundMappedChild?a=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor<t.equalityFactor?i=!1:a=!1}i?(TW(e,n,c,r),l+=1):a?(TW(e,d,f,r),u+=1):(r.mapping.delete(t.get(l)),t.delete(l,1),t.insert(l,[dW(c,r)]),l+=1)}}let n=s-l-u;if(s===1&&a===0&&o[0]instanceof VH?(r.mapping.delete(o[0]),o[0].delete(0,o[0].length)):n>0&&(t.slice(l,l+n).forEach(e=>r.mapping.delete(e)),t.delete(l,n)),l+u<a){let e=[];for(let t=l;t<a-u;t++)e.push(dW(i[t],r));t.insert(l,e)}},RU)},EW=(e,t)=>!(t instanceof Array)&&e.nodeName===t.type.name})),OW,kW,AW,jW,MW,NW,PW=o((()=>{VU(),MU(),xI(),GP(),vz(),OW=null,kW=()=>{let e=OW;OW=null,e.forEach((e,t)=>{let n=t.state.tr,r=RU.getState(t.state);r&&r.binding&&!r.binding.isDestroyed&&(e.forEach((e,t)=>{n.setMeta(t,e)}),t.dispatch(n))})},AW=(e,t,n)=>{OW||(OW=new Map,_z(0,kW)),HP(OW,e,BP).set(t,n)},jW=(e,t,n)=>{if(e===0)return BB(t,0,t.length===0?-1:0);let r=t._first===null?null:t._first.content.type;for(;r!==null&&t!==r;){if(r instanceof VH){if(r._length>=e)return BB(r,e,t.length===0?-1:0);if(e-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,e--;while(r!==t&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==t&&(r=r._item===null?null:r._item.next.content.type)}}else{let i=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&e<i)r=r._first.content.type,e--;else{if(e===1&&r._length===0&&i>1)return new FB(r._item===null?null:r._item.id,r._item===null?NB(r):null,null);if(e-=i,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(e===0)return r=r._item===null?r:r._item.parent,new FB(r._item===null?null:r._item.id,r._item===null?NB(r):null,null);do r=r._item.parent,e--;while(r!==t&&r._item.next===null);r!==t&&(r=r._item.next.content.type)}}}if(r===null)throw bI();if(e===0&&r.constructor!==VH&&r!==t)return MW(r._item.parent,r._item)}return BB(t,t._length,t.length===0?-1:0)},MW=(e,t)=>{let n=null,r=null;return e._item===null?r=NB(e):n=MB(e._item.id.client,e._item.id.clock),new FB(n,r,t.id)},NW=(e,t,n,r)=>{let i=HB(n,e);if(i===null||i.type!==t&&!PB(t,i.type._item))return null;let a=i.type,o=0;if(a.constructor===VH)o=i.index;else if(a._item===null||!a._item.deleted){let e=a._first,t=0;for(;t<a._length&&t<i.index&&e!==null;){if(!e.deleted){let n=e.content.type;t++,n instanceof VH?o+=n._length:o+=r.get(n).nodeSize}e=e.right}o+=1}for(;a!==t&&a._item!==null;){let e=a._item.parent;if(e._item===null||!e._item.deleted){o+=1;let t=e._first;for(;t!==null;){let e=t.content.type;if(e===a)break;t.deleted||(e instanceof VH?o+=e._length:o+=r.get(e).nodeSize),t=t.right}}a=e}return o-1}})),FW,IW,LW,RW,zW,BW,ume=o((()=>{MU(),zP(),mM(),PW(),VU(),cF(),FW=(e,t,n)=>e!==t,IW=e=>{let t=document.createElement(`span`);t.classList.add(`ProseMirror-yjs-cursor`),t.setAttribute(`style`,`border-color: ${e.color}`);let n=document.createElement(`div`);n.setAttribute(`style`,`background-color: ${e.color}`),n.insertBefore(document.createTextNode(e.name),null);let r=document.createTextNode(``),i=document.createTextNode(``);return t.insertBefore(r,null),t.insertBefore(n,null),t.insertBefore(i,null),t},LW=e=>({style:`background-color: ${e.color}70`,class:`ProseMirror-yjs-selection`}),RW=/^#[0-9a-fA-F]{6}$/,zW=(e,t,n,r,i)=>{let a=RU.getState(e),o=a.doc,s=[];return a.snapshot!=null||a.prevSnapshot!=null||a.binding.mapping.size===0?OP.create(e.doc,[]):(t.getStates().forEach((t,c)=>{if(n(o.clientID,c,t)&&t.cursor!=null){let n=t.user||{};n.color==null?n.color=`#ffa500`:RW.test(n.color)||console.warn(`A user uses an unsupported color format`,n),n.name??=`User: ${c}`;let l=NW(o,a.type,IB(t.cursor.anchor),a.binding.mapping),u=NW(o,a.type,IB(t.cursor.head),a.binding.mapping);if(l!==null&&u!==null){let t=oF(e.doc.content.size-1,0);l=aF(l,t),u=aF(u,t),s.push(TP.widget(u,()=>r(n,c),{key:c+``,side:10}));let a=aF(l,u),o=oF(l,u);s.push(TP.inline(a,o,i(n,c),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),OP.create(e.doc,s))},BW=(e,{awarenessStateFilter:t=FW,cursorBuilder:n=IW,selectionBuilder:r=LW,getSelection:i=e=>e.selection}={},a=`cursor`)=>new dM({key:BU,state:{init(i,a){return zW(a,e,t,n,r)},apply(i,a,o,s){let c=RU.getState(s),l=i.getMeta(BU);return c&&c.isChangeOrigin||l&&l.awarenessUpdated?zW(s,e,t,n,r):a.map(i.mapping,i.doc)}},props:{decorations:e=>BU.getState(e)},view:t=>{let n=()=>{t.docView&&AW(t,BU,{awarenessUpdated:!0})},r=()=>{let n=RU.getState(t.state),r=e.getLocalState()||{};if(t.hasFocus()){let o=i(t.state),s=jW(o.anchor,n.type,n.binding.mapping),c=jW(o.head,n.type,n.binding.mapping);(r.cursor==null||!UB(IB(r.cursor.anchor),s)||!UB(IB(r.cursor.head),c))&&e.setLocalStateField(a,{anchor:s,head:c})}else r.cursor!=null&&NW(n.doc,n.type,IB(r.cursor.anchor),n.binding.mapping)!==null&&e.setLocalStateField(a,null)};return e.on(`change`,n),t.dom.addEventListener(`focusin`,r),t.dom.addEventListener(`focusout`,r),{update:r,destroy:()=>{t.dom.removeEventListener(`focusin`,r),t.dom.removeEventListener(`focusout`,r),e.off(`change`,n),e.setLocalStateField(a,null)}}}})})),VW,HW,UW,WW,GW,KW,qW,dme=o((()=>{mM(),DW(),MU(),VU(),VW=e=>zU.getState(e)?.undoManager?.undo()!=null,HW=e=>zU.getState(e)?.undoManager?.redo()!=null,UW=(e,t)=>t==null?zU.getState(e)?.undoManager?.canUndo():VW(e),WW=(e,t)=>t==null?zU.getState(e)?.undoManager?.canRedo():HW(e),GW=new Set([`paragraph`]),KW=(e,t)=>!(e instanceof TU)||!(e.content instanceof vU)||!(e.content.type instanceof jH||e.content.type instanceof IH&&t.has(e.content.type.nodeName))||e.content.type._length===0,qW=({protectedNodes:e=GW,trackedOrigins:t=[],undoManager:n=null}={})=>new dM({key:zU,state:{init:(r,i)=>{let a=RU.getState(i),o=n||new vV(a.type,{trackedOrigins:new Set([RU].concat(t)),deleteFilter:t=>KW(t,e),captureTransaction:e=>e.meta.get(`addToHistory`)!==!1});return{undoManager:o,prevSel:null,hasUndoOps:o.undoStack.length>0,hasRedoOps:o.redoStack.length>0}},apply:(e,t,n,r)=>{let i=RU.getState(r).binding,a=t.undoManager,o=a.undoStack.length>0,s=a.redoStack.length>0;return i?{undoManager:a,prevSel:iW(i,n),hasUndoOps:o,hasRedoOps:s}:o!==t.hasUndoOps||s!==t.hasRedoOps?Object.assign({},t,{hasUndoOps:a.undoStack.length>0,hasRedoOps:a.redoStack.length>0}):t}},view:e=>{let t=RU.getState(e.state),n=zU.getState(e.state).undoManager;return n.on(`stack-item-added`,({stackItem:n})=>{let r=t.binding;r&&n.meta.set(r,zU.getState(e.state).prevSel)}),n.on(`stack-item-popped`,({stackItem:e})=>{let n=t.binding;n&&(n.beforeTransactionSelection=e.meta.get(n)||n.beforeTransactionSelection)}),{destroy:()=>{n.destroy()}}}})})),JW=o((()=>{ume(),DW(),dme(),VU(),PW()}));function YW(e){let t=Array.from(e).sort((e,t)=>e instanceof oG&&e.options.deps.includes(t)?1:t instanceof oG&&t.options.deps.includes(e)?-1:0);for(let e of t){if(QW.current.includes(e))continue;QW.current.push(e),e.recompute();let t=ZW.get(e);if(t)for(let e of t){let t=XW.get(e);t&&YW(t)}}}function fme(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function pme(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function mme(e){if(eG>0&&!nG.has(e)&&nG.set(e,e.prevState),tG.add(e),!(eG>0)&&!$W)try{for($W=!0;tG.size>0;){let e=Array.from(tG);tG.clear();for(let t of e)t.prevState=nG.get(t)??t.prevState,fme(t);for(let t of e){let e=XW.get(t);e&&(QW.current.push(t),YW(e))}for(let t of e){let e=XW.get(t);if(e)for(let t of e)pme(t)}}}finally{$W=!1,QW.current=[],nG.clear()}}var XW,ZW,QW,$W,eG,tG,nG,rG=o((()=>{_me(),XW=new WeakMap,ZW=new WeakMap,QW={current:[]},$W=!1,eG=0,tG=new Set,nG=new Map}));function hme(e){return typeof e==`function`}var gme=o((()=>{})),iG,aG=o((()=>{rG(),gme(),iG=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):hme(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),mme(this)}}})),oG,_me=o((()=>{aG(),rG(),oG=class e{constructor(t){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{let e=this.options.deps.length,t=Array(e),n=Array(e);for(let r=0;r<e;r++){let e=this.options.deps[r];t[r]=e.prevState,n[r]=e.state}return this.lastSeenDepValues=n,{prevDepVals:t,currDepVals:n,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,t;this.prevState=this.state;let n=this.getDepVals();this.state=this.options.fn(n),(t=(e=this.options).onUpdate)==null||t.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(let t of this.options.deps)t instanceof e&&t.checkIfRecalculationNeededDeeply();let t=!1,n=this.lastSeenDepValues,{currDepVals:r}=this.getDepVals();for(let e=0;e<r.length;e++)if(r[e]!==n[e]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(let e of this._subscriptions)e()}),this.subscribe=e=>{var t;this.listeners.add(e);let n=(t=this.options).onSubscribe?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.options=t,this.state=t.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(t=this.options.deps){for(let n of t)if(n instanceof e)n.registerOnGraph(),this.registerOnGraph(n.options.deps);else if(n instanceof iG){let e=XW.get(n);e||(e=new Set,XW.set(n,e)),e.add(this);let t=ZW.get(this);t||(t=new Set,ZW.set(this,t)),t.add(n)}}unregisterFromGraph(t=this.options.deps){for(let n of t)if(n instanceof e)this.unregisterFromGraph(n.options.deps);else if(n instanceof iG){let e=XW.get(n);e&&e.delete(this);let t=ZW.get(this);t&&t.delete(n)}}}})),sG=o((()=>{aG()}));function cG(e){if(typeof e==`object`&&`key`in e)return function t(){return e[uG]=t,e};if(typeof e!=`function`)throw Error(`factory must be a function`);return function t(n){return r=>{let i=e({editor:r.editor,options:n});return i[uG]=t,i}}}function lG(e,t){return new iG(e,t)}var uG,dG=o((()=>{sG(),uG=Symbol(`originalFactory`)})),fG,pG,mG=o((()=>{mM(),zP(),dG(),fG=new pM(`blocknote-show-selection`),pG=cG(({editor:e})=>{let t=lG({enabledSet:new Set},{onUpdate(){e.transact(e=>e.setMeta(fG,{}))}});return{key:`showSelection`,store:t,prosemirrorPlugins:[new dM({key:fG,props:{decorations:e=>{let{doc:n,selection:r}=e;if(t.state.enabledSet.size===0)return OP.empty;let i=TP.inline(r.from,r.to,{"data-show-selection":`true`});return OP.create(n,[i])}}})],showSelection(e,n){t.setState({enabledSet:e?new Set([...t.state.enabledSet,n]):new Set([...t.state.enabledSet].filter(e=>e!==n))})}}})})),vme=o((()=>{Zj()}));function hG(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}function gG(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=wj(e.doc,i,o,R.empty);if(!s||s.from!=i||s instanceof Gj&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(z.create(t.doc,i)),n(t.scrollIntoView())}return!0}function _G(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}function vG(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function yG(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}function bG(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function xG(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function yme(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof iM&&t.selection.node.isBlock)return!r.parentOffset||!xj(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=xG(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof z||t.selection instanceof aM)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=xj(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,xj(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}function bme(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Sj(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function SG(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&bme(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=L.empty;for(let e=o.length-1;e>=0;e--)s=L.from(o[e].create(null,s));s=L.from(i.copy(s));let c=e.tr.step(new Kj(t.pos-1,r,t.pos,r,new R(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Sj(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:eM.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&bj(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&_G(a,`start`,!0)&&_G(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=L.empty;for(let e=o.length-1;e>=0;e--)r=L.from(o[e].copy(r));n(e.tr.step(new Kj(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new R(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function CG(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(z.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}function xme(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&dde(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function wG(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function TG(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var EG,DG,OG,kG,AG,jG,MG,NG,PG,FG,IG,LG,RG,zG,BG,VG,HG,UG,WG,GG,KG,qG,JG,Sme=o((()=>{Zj(),gj(),mM(),EG=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0),DG=(e,t,n)=>{let r=hG(e,n);if(!r)return!1;let i=vG(r);if(!i){let n=r.blockRange(),i=n&&bj(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(SG(e,i,t,-1))return!0;if(r.parent.content.size==0&&(_G(a,`end`)||iM.isSelectable(a)))for(let n=r.depth;;n--){let o=wj(e.doc,r.before(n),r.after(n),R.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(_G(a,`end`)?eM.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):iM.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},OG=(e,t,n)=>{let r=hG(e,n);if(!r)return!1;let i=vG(r);return i?gG(e,i,t):!1},kG=(e,t,n)=>{let r=yG(e,n);if(!r)return!1;let i=bG(r);return i?gG(e,i,t):!1},AG=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=vG(r)}let o=a&&a.nodeBefore;return!o||!iM.isSelectable(o)?!1:(t&&t(e.tr.setSelection(iM.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)},jG=(e,t,n)=>{let r=yG(e,n);if(!r)return!1;let i=bG(r);if(!i)return!1;let a=i.nodeAfter;if(SG(e,i,t,1))return!0;if(r.parent.content.size==0&&(_G(a,`start`)||iM.isSelectable(a))){let n=wj(e.doc,r.before(),r.after(),R.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(_G(a,`start`)?eM.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):iM.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},MG=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=bG(r)}let o=a&&a.nodeAfter;return!o||!iM.isSelectable(o)?!1:(t&&t(e.tr.setSelection(iM.create(e.doc,a.pos)).scrollIntoView()),!0)},NG=(e,t)=>{let n=e.selection,r=n instanceof iM,i;if(r){if(n.node.isTextblock||!Sj(e.doc,n.from))return!1;i=n.from}else if(i=Cj(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(iM.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},PG=(e,t)=>{let n=e.selection,r;if(n instanceof iM){if(n.node.isTextblock||!Sj(e.doc,n.to))return!1;r=n.to}else if(r=Cj(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},FG=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&bj(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},IG=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
27
|
+
`).scrollIntoView()),!0)},LG=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=xG(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(eM.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},RG=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof aM||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=xG(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(z.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},zG=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(xj(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&bj(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},BG=yme(),VG=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(iM.create(e.doc,i))),!0)},HG=(e,t)=>(t&&t(e.tr.setSelection(new aM(e.doc))),!0),UG=CG(-1),WG=CG(1),GG=TG(EG,DG,AG),KG=TG(EG,jG,MG),qG={Enter:TG(IG,RG,zG,BG),"Mod-Enter":LG,Backspace:GG,"Mod-Backspace":GG,"Shift-Backspace":GG,Delete:KG,"Mod-Delete":KG,"Mod-a":HG},JG={"Ctrl-h":qG.Backspace,"Alt-Backspace":qG[`Mod-Backspace`],"Ctrl-d":qG.Delete,"Ctrl-Alt-Backspace":qG[`Mod-Delete`],"Alt-Delete":qG[`Mod-Delete`],"Alt-d":qG[`Mod-Delete`],"Ctrl-a":UG,"Ctrl-e":WG};for(let e in qG)JG[e]=qG[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform()})),Cme=o((()=>{Sme()})),YG=o((()=>{mM()})),XG=o((()=>{gj()}));function wme(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Tme(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Tme(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new ej(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new ej(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=dde(a,n,r,t);return s?(e&&Eme(e,t,s,i,n),!0):!1}function Eme(e,t,n,r,i){let a=L.empty;for(let e=n.length-1;e>=0;e--)a=L.from(n[e].type.create(n[e].attrs,a));e.step(new Kj(t.start-(r?2:0),t.end,t.start,t.end,new R(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&xj(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Dme(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?Ome(t,n,e,a):kme(t,n,a):!0:!1}}function Ome(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Kj(a-1,o,a,o,new R(L.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ej(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=bj(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Sj(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function kme(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+(s?0:1),u+1,o.content.append(c?L.empty:L.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Kj(d-(s?1:0),f+(c?1:0),d+1,f-1,new R((s?L.empty:L.from(i.copy(L.empty))).append(c?L.empty:L.from(i.copy(L.empty))),s?0:1,c?0:1),s?0:1)),t(r.scrollIntoView()),!0}function Ame(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=L.from(r?e.create():null),o=new R(L.from(e.create(null,L.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Kj(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var jme=o((()=>{Zj(),gj()})),Mme=o((()=>{jme()})),ZG=o((()=>{zP()}));function Nme(e){var t=!(eK&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||tK&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?$G:QG)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var QG,$G,eK,tK,nK,Pme=o((()=>{for(QG={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},$G={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},eK=typeof navigator<`u`&&/Mac/.test(navigator.platform),tK=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),nK=0;nK<10;nK++)QG[48+nK]=QG[96+nK]=String(nK);for(nK=1;nK<=24;nK++)QG[nK+111]=`F`+nK;for(nK=65;nK<=90;nK++)QG[nK]=String.fromCharCode(nK+32),$G[nK]=String.fromCharCode(nK);for(var e in QG)$G.hasOwnProperty(e)||($G[e]=QG[e])}));function Fme(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))oK?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Ime(e){let t=Object.create(null);for(let n in e)t[Fme(n)]=e[n];return t}function rK(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function iK(e){return new dM({props:{handleKeyDown:aK(e)}})}function aK(e){let t=Ime(e);return function(e,n){let r=Nme(n),i,a=t[rK(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[rK(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(sK&&n.ctrlKey&&n.altKey)&&(i=QG[n.keyCode])&&i!=r){let r=t[rK(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var oK,sK,cK=o((()=>{Pme(),mM(),oK=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),sK=typeof navigator<`u`&&/Win/.test(navigator.platform)})),lK=o((()=>{cK()}));function uK(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}function dK(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function fK(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function pK(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:fK(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function mK(e,t,n={}){return e.find(e=>e.type===t&&pK(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function hK(e,t,n={}){return!!mK(e,t,n)}function gK(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!mK([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&hK([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&hK([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function _K(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}function vK(e){return e instanceof z}function yK(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function bK(e,t=null){if(!t)return null;let n=eM.atStart(e),r=eM.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?z.create(e,yK(0,i,a),yK(e.content.size,i,a)):z.create(e,yK(t,i,a),yK(t,i,a))}function xK(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function SK(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function Lme(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}function CK(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return zq(n)}function wK(e,t,n){if(e instanceof tj||e instanceof L)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return L.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),wK(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new aj({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?oj.fromSchema(a).parseSlice(CK(e),n.parseOptions):oj.fromSchema(a).parse(CK(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=oj.fromSchema(t);return n.slice?r.parseSlice(CK(e),n.parseOptions).content:r.parse(CK(e),n.parseOptions)}return wK(``,t,n)}function TK(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Gj||i instanceof Kj))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(eM.near(e.doc.resolve(o),n))}function EK(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function Rme(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))SK()||EK()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}function DK(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?dK(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>pK(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}function OK(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function kK(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function AK(e,t,n={},r={}){return wK(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function jK(e,t){let n=_K(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function MK(e,t){let n=new Xj(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function zme(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function NK(e,t){let n=[];return e.descendants((e,r)=>{t(e)&&n.push({node:e,pos:r})}),n}function PK(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function FK(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function IK(e){return t=>FK(t.$from,e)}function B(e,t,n){return e.config[t]===void 0&&e.parent?B(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?B(e.parent,t,n):null}):e.config[t]}function LK(e){return e.map(e=>{let t=B(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...LK(t())]:e}).flat(10)}function RK(e,t){let n=mj.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function zK(e){return typeof e==`function`}function BK(e,t=void 0,...n){return zK(e)?t?e.bind(t)(...n):e(...n):e}function Bme(e={}){return Object.keys(e).length===0&&e.constructor===Object}function VK(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function HK(e){let t=[],{nodeExtensions:n,markExtensions:r}=VK(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=B(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=B(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Vme(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function UK(e){let t=[],n=Vme(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function WK(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...UK(n[e]),...UK(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function GK(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>WK(e,t),{})}function Hme(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function KK(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Hme(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function qK(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Bme(t)?!1:t!=null))}function JK(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function YK(e,t){let n=HK(e),{nodeExtensions:r,markExtensions:i}=VK(e);return new aj({topNode:r.find(e=>B(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=qK({...e.reduce((e,t)=>{let n=B(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:BK(B(r,`content`,a)),marks:BK(B(r,`marks`,a)),group:BK(B(r,`group`,a)),inline:BK(B(r,`inline`,a)),atom:BK(B(r,`atom`,a)),selectable:BK(B(r,`selectable`,a)),draggable:BK(B(r,`draggable`,a)),code:BK(B(r,`code`,a)),whitespace:BK(B(r,`whitespace`,a)),linebreakReplacement:BK(B(r,`linebreakReplacement`,a)),defining:BK(B(r,`defining`,a)),isolating:BK(B(r,`isolating`,a)),attrs:Object.fromEntries(i.map(JK))}),s=BK(B(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>KK(e,i)));let c=B(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:GK(e,i)}));let l=B(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=qK({...e.reduce((e,t)=>{let n=B(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:BK(B(r,`inclusive`,a)),excludes:BK(B(r,`excludes`,a)),group:BK(B(r,`group`,a)),spanning:BK(B(r,`spanning`,a)),code:BK(B(r,`code`,a)),attrs:Object.fromEntries(i.map(JK))}),s=BK(B(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>KK(e,i)));let c=B(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:GK(e,i)})),[r.name,o]}))})}function Ume(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function XK(e){return e.sort((e,t)=>{let n=B(e,`priority`)||100,r=B(t,`priority`)||100;return n>r?-1:n<r?1:0})}function ZK(e){let t=XK(LK(e)),n=Ume(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Wme(e,t){return YK(ZK(e),t)}function QK(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
28
|
+
|
|
29
|
+
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Gme(e,t){return QK(e,{from:0,to:e.content.size},t)}function $K(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Kme(e,t){let n=dK(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function eq(e,t){let n=OK(typeof t==`string`?t:t.name,e.schema);return n===`node`?Kme(e,t):n===`mark`?jK(e,t):{}}function qme(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Jme(e){let t=qme(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function tq(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Jme(r)}function nq(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=gK(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function rq(e,t){return t.nodes[e]||t.marks[e]||null}function iq(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}function aq(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?_K(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>pK(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>pK(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Yme(e,t,n={}){if(!t)return DK(e,null,n)||aq(e,null,n);let r=OK(t,e.schema);return r===`node`?DK(e,t,n):r===`mark`?aq(e,t,n):!1}function oq(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function sq(e,t){let{nodeExtensions:n}=VK(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=BK(B(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function cq(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(cq(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Xme(e){return e instanceof iM}function Zme(e,t){let n=t.mapping.mapResult(e.position);return{position:new dJ(n.pos),mapResult:n}}function Qme(e){return new dJ(e)}function lq(e,t,n){let r=e.state.doc.content.size,i=yK(t,0,r),a=yK(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function $me(e,t,n){let{selection:r}=t,i=null;if(vK(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}function uq(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}function ehe(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return z.create(t,1,r)}function dq(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=uJ(c)+i;return a.forEach(e=>{if(l)return;let a=IJ(u,e.find);if(!a)return;let c=s.state.tr,d=uK({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new bq({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function the(e){let{editor:t,rules:n}=e,r=new dM({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:RK(L.from(e),a.schema);let{from:i}=s;dq({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return dq({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&dq({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?dq({editor:t,from:a.pos,to:a.pos,text:`
|
|
30
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function nhe(e){return Object.prototype.toString.call(e).slice(8,-1)}function fq(e){return nhe(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function pq(e,t){let n={...e};return fq(e)&&fq(t)&&Object.keys(t).forEach(r=>{fq(t[r])&&fq(e[r])?n[r]=pq(e[r],t[r]):n[r]=t[r]}),n}function rhe(e){return typeof e==`number`}function ihe(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new bq({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||BJ(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}function ahe(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!ihe({editor:t,state:uK({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new dM({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(VJ=t)},i=()=>{VJ&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=VJ;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:RK(L.from(t),r.schema);let{from:n}=d,i=n+t.length,a=HJ(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!rhe(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}function ohe(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function mq(e){return new FJ({find:e.find,handler:({state:t,range:n,match:r})=>{let i=BK(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(nq(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function hq(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,``).replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,``).replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,``).trim();return o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function gq(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function she(e){let{nodeName:t,name:n,parseAttributes:r=hq,serializeAttributes:i=gq,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function che(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=hq,serializeAttributes:a=gq,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
|
|
31
|
+
|
|
32
|
+
${t.renderChildren(e.content||[],`
|
|
33
|
+
|
|
34
|
+
`)}
|
|
35
|
+
|
|
36
|
+
:::`}}}function lhe(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function uhe(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function dhe(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=lhe,serializeAttributes:a=uhe,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function fhe(e,t,n){let r=e.split(`
|
|
37
|
+
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
|
|
38
|
+
`;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
|
|
39
|
+
`;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
|
|
40
|
+
`,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
|
|
41
|
+
`,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
|
|
42
|
+
`);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function phe(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
|
|
43
|
+
`).map(e=>e?t.indent(e):t.indent(``)).join(`
|
|
44
|
+
`);s+=e.type===`paragraph`?`
|
|
45
|
+
|
|
46
|
+
${n}`:`
|
|
47
|
+
${n}`}}),s}function mhe(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}function _q(e){return new zJ({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=BK(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(nq(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var vq,yq,bq,xq,Sq,Cq,wq,Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq,Hq,Uq,Wq,Gq,Kq,qq,Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ,AJ,jJ,MJ,NJ,PJ,FJ,IJ,LJ,RJ,zJ,BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ,ZJ,QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY,cY=o((()=>{vme(),Cme(),YG(),XG(),Mme(),ZG(),lK(),vq=Object.defineProperty,yq=(e,t)=>{for(var n in t)vq(e,n,{get:t[n],enumerable:!0})},bq=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:uK({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},xq={},yq(xq,{blur:()=>Sq,clearContent:()=>Cq,clearNodes:()=>wq,command:()=>Tq,createParagraphNear:()=>Eq,cut:()=>Dq,deleteCurrentNode:()=>Oq,deleteNode:()=>kq,deleteRange:()=>Aq,deleteSelection:()=>jq,enter:()=>Mq,exitCode:()=>Nq,extendMarkRange:()=>Pq,first:()=>Fq,focus:()=>Iq,forEach:()=>Lq,insertContent:()=>Rq,insertContentAt:()=>Vq,joinBackward:()=>Wq,joinDown:()=>Uq,joinForward:()=>Gq,joinItemBackward:()=>Kq,joinItemForward:()=>qq,joinTextblockBackward:()=>Jq,joinTextblockForward:()=>Yq,joinUp:()=>Hq,keyboardShortcut:()=>Xq,lift:()=>Zq,liftEmptyBlock:()=>Qq,liftListItem:()=>$q,newlineInCode:()=>eJ,resetAttributes:()=>tJ,scrollIntoView:()=>nJ,selectAll:()=>rJ,selectNodeBackward:()=>iJ,selectNodeForward:()=>aJ,selectParentNode:()=>oJ,selectTextblockEnd:()=>sJ,selectTextblockStart:()=>cJ,setContent:()=>lJ,setMark:()=>fJ,setMeta:()=>pJ,setNode:()=>mJ,setNodeSelection:()=>hJ,setTextDirection:()=>gJ,setTextSelection:()=>_J,sinkListItem:()=>vJ,splitBlock:()=>yJ,splitListItem:()=>bJ,toggleList:()=>CJ,toggleMark:()=>wJ,toggleNode:()=>TJ,toggleWrap:()=>EJ,undoInputRule:()=>DJ,unsetAllMarks:()=>OJ,unsetMark:()=>kJ,unsetTextDirection:()=>AJ,updateAttributes:()=>jJ,wrapIn:()=>MJ,wrapInList:()=>NJ}),Sq=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Cq=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),wq=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=bj(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Tq=e=>t=>e(t),Eq=()=>({state:e,dispatch:t})=>RG(e,t),Dq=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new z(r.doc.resolve(Math.max(o-1,0)))),!0},Oq=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},kq=e=>({tr:t,state:n,dispatch:r})=>{let i=dK(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Aq=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},jq=()=>({state:e,dispatch:t})=>EG(e,t),Mq=()=>({commands:e})=>e.keyboardShortcut(`Enter`),Nq=()=>({state:e,dispatch:t})=>LG(e,t),Pq=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=_K(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=gK(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=z.create(o,e.from,e.to);n.setSelection(t)}}return!0},Fq=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1},Iq=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(SK()||xK())&&r.dom.focus(),Lme()&&!SK()&&!xK()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!vK(n.state.selection))return o(),!0;let s=bK(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Lq=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Rq=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),zq=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&zq(r)}return e},Bq=e=>!(`type`in e),Vq=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{wK(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=wK(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((Bq(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof L){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&TK(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},Hq=()=>({state:e,dispatch:t})=>NG(e,t),Uq=()=>({state:e,dispatch:t})=>PG(e,t),Wq=()=>({state:e,dispatch:t})=>DG(e,t),Gq=()=>({state:e,dispatch:t})=>jG(e,t),Kq=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Cj(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},qq=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Cj(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Jq=()=>({state:e,dispatch:t})=>OG(e,t),Yq=()=>({state:e,dispatch:t})=>kG(e,t),Xq=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Rme(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0},Zq=(e,t={})=>({state:n,dispatch:r})=>DK(n,dK(e,n.schema),t)?FG(n,r):!1,Qq=()=>({state:e,dispatch:t})=>zG(e,t),$q=e=>({state:t,dispatch:n})=>Dme(dK(e,t.schema))(t,n),eJ=()=>({state:e,dispatch:t})=>IG(e,t),tJ=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=OK(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=dK(e,r.schema)),s===`mark`&&(o=_K(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,kK(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(kK(a.attrs,t))))})})}),c},nJ=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),rJ=()=>({tr:e,dispatch:t})=>{if(t){let t=new aM(e.doc);e.setSelection(t)}return!0},iJ=()=>({state:e,dispatch:t})=>AG(e,t),aJ=()=>({state:e,dispatch:t})=>MG(e,t),oJ=()=>({state:e,dispatch:t})=>VG(e,t),sJ=()=>({state:e,dispatch:t})=>WG(e,t),cJ=()=>({state:e,dispatch:t})=>UG(e,t),lJ=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=AK(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})},uJ=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n},dJ=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}},fJ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=_K(e,r.schema);if(i)if(o){let e=jK(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return $me(r,n,c)},pJ=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),mJ=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=dK(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>wG(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>wG(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},hJ=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=yK(e,0,n.content.size),i=iM.create(n,r);t.setSelection(i)}return!0},gJ=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},_J=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=z.atStart(n).from,o=z.atEnd(n).to,s=yK(r,a,o),c=yK(i,a,o),l=z.create(n,s,c);t.setSelection(l)}return!0},vJ=e=>({state:t,dispatch:n})=>Ame(dK(e,t.schema))(t,n),yJ=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=iq(l,s.node().type.name,s.node().attrs);if(a instanceof iM&&a.node.isBlock)return!s.parentOffset||!xj(o,s.pos)?!1:(r&&(e&&uq(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:zme(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=xj(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&xj(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof z&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&uq(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},bJ=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=dK(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=L.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=L.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...iq(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(L.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new R(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(z.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...iq(d,u.type.name,u.attrs),...t},m={...iq(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!xj(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},xJ=(e,t)=>{let n=IK(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Sj(e.doc,n.pos)&&e.join(n.pos),!0},SJ=(e,t)=>{let n=IK(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Sj(e.doc,r)&&e.join(r),!0},CJ=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=dK(e,o.schema),m=dK(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=IK(e=>sq(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&sq(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,D=!!x&&y.depth>=1&&y.depth-x.depth<=1,O=!!T;if((D||O)&&E){if(E.node.type===p)return S&&O?c().command(({tr:e,dispatch:t})=>{let n=ehe(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(sq(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>xJ(a,p)).command(()=>SJ(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>xJ(a,p)).command(()=>SJ(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>xJ(a,p)).command(()=>SJ(a,p)).run()},wJ=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=_K(e,r.schema);return aq(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},TJ=(e,t,n={})=>({state:r,commands:i})=>{let a=dK(e,r.schema),o=dK(t,r.schema),s=DK(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},EJ=(e,t={})=>({state:n,commands:r})=>{let i=dK(e,n.schema);return DK(n,i,t)?r.lift(i):r.wrapIn(i,t)},DJ=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},OJ=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},kJ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=_K(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=gK(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},AJ=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},jJ=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=OK(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=dK(e,r.schema)),s===`mark`&&(o=_K(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},MJ=(e,t={})=>({state:n,dispatch:r})=>xme(dK(e,n.schema),t)(n,r),NJ=(e,t={})=>({state:n,dispatch:r})=>wme(dK(e,n.schema),t)(n,r),PJ=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},FJ=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},IJ=(e,t)=>{if(fK(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r},LJ=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...BK(B(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...BK(B(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>pq(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},RJ=class e extends LJ{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},zJ=class{constructor(e){this.find=e.find,this.handler=e.handler}},BJ=(e,t,n)=>{if(fK(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]},VJ=null,HJ=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n},UJ=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=ZK(e),this.schema=YK(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=B(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:rq(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return XK([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:rq(t.name,this.schema)},r=[],i=B(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&B(t,`exitable`,n)&&(a.ArrowRight=()=>RJ.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=iK(a);r.push(o);let s=B(t,`addInputRules`,n);if(oq(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=the({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=B(t,`addPasteRules`,n);if(oq(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=ahe({editor:e,rules:t});r.push(...n)}}let l=B(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return HK(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=VK(this.extensions);return Object.fromEntries(t.filter(e=>!!B(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=B(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:dK(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:GK(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return XK([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:rq(n.name,this.schema)},i=B(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return XK([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:rq(n.name,this.schema)},i=B(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=VK(this.extensions);return Object.fromEntries(t.filter(e=>!!B(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=B(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:_K(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=GK(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{mhe(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:rq(e.name,this.schema)};e.type===`mark`&&(BK(B(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=B(e,`onBeforeCreate`,t),r=B(e,`onCreate`,t),i=B(e,`onUpdate`,t),a=B(e,`onSelectionUpdate`,t),o=B(e,`onTransaction`,t),s=B(e,`onFocus`,t),c=B(e,`onBlur`,t),l=B(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}},UJ.resolve=ZK,UJ.sort=XK,UJ.flatten=LK,WJ={},yq(WJ,{ClipboardTextSerializer:()=>KJ,Commands:()=>qJ,Delete:()=>JJ,Drop:()=>YJ,Editable:()=>XJ,FocusEvents:()=>QJ,Keymap:()=>$J,Paste:()=>eY,Tabindex:()=>tY,TextDirection:()=>nY,focusEventsPluginKey:()=>ZJ}),GJ=class e extends LJ{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},KJ=GJ.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new dM({key:new pM(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=$K(n);return QK(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),qJ=GJ.create({name:`commands`,addCommands(){return{...xq}}}),JJ=GJ.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=MK(e.before,[e,...t]);tq(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Hj){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),YJ=GJ.create({name:`drop`,addProseMirrorPlugins(){return[new dM({key:new pM(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),XJ=GJ.create({name:`editable`,addProseMirrorPlugins(){return[new dM({key:new pM(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),ZJ=new pM(`focusEvents`),QJ=GJ.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new dM({key:ZJ,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),$J=GJ.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:eM.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return SK()||EK()?i:r},addProseMirrorPlugins(){return[new dM({key:new pM(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=eM.atStart(t.doc).from,l=eM.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!cq(n.doc))return;let u=n.tr,d=uK({state:n,transaction:u}),{commands:f}=new bq({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),eY=GJ.create({name:`paste`,addProseMirrorPlugins(){return[new dM({key:new pM(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),tY=GJ.create({name:`tabindex`,addProseMirrorPlugins(){return[new dM({key:new pM(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),nY=GJ.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=VK(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new dM({key:new pM(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),rY=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+(a?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},iY=`.ProseMirror {
|
|
48
|
+
position: relative;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ProseMirror {
|
|
52
|
+
word-wrap: break-word;
|
|
53
|
+
white-space: pre-wrap;
|
|
54
|
+
white-space: break-spaces;
|
|
55
|
+
-webkit-font-variant-ligatures: none;
|
|
56
|
+
font-variant-ligatures: none;
|
|
57
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ProseMirror [contenteditable="false"] {
|
|
61
|
+
white-space: normal;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
65
|
+
white-space: pre-wrap;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ProseMirror pre {
|
|
69
|
+
white-space: pre-wrap;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
img.ProseMirror-separator {
|
|
73
|
+
display: inline !important;
|
|
74
|
+
border: none !important;
|
|
75
|
+
margin: 0 !important;
|
|
76
|
+
width: 0 !important;
|
|
77
|
+
height: 0 !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ProseMirror-gapcursor {
|
|
81
|
+
display: none;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
position: absolute;
|
|
84
|
+
margin: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ProseMirror-gapcursor:after {
|
|
88
|
+
content: "";
|
|
89
|
+
display: block;
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: -2px;
|
|
92
|
+
width: 20px;
|
|
93
|
+
border-top: 1px solid black;
|
|
94
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@keyframes ProseMirror-cursor-blink {
|
|
98
|
+
to {
|
|
99
|
+
visibility: hidden;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ProseMirror-hideselection *::selection {
|
|
104
|
+
background: transparent;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
108
|
+
background: transparent;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ProseMirror-hideselection * {
|
|
112
|
+
caret-color: transparent;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
116
|
+
display: block;
|
|
117
|
+
}`,aY=class extends PJ{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Zme,createMappablePosition:Qme},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=bK(t,this.options.autofocus);this.editorState=Kde.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=ohe(iY,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=zK(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new UJ([...this.options.enableCoreExtensions?[XJ,KJ.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),qJ,QJ,$J,tY,YJ,eY,JJ,nY.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new bq({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=AK(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(t.message))throw t;this.emit(`contentError`,{editor:this,error:t,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=AK(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new RP(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return eq(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Yme(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return RK(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
|
118
|
+
|
|
119
|
+
`,textSerializers:n={}}=e||{};return Gme(this.state.doc,{blockSeparator:t,textSerializers:{...$K(this.schema),...n}})}get isEmpty(){return cq(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new rY(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}},oY={},yq(oY,{createAtomBlockMarkdownSpec:()=>she,createBlockMarkdownSpec:()=>che,createInlineMarkdownSpec:()=>dhe,parseAttributes:()=>hq,parseIndentedBlocks:()=>fhe,renderNestedMarkdownContent:()=>phe,serializeAttributes:()=>gq}),sY=class e extends LJ{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}}})),lY,uY,dY,fY,pY=o((()=>{lY=Object.defineProperty,uY=(e,t,n)=>t in e?lY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dY=(e,t,n)=>uY(e,typeof t==`symbol`?t:t+``,n),fY=class{constructor(){dY(this,`callbacks`,{})}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),()=>this.off(e,t)}emit(e,...t){let n=this.callbacks[e];n&&n.forEach(e=>e.apply(this,t))}off(e,t){let n=this.callbacks[e];n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e])}removeAllListeners(){this.callbacks={}}}}));function hhe(){if(!mY&&(mY=typeof crypto<`u`&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<`u`&&typeof msCrypto.getRandomValues==`function`&&msCrypto.getRandomValues.bind(msCrypto),!mY))throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);return mY(hY)}var mY,hY,ghe=o((()=>{hY=new Uint8Array(16)})),gY,_he=o((()=>{gY=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i}));function vhe(e){return typeof e==`string`&&gY.test(e)}var yhe=o((()=>{_he()}));function bhe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(_Y[e[t+0]]+_Y[e[t+1]]+_Y[e[t+2]]+_Y[e[t+3]]+`-`+_Y[e[t+4]]+_Y[e[t+5]]+`-`+_Y[e[t+6]]+_Y[e[t+7]]+`-`+_Y[e[t+8]]+_Y[e[t+9]]+`-`+_Y[e[t+10]]+_Y[e[t+11]]+_Y[e[t+12]]+_Y[e[t+13]]+_Y[e[t+14]]+_Y[e[t+15]]).toLowerCase();if(!vhe(n))throw TypeError(`Stringified UUID is invalid`);return n}var _Y,vY,xhe=o((()=>{for(yhe(),_Y=[],vY=0;vY<256;++vY)_Y.push((vY+256).toString(16).substr(1))}));function yY(e,t,n){e||={};var r=e.random||(e.rng||hhe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n||=0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return bhe(r)}var She=o((()=>{ghe(),xhe()})),bY=o((()=>{She()}));function Che(e,t){let n=new Map;return e.descendants((e,r)=>{e.marks.forEach(i=>{if(i.type.name===t){let t=i.attrs.threadId;if(!t)return;let a=r,o=a+e.nodeSize,s=n.get(t)??{from:1/0,to:0};n.set(t,{from:Math.min(a,s.from),to:Math.max(o,s.to)})}})}),n}var xY,SY,CY,wY,TY,EY,DY,whe=o((()=>{mM(),zP(),JW(),dG(),mG(),cY(),pY(),xY=Object.defineProperty,SY=(e,t,n)=>t in e?xY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CY=(e,t,n)=>SY(e,typeof t==`symbol`?t:t+``,n),wY=RJ.create({name:`comment`,excludes:``,inclusive:!1,keepOnSplit:!0,addAttributes(){return{orphan:{parseHTML:e=>!!e.getAttribute(`data-orphan`),renderHTML:e=>e.orphan?{"data-orphan":`true`}:{},default:!1},threadId:{parseHTML:e=>e.getAttribute(`data-bn-thread-id`),renderHTML:e=>({"data-bn-thread-id":e.threadId}),default:``}}},renderHTML({HTMLAttributes:e}){return[`span`,WK(e,{class:`bn-thread-mark`})]},parseHTML(){return[{tag:`span.bn-thread-mark`}]},extendMarkSchema(e){return e.name===`comment`?{blocknoteIgnore:!0}:{}}}),TY=class extends fY{constructor(e){super(),CY(this,`userCache`,new Map),CY(this,`loadingUsers`,new Set),this.resolveUsers=e}async loadUsers(e){let t=e.filter(e=>!this.userCache.has(e)&&!this.loadingUsers.has(e));if(t.length!==0){for(let e of t)this.loadingUsers.add(e);try{let e=await this.resolveUsers(t);for(let t of e)this.userCache.set(t.id,t);this.emit(`update`,this.userCache)}finally{for(let e of t)this.loadingUsers.delete(e)}}}getUser(e){return this.userCache.get(e)}subscribe(e){return this.on(`update`,e)}},EY=new pM(`blocknote-comments`),DY=cG(({editor:e,options:{schema:t,threadStore:n,resolveUsers:r}})=>{if(!r)throw Error(`resolveUsers is required to be defined when using comments`);if(!n)throw Error(`threadStore is required to be defined when using comments`);let i=wY.name,a=new TY(r),o=lG({pendingComment:!1,selectedThreadId:void 0,threadPositions:new Map},{onUpdate(){o.state.selectedThreadId!==o.prevState.selectedThreadId&&e.transact(e=>e.setMeta(EY,!0))}}),s=t=>{e.transact(e=>{e.doc.descendants((n,r)=>{n.marks.forEach(a=>{if(a.type.name===i){let i=a.type,s=a.attrs.threadId,c=t.get(s),l=!!(!c||c.resolved||c.deletedAt);if(l!==a.attrs.orphan){let t=Math.max(r,0),c=Math.min(r+n.nodeSize,e.doc.content.size-1,e.doc.content.size-1);e.removeMark(t,c,a),e.addMark(t,c,i.create({...a.attrs,orphan:l})),l&&o.state.selectedThreadId===s&&o.setState(e=>({...e,selectedThreadId:void 0}))}}})})})};return{key:`comments`,store:o,prosemirrorPlugins:[new dM({key:EY,state:{init(){return{decorations:OP.empty}},apply(e,t){let n=e.getMeta(EY);if(!e.docChanged&&!n)return t;let r=e.docChanged?Che(e.doc,i):o.state.threadPositions;(r.size>0||o.state.threadPositions.size>0)&&o.setState(e=>({...e,threadPositions:r}));let a=[];if(o.state.selectedThreadId){let e=r.get(o.state.selectedThreadId);e&&a.push(TP.inline(e.from,e.to,{class:`bn-thread-mark-selected`}))}return{decorations:OP.create(e.doc,a)}}},props:{decorations(e){return EY.getState(e)?.decorations??OP.empty},handleClick:(e,t,n)=>{if(n.button!==0)return;let r=e.state.doc.nodeAt(t);if(!r){o.setState(e=>({...e,selectedThreadId:void 0}));return}let a=r.marks.find(e=>e.type.name===i&&e.attrs.orphan!==!0)?.attrs.threadId;a!==o.state.selectedThreadId&&o.setState(e=>({...e,selectedThreadId:a}))}}})],threadStore:n,mount(){let t=n.subscribe(s);s(n.getThreads());let r=e.onSelectionChange(()=>{o.state.pendingComment&&o.setState(e=>({...e,pendingComment:!1}))});return()=>{t(),r()}},selectThread(t,n=!0){var r;if(o.state.selectedThreadId!==t&&(o.setState(e=>({...e,pendingComment:!1,selectedThreadId:t})),t&&n)){let n=o.state.threadPositions.get(t);if(!n)return;(r=e.prosemirrorView?.domAtPos(n.from).node)==null||r.scrollIntoView({behavior:`smooth`,block:`center`})}},startPendingComment(){var t;o.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!0})),(t=e.getExtension(pG))==null||t.showSelection(!0,`comments`)},stopPendingComment(){var t;o.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!1})),(t=e.getExtension(pG))==null||t.showSelection(!1,`comments`)},async createThread(t){let r=await n.createThread(t);if(n.addThreadToDocument){let t=e.prosemirrorView,i=t.state.selection,a=RU.getState(t.state),o={prosemirror:{head:i.head,anchor:i.anchor},yjs:a?iW(a.binding,t.state):void 0};await n.addThreadToDocument({threadId:r.id,selection:o})}else e._tiptapEditor.commands.setMark(i,{orphan:!1,threadId:r.id})},userStore:a,commentEditorSchema:t,tiptapExtensions:[wY]}})})),The=s(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}));function Ehe(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Dhe(e){return Ehe(e.filter((t,n)=>e.indexOf(t)!==n))}function OY(e){return e.type===`link`}function kY(e){return typeof e!=`string`&&e.type===`link`}function AY(e){return typeof e!=`string`&&e.type===`text`}function jY(e){return NY(e)?{...e}:MY(e)?{type:`tableCell`,content:[].concat(e.content),props:{backgroundColor:e.props?.backgroundColor??`default`,textColor:e.props?.textColor??`default`,textAlignment:e.props?.textAlignment??`left`,colspan:e.props?.colspan??1,rowspan:e.props?.rowspan??1}}:{type:`tableCell`,content:[].concat(e),props:{backgroundColor:`default`,textColor:`default`,textAlignment:`left`,colspan:1,rowspan:1}}}function MY(e){return e!=null&&typeof e!=`string`&&!Array.isArray(e)&&e.type===`tableCell`}function NY(e){return MY(e)&&e.props!==void 0&&e.content!==void 0}function PY(e){return NY(e)?e.props.colspan??1:1}function FY(e){return NY(e)?e.props.rowspan??1:1}function IY(e,t=!0){let{"data-test":n,...r}=e;if(Object.keys(r).length>0&&t)throw Error(`Object must be empty `+JSON.stringify(e))}function LY(e,t){let n=e.resolve(t);if(n.nodeAfter&&n.nodeAfter.type.isInGroup(`bnBlock`))return{posBeforeNode:n.pos,node:n.nodeAfter};let r=n.depth,i=n.node(r);for(;r>0;){if(i.type.isInGroup(`bnBlock`))return{posBeforeNode:n.before(r),node:i};r--,i=n.node(r)}let a=[];e.descendants((e,t)=>{e.type.isInGroup(`bnBlock`)&&a.push(t)}),console.warn(`Position ${t} is not within a blockContainer node.`);let o=e.resolve(a.find(e=>e>=t)||a[a.length-1]);return{posBeforeNode:o.pos,node:o.nodeAfter}}function RY(e,t){if(!e.type.isInGroup(`bnBlock`))throw Error(`Attempted to get bnBlock node at position but found node of different type ${e.type.name}`);let n=e,r=t,i={node:n,beforePos:r,afterPos:r+n.nodeSize};if(n.type.name===`blockContainer`){let e,t;if(n.forEach((n,i)=>{if(n.type.spec.group===`blockContent`){let t=n,a=r+i+1;e={node:t,beforePos:a,afterPos:a+n.nodeSize}}else if(n.type.name===`blockGroup`){let e=n,a=r+i+1;t={node:e,beforePos:a,afterPos:a+n.nodeSize}}}),!e)throw Error(`blockContainer node does not contain a blockContent node in its children: ${n}`);return{isBlockContainer:!0,bnBlock:i,blockContent:e,childContainer:t,blockNoteType:e.node.type.name}}else{if(!i.node.type.isInGroup(`childContainer`))throw Error(`bnBlock node is not in the childContainer group: ${i.node}`);return{isBlockContainer:!1,bnBlock:i,childContainer:i,blockNoteType:i.node.type.name}}}function zY(e){return RY(e.node,e.posBeforeNode)}function BY(e){if(!e.nodeAfter)throw Error(`Attempted to get blockContainer node at position ${e.pos} but a node at this position does not exist`);return RY(e.nodeAfter,e.pos)}function VY(e){return zY(LY(e.doc,e.selection.anchor))}function HY(e){return zY(LY(e.doc,e.selection.anchor))}function UY(e){return`doc`in e?e.doc.type.schema:e.type.schema}function WY(e){return e.cached.blockNoteEditor}function GY(e){return WY(e).schema}function KY(e){return GY(e).blockSchema}function qY(e){return GY(e).inlineContentSchema}function JY(e){return GY(e).styleSchema}function YY(e){return WY(e).blockCache}function XY(e,t,n){var r;let i={type:`tableContent`,columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},a=[];e.content.forEach((e,r,o)=>{let s={cells:[]};o===0&&e.content.forEach(e=>{let t=e.attrs.colwidth;t??=Array(e.attrs.colspan??1).fill(void 0),i.columnWidths.push(...t)}),s.cells=e.content.content.map((e,r)=>(a[o]||(a[o]=[]),a[o][r]=e.type.name===`tableHeader`,{type:`tableCell`,content:e.content.content.map(e=>ZY(e,t,n)).reduce((e,t)=>{if(!e.length)return t;let n=e[e.length-1],r=t[0];return r&&AY(n)&&AY(r)&&JSON.stringify(n.styles)===JSON.stringify(r.styles)?(n.text+=`
|
|
120
|
+
`+r.text,e.push(...t.slice(1)),e):(e.push(...t),e)},[]),props:{colspan:e.attrs.colspan,rowspan:e.attrs.rowspan,backgroundColor:e.attrs.backgroundColor,textColor:e.attrs.textColor,textAlignment:e.attrs.textAlignment}})),i.rows.push(s)});for(let e=0;e<a.length;e++)(r=a[e])!=null&&r.every(e=>e)&&(i.headerRows=(i.headerRows??0)+1);for(let e=0;e<a[0]?.length;e++)a!=null&&a.every(t=>t[e])&&(i.headerCols=(i.headerCols??0)+1);return i}function ZY(e,t,n){let r=[],i;return e.content.forEach(e=>{if(e.type.name===`hardBreak`){if(i)if(AY(i))i.text+=`
|
|
121
|
+
`;else if(OY(i))i.content[i.content.length-1].text+=`
|
|
122
|
+
`;else throw Error(`unexpected`);else i={type:`text`,text:`
|
|
123
|
+
`,styles:{}};return}if(e.type.name!==`link`&&e.type.name!==`text`){if(!t[e.type.name]){console.warn(`unrecognized inline content type`,e.type.name);return}i&&=(r.push(i),void 0),r.push(QY(e,t,n));return}let a={},o;for(let t of e.marks)if(t.type.name===`link`)o=t;else{let e=n[t.type.name];if(!e){if(t.type.spec.blocknoteIgnore)continue;throw Error(`style ${t.type.name} not found in styleSchema`)}if(e.propSchema===`boolean`)a[e.type]=!0;else if(e.propSchema===`string`)a[e.type]=t.attrs.stringValue;else throw new _X(e.propSchema)}i?AY(i)?o?(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):JSON.stringify(i.styles)===JSON.stringify(a)?i.text+=e.textContent:(r.push(i),i={type:`text`,text:e.textContent,styles:a}):OY(i)&&(o?i.href===o.attrs.href?JSON.stringify(i.content[i.content.length-1].styles)===JSON.stringify(a)?i.content[i.content.length-1].text+=e.textContent:i.content.push({type:`text`,text:e.textContent,styles:a}):(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):(r.push(i),i={type:`text`,text:e.textContent,styles:a})):i=o?{type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}:{type:`text`,text:e.textContent,styles:a}}),i&&r.push(i),r}function QY(e,t,n){if(e.type.name===`text`||e.type.name===`link`)throw Error(`unexpected`);let r={},i=t[e.type.name];for(let[t,n]of Object.entries(e.attrs)){if(!i)throw Error(`ic node is of an unrecognized type: `+e.type.name);t in i.propSchema&&(r[t]=n)}let a;return a=i.content===`styled`?ZY(e,t,n):void 0,{type:e.type.name,props:r,content:a}}function $Y(e,t,n=KY(t),r=qY(t),i=JY(t),a=YY(t)){var o;if(!e.type.isInGroup(`bnBlock`))throw Error(`Node should be a bnBlock, but is instead: `+e.type.name);let s=a?.get(e);if(s)return s;let c=RY(e,0),l=c.bnBlock.node.attrs.id;l===null&&(l=gX.options.generateID());let u=n[c.blockNoteType];if(!u)throw Error(`Block is of an unrecognized type: `+c.blockNoteType);let d={};for(let[t,n]of Object.entries({...e.attrs,...c.isBlockContainer?c.blockContent.node.attrs:{}})){let e=u.propSchema;t in e&&!(e[t].default===void 0&&n===void 0)&&(d[t]=n)}let f=n[c.blockNoteType],p=[];(o=c.childContainer)==null||o.node.forEach(e=>{p.push($Y(e,t,n,r,i,a))});let m;if(f.content===`inline`){if(!c.isBlockContainer)throw Error(`impossible`);m=ZY(c.blockContent.node,r,i)}else if(f.content===`table`){if(!c.isBlockContainer)throw Error(`impossible`);m=XY(c.blockContent.node,r,i)}else if(f.content===`none`)m=void 0;else throw new _X(f.content);let h={id:l,type:f.type,props:d,content:m,children:p};return a?.set(e,h),h}function Ohe(e,t=UY(e),n=KY(t),r=qY(t),i=JY(t),a=YY(t)){let o=[];return e.firstChild&&e.firstChild.descendants(e=>(o.push($Y(e,t,n,r,i,a)),!1)),o}function khe(e,t,n=KY(t),r=qY(t),i=JY(t),a=YY(t)){function o(e,s,c){if(e.type.name!==`blockGroup`)throw Error(`unexpected`);let l=[],u,d;return e.forEach((f,p,m)=>{if(f.type.name!==`blockContainer`)throw Error(`unexpected`);if(f.childCount===0)return;if(f.childCount===0||f.childCount>2)throw Error(`unexpected, blockContainer.childCount: `+f.childCount);let h=m===0,g=m===e.childCount-1;if(f.firstChild.type.name===`blockGroup`){if(!h)throw Error(`unexpected`);let e=o(f.firstChild,Math.max(0,s-1),g?Math.max(0,c-1):0);u=e.blockCutAtStart,g&&(d=e.blockCutAtEnd),l.push(...e.blocks);return}let _=$Y(f,t,n,r,i,a),v=f.childCount>1?f.child(1):void 0,y=[];if(v){let e=o(v,0,g?Math.max(0,c-1):0);y=e.blocks,g&&(d=e.blockCutAtEnd)}g&&!v&&c>1&&(d=_.id),h&&s>1&&(u=_.id),l.push({..._,children:y})}),{blocks:l,blockCutAtStart:u,blockCutAtEnd:d}}if(e.content.childCount===0)return{blocks:[],blockCutAtStart:void 0,blockCutAtEnd:void 0};if(e.content.childCount!==1)throw Error(`slice must be a single block, did you forget includeParents=true?`);return o(e.content.firstChild,Math.max(e.openStart-1,0),Math.max(e.openEnd-1,0))}function eX(e){let{height:t,width:n}=rX(e),r=Array(t).fill(!1).map(()=>Array(n).fill(null)),i=(e,i)=>{for(let a=e;a<t;a++)for(let e=i;e<n;e++)if(!r[a][e])return{row:a,col:e};throw Error(`Unable to create occupancy grid for table, no more available cells`)};for(let t=0;t<e.content.rows.length;t++)for(let n=0;n<e.content.rows[t].cells.length;n++){let a=jY(e.content.rows[t].cells[n]),o=FY(a),s=PY(a),{row:c,col:l}=i(t,n);for(let e=c;e<c+o;e++)for(let i=l;i<l+s;i++){if(r[e][i])throw Error(`Unable to create occupancy grid for table, cell at ${e},${i} is already occupied`);r[e][i]={row:t,col:n,rowspan:o,colspan:s,cell:a}}}return r}function tX(e){let t=new Set;return e.map(e=>({cells:e.map(e=>t.has(e.row+`:`+e.col)?!1:(t.add(e.row+`:`+e.col),e.cell)).filter(e=>e!==!1)}))}function nX(e,t,n=eX(t)){for(let t=0;t<n.length;t++)for(let r=0;r<n[t].length;r++){let i=n[t][r];if(i&&i.row===e.row&&i.col===e.col)return{row:t,col:r,cell:i.cell}}throw Error(`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`)}function rX(e){let t=e.content.rows.length,n=0;return e.content.rows.forEach(e=>{let t=0;e.cells.forEach(e=>{t+=PY(e)}),n=Math.max(n,t)}),{height:t,width:n}}function iX(e,t,n=eX(t)){let r=n[e.row]?.[e.col];if(r)return{row:r.row,col:r.col,cell:r.cell}}function aX(e,t){let n=eX(e);if(t<0||t>=n.length)return[];let r=0;for(let e=0;e<t;e++){let e=n[r]?.[0];if(!e)return[];r+=e.rowspan}let i=Array(n[0].length).fill(!1).map((t,i)=>iX({row:r,col:i},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function oX(e,t){let n=eX(e);if(t<0||t>=n[0].length)return[];let r=0;for(let e=0;e<t;e++){let e=n[0]?.[r];if(!e)return[];r+=e.colspan}let i=Array(n.length).fill(!1).map((t,i)=>iX({row:i,col:r},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function Ahe(e,t,n,r=eX(e)){let{col:i}=nX({row:0,col:t},e,r),{col:a}=nX({row:0,col:n},e,r);return r.forEach(e=>{let[t]=e.splice(i,1);e.splice(a,0,t)}),tX(r)}function jhe(e,t,n,r=eX(e)){let{row:i}=nX({row:t,col:0},e,r),{row:a}=nX({row:n,col:0},e,r),[o]=r.splice(i,1);return r.splice(a,0,o),tX(r)}function sX(e){return e?MY(e)?sX(e.content):typeof e==`string`?e.length===0:Array.isArray(e)?e.every(e=>typeof e==`string`?e.length===0:AY(e)?e.text.length===0:kY(e)?typeof e.content==`string`?e.content.length===0:e.content.every(e=>e.text.length===0):!1):!1:!0}function Mhe(e,t,n=eX(e)){if(t===`columns`){let e=0;for(let t=n[0].length-1;t>=0&&n.every(e=>sX(e[t].cell)&&e[t].colspan===1);t--)e++;for(let t=n.length-1;t>=0;t--){let r=Math.max(n[t].length-e,1);n[t]=n[t].slice(0,r)}return tX(n)}let r=0;for(let e=n.length-1;e>=0&&n[e].every(e=>sX(e.cell)&&e.rowspan===1);e--)r++;let i=Math.min(r,n.length-1);return n.splice(n.length-i,i),tX(n)}function Nhe(e,t,n,r=eX(e)){let{width:i,height:a}=rX(e);if(t===`columns`)r.forEach((e,t)=>{if(n>=0)for(let r=0;r<n;r++)e.push({row:t,col:Math.max(...e.map(e=>e.col))+1,rowspan:1,colspan:1,cell:jY(``)});else e.splice(i+n,-1*n)});else if(n>0)for(let e=0;e<n;e++){let t=Array(i).fill(null).map((t,n)=>({row:a+e,col:n,rowspan:1,colspan:1,cell:jY(``)}));r.push(t)}else n<0&&r.splice(a+n,-1*n);return tX(r)}function cX(e,t,n){let r=aX(e,n);if(!r.some(e=>FY(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=FY(e.cell);i=Math.max(i,e.row+t-1),a=Math.min(a,e.row)}),t<n?n===i:n===a}function lX(e,t,n){let r=oX(e,n);if(!r.some(e=>PY(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=PY(e.cell);i=Math.max(i,e.col+t-1),a=Math.min(a,e.col)}),t<n?n===i:n===a}function Phe(e,t,n){let r=nX(e,n),i=nX(t,n);return r.col===i.col}function uX(e,t,n,r){let i=[];for(let[r,a]of Object.entries(e.styles||{})){let e=n[r];if(!e)throw Error(`style ${r} not found in styleSchema`);if(e.propSchema===`boolean`)a&&i.push(t.mark(r));else if(e.propSchema===`string`)a&&i.push(t.mark(r,{stringValue:a}));else throw new _X(e.propSchema)}return!r||!t.nodes[r].spec.code?e.text.split(/(\n)/g).filter(e=>e.length>0).map(e=>e===`
|
|
124
|
+
`?t.nodes.hardBreak.createChecked():t.text(e,i)):e.text.length>0?[t.text(e.text,i)]:[]}function Fhe(e,t,n){let r=t.marks.link.create({href:e.href});return dX(e.content,t,n).map(e=>{if(e.type.name===`text`)return e.mark([...e.marks,r]);if(e.type.name===`hardBreak`)return e;throw Error(`unexpected node type`)})}function dX(e,t,n,r){let i=[];if(typeof e==`string`)return i.push(...uX({text:e,styles:{}},t,n,r)),i;for(let a of e)i.push(...uX(a,t,n,r));return i}function fX(e,t,n,r=JY(t)){let i=[];for(let a of e)typeof a==`string`?i.push(...dX(a,t,r,n)):kY(a)?i.push(...Fhe(a,t,r)):AY(a)?i.push(...dX([a],t,r,n)):i.push(mX(a,t,r));return i}function pX(e,t,n=JY(t)){let r=[],i=Array(e.headerRows??0).fill(!0),a=Array(e.headerCols??0).fill(!0),o=e.columnWidths??[];for(let s=0;s<e.rows.length;s++){let c=e.rows[s],l=[],u=i[s];for(let r=0;r<c.cells.length;r++){let i=c.cells[r],d=a[r],f=null,p=nX({row:s,col:r},{content:e}),m=o[p.col]?[o[p.col]]:null;if(i)if(typeof i==`string`)f=t.text(i);else if(MY(i)){i.content&&(f=fX(i.content,t,`tableParagraph`,n));let e=PY(i);e>1&&(m=Array(e).fill(!1).map((e,t)=>o[p.col+t]??void 0))}else f=fX(i,t,`tableParagraph`,n);let h=t.nodes[d||u?`tableHeader`:`tableCell`].createChecked({...MY(i)?i.props:{},colwidth:m},t.nodes.tableParagraph.createChecked(void 0,f));l.push(h)}let d=t.nodes.tableRow.createChecked({},l);r.push(d)}return r}function mX(e,t,n){let r,i=e.type;if(i===void 0&&(i=`paragraph`),!t.nodes[i])throw Error(`node type ${i} not found in schema`);if(!e.content)r=t.nodes[i].createChecked(e.props);else if(typeof e.content==`string`){let a=fX([e.content],t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(Array.isArray(e.content)){let a=fX(e.content,t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(e.content.type===`tableContent`){let a=pX(e.content,t,n);r=t.nodes[i].createChecked(e.props,a)}else throw new _X(e.content.type);return r}function hX(e,t,n=JY(t)){let r=e.id;r===void 0&&(r=gX.options.generateID());let i=[];if(e.children)for(let r of e.children)i.push(hX(r,t,n));if(!e.type||t.nodes[e.type].isInGroup(`blockContent`)){let a=mX(e,t,n),o=i.length>0?t.nodes.blockGroup.createChecked({},i):void 0;return t.nodes.blockContainer.createChecked({id:r,...e.props},o?[a,o]:a)}else{if(t.nodes[e.type].isInGroup(`bnBlock`))return t.nodes[e.type].createChecked({id:r,...e.props},i);throw Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}}var gX,_X,vX=o((()=>{cY(),gj(),mM(),bY(),gX=GJ.create({name:`uniqueID`,priority:1e4,addOptions(){return{attributeName:`id`,types:[],setIdAttribute:!1,generateID:()=>{if(typeof window<`u`&&window.__TEST_OPTIONS){let e=window.__TEST_OPTIONS;return e.mockID===void 0?e.mockID=0:e.mockID++,e.mockID.toString()}return yY()},filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>e.getAttribute(`data-${this.options.attributeName}`),renderHTML:e=>{let t={[`data-${this.options.attributeName}`]:e[this.options.attributeName]};return this.options.setIdAttribute?{...t,id:e[this.options.attributeName]}:t}}}}]},addProseMirrorPlugins(){let e=null,t=!1;return[new dM({key:new pM(`uniqueID`),appendTransaction:(e,t,n)=>{let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=this.options.filterTransaction&&e.some(e=>{var t,n;return!((n=(t=this.options).filterTransaction)!=null&&n.call(t,e))});if(!r||i)return;let{tr:a}=n,{types:o,attributeName:s,generateID:c}=this.options,l=MK(t.doc,e),{mapping:u}=l;if(tq(l).forEach(({newRange:e})=>{let r=PK(n.doc,e,e=>o.includes(e.type.name)),i=Dhe(r.map(({node:e})=>e.attrs[s]).filter(e=>e!==null));r.forEach(({node:e,pos:r})=>{let o=a.doc.nodeAt(r)?.attrs[s];if(o===null){let i=t.doc.type.createAndFill().content;if(t.doc.content.findDiffStart(i)===null){let t=JSON.parse(JSON.stringify(n.doc.toJSON()));if(t.content[0].content[0].attrs.id=`initialBlockId`,JSON.stringify(t.content)===JSON.stringify(i.toJSON())){a.setNodeMarkup(r,void 0,{...e.attrs,[s]:`initialBlockId`});return}}a.setNodeMarkup(r,void 0,{...e.attrs,[s]:c()});return}let{deleted:l}=u.invert().mapResult(r);l&&i.includes(o)&&a.setNodeMarkup(r,void 0,{...e.attrs,[s]:c()})})}),a.steps.length)return a.setMeta(`uniqueID`,!0),a},view(t){let n=n=>{let r;e=(r=t.dom.parentElement)!=null&&r.contains(n.target)?t.dom.parentElement:null};return window.addEventListener(`dragstart`,n),{destroy(){window.removeEventListener(`dragstart`,n)}}},props:{handleDOMEvents:{drop:(n,r)=>(t=e!==n.dom.parentElement||r.dataTransfer?.effectAllowed===`copy`,e=null,!1),paste:()=>(t=!0,!1)},transformPasted:e=>{if(!t)return e;let{types:n,attributeName:r}=this.options,i=e=>{let t=[];return e.forEach(e=>{if(e.isText){t.push(e);return}if(!n.includes(e.type.name)){t.push(e.copy(i(e.content)));return}let a=e.type.create({...e.attrs,[r]:null},i(e.content),e.marks);t.push(a)}),L.from(t)};return t=!1,new R(i(e.content),e.openStart,e.openEnd)}}})]}}),_X=class extends Error{constructor(e){super(`Unreachable case: ${e}`)}}}));function Ihe(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=Lhe(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new eZ(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&Rhe(s,o,e),s}function Lhe(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function Rhe(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=zhe(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function zhe(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function yX(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}function bX(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function Bhe(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function xX(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function SX(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=bX(t.$head)||Vhe(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Vhe(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function CX(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function Hhe(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function wX(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function TX(e,t,n){let r=e.node(-1),i=eZ.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function EX(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function DX(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function Uhe(e,t,n){let r=yX(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}function Whe(e){if(!(e.selection instanceof nZ))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(TP.node(n,n+e.nodeSize,{class:`selectedCell`}))}),OP.create(e.doc,t)}function Ghe({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Khe({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function qhe(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof iM&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=nZ.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=nZ.rowSelection(e,e)}else if(!n){let e=eZ.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=nZ.create(i,t+1,n)}}else r instanceof z&&Ghe(r)?a=z.create(i,r.from):r instanceof z&&Khe(r)&&(a=z.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}function OX(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?OX(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Jhe(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=Yhe(e,t,r,n))};return t?t.doc!=e.doc&&OX(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Yhe(e,t,n,r){let i=eZ.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,EX(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=yX(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(iZ,{fixTables:!0})}function kX(e){let t=e.selection,n=SX(e),r=n.node(-1),i=n.start(-1),a=eZ.get(r);return{...t instanceof nZ?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function AX(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Uhe(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,DX(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?yX(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Xhe(e,t){if(!xX(e))return!1;if(t){let n=kX(e);t(AX(e.tr,n,n.left))}return!0}function Zhe(e,t){if(!xX(e))return!1;if(t){let n=kX(e);t(AX(e.tr,n,n.right))}return!0}function Qhe(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,EX(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function $he(e,t){if(!xX(e))return!1;if(t){let n=kX(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Qhe(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=eZ.get(e)}t(r)}return!0}function ege(e,t,n){let r=yX(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function jX(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;ege(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?yX(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,yX(r.type.schema).row.create(null,o)),e}function tge(e,t){if(!xX(e))return!1;if(t){let n=kX(e);t(jX(e.tr,n,n.top))}return!0}function nge(e,t){if(!xX(e))return!1;if(t){let n=kX(e);t(jX(e.tr,n,n.bottom))}return!0}function rge(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function ige(e,t){if(!xX(e))return!1;if(t){let n=kX(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;rge(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=eZ.get(n.table)}t(r)}return!0}function MX(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function age({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function oge(e,t){let n=e.selection;if(!(n instanceof nZ)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=kX(e),{map:i}=r;if(age(i,r))return!1;if(t){let n=e.tr,a={},o=L.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{MX(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...DX(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=MX(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new nZ(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function sge(e,t){let n=yX(e.schema);return cge(({node:e})=>n[e.type.spec.tableRole])(e,t)}function cge(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof nZ){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Bhe(r.$from),!i)return!1;a=bX(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=kX(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof nZ&&u.setSelection(new nZ(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function lge(e){return function(t,n){if(!xX(t))return!1;if(n){let r=yX(t.schema),i=kX(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function NX(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function PX(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?lge(e):function(t,n){if(!xX(t))return!1;if(n){let r=yX(t.schema),i=kX(t),a=t.tr,o=NX(`row`,i,r),s=NX(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}function uge(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function FX(e){return function(t,n){if(!xX(t))return!1;let r=uge(SX(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(z.between(e,Hhe(e))).scrollIntoView())}return!0}}function IX(e,t){let n=e.selection;if(!(n instanceof nZ))return!1;if(t){let r=e.tr,i=yX(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new R(i,0,0))}),r.docChanged&&t(r)}return!0}function dge(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=LX(yX(o).row,new R(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?LX(yX(o).row,new R(t,n,r)).content:t);else return null;return fge(o,s)}function fge(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(L.empty),n[i]<r){let a=yX(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(L.from(o))}return{height:t.length,width:r,rows:t}}function LX(e,t){let n=e.createAndFill();return new Xj(n).replace(0,n.content.size,t).doc}function pge({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(EX(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(L.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(L.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function mge(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=yX(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,L.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function RX(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function zX(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,EX(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(EX(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function BX(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=eZ.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=eZ.get(a),f=d.mapping.maps.length}mge(d,o,a,n,l,u,f)&&p(),RX(d,o,a,n,c,l,s,f)&&p(),RX(d,o,a,n,c,l,u,f)&&p(),zX(d,o,a,n,s,u,c,f)&&p(),zX(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new R(i.rows[e-s],0,0))}p(),d.setSelection(new nZ(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}function VX(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function HX(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof nZ)return VX(n,r,eM.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=WX(i,e,t);if(o==null)return!1;if(e==`horiz`)return VX(n,r,eM.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=TX(i,e,t),s;return s=a?eM.near(a,1):t<0?eM.near(n.doc.resolve(i.before(-1)),-1):eM.near(n.doc.resolve(i.after(-1)),1),VX(n,r,s)}}}function UX(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof nZ)o=a;else{let r=WX(i,e,t);if(r==null)return!1;o=new nZ(n.doc.resolve(r))}let s=TX(o.$headCell,e,t);return s?VX(n,r,new nZ(o.$anchorCell,s)):!1}}function hge(e,t){let n=e.state.doc,r=bX(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new nZ(r))),!0):!1}function gge(e,t,n){if(!xX(e.state))return!1;let r=dge(n),i=e.state.selection;if(i instanceof nZ){r||={width:1,height:1,rows:[L.from(LX(yX(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=eZ.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=pge(r,o.right-o.left,o.bottom-o.top),BX(e.state,e.dispatch,a,o,r),!0}else if(r){let t=SX(e.state),n=t.start(-1);return BX(e.state,e.dispatch,n,eZ.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function _ge(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=GX(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof nZ)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=bX(e.state.selection.$anchor))!=null&&KX(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=KX(e,n),i=tZ.getState(e.state)==null;if(!r||!wX(t,r))if(i)r=t;else return;let a=new nZ(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(tZ,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),tZ.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(tZ,-1))}function o(r){let o=r,s=tZ.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(GX(e,o.target)!=n&&(c=KX(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function WX(e,t,n){if(!(e.state.selection instanceof z))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function GX(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function KX(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&bX(e.state.doc.resolve(r))||bX(e.state.doc.resolve(i))}function qX(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}function vge({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=oZ,lastColumnResizable:i=!0}={}){let a=new dM({key:sZ,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=yX(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new cZ(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=sZ.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{yge(t,n,e,i)},mouseleave:e=>{bge(e)},mousedown:(e,r)=>{xge(e,r,t,n)}},decorations:e=>{let t=sZ.getState(e);if(t&&t.activeHandle>-1)return Ege(e,t.activeHandle)},nodeViews:{}}});return a}function yge(e,t,n,r){if(!e.editable)return;let i=sZ.getState(e.state);if(i&&!i.dragging){let a=Cge(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=JX(e,t,`left`,n):i-t.clientX<=n&&(o=JX(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=eZ.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}XX(e,o)}}}function bge(e){if(!e.editable)return;let t=sZ.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&XX(e,-1)}function xge(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=sZ.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=Sge(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(sZ,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=sZ.getState(e.state);r?.dragging&&(wge(e,r.activeHandle,YX(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(sZ,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=sZ.getState(e.state);if(i&&i.dragging){let a=YX(i.dragging,t,n);ZX(e,i.activeHandle,a,r)}}return ZX(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function Sge(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function Cge(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function JX(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=bX(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=eZ.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function YX(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function XX(e,t){e.dispatch(e.state.tr.setMeta(sZ,{setHandle:t}))}function wge(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=eZ.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():Tge(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function ZX(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=eZ.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&qX(a,c.firstChild,c,r,s,n)}function Tge(e){return Array(e).fill(0)}function Ege(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return OP.empty;let a=eZ.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,sZ.getState(e)?.dragging&&n.push(TP.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(TP.widget(s,c))}}return OP.create(e.doc,n)}function Dge({allowTableNodeSelection:e=!1}={}){return new dM({key:tZ,state:{init(){return null},apply(e,t){let n=e.getMeta(tZ);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Whe,handleDOMEvents:{mousedown:_ge},createSelectionBetween(e){return tZ.getState(e.state)==null?null:e.state.selection},handleTripleClick:hge,handleKeyDown:aZ,handlePaste:gge},appendTransaction(t,n,r){return qhe(r,Jhe(r,n),e)}})}var QX,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ=o((()=>{if(mM(),gj(),zP(),cK(),Zj(),typeof WeakMap<`u`){let e=new WeakMap;QX=t=>e.get(t),$X=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;QX=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},$X=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}eZ=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return QX(e)||$X(e,Ihe(e))}},tZ=new pM(`selectingCells`),nZ=class e extends eM{constructor(e,t=e){let n=e.node(-1),r=eZ.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new tM(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(CX(r)&&CX(i)&&wX(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return z.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=eZ.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=EX(e,0,l)),u>0&&(e=EX(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(L.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new R(L.from(o),1,1)}replace(e,t=R.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?R.empty:t)}let i=eM.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new R(L.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=eZ.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=eZ.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=eZ.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=eZ.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new rZ(this.$anchorCell.pos,this.$headCell.pos)}},nZ.prototype.visible=!1,eM.jsonID(`cell`,nZ),rZ=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&wX(t,n)?new nZ(t,n):eM.near(n,1)}},iZ=new pM(`fix-tables`),PX(`row`,{useDeprecatedLogic:!0}),PX(`column`,{useDeprecatedLogic:!0}),PX(`cell`,{useDeprecatedLogic:!0}),aZ=aK({ArrowLeft:HX(`horiz`,-1),ArrowRight:HX(`horiz`,1),ArrowUp:HX(`vert`,-1),ArrowDown:HX(`vert`,1),"Shift-ArrowLeft":UX(`horiz`,-1),"Shift-ArrowRight":UX(`horiz`,1),"Shift-ArrowUp":UX(`vert`,-1),"Shift-ArrowDown":UX(`vert`,1),Backspace:IX,"Mod-Backspace":IX,Delete:IX,"Mod-Delete":IX}),oZ=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),qX(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,qX(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}},sZ=new pM(`tableColumnResizing`),cZ=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(sZ);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return CX(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}}})),uZ,Oge=o((()=>{uZ=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]}})),kge=o((()=>{Oge()})),dZ,fZ,pZ,mZ,hZ,gZ,Age=o((()=>{cY(),kge(),dZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,fZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,pZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,mZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,hZ=RJ.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return uZ(`strong`,{...WK(this.options.HTMLAttributes,e),children:uZ(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[mq({find:dZ,type:this.type}),mq({find:pZ,type:this.type})]},addPasteRules(){return[_q({find:fZ,type:this.type}),_q({find:mZ,type:this.type})]}}),gZ=hZ})),_Z,vZ,yZ,bZ,jge=o((()=>{cY(),_Z=/(^|[^`])`([^`]+)`(?!`)$/,vZ=/(^|[^`])`([^`]+)`(?!`)/g,yZ=RJ.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,WK(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[mq({find:_Z,type:this.type})]},addPasteRules(){return[_q({find:vZ,type:this.type})]}}),bZ=yZ})),xZ,SZ,CZ,wZ,TZ,EZ,Mge=o((()=>{cY(),xZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,SZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,CZ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,wZ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,TZ=RJ.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,WK(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[mq({find:xZ,type:this.type}),mq({find:CZ,type:this.type})]},addPasteRules(){return[_q({find:SZ,type:this.type}),_q({find:wZ,type:this.type})]}}),EZ=TZ})),DZ,OZ,kZ,AZ,Nge=o((()=>{cY(),DZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,OZ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,kZ=RJ.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,WK(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[mq({find:DZ,type:this.type})]},addPasteRules(){return[_q({find:OZ,type:this.type})]}}),AZ=kZ})),jZ,MZ,Pge=o((()=>{cY(),jZ=RJ.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,WK(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),MZ=jZ}));function Fge({parser:e,nodeTypes:t=[`code_block`,`codeBlock`],languageExtractor:n=e=>e.attrs.language}){let r=new pM(`prosemirror-highlight`);return new dM({key:r,state:{init(r,i){let a=new PZ,[o,s]=NZ(i.doc,e,t,n,a);return{cache:a,decorations:o,promises:s}},apply:(r,i)=>{let a=i.cache.invalidate(r),o=!!r.getMeta(`prosemirror-highlight-refresh`);if(!r.docChanged&&!o)return{cache:a,decorations:i.decorations.map(r.mapping,r.doc),promises:i.promises};let[s,c]=NZ(r.doc,e,t,n,a);return{cache:a,decorations:s,promises:c}}},view:e=>{let t=new Set,n=()=>{if(t.size>0)return;let n=e.state.tr.setMeta(`prosemirror-highlight-refresh`,!0);e.dispatch(n)},i=()=>{let i=r.getState(e.state);for(let e of i?.promises??[])t.add(e),e.then(()=>{t.delete(e),n()}).catch(()=>{t.delete(e)})};return i(),{update:()=>{i()}}},props:{decorations(e){return this.getState(e)?.decorations}}})}function NZ(e,t,n,r,i){let a=[],o=[];return e.descendants((e,s)=>{if(!e.type.isTextblock)return!0;if(n.includes(e.type.name)){let n=r(e),c=i.get(s);if(c){let[e,t]=c;a.push(...t)}else{let r=t({content:e.textContent,language:n||void 0,pos:s,size:e.nodeSize});r&&Array.isArray(r)?(i.set(s,e,r),a.push(...r)):r instanceof Promise&&(i.remove(s),o.push(r))}}return!1}),[OP.create(e,a),o]}var PZ,Ige=o((()=>{mM(),zP(),PZ=class e{constructor(e){this.cache=new Map(e)}get(e){return this.cache.get(e)}set(e,t,n){e<0||this.cache.set(e,[t,n])}replace(e,t,n,r){this.remove(e),this.set(t,n,r)}remove(e){this.cache.delete(e)}invalidate(t){let n=new e(this.cache),r=t.mapping;return this.cache.forEach(([e,i],a)=>{if(a<0)return;let o=r.mapResult(a),s=t.doc.nodeAt(o.pos);if(o.deleted||!s?.eq(e))n.remove(a);else if(a!==o.pos){let e=i.map(e=>e.map(r,0,0)).filter(e=>e!=null);n.replace(a,o.pos,s,e)}}),n}}}));function Lge(e,t){return function({content:n,language:r,pos:i,size:a}){let o=[],{tokens:s,fg:c,bg:l,rootStyle:u}=e.codeToTokens(n,{lang:r,...t??{theme:e.getLoadedThemes()[0]}}),d=u||(c&&l?`--prosemirror-highlight:${c};--prosemirror-highlight-bg:${l}`:``);if(d){let e=TP.node(i,i+a,{style:d});o.push(e)}let f=i+1;for(let e of s){for(let t of e){let e=f+t.content.length,n=TP.inline(f,e,{style:Rge(t.htmlStyle??`color: ${t.color}`),class:`shiki`});o.push(n),f=e}f+=1}return o}}function Rge(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var zge=o((()=>{zP()}));function FZ(e,t=`Ctrl`){return dQ()?e.replace(`Mod`,`⌘`):e.replace(`Mod`,t)}function IZ(...e){return[...new Set(e.filter(e=>e).join(` `).split(` `))].join(` `)}function Bge(e,t,n,r){let i=document.createElement(`div`);i.className=IZ(`bn-block-content`,n.class),i.setAttribute(`data-content-type`,e);for(let[e,t]of Object.entries(n))e!==`class`&&i.setAttribute(e,t);let a=document.createElement(t);a.className=IZ(`bn-inline-content`,r.class);for(let[e,t]of Object.entries(r))e!==`class`&&a.setAttribute(e,t);return i.appendChild(a),{dom:i,contentDOM:a}}function LZ(e,t=`<br>`){let n=e.querySelectorAll(`p`);if(n.length>1){let e=n[0];for(let r=1;r<n.length;r++){let i=n[r];e.innerHTML+=t+i.innerHTML,i.remove()}}}function RZ(e){return`data-`+e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function zZ(e){let t=e.split(`/`);return!t.length||t[t.length-1]===``?e:t[t.length-1]}function Vge(e){let t=[`mp4`,`webm`,`ogg`,`mov`,`mkv`,`flv`,`avi`,`wmv`,`m4v`];try{let n=new URL(e).pathname.split(`.`).pop()?.toLowerCase()||``;return t.includes(n)}catch{return!1}}function Hge(e){let t={};return Object.entries(e).forEach(([e,n])=>{t[e]={default:n.default,keepOnSplit:!0,parseHTML:t=>{let r=t.getAttribute(RZ(e));if(r===null)return null;if(n.default===void 0&&n.type===`boolean`||n.default!==void 0&&typeof n.default==`boolean`)return r===`true`?!0:r===`false`?!1:null;if(n.default===void 0&&n.type===`number`||n.default!==void 0&&typeof n.default==`number`){let e=parseFloat(r);return!Number.isNaN(e)&&Number.isFinite(e)?e:null}return r},renderHTML:t=>t[e]===n.default?{}:{[RZ(e)]:t[e]}}}),t}function Uge(e,t,n,r){let i=e();if(i===void 0)throw Error(`Cannot find node position`);let a=n.state.doc.resolve(i).node().attrs.id;if(!a)throw Error(`Block doesn't have id`);let o=t.getBlock(a);if(o.type!==r)throw Error(`Block type does not match`);return o}function BZ(e,t,n,r,i=!1,a){let o=document.createElement(`div`);if(a!==void 0)for(let[e,t]of Object.entries(a))e!==`class`&&o.setAttribute(e,t);o.className=IZ(`bn-block-content`,a?.class||``),o.setAttribute(`data-content-type`,t);for(let[e,t]of Object.entries(n))t!==r[e].default&&o.setAttribute(RZ(e),t);return i&&o.setAttribute(`data-file-block`,``),o.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=IZ(`bn-inline-content`,e.contentDOM.className)),{...e,dom:o}}function Wge(e,t,n){return{config:{type:e.type,content:e.content,propSchema:t},implementation:{node:e.node,render:pQ,toExternalHTML:pQ},extensions:n}}function Gge(e,t){e.stopEvent=e=>(e.type===`mousedown`&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function Kge(e,t){let n=[{tag:`[data-content-type=`+e.type+`]`,contentElement:`.bn-inline-content`}];return t.parse&&n.push({tag:`*`,getAttrs(e){if(typeof e==`string`)return!1;let n=t.parse?.call(t,e);return n===void 0?!1:n},preserveWhitespace:!0,getContent:e.content===`inline`||e.content===`none`?(n,r)=>{var i;if(t.parseContent){let e=t.parseContent({el:n,schema:r});if(e!==void 0)return e}if(e.content===`inline`){let e=n.cloneNode(!0);return LZ(e,(i=t.meta)!=null&&i.code?`
|
|
125
|
+
`:`<br>`),oj.fromSchema(r).parse(e,{topNode:r.nodes.paragraph.create(),preserveWhitespace:!0}).content}return L.empty}:void 0}),n}function qge(e,t,n,r){let i=t.node||sY.create({name:e.type,content:e.content===`inline`?`inline*`:e.content===`none`?``:e.content,group:`blockContent`,selectable:t.meta?.selectable??!0,isolating:t.meta?.isolating??!0,code:t.meta?.code??!1,defining:t.meta?.defining??!0,priority:r,addAttributes(){return Hge(e.propSchema)},parseHTML(){return Kge(e,t)},renderHTML({HTMLAttributes:n}){let r=document.createElement(`div`);return BZ({dom:r,contentDOM:e.content===`inline`?r:void 0},e.type,{},e.propSchema,t.meta?.fileBlockAccept!==void 0,n)},addNodeView(){return n=>{let r=this.options.editor,i=Uge(n.getPos,r,this.editor,e.type),a=this.options.domAttributes?.blockContent||{},o=t.render.call({blockContentDOMAttributes:a,props:n,renderType:`nodeView`},i,r);return t.meta?.selectable===!1&&Gge(o,this.editor),o}}});if(i.name!==e.type)throw Error(`Node name does not match block type. This is a bug in BlockNote.`);return{config:e,implementation:{...t,node:i,render(e,n){let r=i.options.domAttributes?.blockContent||{};return t.render.call({blockContentDOMAttributes:r,props:void 0,renderType:`dom`},e,n)},toExternalHTML:(e,n,r)=>{let a=i.options.domAttributes?.blockContent||{};return t.toExternalHTML?.call({blockContentDOMAttributes:a},e,n,r)??t.render.call({blockContentDOMAttributes:a,renderType:`dom`,props:void 0},e,n)}},extensions:n}}function VZ(e,t,n){return(r={})=>{let i=typeof e==`function`?e(r):e,a=typeof t==`function`?t(r):t,o=n?typeof n==`function`?n(r):n:void 0;return{config:i,implementation:{...a,toExternalHTML(e,t,n){let r=a.toExternalHTML?.call({blockContentDOMAttributes:this.blockContentDOMAttributes},e,t,n);if(r!==void 0)return BZ(r,e.type,e.props,i.propSchema,a.meta?.fileBlockAccept!==void 0)},render(e,t){return BZ(a.render.call({blockContentDOMAttributes:this.blockContentDOMAttributes,renderType:this.renderType,props:this.props},e,t),e.type,e.props,i.propSchema,a.meta?.fileBlockAccept!==void 0,this.blockContentDOMAttributes)}},extensions:o}}}function HZ(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function Jge(e){return e===`boolean`?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:e=>e.getAttribute(`data-value`),renderHTML:e=>e.stringValue===void 0?{}:{"data-value":e.stringValue}}}}function UZ(e,t,n,r){return e.dom.setAttribute(`data-style-type`,t),r===`string`&&e.dom.setAttribute(`data-value`,n),e.contentDOM&&e.contentDOM.setAttribute(`data-editable`,``),e}function WZ(e,t){return{config:e,implementation:t}}function GZ(e,t){return WZ({type:e.name,propSchema:t},{mark:e,render(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=mj.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a},toExternalHTML(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=mj.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a}})}function KZ(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function Yge(e,t){let n=[{tag:`[data-style-type="${e.type}"]`,contentElement:e=>{let t=e;return t.matches(`[data-editable]`)?t:t.querySelector(`[data-editable]`)||t}}];return t&&n.push({tag:`*`,consuming:!1,getAttrs(e){if(typeof e==`string`)return!1;let n=t?.(e);return n===void 0?!1:{stringValue:n}}}),n}function qZ(e,t){let n=RJ.create({name:e.type,addAttributes(){return Jge(e.propSchema)},parseHTML(){return Yge(e,t.parse)},renderHTML({mark:n}){return UZ((t.toExternalHTML||t.render)(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)},addMarkView(){return({mark:n})=>UZ(t.render(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)}});return WZ(e,{...t,mark:n,render:n=>UZ(t.render(n),e.type,n,e.propSchema),toExternalHTML:n=>UZ((t.toExternalHTML||t.render)(n),e.type,n,e.propSchema)})}function JZ(e,t){let n,r;if(t.firstChild.descendants((t,i)=>n?!1:!YZ(t)||t.attrs.id!==e?!0:(n=t,r=i+1,!1)),!(n===void 0||r===void 0))return{node:n,posBeforeNode:r}}function YZ(e){return e.type.isInGroup(`bnBlock`)}function XZ(e,t,n,r,i){let a=BY(e.doc.resolve(t)),o=null;a.blockNoteType===`table`&&(o=Qge(e));let s=UY(e);if(r!==void 0&&i!==void 0&&r>i)throw Error(`Invalid replaceFromPos or replaceToPos`);let c=s.nodes[a.blockNoteType],l=s.nodes[n.type||a.blockNoteType],u=l.isInGroup(`bnBlock`)?l:s.nodes.blockContainer;if(a.isBlockContainer&&l.isInGroup(`blockContent`)){let t=r!==void 0&&r>a.blockContent.beforePos&&r<a.blockContent.afterPos?r-a.blockContent.beforePos-1:void 0,o=i!==void 0&&i>a.blockContent.beforePos&&i<a.blockContent.afterPos?i-a.blockContent.beforePos-1:void 0;ZZ(n,e,a),Xge(n,e,c,l,a,t,o)}else if(!a.isBlockContainer&&l.isInGroup(`bnBlock`))ZZ(n,e,a);else{let t=$Y(a.bnBlock.node,s);e.replaceWith(a.bnBlock.beforePos,a.bnBlock.afterPos,hX({children:t.children,...n},s));return}e.setNodeMarkup(a.bnBlock.beforePos,u,{...a.bnBlock.node.attrs,...n.props}),o&&$ge(e,a,o)}function Xge(e,t,n,r,i,a,o){let s=UY(t),c=`keep`;if(e.content)if(typeof e.content==`string`)c=fX([e.content],s,r.name);else if(Array.isArray(e.content))c=fX(e.content,s,r.name);else if(e.content.type===`tableContent`)c=pX(e.content,s);else throw new _X(e.content.type);else n.spec.content===``||r.spec.content!==n.spec.content&&(c=[]);if(c===`keep`)t.setNodeMarkup(i.blockContent.beforePos,r,{...i.blockContent.node.attrs,...e.props});else if(a!==void 0||o!==void 0){t.setNodeMarkup(i.blockContent.beforePos,r,{...i.blockContent.node.attrs,...e.props});let n=i.blockContent.beforePos+1+(a??0),s=i.blockContent.beforePos+1+(o??i.blockContent.node.content.size),l=t.doc.resolve(i.blockContent.beforePos).depth,u=t.doc.resolve(n).depth,d=t.doc.resolve(s).depth;t.replace(n,s,new R(L.from(c),u-l-1,d-l-1))}else t.replaceWith(i.blockContent.beforePos,i.blockContent.afterPos,r.createChecked({...i.blockContent.node.attrs,...e.props},c))}function ZZ(e,t,n){let r=UY(t);if(e.children!==void 0&&e.children.length>0){let i=e.children.map(e=>hX(e,r));if(n.childContainer)t.step(new Gj(n.childContainer.beforePos+1,n.childContainer.afterPos-1,new R(L.from(i),0,0)));else{if(!n.isBlockContainer)throw Error(`impossible`);t.insert(n.blockContent.afterPos,r.nodes.blockGroup.createChecked({},i))}}}function Zge(e,t,n,r,i){let a=typeof t==`string`?t:t.id,o=JZ(a,e.doc);if(!o)throw Error(`Block with ID ${a} not found`);return XZ(e,o.posBeforeNode,n,r,i),$Y(e.doc.resolve(o.posBeforeNode+1).node(),UY(e))}function Qge(e){let t=`selection`in e?e.selection:null;if(!(t instanceof z))return null;let n=e.doc.resolve(t.head),r=-1,i=-1;for(let e=n.depth;e>=0;e--){let t=n.node(e).type.name;if(r<0&&(t===`tableCell`||t===`tableHeader`)&&(r=e),t===`table`){i=e;break}}if(r<0||i<0)return null;let a=n.before(r),o=n.before(i),s=e.doc.nodeAt(o);if(!s||s.type.name!==`table`)return null;let c=eZ.get(s),l=a-(o+1),u=c.map.indexOf(l);if(u<0)return null;let d=Math.floor(u/c.width),f=u%c.width,p=a+1+1;return{row:d,col:f,offset:Math.max(0,t.head-p)}}function $ge(e,t,n){if(t.blockNoteType!==`table`)return!1;let r=-1;if(t.isBlockContainer)r=e.mapping.map(t.blockContent.beforePos);else{let n=e.mapping.map(t.bnBlock.beforePos),i=n+(e.doc.nodeAt(n)?.nodeSize||0);e.doc.nodesBetween(n,i,(e,t)=>e.type.name===`table`?(r=t,!1):!0)}let i=r>=0?e.doc.nodeAt(r):null;if(!i||i.type.name!==`table`)return!1;let a=eZ.get(i),o=Math.max(0,Math.min(n.row,a.height-1)),s=Math.max(0,Math.min(n.col,a.width-1)),c=o*a.width+s,l=a.map[c];if(l==null)return!1;let u=r+1+l+1,d=e.doc.nodeAt(u),f=u+1,p=d?d.content.size:0,m=f+Math.max(0,Math.min(n.offset,p));return`selection`in e&&e.setSelection(z.create(e.doc,m)),!0}function e_e(e){let t=globalThis,n,r;return Fge({parser:i=>{if(!e.createHighlighter)return[];if(!n)return t[IQ]=t[IQ]||e.createHighlighter(),t[IQ].then(e=>{n=e});let a=QZ(e,i.language);return!a||a===`text`||a===`none`||a===`plaintext`||a===`txt`?[]:n.getLoadedLanguages().includes(a)?(r||(r=t[FQ]||Lge(n),t[FQ]=r),r(i)):n.loadLanguage(a)},languageExtractor:e=>e.attrs.language,nodeTypes:[`codeBlock`]})}function QZ(e,t){return Object.entries(e.supportedLanguages??{}).find(([e,{aliases:n}])=>n?.includes(t)||e===t)?.[0]}function $Z(e,t,n){var r;let i=oj.fromSchema(t),a=e.querySelector(`:scope > summary`),o;if(a){let e=a.cloneNode(!0);LZ(e),o=i.parse(e,{topNode:t.nodes.paragraph.create(),preserveWhitespace:!0}).content}else o=L.empty;let s=document.createElement(`div`);s.setAttribute(`data-node-type`,`blockGroup`);let c=!1;for(let t of Array.from(e.childNodes))t.tagName!==`SUMMARY`&&(t.nodeType===3&&!((r=t.textContent)!=null&&r.trim())||(c=!0,s.appendChild(t.cloneNode(!0))));let l=t.nodes[n].create({},o);if(!c)return l.content;let u=i.parse(s,{topNode:t.nodes.blockGroup.create()});return u.content.size>0?l.content.addToEnd(u):l.content}function eQ(e,t,n){let r=oj.fromSchema(t),i=e,a=document.createElement(`div`);a.setAttribute(`data-node-type`,`blockGroup`);for(let e of Array.from(i.childNodes))a.appendChild(e.cloneNode(!0));let o=r.parse(a,{topNode:t.nodes.blockGroup.create()});(o.firstChild?.firstChild)?.type.name===`checkListItem`&&(o=o.copy(o.content.cut(o.firstChild.firstChild.nodeSize+2)));let s=o.firstChild?.firstChild;if(!(s!=null&&s.isTextblock))return L.from(o);let c=t.nodes[n].create({},s.content),l=o.content.cut(s.nodeSize+2);if(l.size>0){let e=o.copy(l);return c.content.addToEnd(e)}return c.content}function tQ(e,t,n,r){let i=e.firstChild.attrs.start||1,a=!0,o=!!e.firstChild.attrs.start,s=zY({posBeforeNode:t,node:e});if(!s.isBlockContainer)throw Error(`impossible`);let c=n.doc.resolve(s.bnBlock.beforePos).nodeBefore,l=c?r.get(c):void 0;return l===void 0?c&&zY({posBeforeNode:s.bnBlock.beforePos-c.nodeSize,node:c}).blockNoteType===`numberedListItem`&&(i=tQ(c,s.bnBlock.beforePos-c.nodeSize,n,r).index+1,a=!1):(i=l+1,a=!1),r.set(e,i),{index:i,isFirst:a,hasStart:o}}function nQ(e,t){let n=new Map,r=t.decorations.map(e.mapping,e.doc),i=[];e.doc.nodesBetween(0,e.doc.nodeSize-2,(t,a)=>{if(t.type.name===`blockContainer`&&t.firstChild.type.name===`numberedListItem`){let{index:o,isFirst:s,hasStart:c}=tQ(t,a,e,n);if(r.find(a,a+t.nodeSize,e=>e.index===o&&e.isFirst===s&&e.hasStart===c).length===0){let t=e.doc.nodeAt(a+1);i.push(TP.node(a+1,a+1+t.nodeSize,{"data-index":o.toString()}))}}});let a=i.flatMap(e=>r.find(e.from,e.to));return{decorations:r.remove(a).add(e.doc,i)}}function rQ(e,t){let n=oj.fromSchema(t).parse(e,{topNode:t.nodes.blockGroup.create()}),r=[];return n.content.descendants(e=>{if(e.isInline)return r.push(e),!1}),L.fromArray(r)}function iQ(e,t,n){if(!(t in e.schema.blockSpecs))return!1;if(!n)return!0;for(let[r,i]of Object.entries(n)){if(!(r in e.schema.blockSpecs[t].config.propSchema))return!1;if(typeof i==`string`){if(e.schema.blockSpecs[t].config.propSchema[r].default!==void 0&&typeof e.schema.blockSpecs[t].config.propSchema[r].default!==i||e.schema.blockSpecs[t].config.propSchema[r].type!==void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i)return!1}else{if(e.schema.blockSpecs[t].config.propSchema[r].default!==i.default||e.schema.blockSpecs[t].config.propSchema[r].default===void 0&&i.default===void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i.type||typeof e.schema.blockSpecs[t].config.propSchema[r].values!=typeof i.values)return!1;if(typeof e.schema.blockSpecs[t].config.propSchema[r].values==`object`&&typeof i.values==`object`){for(let n of i.values)if(!e.schema.blockSpecs[t].config.propSchema[r].values.includes(n))return!1}}}return!0}function aQ(e,t,n,r){return iQ(t,n,r)&&e.type===n}function oQ(e){return e instanceof nZ}function t_e(e){if(N$.has(e))return N$.get(e);let t=new Lj;return e._tiptapEditor.on(`transaction`,({transaction:e})=>{t.appendMapping(e.mapping)}),e._tiptapEditor.on(`destroy`,()=>{N$.delete(e)}),N$.set(e,t),t}function n_e(e,t,n=`left`){let r=RU.getState(e.prosemirrorState);if(!r){let r=t_e(e),i=r.maps.length;return()=>r.slice(i).map(t,n===`left`?-1:1)}let i=jW(t+(n===`right`?1:-1),r.binding.type,r.binding.mapping);return()=>{let t=RU.getState(e.prosemirrorState),r=NW(t.doc,t.binding.type,i,t.binding.mapping);if(r===null)throw Error(`Position not found, cannot track positions`);return r+(n===`right`?-1:1)}}function r_e(e){let t=e.getTextCursorPosition().block,n=e.schema.blockSchema[t.type].content;for(;n===`none`;){if(t=e.getTextCursorPosition().nextBlock,t===void 0)return;n=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,`end`)}}function sQ(e,t){let n=e.getTextCursorPosition().block;if(n.content===void 0)throw Error(`Slash Menu open in a block that doesn't contain content.`);let r;return Array.isArray(n.content)&&(n.content.length===1&&AY(n.content[0])&&n.content[0].type===`text`&&n.content[0].text===`/`||n.content.length===0)?(r=e.updateBlock(n,t),e.setTextCursorPosition(r)):(r=e.insertBlocks([t],n,`after`)[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),r_e(e),r}function i_e(e){let t=[];return iQ(e,`heading`,{level:`number`})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(e=>e<=3).forEach(n=>{t.push({onItemClick:()=>{sQ(e,{type:`heading`,props:{level:n}})},badge:FZ(`Mod-Alt-${n}`),key:n===1?`heading`:`heading_${n}`,...e.dictionary.slash_menu[n===1?`heading`:`heading_${n}`]})}),iQ(e,`quote`)&&t.push({onItemClick:()=>{sQ(e,{type:`quote`})},key:`quote`,...e.dictionary.slash_menu.quote}),iQ(e,`toggleListItem`)&&t.push({onItemClick:()=>{sQ(e,{type:`toggleListItem`})},badge:FZ(`Mod-Shift-6`),key:`toggle_list`,...e.dictionary.slash_menu.toggle_list}),iQ(e,`numberedListItem`)&&t.push({onItemClick:()=>{sQ(e,{type:`numberedListItem`})},badge:FZ(`Mod-Shift-7`),key:`numbered_list`,...e.dictionary.slash_menu.numbered_list}),iQ(e,`bulletListItem`)&&t.push({onItemClick:()=>{sQ(e,{type:`bulletListItem`})},badge:FZ(`Mod-Shift-8`),key:`bullet_list`,...e.dictionary.slash_menu.bullet_list}),iQ(e,`checkListItem`)&&t.push({onItemClick:()=>{sQ(e,{type:`checkListItem`})},badge:FZ(`Mod-Shift-9`),key:`check_list`,...e.dictionary.slash_menu.check_list}),iQ(e,`paragraph`)&&t.push({onItemClick:()=>{sQ(e,{type:`paragraph`})},badge:FZ(`Mod-Alt-0`),key:`paragraph`,...e.dictionary.slash_menu.paragraph}),iQ(e,`codeBlock`)&&t.push({onItemClick:()=>{sQ(e,{type:`codeBlock`})},badge:FZ(`Mod-Alt-c`),key:`code_block`,...e.dictionary.slash_menu.code_block}),iQ(e,`divider`)&&t.push({onItemClick:()=>{sQ(e,{type:`divider`})},key:`divider`,...e.dictionary.slash_menu.divider}),iQ(e,`table`)&&t.push({onItemClick:()=>{sQ(e,{type:`table`,content:{type:`tableContent`,rows:[{cells:[``,``,``]},{cells:[``,``,``]}]}})},badge:void 0,key:`table`,...e.dictionary.slash_menu.table}),iQ(e,`image`,{url:`string`})&&t.push({onItemClick:()=>{var t;let n=sQ(e,{type:`image`});(t=e.getExtension(SQ))==null||t.showMenu(n.id)},key:`image`,...e.dictionary.slash_menu.image}),iQ(e,`video`,{url:`string`})&&t.push({onItemClick:()=>{var t;let n=sQ(e,{type:`video`});(t=e.getExtension(SQ))==null||t.showMenu(n.id)},key:`video`,...e.dictionary.slash_menu.video}),iQ(e,`audio`,{url:`string`})&&t.push({onItemClick:()=>{var t;let n=sQ(e,{type:`audio`});(t=e.getExtension(SQ))==null||t.showMenu(n.id)},key:`audio`,...e.dictionary.slash_menu.audio}),iQ(e,`file`,{url:`string`})&&t.push({onItemClick:()=>{var t;let n=sQ(e,{type:`file`});(t=e.getExtension(SQ))==null||t.showMenu(n.id)},key:`file`,...e.dictionary.slash_menu.file}),iQ(e,`heading`,{level:`number`,isToggleable:`boolean`})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(e=>e<=3).forEach(n=>{t.push({onItemClick:()=>{sQ(e,{type:`heading`,props:{level:n,isToggleable:!0}})},key:n===1?`toggle_heading`:`toggle_heading_${n}`,...e.dictionary.slash_menu[n===1?`toggle_heading`:`toggle_heading_${n}`]})}),iQ(e,`heading`,{level:`number`})&&(e.schema.blockSchema.heading.propSchema.level.values||[]).filter(e=>e>3).forEach(n=>{t.push({onItemClick:()=>{sQ(e,{type:`heading`,props:{level:n}})},badge:FZ(`Mod-Alt-${n}`),key:`heading_${n}`,...e.dictionary.slash_menu[`heading_${n}`]})}),t.push({onItemClick:()=>{var t;(t=e.getExtension(L$))==null||t.openSuggestionMenu(`:`,{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:`emoji`,...e.dictionary.slash_menu.emoji}),t}function a_e(e,t){return e.filter(({title:e,aliases:n})=>e.toLowerCase().includes(t.toLowerCase())||n&&n.filter(e=>e.toLowerCase().includes(t.toLowerCase())).length!==0)}var cQ,lQ,uQ,dQ,fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,zQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,$Q,e$,t$,n$,r$,i$,a$,o$,s$,c$,l$,u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$,C$,w$,T$,E$,D$,O$,k$,A$,j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$,W$=o((()=>{lZ(),cY(),mM(),zP(),Zj(),JW(),dG(),vX(),Age(),jge(),Mge(),Nge(),Pge(),XG(),Ige(),zge(),gj(),YG(),ZG(),cQ=Object.defineProperty,lQ=(e,t,n)=>t in e?cQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,uQ=(e,t,n)=>lQ(e,typeof t==`symbol`?t:t+``,n),dQ=()=>typeof navigator<`u`&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)),fQ=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),pQ=(e,t)=>{let n=hX(e,t.pmSchema);n.type.name===`blockContainer`&&(n=n.firstChild);let r=t.pmSchema.nodes[n.type.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=r(n);if(typeof i!=`object`||!(`dom`in i))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return i},mQ=(e,t)=>({tr:n,dispatch:r})=>(r&&XZ(n,e,t),!0),hQ={gray:{text:`#9b9a97`,background:`#ebeced`},brown:{text:`#64473a`,background:`#e9e5e3`},red:{text:`#e03e3e`,background:`#fbe4e4`},orange:{text:`#d9730d`,background:`#f6e9d9`},yellow:{text:`#dfab01`,background:`#fbf3db`},green:{text:`#4d6461`,background:`#ddedea`},blue:{text:`#0b6e99`,background:`#ddebf1`},purple:{text:`#6940a5`,background:`#eae4f2`},pink:{text:`#ad1a72`,background:`#f4dfeb`}},gQ={backgroundColor:{default:`default`},textColor:{default:`default`},textAlignment:{default:`left`,values:[`left`,`center`,`right`,`justify`]}},_Q=e=>{let t={};return e.hasAttribute(`data-background-color`)?t.backgroundColor=e.getAttribute(`data-background-color`):e.style.backgroundColor&&(t.backgroundColor=e.style.backgroundColor),e.hasAttribute(`data-text-color`)?t.textColor=e.getAttribute(`data-text-color`):e.style.color&&(t.textColor=e.style.color),t.textAlignment=gQ.textAlignment.values.includes(e.style.textAlign)?e.style.textAlign:void 0,t},vQ=(e,t)=>{e.backgroundColor&&e.backgroundColor!==gQ.backgroundColor.default&&(t.style.backgroundColor=e.backgroundColor in hQ?hQ[e.backgroundColor].background:e.backgroundColor),e.textColor&&e.textColor!==gQ.textColor.default&&(t.style.color=e.textColor in hQ?hQ[e.textColor].text:e.textColor),e.textAlignment&&e.textAlignment!==gQ.textAlignment.default&&(t.style.textAlign=e.textAlignment)},yQ=(e=`backgroundColor`)=>({default:gQ.backgroundColor.default,parseHTML:e=>e.hasAttribute(`data-background-color`)?e.getAttribute(`data-background-color`):e.style.backgroundColor?e.style.backgroundColor:gQ.backgroundColor.default,renderHTML:t=>t[e]===gQ.backgroundColor.default?{}:{"data-background-color":t[e]}}),bQ=(e=`textColor`)=>({default:gQ.textColor.default,parseHTML:e=>e.hasAttribute(`data-text-color`)?e.getAttribute(`data-text-color`):e.style.color?e.style.color:gQ.textColor.default,renderHTML:t=>t[e]===gQ.textColor.default?{}:{"data-text-color":t[e]}}),xQ=(e,t)=>{let n=e.querySelector(t);return n?{targetElement:n,caption:e.querySelector(`figcaption`)?.textContent??void 0}:void 0},SQ=cG(({editor:e})=>{let t=lG(void 0);function n(){t.setState(void 0)}return{key:`filePanel`,store:t,mount({signal:t}){let r=e.onChange(n,!1),i=e.onSelectionChange(n,!1);t.addEventListener(`abort`,()=>{r(),i()})},closeMenu:n,showMenu(e){t.setState(e)}}}),CQ=(e,t,n)=>{let r=document.createElement(`div`);r.className=`bn-add-file-button`;let i=document.createElement(`div`);i.className=`bn-add-file-button-icon`,n?i.appendChild(n):i.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,r.appendChild(i);let a=document.createElement(`p`);a.className=`bn-add-file-button-text`,a.innerHTML=e.type in t.dictionary.file_blocks.add_button_text?t.dictionary.file_blocks.add_button_text[e.type]:t.dictionary.file_blocks.add_button_text.file,r.appendChild(a);let o=e=>{e.preventDefault(),e.stopPropagation()},s=()=>{var n;t.isEditable&&((n=t.getExtension(SQ))==null||n.showMenu(e.id))};return r.addEventListener(`mousedown`,o,!0),r.addEventListener(`click`,s,!0),{dom:r,destroy:()=>{r.removeEventListener(`mousedown`,o,!0),r.removeEventListener(`click`,s,!0)}}},wQ=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,TQ=e=>{let t=document.createElement(`div`);t.className=`bn-file-name-with-icon`;let n=document.createElement(`div`);n.className=`bn-file-icon`,n.innerHTML=wQ,t.appendChild(n);let r=document.createElement(`p`);return r.className=`bn-file-name`,r.textContent=e.props.name,t.appendChild(r),{dom:t}},EQ=(e,t,n,r)=>{let i=document.createElement(`div`);if(i.className=`bn-file-block-content-wrapper`,e.props.url===``){let n=CQ(e,t,r);i.appendChild(n.dom);let a=t.onUploadStart(t=>{if(t===e.id){i.removeChild(n.dom);let e=document.createElement(`div`);e.className=`bn-file-loading-preview`,e.textContent=`Loading...`,i.appendChild(e)}});return{dom:i,destroy:()=>{a(),n.destroy()}}}let a={dom:i};if(e.props.showPreview===!1||!n){let t=TQ(e);i.appendChild(t.dom),a.destroy=()=>{var e;(e=t.destroy)==null||e.call(t)}}else i.appendChild(n.dom);if(e.props.caption){let t=document.createElement(`p`);t.className=`bn-file-caption`,t.textContent=e.props.caption,i.appendChild(t)}return a},DQ=(e,t)=>{let n=document.createElement(`figure`),r=document.createElement(`figcaption`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},OQ=(e,t)=>{let n=document.createElement(`div`),r=document.createElement(`p`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},kQ=e=>({url:e.src||void 0}),AQ=e=>({type:`audio`,propSchema:{backgroundColor:gQ.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0}},content:`none`}),jQ=(e={})=>e=>{if(e.tagName===`AUDIO`){if(e.closest(`figure`))return;let{backgroundColor:t}=_Q(e);return{...kQ(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=xQ(e,`audio`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=_Q(e);return{...kQ(n),backgroundColor:i,caption:r}}},MQ=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>`;let i=document.createElement(`audio`);return i.className=`bn-audio`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{i.src=e}):i.src=t.props.url,i.controls=!0,i.contentEditable=`false`,i.draggable=!1,EQ(t,n,{dom:i},r.firstElementChild)},NQ=(e={})=>(e,t)=>{if(!e.props.url){let e=document.createElement(`p`);return e.textContent=`Add audio`,{dom:e}}let n;return e.props.showPreview?(n=document.createElement(`audio`),n.src=e.props.url):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?DQ(n,e.props.caption):OQ(n,e.props.caption):{dom:n}},PQ=VZ(AQ,e=>({meta:{fileBlockAccept:[`audio/*`]},parse:jQ(e),render:MQ(e),toExternalHTML:NQ(e),runsBefore:[`file`]})),FQ=Symbol.for(`blocknote.shikiParser`),IQ=Symbol.for(`blocknote.shikiHighlighterPromise`),LQ=({defaultLanguage:e=`text`})=>({type:`codeBlock`,propSchema:{language:{default:e}},content:`inline`}),RQ=VZ(LQ,e=>({meta:{code:!0,defining:!0,isolating:!1},parse:e=>{if(e.tagName!==`PRE`||e.childElementCount!==1||e.firstElementChild?.tagName!==`CODE`)return;let t=e.firstElementChild;return{language:t.getAttribute(`data-language`)||t.className.split(` `).find(e=>e.includes(`language-`))?.replace(`language-`,``)}},parseContent:({el:e,schema:t})=>{let n=oj.fromSchema(t),r=e.firstElementChild;return n.parse(r,{preserveWhitespace:`full`,topNode:t.nodes.codeBlock.create()}).content},render(t,n){let r=document.createDocumentFragment(),i=document.createElement(`pre`),a=document.createElement(`code`);i.appendChild(a);let o;if(e.supportedLanguages){let i=document.createElement(`select`);if(Object.entries(e.supportedLanguages??{}).forEach(([e,{name:t}])=>{let n=document.createElement(`option`);n.value=e,n.text=t,i.appendChild(n)}),i.value=t.props.language||e.defaultLanguage||`text`,n.isEditable){let e=e=>{let r=e.target.value;n.updateBlock(t.id,{props:{language:r}})};i.addEventListener(`change`,e),o=()=>i.removeEventListener(`change`,e)}else i.disabled=!0;let a=document.createElement(`div`);a.contentEditable=`false`,a.appendChild(i),r.appendChild(a)}return r.appendChild(i),{dom:r,contentDOM:a,destroy:()=>{o?.()}}},toExternalHTML(e){let t=document.createElement(`pre`),n=document.createElement(`code`);return n.className=`language-${e.props.language}`,n.dataset.language=e.props.language,t.appendChild(n),{dom:t,contentDOM:n}}}),e=>[cG({key:`code-block-highlighter`,prosemirrorPlugins:[e_e(e)]}),cG({key:`code-block-keyboard-shortcuts`,keyboardShortcuts:{Delete:({editor:e})=>e.transact(t=>{let{block:n}=e.getTextCursorPosition();if(n.type!==`codeBlock`)return!1;let{$from:r}=t.selection;return r.parent.textContent?!1:(e.removeBlocks([n]),!0)}),Tab:({editor:t})=>e.indentLineWithTab===!1?!1:t.transact(e=>{let{block:n}=t.getTextCursorPosition();return n.type===`codeBlock`?(e.insertText(` `),!0):!1}),Enter:({editor:e})=>e.transact(t=>{let{block:n,nextBlock:r}=e.getTextCursorPosition();if(n.type!==`codeBlock`)return!1;let{$from:i}=t.selection,a=i.parentOffset===i.parent.nodeSize-2,o=i.parent.textContent.endsWith(`
|
|
126
|
+
|
|
127
|
+
`);if(a&&o){if(t.delete(i.pos-2,i.pos),r)return e.setTextCursorPosition(r,`start`),!0;let[a]=e.insertBlocks([{type:`paragraph`}],n,`after`);return e.setTextCursorPosition(a,`start`),!0}return t.insertText(`
|
|
128
|
+
`),!0}),"Shift-Enter":({editor:e})=>e.transact(()=>{let{block:t}=e.getTextCursorPosition();if(t.type!==`codeBlock`)return!1;let[n]=e.insertBlocks([{type:`paragraph`}],t,`after`);return e.setTextCursorPosition(n,`start`),!0})},inputRules:[{find:/^```(.*?)\s$/,replace:({match:t})=>{let n=t[1].trim();return{type:`codeBlock`,props:{language:{language:QZ(e,n)??n}.language},content:[]}}}]})]),zQ=()=>({type:`divider`,propSchema:{},content:`none`}),BQ=VZ(zQ,{meta:{isolating:!1},parse(e){if(e.tagName===`HR`)return{}},render(){return{dom:document.createElement(`hr`)}}},[cG({key:`divider-block-shortcuts`,inputRules:[{find:RegExp(`^---$`),replace(){return{type:`divider`,props:{},content:[]}}}]})]),VQ=e=>({url:e.src||void 0}),HQ=()=>({type:`file`,propSchema:{backgroundColor:gQ.backgroundColor,name:{default:``},url:{default:``},caption:{default:``}},content:`none`}),UQ=()=>e=>{if(e.tagName===`EMBED`){if(e.closest(`figure`))return;let{backgroundColor:t}=_Q(e);return{...VQ(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=xQ(e,`embed`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=_Q(e);return{...VQ(n),backgroundColor:i,caption:r}}},WQ=VZ(HQ,{meta:{fileBlockAccept:[`*/*`]},parse:UQ(),render(e,t){return EQ(e,t)},toExternalHTML(e){if(!e.props.url){let e=document.createElement(`p`);return e.textContent=`Add file`,{dom:e}}let t=document.createElement(`a`);return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?OQ(t,e.props.caption):{dom:t}}}),GQ={set:(e,t)=>window.localStorage.setItem(`toggle-${e.id}`,t?`true`:`false`),get:e=>window.localStorage.getItem(`toggle-${e.id}`)===`true`},KQ=(e,t,n,r=GQ)=>{if(`isToggleable`in e.props&&!e.props.isToggleable)return{dom:n};let i=document.createElement(`div`),a=document.createElement(`div`);a.className=`bn-toggle-wrapper`;let o=document.createElement(`button`);o.className=`bn-toggle-button`,o.type=`button`,o.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="CURRENTCOLOR"><path d="M320-200v-560l440 280-440 280Z"/></svg>`;let s=e=>e.preventDefault();o.addEventListener(`mousedown`,s);let c=()=>{a.getAttribute(`data-show-children`)===`true`?(a.setAttribute(`data-show-children`,`false`),r.set(t.getBlock(e),!1),i.contains(l)&&i.removeChild(l)):(a.setAttribute(`data-show-children`,`true`),r.set(t.getBlock(e),!0),t.isEditable&&t.getBlock(e)?.children.length===0&&!i.contains(l)&&i.appendChild(l))};o.addEventListener(`click`,c),a.appendChild(o),a.appendChild(n);let l=document.createElement(`button`);l.className=`bn-toggle-add-block-button`,l.type=`button`,l.textContent=t.dictionary.toggle_blocks.add_block_button;let u=e=>e.preventDefault();l.addEventListener(`mousedown`,u);let d=()=>{t.transact(()=>{let n=t.updateBlock(e,{children:[{}]});t.setTextCursorPosition(n.children[0].id,`end`),t.focus()})};l.addEventListener(`click`,d),i.appendChild(a);let f=e.children.length,p=t.onChange(()=>{let n=t.getBlock(e)?.children.length??0;n>f?(a.getAttribute(`data-show-children`)===`false`&&(a.setAttribute(`data-show-children`,`true`),r.set(t.getBlock(e),!0)),i.contains(l)&&i.removeChild(l)):n===0&&n<f&&(a.getAttribute(`data-show-children`)===`true`&&(a.setAttribute(`data-show-children`,`false`),r.set(t.getBlock(e),!1)),i.contains(l)&&i.removeChild(l)),f=n});return r.get(e)?(a.setAttribute(`data-show-children`,`true`),t.isEditable&&e.children.length===0&&i.appendChild(l)):a.setAttribute(`data-show-children`,`false`),{dom:i,ignoreMutation:e=>e instanceof MutationRecord&&(e.type===`attributes`&&e.target===a&&e.attributeName===`data-show-children`||e.type===`childList`&&(e.addedNodes[0]===l||e.removedNodes[0]===l)),destroy:()=>{o.removeEventListener(`mousedown`,s),o.removeEventListener(`click`,c),l.removeEventListener(`mousedown`,u),l.removeEventListener(`click`,d),p?.()}}},qQ=[1,2,3,4,5,6],JQ=e=>({editor:t})=>{let n=t.getTextCursorPosition();return t.schema.blockSchema[n.block.type].content===`inline`?(t.updateBlock(n.block,{type:`heading`,props:{level:e}}),!0):!1},YQ=({defaultLevel:e=1,levels:t=qQ,allowToggleHeadings:n=!0}={})=>({type:`heading`,propSchema:{...gQ,level:{default:e,values:t},...n?{isToggleable:{default:!1,optional:!0}}:{}},content:`inline`}),XQ=VZ(YQ,({allowToggleHeadings:e=!0}={})=>({meta:{isolating:!1},parse(t){if(e&&t.tagName===`DETAILS`){let e=t.querySelector(`:scope > summary`);if(!e)return;let n=e.querySelector(`h1, h2, h3, h4, h5, h6`);return n?{..._Q(n),level:parseInt(n.tagName[1]),isToggleable:!0}:void 0}let n;switch(t.tagName){case`H1`:n=1;break;case`H2`:n=2;break;case`H3`:n=3;break;case`H4`:n=4;break;case`H5`:n=5;break;case`H6`:n=6;break;default:return}return{..._Q(t),level:n}},...e?{parseContent:({el:e,schema:t})=>{if(e.tagName===`DETAILS`)return $Z(e,t,`heading`)}}:{},runsBefore:[`toggleListItem`],render(t,n){let r=document.createElement(`h${t.props.level}`);return e?{...KQ(t,n,r),contentDOM:r}:{dom:r,contentDOM:r}},toExternalHTML(t){let n=document.createElement(`h${t.props.level}`);if(vQ(t.props,n),e&&t.props.isToggleable){let e=document.createElement(`details`);e.setAttribute(`open`,``);let t=document.createElement(`summary`);return t.appendChild(n),e.appendChild(t),{dom:e,contentDOM:n,childrenDOM:e}}return{dom:n,contentDOM:n}}}),({levels:e=qQ}={})=>[cG({key:`heading-shortcuts`,keyboardShortcuts:Object.fromEntries(e.map(e=>[`Mod-Alt-${e}`,JQ(e)])??[]),inputRules:e.map(e=>({find:RegExp(`^(#{${e}})\\s$`),replace({match:e}){return{type:`heading`,props:{level:e[1].length}}}}))})]),ZQ=(e,t,n,r,i)=>{let{dom:a,destroy:o}=EQ(e,t,n,i),s=a;s.style.position=`relative`,e.props.url&&e.props.showPreview&&(e.props.previewWidth?s.style.width=`${e.props.previewWidth}px`:s.style.width=`fit-content`);let c=document.createElement(`div`);c.className=`bn-resize-handle`,c.style.left=`4px`;let l=document.createElement(`div`);l.className=`bn-resize-handle`,l.style.right=`4px`;let u=document.createElement(`div`);u.style.position=`absolute`,u.style.height=`100%`,u.style.width=`100%`;let d,f=e.props.previewWidth,p=n=>{if(!d){!t.isEditable&&r.contains(c)&&r.contains(l)&&(r.removeChild(c),r.removeChild(l));return}let i,a=`touches`in n?n.touches[0].clientX:n.clientX;i=e.props.textAlignment===`center`?d.handleUsed===`left`?d.initialWidth+(d.initialClientX-a)*2:d.initialWidth+(a-d.initialClientX)*2:d.handleUsed===`left`?d.initialWidth+d.initialClientX-a:d.initialWidth+a-d.initialClientX,f=Math.min(Math.max(i,64),t.domElement?.firstElementChild?.clientWidth||Number.MAX_VALUE),s.style.width=`${f}px`},m=n=>{(!n.target||!s.contains(n.target)||!t.isEditable)&&r.contains(c)&&r.contains(l)&&(r.removeChild(c),r.removeChild(l)),d&&(d=void 0,s.contains(u)&&s.removeChild(u),t.updateBlock(e,{props:{previewWidth:f}}))},h=()=>{t.isEditable&&(r.appendChild(c),r.appendChild(l))},g=e=>{e.relatedTarget===c||e.relatedTarget===l||d||t.isEditable&&r.contains(c)&&r.contains(l)&&(r.removeChild(c),r.removeChild(l))},_=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`left`,initialWidth:s.clientWidth,initialClientX:t}},v=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`right`,initialWidth:s.clientWidth,initialClientX:t}};return window.addEventListener(`mousemove`,p),window.addEventListener(`touchmove`,p),window.addEventListener(`mouseup`,m),window.addEventListener(`touchend`,m),s.addEventListener(`mouseenter`,h),s.addEventListener(`mouseleave`,g),c.addEventListener(`mousedown`,_),c.addEventListener(`touchstart`,_),l.addEventListener(`mousedown`,v),l.addEventListener(`touchstart`,v),{dom:s,destroy:()=>{o?.(),window.removeEventListener(`mousemove`,p),window.removeEventListener(`touchmove`,p),window.removeEventListener(`mouseup`,m),window.removeEventListener(`touchend`,m),s.removeEventListener(`mouseenter`,h),s.removeEventListener(`mouseleave`,g),c.removeEventListener(`mousedown`,_),c.removeEventListener(`touchstart`,_),l.removeEventListener(`mousedown`,v),l.removeEventListener(`touchstart`,v)}}},QQ=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.alt||void 0}),$Q=(e={})=>({type:`image`,propSchema:{textAlignment:gQ.textAlignment,backgroundColor:gQ.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`}),e$=(e={})=>e=>{if(e.tagName===`IMG`){if(e.closest(`figure`))return;let{backgroundColor:t}=_Q(e);return{...QQ(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=xQ(e,`img`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=_Q(e);return{...QQ(n),backgroundColor:i,caption:r}}},t$=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`img`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.alt=t.props.name||t.props.caption||`BlockNote image`,a.contentEditable=`false`,a.draggable=!1,i.appendChild(a),ZQ(t,n,{dom:i},i,r.firstElementChild)},n$=(e={})=>(e,t)=>{if(!e.props.url){let e=document.createElement(`p`);return e.textContent=`Add image`,{dom:e}}let n;return e.props.showPreview?(n=document.createElement(`img`),n.src=e.props.url,n.alt=e.props.name||e.props.caption||`BlockNote image`,e.props.previewWidth&&(n.width=e.props.previewWidth)):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?DQ(n,e.props.caption):OQ(n,e.props.caption):{dom:n}},r$=VZ($Q,e=>({meta:{fileBlockAccept:[`image/*`]},parse:e$(e),render:t$(e),toExternalHTML:n$(e),runsBefore:[`file`]})),i$=(e,t,n)=>({state:r,dispatch:i})=>i?a$(r.tr,e,t,n):!0,a$=(e,t,n,r)=>{let i=zY(LY(e.doc,t));if(!i.isBlockContainer)return!1;let a=UY(e),o=[{type:i.bnBlock.node.type,attrs:r?{...i.bnBlock.node.attrs,id:void 0}:{}},{type:n?i.blockContent.node.type:a.nodes.paragraph,attrs:r?{...i.blockContent.node.attrs}:{}}];return e.split(t,2,o),!0},o$=(e,t)=>{let{blockInfo:n,selectionEmpty:r}=e.transact(e=>({blockInfo:HY(e),selectionEmpty:e.selection.anchor===e.selection.head}));if(!n.isBlockContainer)return!1;let{bnBlock:i,blockContent:a}=n;return a.node.type.name!==t||!r?!1:a.node.childCount===0?(e.transact(e=>{XZ(e,i.beforePos,{type:`paragraph`,props:{}})}),!0):a.node.childCount>0?e.transact(e=>(e.deleteSelection(),a$(e,e.selection.from,!0))):!1},s$=()=>({type:`bulletListItem`,propSchema:{...gQ},content:`inline`}),c$=VZ(s$,{meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`))return _Q(e)},parseContent:({el:e,schema:t})=>eQ(e,t,`bulletListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return vQ(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[cG({key:`bullet-list-item-shortcuts`,keyboardShortcuts:{Enter:({editor:e})=>o$(e,`bulletListItem`),"Mod-Shift-8":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`bulletListItem`,props:{}}),!0):!1}},inputRules:[{find:/^\s?[-+*]\s$/,replace({editor:e}){if(VY(e.prosemirrorState).blockNoteType!==`heading`)return{type:`bulletListItem`,props:{}}}}]})]),l$=()=>({type:`checkListItem`,propSchema:{...gQ,checked:{default:!1,type:`boolean`}},content:`inline`}),u$=VZ(l$,{meta:{isolating:!1},parse(e){if(e.tagName===`input`)return e.closest(`[data-content-type]`)||e.closest(`li`)?void 0:e.type===`checkbox`?{checked:e.checked}:void 0;if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)){let t=e.querySelector(`input[type=checkbox]`)||null;return t===null?void 0:{..._Q(e),checked:t.checked}}},parseContent:({el:e,schema:t})=>eQ(e,t,`checkListItem`),render(e,t){let n=document.createDocumentFragment(),r=document.createElement(`input`);r.type=`checkbox`,r.checked=e.props.checked,e.props.checked&&r.setAttribute(`checked`,``),r.disabled=!t.isEditable,r.addEventListener(`change`,()=>{t.isEditable&&t.updateBlock(e,{props:{checked:!e.props.checked}})});let i=document.createElement(`p`),a=document.createElement(`div`);return a.contentEditable=`false`,a.appendChild(r),n.appendChild(a),n.appendChild(i),{dom:n,contentDOM:i}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`input`);n.type=`checkbox`,n.checked=e.props.checked,e.props.checked&&n.setAttribute(`checked`,``);let r=document.createElement(`p`);return vQ(e.props,t),t.appendChild(n),t.appendChild(r),{dom:t,contentDOM:r}},runsBefore:[`bulletListItem`]},[cG({key:`check-list-item-shortcuts`,keyboardShortcuts:{Enter:({editor:e})=>o$(e,`checkListItem`),"Mod-Shift-9":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`checkListItem`,props:{}}),!0):!1}},inputRules:[{find:/^\s?\[\s*\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!1}}}},{find:/^\s?\[[Xx]\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!0}}}}]})]),d$=()=>new dM({key:new pM(`numbered-list-indexing-decorations`),state:{init(e,t){return nQ(t.tr,{decorations:OP.empty})},apply(e,t){return!e.docChanged&&!e.selectionSet&&t.decorations?t:nQ(e,t)}},props:{decorations(e){return this.getState(e)?.decorations??OP.empty}}}),f$=()=>({type:`numberedListItem`,propSchema:{...gQ,start:{default:void 0,type:`number`}},content:`inline`}),p$=VZ(f$,{meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`OL`||t.tagName===`DIV`&&t.parentElement?.tagName===`OL`)){let n=parseInt(t.getAttribute(`start`)||`1`),r=_Q(e);return e.previousElementSibling||n===1?r:{...r,start:n}}},parseContent:({el:e,schema:t})=>eQ(e,t,`numberedListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return vQ(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[cG({key:`numbered-list-item-shortcuts`,inputRules:[{find:/^\s?(\d+)\.\s$/,replace({match:e,editor:t}){if(VY(t.prosemirrorState).blockNoteType===`heading`)return;let n=parseInt(e[1]);return{type:`numberedListItem`,props:{start:n===1?void 0:n}}}}],keyboardShortcuts:{Enter:({editor:e})=>o$(e,`numberedListItem`),"Mod-Shift-7":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`numberedListItem`,props:{}}),!0):!1}},prosemirrorPlugins:[d$()]})]),m$=()=>({type:`toggleListItem`,propSchema:{...gQ},content:`inline`}),h$=VZ(m$,{meta:{isolating:!1},parse(e){if(e.tagName===`DETAILS`)return _Q(e);if(e.tagName===`LI`){let t=e.parentElement;if(t&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)&&e.querySelector(`:scope > details`))return _Q(e)}},parseContent:({el:e,schema:t})=>{let n=e.tagName===`DETAILS`?e:e.querySelector(`:scope > details`);if(!n)throw Error(`No details found in toggleListItem parseContent`);return $Z(n,t,`toggleListItem`)},runsBefore:[`bulletListItem`],render(e,t){let n=document.createElement(`p`);return{...KQ(e,t,n),contentDOM:n}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`details`);n.setAttribute(`open`,``);let r=document.createElement(`summary`),i=document.createElement(`p`);return r.appendChild(i),n.appendChild(r),vQ(e.props,t),t.appendChild(n),{dom:t,contentDOM:i,childrenDOM:n}}},[cG({key:`toggle-list-item-shortcuts`,keyboardShortcuts:{Enter:({editor:e})=>o$(e,`toggleListItem`),"Mod-Shift-6":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`toggleListItem`,props:{}}),!0):!1}}})]),g$=()=>({type:`paragraph`,propSchema:gQ,content:`inline`}),_$=VZ(g$,{meta:{isolating:!1},parse:e=>{var t;if(e.tagName===`P`&&(t=e.textContent)!=null&&t.trim())return _Q(e)},render:()=>{let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`p`);return vQ(e.props,t),{dom:t,contentDOM:t}},runsBefore:[`default`,`heading`]},[cG({key:`paragraph-shortcuts`,keyboardShortcuts:{"Mod-Alt-0":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`paragraph`,props:{}}),!0):!1}}})]),v$=()=>({type:`quote`,propSchema:{backgroundColor:gQ.backgroundColor,textColor:gQ.textColor},content:`inline`}),y$=VZ(v$,{meta:{isolating:!1},parse(e){if(e.tagName===`BLOCKQUOTE`){let{backgroundColor:t,textColor:n}=_Q(e);return{backgroundColor:t,textColor:n}}},render(){let e=document.createElement(`blockquote`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`blockquote`);return vQ(e.props,t),{dom:t,contentDOM:t}}},[cG({key:`quote-block-shortcuts`,keyboardShortcuts:{"Mod-Alt-q":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`?(e.updateBlock(t.block,{type:`quote`,props:{}}),!0):!1}},inputRules:[{find:RegExp(`^>\\s$`),replace(){return{type:`quote`,props:{}}}}]})]),b$=35,x$=GJ.create({name:`BlockNoteTableExtension`,addProseMirrorPlugins:()=>[vge({cellMinWidth:b$,defaultCellMinWidth:120,View:null}),Dge()],addKeyboardShortcuts(){return{Enter:()=>this.editor.state.selection.empty&&this.editor.state.selection.$head.parent.type.name===`tableParagraph`?(this.editor.commands.insertContent({type:`hardBreak`}),!0):!1,Backspace:()=>{let e=this.editor.state.selection,t=e.empty,n=e.$head.parentOffset===0,r=e.$head.node().type.name===`tableParagraph`;return t&&n&&r},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>FX(1)(e,t,n)),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>FX(-1)(e,t,n))}},extendNodeSchema(e){return{tableRole:BK(B(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}}),S$={textColor:gQ.textColor},C$=sY.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getContent:(e,t)=>rQ(e,t)}]},renderHTML({HTMLAttributes:e}){return[`th`,WK(this.options.HTMLAttributes,e),0]}}),w$=sY.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getContent:(e,t)=>rQ(e,t)}]},renderHTML({HTMLAttributes:e}){return[`td`,WK(this.options.HTMLAttributes,e),0]}}),T$=sY.create({name:`table`,content:`tableRow+`,group:`blockContent`,tableRole:`table`,marks:`deletion insertion modification`,isolating:!0,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){var n;let r=Bge(this.name,`table`,{...this.options.domAttributes?.blockContent||{},...t},this.options.domAttributes?.inlineContent||{}),i=document.createElement(`colgroup`);for(let t of e.children[0].children)if(t.attrs.colwidth)for(let e of t.attrs.colwidth){let t=document.createElement(`col`);e&&(t.style=`width: ${e}px`),i.appendChild(t)}else i.appendChild(document.createElement(`col`));return(n=r.dom.firstChild)==null||n.appendChild(i),r},addNodeView(){return({node:e,HTMLAttributes:t})=>{class n extends oZ{constructor(e,t,n){super(e,t),this.node=e,this.cellMinWidth=t,this.blockContentHTMLAttributes=n;let r=document.createElement(`div`);r.className=IZ(`bn-block-content`,n.class),r.setAttribute(`data-content-type`,`table`);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);let i=this.dom,a=document.createElement(`div`);a.className=`tableWrapper-inner`,a.appendChild(i.firstChild),i.appendChild(a),r.appendChild(i);let o=document.createElement(`div`);o.className=`table-widgets-container`,o.style.position=`relative`,i.appendChild(o),this.dom=r}ignoreMutation(e){return!e.target.closest(`.tableWrapper-inner`)||super.ignoreMutation(e)}}return new n(e,120,{...this.options.domAttributes?.blockContent||{},...t})}}}),E$=sY.create({name:`tableParagraph`,group:`tableContent`,content:`inline*`,parseHTML(){return[{tag:`p`,getAttrs:e=>{if(typeof e==`string`||!e.textContent||!e.closest(`[data-content-type]`))return!1;let t=e.parentElement;return t===null?!1:t.tagName===`TD`||t.tagName===`TH`?{}:!1},node:`tableParagraph`}]},renderHTML({HTMLAttributes:e}){return[`p`,e,0]}}),D$=sY.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)+`,tableRole:`row`,marks:`deletion insertion modification`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,WK(this.options.HTMLAttributes,e),0]}}),O$=()=>Wge({node:T$,type:`table`,content:`table`},S$,[cG({key:`table-extensions`,tiptapExtensions:[x$,E$,C$,w$,D$]}),cG({key:`table-keyboard-delete`,keyboardShortcuts:{Backspace:({editor:e})=>{if(!(e.prosemirrorState.selection instanceof nZ))return!1;let t=e.getTextCursorPosition().block,n=t.content,r=0;for(let e of n.rows)for(let t of e.cells){if(`type`in t&&t.content.length>0||!(`type`in t)&&t.length>0)return!1;r++}let i=0;return e.prosemirrorState.selection.forEachCell(()=>{i++}),i<r?!1:(e.transact(()=>{(e.getPrevBlock(t)||e.getNextBlock(t))&&e.setTextCursorPosition(t),e.removeBlocks([t])}),!0)}}})]),k$=e=>({url:e.src||void 0,previewWidth:e.width||void 0}),A$=e=>({type:`video`,propSchema:{textAlignment:gQ.textAlignment,backgroundColor:gQ.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`}),j$=e=>e=>{if(e.tagName===`VIDEO`){if(e.closest(`figure`))return;let{backgroundColor:t}=_Q(e);return{...k$(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=xQ(e,`video`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=_Q(e);return{...k$(n),backgroundColor:i,caption:r}}},M$=VZ(A$,e=>({meta:{fileBlockAccept:[`video/*`]},parse:j$(),render(t,n){let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`video`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.controls=!0,a.contentEditable=`false`,a.draggable=!1,a.width=t.props.previewWidth,i.appendChild(a),ZQ(t,n,{dom:i},i,r.firstElementChild)},toExternalHTML(e){if(!e.props.url){let e=document.createElement(`p`);return e.textContent=`Add video`,{dom:e}}let t;return e.props.showPreview?(t=document.createElement(`video`),t.src=e.props.url,e.props.previewWidth&&(t.width=e.props.previewWidth)):(t=document.createElement(`a`),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?DQ(t,e.props.caption):OQ(t,e.props.caption):{dom:t}},runsBefore:[`file`]})),N$=new Map,P$=IK(e=>e.type.name===`blockContainer`),F$=class{constructor(e,t,n){uQ(this,`state`),uQ(this,`emitUpdate`),uQ(this,`rootEl`),uQ(this,`pluginState`),uQ(this,`handleScroll`,()=>{var e;if((e=this.state)!=null&&e.show){let e=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!e)return;this.state.referencePos=e.getBoundingClientRect().toJSON(),this.emitUpdate(this.pluginState.triggerCharacter)}}),uQ(this,`closeMenu`,()=>{this.editor.transact(e=>e.setMeta(I$,null))}),uQ(this,`clearQuery`,()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos()-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor.transact(e=>e.selection.from)}).run()});var r;this.editor=e,this.pluginState=void 0,this.emitUpdate=e=>{if(!this.state)throw Error(`Attempting to update uninitialized suggestions menu`);t(e,{...this.state,ignoreQueryLength:this.pluginState?.ignoreQueryLength})},this.rootEl=n.root,(r=this.rootEl)==null||r.addEventListener(`scroll`,this.handleScroll,!0)}update(e,t){let n=I$.getState(t),r=I$.getState(e.state),i=n===void 0&&r!==void 0,a=n!==void 0&&r===void 0;if(!i&&!(n!==void 0&&r!==void 0)&&!a)return;if(this.pluginState=a?n:r,a||!this.editor.isEditable){this.state&&(this.state.show=!1),this.emitUpdate(this.pluginState.triggerCharacter);return}let o=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&o&&(this.state={show:!0,referencePos:o.getBoundingClientRect().toJSON(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){var e;(e=this.rootEl)==null||e.removeEventListener(`scroll`,this.handleScroll,!0)}},I$=new pM(`SuggestionMenuPlugin`),L$=cG(({editor:e})=>{let t=new Map,n,r=lG(void 0);return{key:`suggestionMenu`,store:r,addSuggestionMenu:e=>{t.set(e.triggerCharacter,e)},removeSuggestionMenu:e=>{t.delete(e)},closeMenu:()=>{n?.closeMenu()},clearQuery:()=>{n?.clearQuery()},shown:()=>n?.state?.show||!1,openSuggestionMenu:(t,n)=>{e.headless||(e.focus(),e.transact(e=>{n!=null&&n.deleteTriggerCharacter&&e.insertText(t),e.scrollIntoView().setMeta(I$,{triggerCharacter:t,deleteTriggerCharacter:n?.deleteTriggerCharacter||!1,ignoreQueryLength:n?.ignoreQueryLength||!1})}))},prosemirrorPlugins:[new dM({key:I$,view:t=>(n=new F$(e,(e,t)=>{r.setState({...t,triggerCharacter:e})},t),n),state:{init(){},apply:(t,r,i,a)=>{if(t.selection.$from.parent.type.spec.code)return r;let o=t.getMeta(I$);if(typeof o==`object`&&o){r&&n?.closeMenu();let t=n_e(e,a.selection.from-o.triggerCharacter.length);return{triggerCharacter:o.triggerCharacter,deleteTriggerCharacter:o.deleteTriggerCharacter!==!1,queryStartPos:()=>t()+o.triggerCharacter.length,query:``,decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:o?.ignoreQueryLength}}if(r===void 0)return r;if(a.selection.from!==a.selection.to||o===null||t.getMeta(`focus`)||t.getMeta(`blur`)||t.getMeta(`pointer`)||r.triggerCharacter!==void 0&&a.selection.from<r.queryStartPos()||!a.selection.$from.sameParent(a.doc.resolve(r.queryStartPos())))return;let s={...r};return s.query=a.doc.textBetween(r.queryStartPos(),a.selection.from),s}},props:{handleTextInput(e,n,r,i){if(n===r){let r=e.state.doc;for(let[a,o]of t){let t=a.length>1?r.textBetween(n-a.length,n)+i:i;if(a===t){if(o.shouldOpen&&!o.shouldOpen(e.state.tr))continue;return e.dispatch(e.state.tr.insertText(i)),e.dispatch(e.state.tr.setMeta(I$,{triggerCharacter:t}).scrollIntoView()),!0}}}return!1},decorations(e){let t=this.getState(e);if(t===void 0)return null;if(!t.deleteTriggerCharacter){let n=P$(e.selection);if(n)return OP.create(e.doc,[TP.node(n.pos,n.pos+n.node.nodeSize,{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}return OP.create(e.doc,[TP.inline(t.queryStartPos()-t.triggerCharacter.length,t.queryStartPos(),{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}}})]}}),R$={audio:PQ(),bulletListItem:c$(),checkListItem:u$(),codeBlock:RQ(),divider:BQ(),file:WQ(),heading:XQ(),image:r$(),numberedListItem:p$(),paragraph:_$(),quote:y$(),table:O$(),toggleListItem:h$(),video:M$()},z$=qZ({type:`textColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==gQ.textColor.default&&(t.style.color=e in hQ?hQ[e].text:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.color)return e.style.color}}),B$=qZ({type:`backgroundColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==gQ.backgroundColor.default&&(t.style.backgroundColor=e in hQ?hQ[e].background:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.backgroundColor)return e.style.backgroundColor}}),V$={bold:GZ(gZ,`boolean`),italic:GZ(EZ,`boolean`),underline:GZ(MZ,`boolean`),strike:GZ(AZ,`boolean`),code:GZ(bZ,`boolean`),textColor:z$,backgroundColor:B$},KZ(V$),H$={text:{config:`text`,implementation:{}},link:{config:`link`,implementation:{}}},U$=HZ(H$)})),G$,K$,q$,J$,o_e=o((()=>{G$=200,K$=function(){},K$.prototype.append=function(e){return e.length?(e=K$.from(e),!this.length&&e||e.length<G$&&this.leafAppend(e)||this.length<G$&&e.leafPrepend(this)||this.appendInner(e)):this},K$.prototype.prepend=function(e){return e.length?K$.from(e).append(this):this},K$.prototype.appendInner=function(e){return new J$(this,e)},K$.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?K$.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},K$.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},K$.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},K$.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},K$.from=function(e){return e instanceof K$?e:e&&e.length?new q$(e):K$.empty},q$=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=G$)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=G$)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(K$),K$.empty=new q$([]),J$=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(K$)}));function s_e(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}function c_e(e,t,n,r){let i=n.getMeta(o1),a;if(i)return i.historyState;n.getMeta(s1)&&(e=new n1(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(o1))return o.getMeta(o1).redo?new n1(e.done.addTransform(n,void 0,r,Z$(t)),e.undone,Y$(n.mapping.maps),e.prevTime,e.prevComposition):new n1(e.done,e.undone.addTransform(n,void 0,r,Z$(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!l_e(n,e.prevRanges)),s=o?X$(e.prevRanges,n.mapping):Y$(n.mapping.maps);return new n1(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Z$(t)),e1.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new n1(e.done.rebased(n,a),e.undone.rebased(n,a),X$(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new n1(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),X$(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function l_e(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function Y$(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function X$(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function u_e(e,t,n){let r=Z$(t),i=o1.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new n1(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(o1,{redo:n,historyState:c})}function Z$(e){let t=e.plugins;if(a1!=t){i1=!1,a1=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){i1=!0;break}}return i1}function d_e(e){return e.setMeta(s1,!0)}function f_e(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new dM({key:o1,state:{init(){return new n1(e1.empty,e1.empty,null,0,-1)},apply(t,n,r){return c_e(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?c1:n==`historyRedo`?l1:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Q$(e,t){return(n,r)=>{let i=o1.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=u_e(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var $$,e1,t1,n1,r1,i1,a1,o1,s1,c1,l1,u1=o((()=>{o_e(),Zj(),mM(),$$=500,e1=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new t1(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new t1(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new t1(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>r1&&(s=s_e(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Lj;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new t1(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new t1(i,o,l))}else r.push(new t1(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new t1(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>$$&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new t1(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(K$.from(i.reverse()),a)}},e1.empty=new e1(K$.empty,0),t1=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},n1=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},r1=20,i1=!1,a1=null,o1=new pM(`history`),s1=new pM(`closeHistory`),c1=Q$(!1,!0),l1=Q$(!0,!0)})),p_e=o((()=>{u1()})),d1=o((()=>{})),f1,p1=o((()=>{f1=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}},f1.prototype.normal={},f1.prototype.property={},f1.prototype.space=void 0}));function m1(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new f1(n,r,t)}var m_e=o((()=>{p1()}));function h1(e){return e.toLowerCase()}var g1=o((()=>{})),_1,v1=o((()=>{_1=class{constructor(e,t){this.attribute=t,this.property=e}},_1.prototype.attribute=``,_1.prototype.booleanish=!1,_1.prototype.boolean=!1,_1.prototype.commaOrSpaceSeparated=!1,_1.prototype.commaSeparated=!1,_1.prototype.defined=!1,_1.prototype.mustUseProperty=!1,_1.prototype.number=!1,_1.prototype.overloadedBoolean=!1,_1.prototype.property=``,_1.prototype.spaceSeparated=!1,_1.prototype.space=void 0})),y1=c({boolean:()=>S1,booleanish:()=>C1,commaOrSpaceSeparated:()=>D1,commaSeparated:()=>E1,number:()=>V,overloadedBoolean:()=>w1,spaceSeparated:()=>T1});function b1(){return 2**++x1}var x1,S1,C1,w1,V,T1,E1,D1,O1=o((()=>{x1=0,S1=b1(),C1=b1(),w1=b1(),V=b1(),T1=b1(),E1=b1(),D1=b1()}));function k1(e,t,n){n&&(e[t]=n)}var A1,j1,M1=o((()=>{v1(),O1(),A1=Object.keys(y1),j1=class extends _1{constructor(e,t,n,r){let i=-1;if(super(e,t),k1(this,`space`,r),typeof n==`number`)for(;++i<A1.length;){let e=A1[i];k1(this,A1[i],(n&y1[e])===y1[e])}}},j1.prototype.defined=!0}));function N1(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new j1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[h1(r)]=r,n[h1(a.attribute)]=r}return new f1(t,n,e.space)}var P1=o((()=>{g1(),M1(),p1()})),F1,h_e=o((()=>{P1(),O1(),F1=N1({properties:{ariaActiveDescendant:null,ariaAtomic:C1,ariaAutoComplete:null,ariaBusy:C1,ariaChecked:C1,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:T1,ariaCurrent:null,ariaDescribedBy:T1,ariaDetails:null,ariaDisabled:C1,ariaDropEffect:T1,ariaErrorMessage:null,ariaExpanded:C1,ariaFlowTo:T1,ariaGrabbed:C1,ariaHasPopup:null,ariaHidden:C1,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:T1,ariaLevel:V,ariaLive:null,ariaModal:C1,ariaMultiLine:C1,ariaMultiSelectable:C1,ariaOrientation:null,ariaOwns:T1,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:C1,ariaReadOnly:C1,ariaRelevant:null,ariaRequired:C1,ariaRoleDescription:T1,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:C1,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}})}));function I1(e,t){return t in e?e[t]:t}var L1=o((()=>{}));function R1(e,t){return I1(e,t.toLowerCase())}var z1=o((()=>{L1()})),B1,g_e=o((()=>{z1(),P1(),O1(),B1=N1({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:E1,acceptCharset:T1,accessKey:T1,action:null,allow:null,allowFullScreen:S1,allowPaymentRequest:S1,allowUserMedia:S1,alt:null,as:null,async:S1,autoCapitalize:null,autoComplete:T1,autoFocus:S1,autoPlay:S1,blocking:T1,capture:null,charSet:null,checked:S1,cite:null,className:T1,cols:V,colSpan:null,content:null,contentEditable:C1,controls:S1,controlsList:T1,coords:V|E1,crossOrigin:null,data:null,dateTime:null,decoding:null,default:S1,defer:S1,dir:null,dirName:null,disabled:S1,download:w1,draggable:C1,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:S1,formTarget:null,headers:T1,height:V,hidden:w1,high:V,href:null,hrefLang:null,htmlFor:T1,httpEquiv:T1,id:null,imageSizes:null,imageSrcSet:null,inert:S1,inputMode:null,integrity:null,is:null,isMap:S1,itemId:null,itemProp:T1,itemRef:T1,itemScope:S1,itemType:T1,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:S1,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:S1,muted:S1,name:null,nonce:null,noModule:S1,noValidate:S1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:S1,optimum:V,pattern:null,ping:T1,placeholder:null,playsInline:S1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:S1,referrerPolicy:null,rel:T1,required:S1,reversed:S1,rows:V,rowSpan:V,sandbox:T1,scope:null,scoped:S1,seamless:S1,selected:S1,shadowRootClonable:S1,shadowRootDelegatesFocus:S1,shadowRootMode:null,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:C1,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:S1,useMap:null,value:C1,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:T1,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:S1,declare:S1,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:S1,noHref:S1,noShade:S1,noWrap:S1,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:C1,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:S1,disableRemotePlayback:S1,prefix:null,property:null,results:V,security:null,unselectable:null},space:`html`,transform:R1})})),V1,__e=o((()=>{L1(),P1(),O1(),V1=N1({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:D1,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:T1,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:S1,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:E1,g2:E1,glyphName:E1,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:D1,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:T1,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:D1,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:D1,rev:D1,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:D1,requiredFeatures:D1,requiredFonts:D1,requiredFormats:D1,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:D1,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:D1,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:D1,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:I1})})),H1,v_e=o((()=>{P1(),H1=N1({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}})})),U1,y_e=o((()=>{P1(),z1(),U1=N1({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:R1})})),W1,b_e=o((()=>{P1(),W1=N1({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}})}));function G1(e,t){let n=h1(t),r=t,i=_1;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&J1.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(q1,S_e);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!q1.test(e)){let n=e.replace(K1,x_e);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=j1}return new i(r,t)}function x_e(e){return`-`+e.toLowerCase()}function S_e(e){return e.charAt(1).toUpperCase()}var K1,q1,J1,C_e=o((()=>{M1(),v1(),g1(),K1=/[A-Z]/g,q1=/-[a-z]/g,J1=/^data[-\w.:]+$/i})),Y1,X1,Z1=o((()=>{m_e(),h_e(),g_e(),__e(),v_e(),y_e(),b_e(),C_e(),g1(),Y1=m1([F1,B1,H1,U1,W1],`html`),X1=m1([F1,V1,H1,U1,W1],`svg`)}));function Q1(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function w_e(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var $1=o((()=>{}));function T_e(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){e0.lastIndex=i;let e=e0.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}var e0,E_e=o((()=>{e0=/[#.]/g})),D_e=o((()=>{E_e()}));function t0(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function O_e(e){return e.join(` `).trim()}var n0=o((()=>{}));function r0(e,t,n){let r=n?M_e(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=T_e(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,k_e(i))a.unshift(i);else for(let[t,n]of Object.entries(i))A_e(e,o.properties,t,n)}for(let e of a)i0(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function k_e(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function A_e(e,t,n,r){let i=G1(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?t0(r):i.commaSeparated?Q1(r):i.commaOrSpaceSeparated?t0(Q1(r).join(` `)):a0(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?j_e(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(a0(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function i0(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)i0(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?i0(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function a0(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||h1(n)===h1(t)))return!0}return n}function j_e(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function M_e(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var N_e=o((()=>{$1(),D_e(),Z1(),n0()})),o0,P_e=o((()=>{o0=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.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.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`)})),s0,c0,F_e=o((()=>{Z1(),N_e(),P_e(),s0=r0(Y1,`div`),c0=r0(X1,`g`,o0)})),l0=o((()=>{F_e()}));function I_e(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=u0(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=u0(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function u0(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
129
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var L_e=o((()=>{})),R_e=o((()=>{L_e()})),d0,f0=o((()=>{d0={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`}}));function z_e(e,t){let n=t||{};return p0({file:n.file||void 0,location:!1,schema:n.space===`svg`?X1:Y1,verbose:n.verbose||!1},e)}function p0(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},h0(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:m0(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=I_e(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},h0(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},h0(e,r,n),n}default:return n=B_e(e,t),n}}function m0(e,t){let n=-1,r=[];for(;++n<t.length;){let i=p0(e,t[n]);r.push(i)}return r}function B_e(e,t){let n=e.schema;e.schema=t.namespaceURI===d0.svg?X1:Y1;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;v0.call(y0,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?c0:s0)(t.tagName,i,m0(e,t.childNodes));if(h0(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&g0(r.startTag),o=r&&r.endTag&&g0(r.endTag),s=p0(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function h0(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=V_e(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function V_e(e,t,n){let r=g0(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)v0.call(n.attrs,i)&&(r[G1(e.schema,i).property]=g0(n.attrs[i]));n.startTag;let a=g0(n.startTag),o=n.endTag?g0(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function g0(e){let t=_0({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=_0({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function _0(e){return e.line&&e.column?e:void 0}var v0,y0,H_e=o((()=>{d1(),l0(),Z1(),R_e(),f0(),v0={}.hasOwnProperty,y0=Object.prototype})),U_e=o((()=>{H_e()}));function b0(e){return e>=55296&&e<=57343}function W_e(e){return e>=56320&&e<=57343}function G_e(e,t){return(e-55296)*1024+9216+t}function x0(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function S0(e){return e>=64976&&e<=65007||C0.has(e)}var C0,H,w0,T0=o((()=>{C0=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(H||={}),w0={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`}})),U,E0=o((()=>{(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(U||={})})),D0,O0,K_e=o((()=>{T0(),E0(),D0=65536,O0=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=D0,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(W_e(t))return this.pos++,this._addGap(),G_e(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,H.EOF;return this._err(U.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,H.EOF;let n=this.html.charCodeAt(t);return n===H.CARRIAGE_RETURN?H.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,H.EOF;let e=this.html.charCodeAt(this.pos);return e===H.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,H.LINE_FEED):e===H.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,b0(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===H.LINE_FEED||e===H.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){x0(e)?this._err(U.controlCharacterInInputStream):S0(e)&&this._err(U.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}}));function k0(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var A0,j0=o((()=>{(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(A0||={})})),M0,q_e=o((()=>{M0=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0)))}));function J_e(e){return e>=55296&&e<=57343||e>1114111?65533:N0.get(e)??e}var N0,Y_e=o((()=>{N0=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),String.fromCodePoint}));function P0(e){return e>=F0.ZERO&&e<=F0.NINE}function X_e(e){return e>=F0.UPPER_A&&e<=F0.UPPER_F||e>=F0.LOWER_A&&e<=F0.LOWER_F}function Z_e(e){return e>=F0.UPPER_A&&e<=F0.UPPER_Z||e>=F0.LOWER_A&&e<=F0.LOWER_Z||P0(e)}function Q_e(e){return e===F0.EQUALS||Z_e(e)}function $_e(e,t,n,r){let i=(t&L0.BRANCH_LENGTH)>>7,a=t&L0.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var F0,I0,L0,R0,z0,B0,eve=o((()=>{Y_e(),q_e(),(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(F0||={}),I0=32,(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(L0||={}),(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(R0||={}),(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(z0||={}),B0=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=R0.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=z0.Strict}startEntity(e){this.decodeMode=e,this.state=R0.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case R0.EntityStart:return e.charCodeAt(t)===F0.NUM?(this.state=R0.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=R0.NamedEntity,this.stateNamedEntity(e,t));case R0.NumericStart:return this.stateNumericStart(e,t);case R0.NumericDecimal:return this.stateNumericDecimal(e,t);case R0.NumericHex:return this.stateNumericHex(e,t);case R0.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|I0)===F0.LOWER_X?(this.state=R0.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=R0.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(P0(r)||X_e(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(P0(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===F0.SEMI)this.consumed+=1;else if(this.decodeMode===z0.Strict)return 0;return this.emitCodePoint(J_e(this.result),this.consumed),this.errors&&(e!==F0.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&L0.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=$_e(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===z0.Attribute&&(i===0||Q_e(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&L0.VALUE_LENGTH)>>14,i!==0){if(a===F0.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==z0.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&L0.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~L0.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case R0.NamedEntity:return this.result!==0&&(this.decodeMode!==z0.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case R0.NumericDecimal:return this.emitNumericEntity(0,2);case R0.NumericHex:return this.emitNumericEntity(0,3);case R0.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case R0.EntityStart:return 0}}}}));function V0(e){return W0.get(e)??K.UNKNOWN}var W,H0,U0,G,K,W0,q,G0,K0,q0=o((()=>{(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(W||={}),(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(H0||={}),(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(U0||={}),(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(G||={}),(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(K||={}),W0=new Map([[G.A,K.A],[G.ADDRESS,K.ADDRESS],[G.ANNOTATION_XML,K.ANNOTATION_XML],[G.APPLET,K.APPLET],[G.AREA,K.AREA],[G.ARTICLE,K.ARTICLE],[G.ASIDE,K.ASIDE],[G.B,K.B],[G.BASE,K.BASE],[G.BASEFONT,K.BASEFONT],[G.BGSOUND,K.BGSOUND],[G.BIG,K.BIG],[G.BLOCKQUOTE,K.BLOCKQUOTE],[G.BODY,K.BODY],[G.BR,K.BR],[G.BUTTON,K.BUTTON],[G.CAPTION,K.CAPTION],[G.CENTER,K.CENTER],[G.CODE,K.CODE],[G.COL,K.COL],[G.COLGROUP,K.COLGROUP],[G.DD,K.DD],[G.DESC,K.DESC],[G.DETAILS,K.DETAILS],[G.DIALOG,K.DIALOG],[G.DIR,K.DIR],[G.DIV,K.DIV],[G.DL,K.DL],[G.DT,K.DT],[G.EM,K.EM],[G.EMBED,K.EMBED],[G.FIELDSET,K.FIELDSET],[G.FIGCAPTION,K.FIGCAPTION],[G.FIGURE,K.FIGURE],[G.FONT,K.FONT],[G.FOOTER,K.FOOTER],[G.FOREIGN_OBJECT,K.FOREIGN_OBJECT],[G.FORM,K.FORM],[G.FRAME,K.FRAME],[G.FRAMESET,K.FRAMESET],[G.H1,K.H1],[G.H2,K.H2],[G.H3,K.H3],[G.H4,K.H4],[G.H5,K.H5],[G.H6,K.H6],[G.HEAD,K.HEAD],[G.HEADER,K.HEADER],[G.HGROUP,K.HGROUP],[G.HR,K.HR],[G.HTML,K.HTML],[G.I,K.I],[G.IMG,K.IMG],[G.IMAGE,K.IMAGE],[G.INPUT,K.INPUT],[G.IFRAME,K.IFRAME],[G.KEYGEN,K.KEYGEN],[G.LABEL,K.LABEL],[G.LI,K.LI],[G.LINK,K.LINK],[G.LISTING,K.LISTING],[G.MAIN,K.MAIN],[G.MALIGNMARK,K.MALIGNMARK],[G.MARQUEE,K.MARQUEE],[G.MATH,K.MATH],[G.MENU,K.MENU],[G.META,K.META],[G.MGLYPH,K.MGLYPH],[G.MI,K.MI],[G.MO,K.MO],[G.MN,K.MN],[G.MS,K.MS],[G.MTEXT,K.MTEXT],[G.NAV,K.NAV],[G.NOBR,K.NOBR],[G.NOFRAMES,K.NOFRAMES],[G.NOEMBED,K.NOEMBED],[G.NOSCRIPT,K.NOSCRIPT],[G.OBJECT,K.OBJECT],[G.OL,K.OL],[G.OPTGROUP,K.OPTGROUP],[G.OPTION,K.OPTION],[G.P,K.P],[G.PARAM,K.PARAM],[G.PLAINTEXT,K.PLAINTEXT],[G.PRE,K.PRE],[G.RB,K.RB],[G.RP,K.RP],[G.RT,K.RT],[G.RTC,K.RTC],[G.RUBY,K.RUBY],[G.S,K.S],[G.SCRIPT,K.SCRIPT],[G.SEARCH,K.SEARCH],[G.SECTION,K.SECTION],[G.SELECT,K.SELECT],[G.SOURCE,K.SOURCE],[G.SMALL,K.SMALL],[G.SPAN,K.SPAN],[G.STRIKE,K.STRIKE],[G.STRONG,K.STRONG],[G.STYLE,K.STYLE],[G.SUB,K.SUB],[G.SUMMARY,K.SUMMARY],[G.SUP,K.SUP],[G.TABLE,K.TABLE],[G.TBODY,K.TBODY],[G.TEMPLATE,K.TEMPLATE],[G.TEXTAREA,K.TEXTAREA],[G.TFOOT,K.TFOOT],[G.TD,K.TD],[G.TH,K.TH],[G.THEAD,K.THEAD],[G.TITLE,K.TITLE],[G.TR,K.TR],[G.TRACK,K.TRACK],[G.TT,K.TT],[G.U,K.U],[G.UL,K.UL],[G.SVG,K.SVG],[G.VAR,K.VAR],[G.WBR,K.WBR],[G.XMP,K.XMP]]),q=K,G0={[W.HTML]:new Set([q.ADDRESS,q.APPLET,q.AREA,q.ARTICLE,q.ASIDE,q.BASE,q.BASEFONT,q.BGSOUND,q.BLOCKQUOTE,q.BODY,q.BR,q.BUTTON,q.CAPTION,q.CENTER,q.COL,q.COLGROUP,q.DD,q.DETAILS,q.DIR,q.DIV,q.DL,q.DT,q.EMBED,q.FIELDSET,q.FIGCAPTION,q.FIGURE,q.FOOTER,q.FORM,q.FRAME,q.FRAMESET,q.H1,q.H2,q.H3,q.H4,q.H5,q.H6,q.HEAD,q.HEADER,q.HGROUP,q.HR,q.HTML,q.IFRAME,q.IMG,q.INPUT,q.LI,q.LINK,q.LISTING,q.MAIN,q.MARQUEE,q.MENU,q.META,q.NAV,q.NOEMBED,q.NOFRAMES,q.NOSCRIPT,q.OBJECT,q.OL,q.P,q.PARAM,q.PLAINTEXT,q.PRE,q.SCRIPT,q.SECTION,q.SELECT,q.SOURCE,q.STYLE,q.SUMMARY,q.TABLE,q.TBODY,q.TD,q.TEMPLATE,q.TEXTAREA,q.TFOOT,q.TH,q.THEAD,q.TITLE,q.TR,q.TRACK,q.UL,q.WBR,q.XMP]),[W.MATHML]:new Set([q.MI,q.MO,q.MN,q.MS,q.MTEXT,q.ANNOTATION_XML]),[W.SVG]:new Set([q.TITLE,q.FOREIGN_OBJECT,q.DESC]),[W.XLINK]:new Set,[W.XML]:new Set,[W.XMLNS]:new Set},K0=new Set([q.H1,q.H2,q.H3,q.H4,q.H5,q.H6]),new Set([G.STYLE,G.SCRIPT,G.XMP,G.IFRAME,G.NOEMBED,G.NOFRAMES,G.PLAINTEXT])}));function tve(e){return e>=H.DIGIT_0&&e<=H.DIGIT_9}function J0(e){return e>=H.LATIN_CAPITAL_A&&e<=H.LATIN_CAPITAL_Z}function nve(e){return e>=H.LATIN_SMALL_A&&e<=H.LATIN_SMALL_Z}function Y0(e){return nve(e)||J0(e)}function X0(e){return Y0(e)||tve(e)}function Z0(e){return e+32}function rve(e){return e===H.SPACE||e===H.LINE_FEED||e===H.TABULATION||e===H.FORM_FEED}function ive(e){return rve(e)||e===H.SOLIDUS||e===H.GREATER_THAN_SIGN}function ave(e){return e===H.NULL?U.nullCharacterReference:e>1114111?U.characterReferenceOutsideUnicodeRange:b0(e)?U.surrogateCharacterReference:S0(e)?U.noncharacterCharacterReference:x0(e)||e===H.CARRIAGE_RETURN?U.controlCharacterReference:null}var J,Q0,ove,sve=o((()=>{K_e(),T0(),j0(),eve(),E0(),q0(),(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(J||={}),Q0={DATA:J.DATA,RCDATA:J.RCDATA,RAWTEXT:J.RAWTEXT,SCRIPT_DATA:J.SCRIPT_DATA,PLAINTEXT:J.PLAINTEXT,CDATA_SECTION:J.CDATA_SECTION},ove=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=J.DATA,this.returnState=J.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new O0(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new B0(M0,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(U.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(U.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=ave(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:A0.START_TAG,tagName:``,tagID:K.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:A0.END_TAG,tagName:``,tagID:K.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:A0.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:A0.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(k0(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(U.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=V0(e.tagName),e.type===A0.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(U.endTagWithAttributes),e.selfClosing&&this._err(U.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case A0.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case A0.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case A0.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:A0.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=rve(e)?A0.WHITESPACE_CHARACTER:e===H.NULL?A0.NULL_CHARACTER:A0.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(A0.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=J.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?z0.Attribute:z0.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===J.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===J.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===J.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case J.DATA:this._stateData(e);break;case J.RCDATA:this._stateRcdata(e);break;case J.RAWTEXT:this._stateRawtext(e);break;case J.SCRIPT_DATA:this._stateScriptData(e);break;case J.PLAINTEXT:this._statePlaintext(e);break;case J.TAG_OPEN:this._stateTagOpen(e);break;case J.END_TAG_OPEN:this._stateEndTagOpen(e);break;case J.TAG_NAME:this._stateTagName(e);break;case J.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case J.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case J.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case J.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case J.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case J.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case J.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case J.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case J.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case J.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case J.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case J.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case J.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case J.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case J.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case J.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case J.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case J.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case J.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case J.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case J.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case J.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case J.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case J.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case J.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case J.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case J.BOGUS_COMMENT:this._stateBogusComment(e);break;case J.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case J.COMMENT_START:this._stateCommentStart(e);break;case J.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case J.COMMENT:this._stateComment(e);break;case J.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case J.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case J.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case J.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case J.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case J.COMMENT_END:this._stateCommentEnd(e);break;case J.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case J.DOCTYPE:this._stateDoctype(e);break;case J.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case J.DOCTYPE_NAME:this._stateDoctypeName(e);break;case J.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case J.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case J.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case J.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case J.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case J.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case J.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case J.CDATA_SECTION:this._stateCdataSection(e);break;case J.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case J.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case J.CHARACTER_REFERENCE:this._stateCharacterReference();break;case J.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case H.LESS_THAN_SIGN:this.state=J.TAG_OPEN;break;case H.AMPERSAND:this._startCharacterReference();break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitCodePoint(e);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case H.AMPERSAND:this._startCharacterReference();break;case H.LESS_THAN_SIGN:this.state=J.RCDATA_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case H.LESS_THAN_SIGN:this.state=J.RAWTEXT_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Y0(e))this._createStartTagToken(),this.state=J.TAG_NAME,this._stateTagName(e);else switch(e){case H.EXCLAMATION_MARK:this.state=J.MARKUP_DECLARATION_OPEN;break;case H.SOLIDUS:this.state=J.END_TAG_OPEN;break;case H.QUESTION_MARK:this._err(U.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=J.BOGUS_COMMENT,this._stateBogusComment(e);break;case H.EOF:this._err(U.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(U.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=J.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Y0(e))this._createEndTagToken(),this.state=J.TAG_NAME,this._stateTagName(e);else switch(e){case H.GREATER_THAN_SIGN:this._err(U.missingEndTagName),this.state=J.DATA;break;case H.EOF:this._err(U.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(U.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=J.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BEFORE_ATTRIBUTE_NAME;break;case H.SOLIDUS:this.state=J.SELF_CLOSING_START_TAG;break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentTagToken();break;case H.NULL:this._err(U.unexpectedNullCharacter),t.tagName+=`�`;break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(J0(e)?Z0(e):e)}}_stateRcdataLessThanSign(e){e===H.SOLIDUS?this.state=J.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=J.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Y0(e)?(this.state=J.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=J.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=J.BEFORE_ATTRIBUTE_NAME,!1;case H.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=J.SELF_CLOSING_START_TAG,!1;case H.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=J.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=J.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===H.SOLIDUS?this.state=J.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=J.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Y0(e)?(this.state=J.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=J.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=J.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case H.SOLIDUS:this.state=J.SCRIPT_DATA_END_TAG_OPEN;break;case H.EXCLAMATION_MARK:this.state=J.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=J.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Y0(e)?(this.state=J.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=J.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=J.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===H.HYPHEN_MINUS?(this.state=J.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=J.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===H.HYPHEN_MINUS?(this.state=J.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=J.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case H.HYPHEN_MINUS:this.state=J.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case H.HYPHEN_MINUS:this.state=J.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=J.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case H.HYPHEN_MINUS:this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case H.GREATER_THAN_SIGN:this.state=J.SCRIPT_DATA,this._emitChars(`>`);break;case H.NULL:this._err(U.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=J.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===H.SOLIDUS?this.state=J.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Y0(e)?(this._emitChars(`<`),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Y0(e)?(this.state=J.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(w0.SCRIPT,!1)&&ive(this.preprocessor.peek(w0.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<w0.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=J.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case H.HYPHEN_MINUS:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case H.NULL:this._err(U.unexpectedNullCharacter),this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case H.HYPHEN_MINUS:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case H.NULL:this._err(U.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case H.HYPHEN_MINUS:this._emitChars(`-`);break;case H.LESS_THAN_SIGN:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case H.GREATER_THAN_SIGN:this.state=J.SCRIPT_DATA,this._emitChars(`>`);break;case H.NULL:this._err(U.unexpectedNullCharacter),this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case H.EOF:this._err(U.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===H.SOLIDUS?(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(w0.SCRIPT,!1)&&ive(this.preprocessor.peek(w0.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<w0.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=J.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=J.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:this.state=J.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case H.EQUALS_SIGN:this._err(U.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=J.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=J.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:this._leaveAttrName(),this.state=J.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case H.EQUALS_SIGN:this._leaveAttrName(),this.state=J.BEFORE_ATTRIBUTE_VALUE;break;case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:this._err(U.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case H.NULL:this._err(U.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(J0(e)?Z0(e):e)}}_stateAfterAttributeName(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:this.state=J.SELF_CLOSING_START_TAG;break;case H.EQUALS_SIGN:this.state=J.BEFORE_ATTRIBUTE_VALUE;break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentTagToken();break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=J.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:this.state=J.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case H.APOSTROPHE:this.state=J.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingAttributeValue),this.state=J.DATA,this.emitCurrentTagToken();break;default:this.state=J.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case H.QUOTATION_MARK:this.state=J.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case H.AMPERSAND:this._startCharacterReference();break;case H.NULL:this._err(U.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case H.APOSTROPHE:this.state=J.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case H.AMPERSAND:this._startCharacterReference();break;case H.NULL:this._err(U.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this._leaveAttrValue(),this.state=J.BEFORE_ATTRIBUTE_NAME;break;case H.AMPERSAND:this._startCharacterReference();break;case H.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=J.DATA,this.emitCurrentTagToken();break;case H.NULL:this._err(U.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:case H.EQUALS_SIGN:case H.GRAVE_ACCENT:this._err(U.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this._leaveAttrValue(),this.state=J.BEFORE_ATTRIBUTE_NAME;break;case H.SOLIDUS:this._leaveAttrValue(),this.state=J.SELF_CLOSING_START_TAG;break;case H.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=J.DATA,this.emitCurrentTagToken();break;case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this._err(U.missingWhitespaceBetweenAttributes),this.state=J.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case H.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=J.DATA,this.emitCurrentTagToken();break}case H.EOF:this._err(U.eofInTag),this._emitEOFToken();break;default:this._err(U.unexpectedSolidusInTag),this.state=J.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentComment(t);break;case H.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case H.NULL:this._err(U.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(w0.DASH_DASH,!0)?(this._createCommentToken(w0.DASH_DASH.length+1),this.state=J.COMMENT_START):this._consumeSequenceIfMatch(w0.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(w0.DOCTYPE.length+1),this.state=J.DOCTYPE):this._consumeSequenceIfMatch(w0.CDATA_START,!0)?this.inForeignNode?this.state=J.CDATA_SECTION:(this._err(U.cdataInHtmlContent),this._createCommentToken(w0.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=J.BOGUS_COMMENT):this._ensureHibernation()||(this._err(U.incorrectlyOpenedComment),this._createCommentToken(2),this.state=J.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case H.HYPHEN_MINUS:this.state=J.COMMENT_START_DASH;break;case H.GREATER_THAN_SIGN:{this._err(U.abruptClosingOfEmptyComment),this.state=J.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=J.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case H.HYPHEN_MINUS:this.state=J.COMMENT_END;break;case H.GREATER_THAN_SIGN:this._err(U.abruptClosingOfEmptyComment),this.state=J.DATA,this.emitCurrentComment(t);break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=J.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case H.HYPHEN_MINUS:this.state=J.COMMENT_END_DASH;break;case H.LESS_THAN_SIGN:t.data+=`<`,this.state=J.COMMENT_LESS_THAN_SIGN;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.data+=`�`;break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case H.EXCLAMATION_MARK:t.data+=`!`,this.state=J.COMMENT_LESS_THAN_SIGN_BANG;break;case H.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=J.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===H.HYPHEN_MINUS?this.state=J.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=J.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===H.HYPHEN_MINUS?this.state=J.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=J.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==H.GREATER_THAN_SIGN&&e!==H.EOF&&this._err(U.nestedComment),this.state=J.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case H.HYPHEN_MINUS:this.state=J.COMMENT_END;break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=J.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentComment(t);break;case H.EXCLAMATION_MARK:this.state=J.COMMENT_END_BANG;break;case H.HYPHEN_MINUS:t.data+=`-`;break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=J.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case H.HYPHEN_MINUS:t.data+=`--!`,this.state=J.COMMENT_END_DASH;break;case H.GREATER_THAN_SIGN:this._err(U.incorrectlyClosedComment),this.state=J.DATA,this.emitCurrentComment(t);break;case H.EOF:this._err(U.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=J.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BEFORE_DOCTYPE_NAME;break;case H.GREATER_THAN_SIGN:this.state=J.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case H.EOF:{this._err(U.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(U.missingWhitespaceBeforeDoctypeName),this.state=J.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(J0(e))this._createDoctypeToken(String.fromCharCode(Z0(e))),this.state=J.DOCTYPE_NAME;else switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.NULL:this._err(U.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=J.DOCTYPE_NAME;break;case H.GREATER_THAN_SIGN:{this._err(U.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=J.DATA;break}case H.EOF:{this._err(U.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=J.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.AFTER_DOCTYPE_NAME;break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.NULL:this._err(U.unexpectedNullCharacter),t.name+=`�`;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(J0(e)?Z0(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(w0.PUBLIC,!1)?this.state=J.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(w0.SYSTEM,!1)?this.state=J.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(U.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case H.QUOTATION_MARK:this._err(U.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:this._err(U.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:t.publicId=``,this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:t.publicId=``,this.state=J.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case H.QUOTATION_MARK:this.state=J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.publicId+=`�`;break;case H.GREATER_THAN_SIGN:this._err(U.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case H.APOSTROPHE:this.state=J.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.publicId+=`�`;break;case H.GREATER_THAN_SIGN:this._err(U.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case H.GREATER_THAN_SIGN:this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.QUOTATION_MARK:this._err(U.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:this._err(U.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.QUOTATION_MARK:t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:this.state=J.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case H.QUOTATION_MARK:this._err(U.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:this._err(U.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case H.APOSTROPHE:t.systemId=``,this.state=J.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case H.GREATER_THAN_SIGN:this._err(U.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.DATA,this.emitCurrentDoctype(t);break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case H.QUOTATION_MARK:this.state=J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.systemId+=`�`;break;case H.GREATER_THAN_SIGN:this._err(U.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case H.APOSTROPHE:this.state=J.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case H.NULL:this._err(U.unexpectedNullCharacter),t.systemId+=`�`;break;case H.GREATER_THAN_SIGN:this._err(U.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.EOF:this._err(U.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(U.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=J.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case H.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=J.DATA;break;case H.NULL:this._err(U.unexpectedNullCharacter);break;case H.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case H.RIGHT_SQUARE_BRACKET:this.state=J.CDATA_SECTION_BRACKET;break;case H.EOF:this._err(U.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===H.RIGHT_SQUARE_BRACKET?this.state=J.CDATA_SECTION_END:(this._emitChars(`]`),this.state=J.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case H.GREATER_THAN_SIGN:this.state=J.DATA;break;case H.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=J.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(H.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&X0(this.preprocessor.peek(1))?J.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){X0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===H.SEMICOLON&&this._err(U.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}})),$0,e2,t2,cve,lve,n2,r2,uve,dve,fve,pve,mve,hve=o((()=>{q0(),$0=new Set([K.DD,K.DT,K.LI,K.OPTGROUP,K.OPTION,K.P,K.RB,K.RP,K.RT,K.RTC]),e2=new Set([...$0,K.CAPTION,K.COLGROUP,K.TBODY,K.TD,K.TFOOT,K.TH,K.THEAD,K.TR]),t2=new Set([K.APPLET,K.CAPTION,K.HTML,K.MARQUEE,K.OBJECT,K.TABLE,K.TD,K.TEMPLATE,K.TH]),cve=new Set([...t2,K.OL,K.UL]),lve=new Set([...t2,K.BUTTON]),n2=new Set([K.ANNOTATION_XML,K.MI,K.MN,K.MO,K.MS,K.MTEXT]),r2=new Set([K.DESC,K.FOREIGN_OBJECT,K.TITLE]),uve=new Set([K.TR,K.TEMPLATE,K.HTML]),dve=new Set([K.TBODY,K.TFOOT,K.THEAD,K.TEMPLATE,K.HTML]),fve=new Set([K.TABLE,K.TEMPLATE,K.HTML]),pve=new Set([K.TD,K.TH]),mve=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=K.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===K.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===W.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==W.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(K0,W.HTML)}popUntilTableCellPopped(){this.popUntilPopped(pve,W.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(fve,W.HTML)}clearBackToTableBodyContext(){this.clearBackTo(dve,W.HTML)}clearBackToTableRowContext(){this.clearBackTo(uve,W.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===K.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===K.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case W.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case W.SVG:if(r2.has(r))return!1;break;case W.MATHML:if(n2.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,t2)}hasInListItemScope(e){return this.hasInDynamicScope(e,cve)}hasInButtonScope(e){return this.hasInDynamicScope(e,lve)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case W.HTML:if(K0.has(t))return!0;if(t2.has(t))return!1;break;case W.SVG:if(r2.has(t))return!1;break;case W.MATHML:if(n2.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===W.HTML)switch(this.tagIDs[t]){case e:return!0;case K.TABLE:case K.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===W.HTML)switch(this.tagIDs[e]){case K.TBODY:case K.THEAD:case K.TFOOT:return!0;case K.TABLE:case K.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===W.HTML)switch(this.tagIDs[t]){case e:return!0;case K.OPTION:case K.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&$0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&e2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&e2.has(this.currentTagId);)this.pop()}}})),i2,a2,o2,gve,_ve=o((()=>{i2=3,(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(a2||={}),o2={type:a2.Marker},gve=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===a2.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<i2)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<i2)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=i2&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(o2)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:a2.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:a2.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(o2);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===a2.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===a2.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===a2.Element&&t.element===e)}}})),s2,c2=o((()=>{q0(),s2={createDocument(){return{nodeName:`#document`,mode:U0.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};s2.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(s2.isTextNode(n)){n.value+=t;return}}s2.appendChild(e,s2.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&s2.isTextNode(r)?r.value+=t:s2.insertBefore(e,s2.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}}}));function vve(e,t){return t.some(t=>e.startsWith(t))}function yve(e){return e.name===l2&&e.publicId===null&&(e.systemId===null||e.systemId===xve)}function bve(e){if(e.name!==l2)return U0.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===Sve)return U0.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),wve.has(n))return U0.QUIRKS;let e=t===null?Cve:u2;if(vve(n,e))return U0.QUIRKS;if(e=t===null?d2:Tve,vve(n,e))return U0.LIMITED_QUIRKS}return U0.NO_QUIRKS}var l2,xve,Sve,u2,Cve,wve,d2,Tve,Eve=o((()=>{q0(),l2=`html`,xve=`about:legacy-compat`,Sve=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,u2=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),Cve=[...u2,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],wve=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),d2=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Tve=[...d2,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`]}));function Dve(e){let t=e.tagID;return t===K.FONT&&e.attrs.some(({name:e})=>e===H0.COLOR||e===H0.SIZE||e===H0.FACE)||zve.has(t)}function Ove(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Pve){e.attrs[t].name=Fve;break}}function kve(e){for(let t=0;t<e.attrs.length;t++){let n=Ive.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function f2(e){for(let t=0;t<e.attrs.length;t++){let n=Lve.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function Ave(e){let t=Rve.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=V0(e.tagName))}function jve(e,t){return t===W.MATHML&&(e===K.MI||e===K.MO||e===K.MN||e===K.MS||e===K.MTEXT)}function Mve(e,t,n){if(t===W.MATHML&&e===K.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===H0.ENCODING){let t=n[e].value.toLowerCase();return t===p2.TEXT_HTML||t===p2.APPLICATION_XML}}return t===W.SVG&&(e===K.FOREIGN_OBJECT||e===K.DESC||e===K.TITLE)}function Nve(e,t,n,r){return(!r||r===W.HTML)&&Mve(e,t,n)||(!r||r===W.MATHML)&&jve(e,t)}var p2,Pve,Fve,Ive,Lve,Rve,zve,Bve=o((()=>{q0(),p2={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},Pve=`definitionurl`,Fve=`definitionURL`,Ive=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),Lve=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:W.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:W.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:W.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:W.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:W.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:W.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:W.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:W.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:W.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:W.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:W.XMLNS}]]),Rve=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),zve=new Set([K.B,K.BIG,K.BLOCKQUOTE,K.BODY,K.BR,K.CENTER,K.CODE,K.DD,K.DIV,K.DL,K.DT,K.EM,K.EMBED,K.H1,K.H2,K.H3,K.H4,K.H5,K.H6,K.HEAD,K.HR,K.I,K.IMG,K.LI,K.LISTING,K.MENU,K.META,K.NOBR,K.OL,K.P,K.PRE,K.RUBY,K.S,K.SMALL,K.SPAN,K.STRONG,K.STRIKE,K.SUB,K.SUP,K.TABLE,K.TT,K.U,K.UL,K.VAR])}));function Vve(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Yye(e,t),n}function Hve(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Uve(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=Lbe;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Wve(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Wve(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function Gve(e,t,n){let r=V0(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===K.TEMPLATE&&i===W.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Kve(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function m2(e,t){for(let n=0;n<Ibe;n++){let n=Vve(e,t);if(!n)break;let r=Hve(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=Uve(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&Gve(e,a,i),Kve(e,r,n)}}function h2(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function qve(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Jve(e,t){e._appendCommentNode(t,e.document)}function g2(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function Yve(e,t){e._setDocumentType(t);let n=t.forceQuirks?U0.QUIRKS:bve(t);yve(t)||e._err(t,U.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Y.BEFORE_HTML}function _2(e,t){e._err(t,U.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,U0.QUIRKS),e.insertionMode=Y.BEFORE_HTML,e._processToken(t)}function Xve(e,t){t.tagID===K.HTML?(e._insertElement(t,W.HTML),e.insertionMode=Y.BEFORE_HEAD):v2(e,t)}function Zve(e,t){let n=t.tagID;(n===K.HTML||n===K.HEAD||n===K.BODY||n===K.BR)&&v2(e,t)}function v2(e,t){e._insertFakeRootElement(),e.insertionMode=Y.BEFORE_HEAD,e._processToken(t)}function Qve(e,t){switch(t.tagID){case K.HTML:E2(e,t);break;case K.HEAD:e._insertElement(t,W.HTML),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD;break;default:y2(e,t)}}function $ve(e,t){let n=t.tagID;n===K.HEAD||n===K.BODY||n===K.HTML||n===K.BR?y2(e,t):e._err(t,U.endTagWithoutMatchingOpenElement)}function y2(e,t){e._insertFakeElement(G.HEAD,K.HEAD),e.headElement=e.openElements.current,e.insertionMode=Y.IN_HEAD,e._processToken(t)}function b2(e,t){switch(t.tagID){case K.HTML:E2(e,t);break;case K.BASE:case K.BASEFONT:case K.BGSOUND:case K.LINK:case K.META:e._appendElement(t,W.HTML),t.ackSelfClosing=!0;break;case K.TITLE:e._switchToTextParsing(t,Q0.RCDATA);break;case K.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,Q0.RAWTEXT):(e._insertElement(t,W.HTML),e.insertionMode=Y.IN_HEAD_NO_SCRIPT);break;case K.NOFRAMES:case K.STYLE:e._switchToTextParsing(t,Q0.RAWTEXT);break;case K.SCRIPT:e._switchToTextParsing(t,Q0.SCRIPT_DATA);break;case K.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Y.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE);break;case K.HEAD:e._err(t,U.misplacedStartTagForHeadElement);break;default:S2(e,t)}}function eye(e,t){switch(t.tagID){case K.HEAD:e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD;break;case K.BODY:case K.BR:case K.HTML:S2(e,t);break;case K.TEMPLATE:x2(e,t);break;default:e._err(t,U.endTagWithoutMatchingOpenElement)}}function x2(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==K.TEMPLATE&&e._err(t,U.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(K.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,U.endTagWithoutMatchingOpenElement)}function S2(e,t){e.openElements.pop(),e.insertionMode=Y.AFTER_HEAD,e._processToken(t)}function tye(e,t){switch(t.tagID){case K.HTML:E2(e,t);break;case K.BASEFONT:case K.BGSOUND:case K.HEAD:case K.LINK:case K.META:case K.NOFRAMES:case K.STYLE:b2(e,t);break;case K.NOSCRIPT:e._err(t,U.nestedNoscriptInHead);break;default:C2(e,t)}}function nye(e,t){switch(t.tagID){case K.NOSCRIPT:e.openElements.pop(),e.insertionMode=Y.IN_HEAD;break;case K.BR:C2(e,t);break;default:e._err(t,U.endTagWithoutMatchingOpenElement)}}function C2(e,t){let n=t.type===A0.EOF?U.openElementsLeftAfterEof:U.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Y.IN_HEAD,e._processToken(t)}function rye(e,t){switch(t.tagID){case K.HTML:E2(e,t);break;case K.BODY:e._insertElement(t,W.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_BODY;break;case K.FRAMESET:e._insertElement(t,W.HTML),e.insertionMode=Y.IN_FRAMESET;break;case K.BASE:case K.BASEFONT:case K.BGSOUND:case K.LINK:case K.META:case K.NOFRAMES:case K.SCRIPT:case K.STYLE:case K.TEMPLATE:case K.TITLE:e._err(t,U.abandonedHeadElementChild),e.openElements.push(e.headElement,K.HEAD),b2(e,t),e.openElements.remove(e.headElement);break;case K.HEAD:e._err(t,U.misplacedStartTagForHeadElement);break;default:w2(e,t)}}function iye(e,t){switch(t.tagID){case K.BODY:case K.HTML:case K.BR:w2(e,t);break;case K.TEMPLATE:x2(e,t);break;default:e._err(t,U.endTagWithoutMatchingOpenElement)}}function w2(e,t){e._insertFakeElement(G.BODY,K.BODY),e.insertionMode=Y.IN_BODY,T2(e,t)}function T2(e,t){switch(t.type){case A0.CHARACTER:oye(e,t);break;case A0.WHITESPACE_CHARACTER:aye(e,t);break;case A0.COMMENT:h2(e,t);break;case A0.START_TAG:E2(e,t);break;case A0.END_TAG:D2(e,t);break;case A0.EOF:Xye(e,t);break;default:}}function aye(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function oye(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function sye(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function cye(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function lye(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_FRAMESET)}function uye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML)}function dye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&K0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,W.HTML)}function fye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function pye(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML),n||(e.formElement=e.openElements.current))}function mye(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===K.LI&&r===K.LI||(n===K.DD||n===K.DT)&&(r===K.DD||r===K.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==K.ADDRESS&&r!==K.DIV&&r!==K.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML)}function hye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML),e.tokenizer.state=Q0.PLAINTEXT}function gye(e,t){e.openElements.hasInScope(K.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(K.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.framesetOk=!1}function _ye(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(G.A);n&&(m2(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function vye(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function yye(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(K.NOBR)&&(m2(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,W.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function bye(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function xye(e,t){e.treeAdapter.getDocumentMode(e.document)!==U0.QUIRKS&&e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._insertElement(t,W.HTML),e.framesetOk=!1,e.insertionMode=Y.IN_TABLE}function Sye(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,W.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Cye(e){let t=k0(e,H0.TYPE);return t!=null&&t.toLowerCase()===Fbe}function wye(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,W.HTML),Cye(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Tye(e,t){e._appendElement(t,W.HTML),t.ackSelfClosing=!0}function Eye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._appendElement(t,W.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Dye(e,t){t.tagName=G.IMG,t.tagID=K.IMG,Sye(e,t)}function Oye(e,t){e._insertElement(t,W.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Q0.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Y.TEXT}function kye(e,t){e.openElements.hasInButtonScope(K.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Q0.RAWTEXT)}function Aye(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Q0.RAWTEXT)}function jye(e,t){e._switchToTextParsing(t,Q0.RAWTEXT)}function Mye(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Y.IN_TABLE||e.insertionMode===Y.IN_CAPTION||e.insertionMode===Y.IN_TABLE_BODY||e.insertionMode===Y.IN_ROW||e.insertionMode===Y.IN_CELL?Y.IN_SELECT_IN_TABLE:Y.IN_SELECT}function Nye(e,t){e.openElements.currentTagId===K.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML)}function Pye(e,t){e.openElements.hasInScope(K.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,W.HTML)}function Fye(e,t){e.openElements.hasInScope(K.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(K.RTC),e._insertElement(t,W.HTML)}function Iye(e,t){e._reconstructActiveFormattingElements(),Ove(t),f2(t),t.selfClosing?e._appendElement(t,W.MATHML):e._insertElement(t,W.MATHML),t.ackSelfClosing=!0}function Lye(e,t){e._reconstructActiveFormattingElements(),kve(t),f2(t),t.selfClosing?e._appendElement(t,W.SVG):e._insertElement(t,W.SVG),t.ackSelfClosing=!0}function Rye(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,W.HTML)}function E2(e,t){switch(t.tagID){case K.I:case K.S:case K.B:case K.U:case K.EM:case K.TT:case K.BIG:case K.CODE:case K.FONT:case K.SMALL:case K.STRIKE:case K.STRONG:vye(e,t);break;case K.A:_ye(e,t);break;case K.H1:case K.H2:case K.H3:case K.H4:case K.H5:case K.H6:dye(e,t);break;case K.P:case K.DL:case K.OL:case K.UL:case K.DIV:case K.DIR:case K.NAV:case K.MAIN:case K.MENU:case K.ASIDE:case K.CENTER:case K.FIGURE:case K.FOOTER:case K.HEADER:case K.HGROUP:case K.DIALOG:case K.DETAILS:case K.ADDRESS:case K.ARTICLE:case K.SEARCH:case K.SECTION:case K.SUMMARY:case K.FIELDSET:case K.BLOCKQUOTE:case K.FIGCAPTION:uye(e,t);break;case K.LI:case K.DD:case K.DT:mye(e,t);break;case K.BR:case K.IMG:case K.WBR:case K.AREA:case K.EMBED:case K.KEYGEN:Sye(e,t);break;case K.HR:Eye(e,t);break;case K.RB:case K.RTC:Pye(e,t);break;case K.RT:case K.RP:Fye(e,t);break;case K.PRE:case K.LISTING:fye(e,t);break;case K.XMP:kye(e,t);break;case K.SVG:Lye(e,t);break;case K.HTML:sye(e,t);break;case K.BASE:case K.LINK:case K.META:case K.STYLE:case K.TITLE:case K.SCRIPT:case K.BGSOUND:case K.BASEFONT:case K.TEMPLATE:b2(e,t);break;case K.BODY:cye(e,t);break;case K.FORM:pye(e,t);break;case K.NOBR:yye(e,t);break;case K.MATH:Iye(e,t);break;case K.TABLE:xye(e,t);break;case K.INPUT:wye(e,t);break;case K.PARAM:case K.TRACK:case K.SOURCE:Tye(e,t);break;case K.IMAGE:Dye(e,t);break;case K.BUTTON:gye(e,t);break;case K.APPLET:case K.OBJECT:case K.MARQUEE:bye(e,t);break;case K.IFRAME:Aye(e,t);break;case K.SELECT:Mye(e,t);break;case K.OPTION:case K.OPTGROUP:Nye(e,t);break;case K.NOEMBED:case K.NOFRAMES:jye(e,t);break;case K.FRAMESET:lye(e,t);break;case K.TEXTAREA:Oye(e,t);break;case K.NOSCRIPT:e.options.scriptingEnabled?jye(e,t):Rye(e,t);break;case K.PLAINTEXT:hye(e,t);break;case K.COL:case K.TH:case K.TD:case K.TR:case K.HEAD:case K.FRAME:case K.TBODY:case K.TFOOT:case K.THEAD:case K.CAPTION:case K.COLGROUP:break;default:Rye(e,t)}}function zye(e,t){if(e.openElements.hasInScope(K.BODY)&&(e.insertionMode=Y.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Bye(e,t){e.openElements.hasInScope(K.BODY)&&(e.insertionMode=Y.AFTER_BODY,Cbe(e,t))}function Vye(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Hye(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(K.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(K.FORM):n&&e.openElements.remove(n))}function Uye(e){e.openElements.hasInButtonScope(K.P)||e._insertFakeElement(G.P,K.P),e._closePElement()}function Wye(e){e.openElements.hasInListItemScope(K.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(K.LI),e.openElements.popUntilTagNamePopped(K.LI))}function Gye(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Kye(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function qye(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Jye(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(G.BR,K.BR),e.openElements.pop(),e.framesetOk=!1}function Yye(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==K.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function D2(e,t){switch(t.tagID){case K.A:case K.B:case K.I:case K.S:case K.U:case K.EM:case K.TT:case K.BIG:case K.CODE:case K.FONT:case K.NOBR:case K.SMALL:case K.STRIKE:case K.STRONG:m2(e,t);break;case K.P:Uye(e);break;case K.DL:case K.UL:case K.OL:case K.DIR:case K.DIV:case K.NAV:case K.PRE:case K.MAIN:case K.MENU:case K.ASIDE:case K.BUTTON:case K.CENTER:case K.FIGURE:case K.FOOTER:case K.HEADER:case K.HGROUP:case K.DIALOG:case K.ADDRESS:case K.ARTICLE:case K.DETAILS:case K.SEARCH:case K.SECTION:case K.SUMMARY:case K.LISTING:case K.FIELDSET:case K.BLOCKQUOTE:case K.FIGCAPTION:Vye(e,t);break;case K.LI:Wye(e);break;case K.DD:case K.DT:Gye(e,t);break;case K.H1:case K.H2:case K.H3:case K.H4:case K.H5:case K.H6:Kye(e);break;case K.BR:Jye(e);break;case K.BODY:zye(e,t);break;case K.HTML:Bye(e,t);break;case K.FORM:Hye(e);break;case K.APPLET:case K.OBJECT:case K.MARQUEE:qye(e,t);break;case K.TEMPLATE:x2(e,t);break;default:Yye(e,t)}}function Xye(e,t){e.tmplInsertionModeStack.length>0?xbe(e,t):g2(e,t)}function Zye(e,t){var n;t.tagID===K.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Qye(e,t){e._err(t,U.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function O2(e,t){if(e.openElements.currentTagId!==void 0&&B2.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Y.IN_TABLE_TEXT,t.type){case A0.CHARACTER:cbe(e,t);break;case A0.WHITESPACE_CHARACTER:sbe(e,t);break}else j2(e,t)}function $ye(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_CAPTION}function ebe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_COLUMN_GROUP}function tbe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(G.COLGROUP,K.COLGROUP),e.insertionMode=Y.IN_COLUMN_GROUP,N2(e,t)}function nbe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_TABLE_BODY}function rbe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(G.TBODY,K.TBODY),e.insertionMode=Y.IN_TABLE_BODY,F2(e,t)}function ibe(e,t){e.openElements.hasInTableScope(K.TABLE)&&(e.openElements.popUntilTagNamePopped(K.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function abe(e,t){Cye(t)?e._appendElement(t,W.HTML):j2(e,t),t.ackSelfClosing=!0}function obe(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,W.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function k2(e,t){switch(t.tagID){case K.TD:case K.TH:case K.TR:rbe(e,t);break;case K.STYLE:case K.SCRIPT:case K.TEMPLATE:b2(e,t);break;case K.COL:tbe(e,t);break;case K.FORM:obe(e,t);break;case K.TABLE:ibe(e,t);break;case K.TBODY:case K.TFOOT:case K.THEAD:nbe(e,t);break;case K.INPUT:abe(e,t);break;case K.CAPTION:$ye(e,t);break;case K.COLGROUP:ebe(e,t);break;default:j2(e,t)}}function A2(e,t){switch(t.tagID){case K.TABLE:e.openElements.hasInTableScope(K.TABLE)&&(e.openElements.popUntilTagNamePopped(K.TABLE),e._resetInsertionMode());break;case K.TEMPLATE:x2(e,t);break;case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:case K.TBODY:case K.TD:case K.TFOOT:case K.TH:case K.THEAD:case K.TR:break;default:j2(e,t)}}function j2(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,T2(e,t),e.fosterParentingEnabled=n}function sbe(e,t){e.pendingCharacterTokens.push(t)}function cbe(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function M2(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)j2(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}function lbe(e,t){let n=t.tagID;U2.has(n)?e.openElements.hasInTableScope(K.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(K.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_TABLE,k2(e,t)):E2(e,t)}function ube(e,t){let n=t.tagID;switch(n){case K.CAPTION:case K.TABLE:e.openElements.hasInTableScope(K.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(K.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_TABLE,n===K.TABLE&&A2(e,t));break;case K.BODY:case K.COL:case K.COLGROUP:case K.HTML:case K.TBODY:case K.TD:case K.TFOOT:case K.TH:case K.THEAD:case K.TR:break;default:D2(e,t)}}function N2(e,t){switch(t.tagID){case K.HTML:E2(e,t);break;case K.COL:e._appendElement(t,W.HTML),t.ackSelfClosing=!0;break;case K.TEMPLATE:b2(e,t);break;default:P2(e,t)}}function dbe(e,t){switch(t.tagID){case K.COLGROUP:e.openElements.currentTagId===K.COLGROUP&&(e.openElements.pop(),e.insertionMode=Y.IN_TABLE);break;case K.TEMPLATE:x2(e,t);break;case K.COL:break;default:P2(e,t)}}function P2(e,t){e.openElements.currentTagId===K.COLGROUP&&(e.openElements.pop(),e.insertionMode=Y.IN_TABLE,e._processToken(t))}function F2(e,t){switch(t.tagID){case K.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_ROW;break;case K.TH:case K.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(G.TR,K.TR),e.insertionMode=Y.IN_ROW,L2(e,t);break;case K.CAPTION:case K.COL:case K.COLGROUP:case K.TBODY:case K.TFOOT:case K.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE,k2(e,t));break;default:k2(e,t)}}function I2(e,t){let n=t.tagID;switch(t.tagID){case K.TBODY:case K.TFOOT:case K.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE);break;case K.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE,A2(e,t));break;case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:case K.TD:case K.TH:case K.TR:break;default:A2(e,t)}}function L2(e,t){switch(t.tagID){case K.TH:case K.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,W.HTML),e.insertionMode=Y.IN_CELL,e.activeFormattingElements.insertMarker();break;case K.CAPTION:case K.COL:case K.COLGROUP:case K.TBODY:case K.TFOOT:case K.THEAD:case K.TR:e.openElements.hasInTableScope(K.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,F2(e,t));break;default:k2(e,t)}}function fbe(e,t){switch(t.tagID){case K.TR:e.openElements.hasInTableScope(K.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY);break;case K.TABLE:e.openElements.hasInTableScope(K.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,I2(e,t));break;case K.TBODY:case K.TFOOT:case K.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(K.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Y.IN_TABLE_BODY,I2(e,t));break;case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:case K.TD:case K.TH:break;default:A2(e,t)}}function pbe(e,t){let n=t.tagID;U2.has(n)?(e.openElements.hasInTableScope(K.TD)||e.openElements.hasInTableScope(K.TH))&&(e._closeTableCell(),L2(e,t)):E2(e,t)}function mbe(e,t){let n=t.tagID;switch(n){case K.TD:case K.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Y.IN_ROW);break;case K.TABLE:case K.TBODY:case K.TFOOT:case K.THEAD:case K.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),fbe(e,t));break;case K.BODY:case K.CAPTION:case K.COL:case K.COLGROUP:case K.HTML:break;default:D2(e,t)}}function hbe(e,t){switch(t.tagID){case K.HTML:E2(e,t);break;case K.OPTION:e.openElements.currentTagId===K.OPTION&&e.openElements.pop(),e._insertElement(t,W.HTML);break;case K.OPTGROUP:e.openElements.currentTagId===K.OPTION&&e.openElements.pop(),e.openElements.currentTagId===K.OPTGROUP&&e.openElements.pop(),e._insertElement(t,W.HTML);break;case K.HR:e.openElements.currentTagId===K.OPTION&&e.openElements.pop(),e.openElements.currentTagId===K.OPTGROUP&&e.openElements.pop(),e._appendElement(t,W.HTML),t.ackSelfClosing=!0;break;case K.INPUT:case K.KEYGEN:case K.TEXTAREA:case K.SELECT:e.openElements.hasInSelectScope(K.SELECT)&&(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode(),t.tagID!==K.SELECT&&e._processStartTag(t));break;case K.SCRIPT:case K.TEMPLATE:b2(e,t);break;default:}}function gbe(e,t){switch(t.tagID){case K.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===K.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===K.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===K.OPTGROUP&&e.openElements.pop();break;case K.OPTION:e.openElements.currentTagId===K.OPTION&&e.openElements.pop();break;case K.SELECT:e.openElements.hasInSelectScope(K.SELECT)&&(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode());break;case K.TEMPLATE:x2(e,t);break;default:}}function _be(e,t){let n=t.tagID;n===K.CAPTION||n===K.TABLE||n===K.TBODY||n===K.TFOOT||n===K.THEAD||n===K.TR||n===K.TD||n===K.TH?(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode(),e._processStartTag(t)):hbe(e,t)}function vbe(e,t){let n=t.tagID;n===K.CAPTION||n===K.TABLE||n===K.TBODY||n===K.TFOOT||n===K.THEAD||n===K.TR||n===K.TD||n===K.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(K.SELECT),e._resetInsertionMode(),e.onEndTag(t)):gbe(e,t)}function ybe(e,t){switch(t.tagID){case K.BASE:case K.BASEFONT:case K.BGSOUND:case K.LINK:case K.META:case K.NOFRAMES:case K.SCRIPT:case K.STYLE:case K.TEMPLATE:case K.TITLE:b2(e,t);break;case K.CAPTION:case K.COLGROUP:case K.TBODY:case K.TFOOT:case K.THEAD:e.tmplInsertionModeStack[0]=Y.IN_TABLE,e.insertionMode=Y.IN_TABLE,k2(e,t);break;case K.COL:e.tmplInsertionModeStack[0]=Y.IN_COLUMN_GROUP,e.insertionMode=Y.IN_COLUMN_GROUP,N2(e,t);break;case K.TR:e.tmplInsertionModeStack[0]=Y.IN_TABLE_BODY,e.insertionMode=Y.IN_TABLE_BODY,F2(e,t);break;case K.TD:case K.TH:e.tmplInsertionModeStack[0]=Y.IN_ROW,e.insertionMode=Y.IN_ROW,L2(e,t);break;default:e.tmplInsertionModeStack[0]=Y.IN_BODY,e.insertionMode=Y.IN_BODY,E2(e,t)}}function bbe(e,t){t.tagID===K.TEMPLATE&&x2(e,t)}function xbe(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(K.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):g2(e,t)}function Sbe(e,t){t.tagID===K.HTML?E2(e,t):R2(e,t)}function Cbe(e,t){if(t.tagID===K.HTML){if(e.fragmentContext||(e.insertionMode=Y.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===K.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else R2(e,t)}function R2(e,t){e.insertionMode=Y.IN_BODY,T2(e,t)}function wbe(e,t){switch(t.tagID){case K.HTML:E2(e,t);break;case K.FRAMESET:e._insertElement(t,W.HTML);break;case K.FRAME:e._appendElement(t,W.HTML),t.ackSelfClosing=!0;break;case K.NOFRAMES:b2(e,t);break;default:}}function Tbe(e,t){t.tagID===K.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==K.FRAMESET&&(e.insertionMode=Y.AFTER_FRAMESET))}function Ebe(e,t){switch(t.tagID){case K.HTML:E2(e,t);break;case K.NOFRAMES:b2(e,t);break;default:}}function Dbe(e,t){t.tagID===K.HTML&&(e.insertionMode=Y.AFTER_AFTER_FRAMESET)}function Obe(e,t){t.tagID===K.HTML?E2(e,t):z2(e,t)}function z2(e,t){e.insertionMode=Y.IN_BODY,T2(e,t)}function kbe(e,t){switch(t.tagID){case K.HTML:E2(e,t);break;case K.NOFRAMES:b2(e,t);break;default:}}function Abe(e,t){t.chars=`�`,e._insertCharacters(t)}function jbe(e,t){e._insertCharacters(t),e.framesetOk=!1}function Mbe(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==W.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Nbe(e,t){if(Dve(t))Mbe(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===W.MATHML?Ove(t):r===W.SVG&&(Ave(t),kve(t)),f2(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Pbe(e,t){if(t.tagID===K.P||t.tagID===K.BR){Mbe(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===W.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}var Fbe,Ibe,Lbe,Y,Rbe,B2,V2,H2,U2,zbe=o((()=>{sve(),hve(),_ve(),c2(),Eve(),Bve(),E0(),T0(),q0(),j0(),Fbe=`hidden`,Ibe=8,Lbe=3,(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(Y||={}),Rbe={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},B2=new Set([K.TABLE,K.TBODY,K.TFOOT,K.THEAD,K.TR]),V2={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:s2,onParseError:null},H2=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=Y.INITIAL,this.originalInsertionMode=Y.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...V2,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new ove(this.options,this),this.activeFormattingElements=new gve(this.treeAdapter),this.fragmentContextID=n?V0(this.treeAdapter.getTagName(n)):K.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new mve(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...V2,...t};e??=n.treeAdapter.createElement(G.TEMPLATE,W.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,W.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===K.TEMPLATE&&i.tmplInsertionModeStack.unshift(Y.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??Rbe,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===W.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,W.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Y.TEXT}switchToPlaintextParsing(){this.insertionMode=Y.TEXT,this.originalInsertionMode=Y.IN_BODY,this.tokenizer.state=Q0.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===G.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==W.HTML))switch(this.fragmentContextID){case K.TITLE:case K.TEXTAREA:this.tokenizer.state=Q0.RCDATA;break;case K.STYLE:case K.XMP:case K.IFRAME:case K.NOEMBED:case K.NOFRAMES:case K.NOSCRIPT:this.tokenizer.state=Q0.RAWTEXT;break;case K.SCRIPT:this.tokenizer.state=Q0.SCRIPT_DATA;break;case K.PLAINTEXT:this.tokenizer.state=Q0.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,W.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,W.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(G.HTML,W.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,K.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===A0.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===K.SVG&&this.treeAdapter.getTagName(t)===G.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===W.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===K.MGLYPH||e.tagID===K.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,W.HTML)}_processToken(e){switch(e.type){case A0.CHARACTER:this.onCharacter(e);break;case A0.NULL_CHARACTER:this.onNullCharacter(e);break;case A0.COMMENT:this.onComment(e);break;case A0.DOCTYPE:this.onDoctype(e);break;case A0.START_TAG:this._processStartTag(e);break;case A0.END_TAG:this.onEndTag(e);break;case A0.EOF:this.onEof(e);break;case A0.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return Nve(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===a2.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Y.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(K.P),this.openElements.popUntilTagNamePopped(K.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case K.TR:this.insertionMode=Y.IN_ROW;return;case K.TBODY:case K.THEAD:case K.TFOOT:this.insertionMode=Y.IN_TABLE_BODY;return;case K.CAPTION:this.insertionMode=Y.IN_CAPTION;return;case K.COLGROUP:this.insertionMode=Y.IN_COLUMN_GROUP;return;case K.TABLE:this.insertionMode=Y.IN_TABLE;return;case K.BODY:this.insertionMode=Y.IN_BODY;return;case K.FRAMESET:this.insertionMode=Y.IN_FRAMESET;return;case K.SELECT:this._resetInsertionModeForSelect(e);return;case K.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case K.HTML:this.insertionMode=this.headElement?Y.AFTER_HEAD:Y.BEFORE_HEAD;return;case K.TD:case K.TH:if(e>0){this.insertionMode=Y.IN_CELL;return}break;case K.HEAD:if(e>0){this.insertionMode=Y.IN_HEAD;return}break}this.insertionMode=Y.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===K.TEMPLATE)break;if(e===K.TABLE){this.insertionMode=Y.IN_SELECT_IN_TABLE;return}}this.insertionMode=Y.IN_SELECT}_isElementCausesFosterParenting(e){return B2.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case K.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===W.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case K.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return G0[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){jbe(this,e);return}switch(this.insertionMode){case Y.INITIAL:_2(this,e);break;case Y.BEFORE_HTML:v2(this,e);break;case Y.BEFORE_HEAD:y2(this,e);break;case Y.IN_HEAD:S2(this,e);break;case Y.IN_HEAD_NO_SCRIPT:C2(this,e);break;case Y.AFTER_HEAD:w2(this,e);break;case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:oye(this,e);break;case Y.TEXT:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:O2(this,e);break;case Y.IN_TABLE_TEXT:cbe(this,e);break;case Y.IN_COLUMN_GROUP:P2(this,e);break;case Y.AFTER_BODY:R2(this,e);break;case Y.AFTER_AFTER_BODY:z2(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Abe(this,e);return}switch(this.insertionMode){case Y.INITIAL:_2(this,e);break;case Y.BEFORE_HTML:v2(this,e);break;case Y.BEFORE_HEAD:y2(this,e);break;case Y.IN_HEAD:S2(this,e);break;case Y.IN_HEAD_NO_SCRIPT:C2(this,e);break;case Y.AFTER_HEAD:w2(this,e);break;case Y.TEXT:this._insertCharacters(e);break;case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:O2(this,e);break;case Y.IN_COLUMN_GROUP:P2(this,e);break;case Y.AFTER_BODY:R2(this,e);break;case Y.AFTER_AFTER_BODY:z2(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){h2(this,e);return}switch(this.insertionMode){case Y.INITIAL:case Y.BEFORE_HTML:case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_TEMPLATE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:h2(this,e);break;case Y.IN_TABLE_TEXT:M2(this,e);break;case Y.AFTER_BODY:qve(this,e);break;case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:Jve(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Y.INITIAL:Yve(this,e);break;case Y.BEFORE_HEAD:case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:this._err(e,U.misplacedDoctype);break;case Y.IN_TABLE_TEXT:M2(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,U.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Nbe(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Y.INITIAL:_2(this,e);break;case Y.BEFORE_HTML:Xve(this,e);break;case Y.BEFORE_HEAD:Qve(this,e);break;case Y.IN_HEAD:b2(this,e);break;case Y.IN_HEAD_NO_SCRIPT:tye(this,e);break;case Y.AFTER_HEAD:rye(this,e);break;case Y.IN_BODY:E2(this,e);break;case Y.IN_TABLE:k2(this,e);break;case Y.IN_TABLE_TEXT:M2(this,e);break;case Y.IN_CAPTION:lbe(this,e);break;case Y.IN_COLUMN_GROUP:N2(this,e);break;case Y.IN_TABLE_BODY:F2(this,e);break;case Y.IN_ROW:L2(this,e);break;case Y.IN_CELL:pbe(this,e);break;case Y.IN_SELECT:hbe(this,e);break;case Y.IN_SELECT_IN_TABLE:_be(this,e);break;case Y.IN_TEMPLATE:ybe(this,e);break;case Y.AFTER_BODY:Sbe(this,e);break;case Y.IN_FRAMESET:wbe(this,e);break;case Y.AFTER_FRAMESET:Ebe(this,e);break;case Y.AFTER_AFTER_BODY:Obe(this,e);break;case Y.AFTER_AFTER_FRAMESET:kbe(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Pbe(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Y.INITIAL:_2(this,e);break;case Y.BEFORE_HTML:Zve(this,e);break;case Y.BEFORE_HEAD:$ve(this,e);break;case Y.IN_HEAD:eye(this,e);break;case Y.IN_HEAD_NO_SCRIPT:nye(this,e);break;case Y.AFTER_HEAD:iye(this,e);break;case Y.IN_BODY:D2(this,e);break;case Y.TEXT:Zye(this,e);break;case Y.IN_TABLE:A2(this,e);break;case Y.IN_TABLE_TEXT:M2(this,e);break;case Y.IN_CAPTION:ube(this,e);break;case Y.IN_COLUMN_GROUP:dbe(this,e);break;case Y.IN_TABLE_BODY:I2(this,e);break;case Y.IN_ROW:fbe(this,e);break;case Y.IN_CELL:mbe(this,e);break;case Y.IN_SELECT:gbe(this,e);break;case Y.IN_SELECT_IN_TABLE:vbe(this,e);break;case Y.IN_TEMPLATE:bbe(this,e);break;case Y.AFTER_BODY:Cbe(this,e);break;case Y.IN_FRAMESET:Tbe(this,e);break;case Y.AFTER_FRAMESET:Dbe(this,e);break;case Y.AFTER_AFTER_BODY:z2(this,e);break;default:}}onEof(e){switch(this.insertionMode){case Y.INITIAL:_2(this,e);break;case Y.BEFORE_HTML:v2(this,e);break;case Y.BEFORE_HEAD:y2(this,e);break;case Y.IN_HEAD:S2(this,e);break;case Y.IN_HEAD_NO_SCRIPT:C2(this,e);break;case Y.AFTER_HEAD:w2(this,e);break;case Y.IN_BODY:case Y.IN_TABLE:case Y.IN_CAPTION:case Y.IN_COLUMN_GROUP:case Y.IN_TABLE_BODY:case Y.IN_ROW:case Y.IN_CELL:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:Xye(this,e);break;case Y.TEXT:Qye(this,e);break;case Y.IN_TABLE_TEXT:M2(this,e);break;case Y.IN_TEMPLATE:xbe(this,e);break;case Y.AFTER_BODY:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:g2(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===H.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case Y.IN_HEAD:case Y.IN_HEAD_NO_SCRIPT:case Y.AFTER_HEAD:case Y.TEXT:case Y.IN_COLUMN_GROUP:case Y.IN_SELECT:case Y.IN_SELECT_IN_TABLE:case Y.IN_FRAMESET:case Y.AFTER_FRAMESET:this._insertCharacters(e);break;case Y.IN_BODY:case Y.IN_CAPTION:case Y.IN_CELL:case Y.IN_TEMPLATE:case Y.AFTER_BODY:case Y.AFTER_AFTER_BODY:case Y.AFTER_AFTER_FRAMESET:aye(this,e);break;case Y.IN_TABLE:case Y.IN_TABLE_BODY:case Y.IN_ROW:O2(this,e);break;case Y.IN_TABLE_TEXT:sbe(this,e);break;default:}}},U2=new Set([K.CAPTION,K.COL,K.COLGROUP,K.TBODY,K.TD,K.TFOOT,K.TH,K.THEAD,K.TR])})),Bbe=o((()=>{q0(),c2(),new Set([G.AREA,G.BASE,G.BASEFONT,G.BGSOUND,G.BR,G.COL,G.EMBED,G.FRAME,G.HR,G.IMG,G.INPUT,G.KEYGEN,G.LINK,G.META,G.PARAM,G.SOURCE,G.TRACK,G.WBR])}));function Vbe(e,t){return H2.parse(e,t)}function Hbe(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=H2.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var Ube=o((()=>{zbe(),c2(),Bbe(),E0(),Bve(),q0(),j0(),sve()}));function W2(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Wbe(e.position):`start`in e||`end`in e?Wbe(e):`line`in e||`column`in e?G2(e):``}function G2(e){return Gbe(e&&e.line)+`:`+Gbe(e&&e.column)}function Wbe(e){return G2(e&&e.start)+`-`+G2(e&&e.end)}function Gbe(e){return e&&typeof e==`number`?e:1}var Kbe=o((()=>{})),qbe=o((()=>{Kbe()})),K2,Jbe=o((()=>{qbe(),K2=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=W2(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}},K2.prototype.file=``,K2.prototype.name=``,K2.prototype.reason=``,K2.prototype.message=``,K2.prototype.stack=``,K2.prototype.column=void 0,K2.prototype.line=void 0,K2.prototype.ancestors=void 0,K2.prototype.cause=void 0,K2.prototype.fatal=void 0,K2.prototype.place=void 0,K2.prototype.ruleId=void 0,K2.prototype.source=void 0})),Ybe=o((()=>{Jbe()}));function Xbe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);q2(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Zbe(e){if(q2(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Qbe(e){q2(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function $be(...e){let t=-1,n;for(;++t<e.length;)q2(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:exe(n)}function exe(e){q2(e);let t=e.codePointAt(0)===47,n=txe(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function txe(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function q2(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var J2,nxe=o((()=>{J2={basename:Xbe,dirname:Zbe,extname:Qbe,join:$be,sep:`/`}}));function rxe(){return`/`}var ixe,axe=o((()=>{ixe={cwd:rxe}}));function Y2(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}var oxe=o((()=>{}));function sxe(e){if(typeof e==`string`)e=new URL(e);else if(!Y2(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return cxe(e)}function cxe(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var lxe=o((()=>{oxe()}));function X2(e,t){if(e&&e.includes(J2.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+J2.sep+"`")}function Z2(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function uxe(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function dxe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Q2,$2,fxe=o((()=>{Ybe(),nxe(),axe(),lxe(),Q2=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],$2=class{constructor(e){let t;t=e?Y2(e)?{path:e}:typeof e==`string`||dxe(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:ixe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Q2.length;){let e=Q2[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Q2.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?J2.basename(this.path):void 0}set basename(e){Z2(e,`basename`),X2(e,`basename`),this.path=J2.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?J2.dirname(this.path):void 0}set dirname(e){uxe(this.basename,`dirname`),this.path=J2.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?J2.extname(this.path):void 0}set extname(e){if(X2(e,`extname`),uxe(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=J2.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Y2(e)&&(e=sxe(e)),Z2(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?J2.basename(this.path,this.extname):void 0}set stem(e){Z2(e,`stem`),X2(e,`stem`),this.path=J2.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new K2(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}}})),pxe=o((()=>{fxe()})),mxe,hxe=o((()=>{mxe={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}}}));function gxe(e,t){let n=t||Exe,r=n.onerror,i=e instanceof $2?e:new $2(e),a=n.fragment?Hbe:Vbe,o=String(i);return z_e(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=_xe(t),s=n[a]??!0,c=typeof s==`number`?s:s?1:0;if(c){let n=mxe[a],o=new K2(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=Txe[c],o.note=l(n.description),o.url=n.url===!1?void 0:xxe+t,r(o)}function l(t){return t.replace(Cxe,n).replace(wxe,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return yxe(o.charAt(e.startOffset+i))}function r(){return bxe(o.charCodeAt(e.startOffset))}}}}function _xe(e){return e.replace(Sxe,vxe)}function vxe(e){return e.charAt(1).toUpperCase()}function yxe(e){return e==="`"?"` ` `":e}function bxe(e){return`0x`+e.toString(16).toUpperCase()}var xxe,Sxe,Cxe,wxe,Txe,Exe,Dxe=o((()=>{d1(),U_e(),Ube(),pxe(),Ybe(),hxe(),xxe=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,Sxe=/-[a-z]/g,Cxe=/%c(?:([-+])(\d+))?/g,wxe=/%x/g,Txe={2:!0,1:!1,0:null},Exe={}})),Oxe=o((()=>{Dxe()}));function kxe(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return gxe(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var Axe=o((()=>{Oxe()})),jxe=o((()=>{Axe()})),Mxe=o((()=>{})),e4,Nxe,t4,Pxe=o((()=>{Mxe(),e4=typeof self==`object`?self:globalThis,Nxe=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new e4[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new e4[a](o),i)};return r},t4=e=>Nxe(new Map,e)(0)})),n4,Fxe,Ixe,r4,i4,Lxe,a4,Rxe=o((()=>{Mxe(),n4=``,{toString:Fxe}={},{keys:Ixe}=Object,r4=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Fxe.call(e).slice(8,-1);switch(n){case`Array`:return[1,n4];case`Object`:return[2,n4];case`Date`:return[3,n4];case`RegExp`:return[4,n4];case`Map`:return[5,n4];case`Set`:return[6,n4];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},i4=([e,t])=>e===0&&(t===`function`||t===`symbol`),Lxe=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=r4(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Ixe(r))(e||!i4(r4(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(i4(r4(n))||i4(r4(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!i4(r4(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},a4=(e,{json:t,lossy:n}={})=>{let r=[];return Lxe(!(t||n),!!t,new Map,r)(e),r}})),o4,s4=o((()=>{Pxe(),Rxe(),o4=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?t4(a4(e,t)):structuredClone(e):(e,t)=>t4(a4(e,t))}));function zxe(e){let t=[],n=-1;for(;++n<e.length;)t[n]=u4(e[n]);return c4(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Bxe(e){return c4(t);function t(t){return t.tagName===e}}function c4(e){return t;function t(t,n,r){return!!(Hxe(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Vxe(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function Hxe(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var l4,u4,Uxe=o((()=>{l4=(function(e,t,n,r,i){let a=u4(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return Hxe(e)?a.call(i,e,n,r):!1}),u4=(function(e){if(e==null)return Vxe;if(typeof e==`string`)return Bxe(e);if(typeof e==`object`)return zxe(e);if(typeof e==`function`)return c4(e);throw Error("Expected function, string, or array as `test`")})})),d4=o((()=>{Uxe()})),f4,Wxe=o((()=>{d4(),f4=u4(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`})})),Gxe=o((()=>{Wxe()}));function p4(e){return typeof e==`object`?e.type===`text`?Kxe(e.value):!1:Kxe(e)}function Kxe(e){return e.replace(qxe,``)===``}var qxe,Jxe=o((()=>{qxe=/[ \t\n\f\r]/g})),m4=o((()=>{Jxe()}));function Yxe(e){let t=[],n=-1;for(;++n<e.length;)t[n]=g4(e[n]);return h4(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Xxe(e){let t=e;return h4(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Zxe(e){return h4(t);function t(t){return t&&t.type===e}}function h4(e){return t;function t(t,n,r){return!!($xe(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Qxe(){return!0}function $xe(e){return typeof e==`object`&&!!e&&`type`in e}var g4,eSe=o((()=>{g4=(function(e){if(e==null)return Qxe;if(typeof e==`function`)return h4(e);if(typeof e==`object`)return Array.isArray(e)?Yxe(e):Xxe(e);if(typeof e==`string`)return Zxe(e);throw Error(`Expected function, string, or object as test`)})})),_4=o((()=>{eSe()})),tSe,nSe=o((()=>{tSe=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`)})),rSe,iSe=o((()=>{rSe=[`button`,`input`,`select`,`textarea`]})),aSe,oSe=o((()=>{aSe=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`]}));function sSe(e,t){cSe(e,{collapse:ySe((t||xSe).newlines?_Se:vSe),whitespace:`normal`})}function cSe(e,t){if(`children`in e){let n={...t};return(e.type===`root`||mSe(e))&&(n.before=!0,n.after=!0),n.whitespace=bSe(e,t),uSe(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return lSe(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:v4(e),stripAtStart:!1,remove:!1}}function lSe(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&gSe(n.charAt(0))&&i++,i!==a&&gSe(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function uSe(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=cSe(i[o],{...t,after:dSe(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),pSe(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function dSe(e,t,n){for(;++t<e.length;){let n=e[t],r=fSe(n);if(r===void 0&&`children`in n&&!hSe(n)&&(r=dSe(n.children,-1)),typeof r==`boolean`)return r}return n}function fSe(e){if(e.type===`element`){if(pSe(e))return!1;if(mSe(e))return!0}else if(e.type===`text`){if(!p4(e))return!1}else if(!v4(e))return!1}function pSe(e){return f4(e)||l4(e,rSe)}function mSe(e){return l4(e,tSe)}function hSe(e){return!!(e.type===`element`&&e.properties.hidden)||v4(e)||l4(e,aSe)}function gSe(e){return e===` `||e===`
|
|
130
|
+
`}function _Se(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function vSe(){return` `}function ySe(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function bSe(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}var xSe,v4,SSe=o((()=>{Gxe(),d4(),m4(),_4(),nSe(),iSe(),oSe(),xSe={},v4=g4([`comment`,`doctype`])})),CSe=o((()=>{SSe()}));function wSe(e){return function(t){sSe(t,e)}}var TSe=o((()=>{CSe()})),ESe=o((()=>{TSe()}));function DSe(e){return e}var OSe=o((()=>{}));function kSe(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=g4(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+DSe(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=y4,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=ASe(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function ASe(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?y4:[e]}var y4,jSe,MSe=o((()=>{_4(),OSe(),y4=[],jSe=`skip`})),NSe=o((()=>{MSe()}));function b4(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),kSe(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var PSe=o((()=>{NSe()})),x4=o((()=>{PSe()}));function FSe(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function ISe(e){let t=C4(e),n=S4(e);if(t&&n)return{start:t,end:n}}var S4,C4,LSe=o((()=>{S4=FSe(`end`),C4=FSe(`start`)})),w4=o((()=>{LSe()}));function RSe(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}var zSe=o((()=>{}));function BSe(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}var VSe=o((()=>{}));function HSe(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}var USe=o((()=>{}));function WSe(e,t){let n={type:`break`};return e.patch(t,n),n}var GSe=o((()=>{})),T4,KSe=o((()=>{_4(),T4=(function(e,t,n){let r=g4(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]})})),qSe=o((()=>{KSe()}));function E4(e,t){let n=t||{},r=`children`in e?e.children:[],i=M4(e),a=$Se(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...XSe(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...JSe(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?k4(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
|
|
131
|
+
`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function JSe(e,t,n){return e.type===`element`?YSe(e,t,n):e.type===`text`?n.whitespace===`normal`?XSe(e,n):ZSe(e):[]}function YSe(e,t,n){let r=$Se(e,n),i=e.children||[],a=-1,o=[];if(iCe(e))return o;let s,c;for(k4(e)||j4(e)&&T4(t,e,j4)?c=`
|
|
132
|
+
`:rCe(e)?(s=2,c=2):M4(e)&&(s=1,c=1);++a<i.length;)o=o.concat(JSe(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?k4(i[a+1]):c}));return A4(e)&&T4(t,e,A4)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function XSe(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){D4.lastIndex=a;let e=D4.exec(n),i=e&&`index`in e?e.index:n.length;r.push(QSe(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function ZSe(e){return[String(e.value)]}function QSe(e,t,n){let r=[],i=0,a;for(;i<e.length;){O4.lastIndex=i;let n=O4.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function $Se(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function eCe(e){return!!(e.properties||{}).hidden}function tCe(e){return e.tagName===`td`||e.tagName===`th`}function nCe(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var D4,O4,k4,A4,rCe,j4,iCe,M4,aCe=o((()=>{qSe(),d4(),D4=/\n/g,O4=/[\t ]+/g,k4=u4(`br`),A4=u4(tCe),rCe=u4(`p`),j4=u4(`tr`),iCe=u4([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,eCe,nCe]),M4=u4(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`))})),N4=o((()=>{aCe()}));function oCe(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var sCe=o((()=>{}));function P4(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===cCe){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:oCe(E4(t))};return e.patch(t,o),o}var cCe,lCe=o((()=>{N4(),sCe(),cCe=`language-`}));function uCe(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}var dCe=o((()=>{}));function F4(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}var fCe=o((()=>{}));function I4(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}var pCe=o((()=>{}));function mCe(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[...hCe(e,r[i].titles),...hCe(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:I4(o),children:o};return e.patch(t,n),n}}function hCe(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,gCe);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:I4(r),children:r}]}function gCe(){return{type:`listItem`,spread:!1,checked:null,children:[]}}var _Ce=o((()=>{pCe()}));function L4(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}var vCe=o((()=>{}));function R4(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}var z4=o((()=>{}));function B4(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:R4(e.all(t))};return e.patch(t,n),n}var yCe=o((()=>{z4()}));function bCe(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}var xCe=o((()=>{}));function SCe(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}var CCe=o((()=>{}));function wCe(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}var TCe=o((()=>{}));function V4(e,t){let n={type:`inlineCode`,value:E4(t)};return e.patch(t,n),n}var ECe=o((()=>{N4()}));function DCe(e,t){let n=[],r=[],i=t||e.properties||{},a=OCe(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=E4(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function OCe(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...OCe(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var kCe=o((()=>{N4()}));function ACe(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||jCe:e.options.unchecked||MCe};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=DCe(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var jCe,MCe,NCe=o((()=>{kCe(),jCe=`[x]`,MCe=`[ ]`}));function PCe(e,t){let n=e.type===`element`&&FCe.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var FCe,ICe=o((()=>{FCe={}.hasOwnProperty})),LCe=o((()=>{ICe()}));function RCe(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!zCe.has(String(t[n])))return!1;return!0}var zCe,BCe=o((()=>{zCe=new Set([`pingback`,`prefetch`,`stylesheet`])})),VCe=o((()=>{BCe()}));function HCe(e){return!!(e.type===`text`||UCe(e)||f4(e)||RCe(e)||WCe(e)&&PCe(e,`itemProp`))}var UCe,WCe,GCe=o((()=>{Gxe(),LCe(),VCe(),d4(),UCe=u4(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),WCe=u4(`meta`)})),KCe=o((()=>{GCe()}));function H4(e,t){let{rest:n,checkbox:r}=JCe(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:qCe(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function qCe(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(HCe(r))continue;if(r.tagName===`p`||n||qCe(r))return!0;n=!0}}return!1}function JCe(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=JCe(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}var YCe=o((()=>{KCe()}));function U4(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),XCe),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:I4(r),children:r};return e.patch(t,a),a}function XCe(){return{type:`listItem`,spread:!1,checked:null,children:[]}}var ZCe=o((()=>{pCe()}));function W4(e,t){let n=t||twe;return QCe(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function QCe(e,t,n){if(ewe(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return $Ce(e.children,t,n)}return Array.isArray(e)?$Ce(e,t,n):``}function $Ce(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=QCe(e[i],t,n);return r.join(``)}function ewe(e){return!!(e&&typeof e==`object`)}var twe,nwe=o((()=>{twe={}})),G4=o((()=>{nwe()})),K4,rwe=o((()=>{_4(),K4=g4([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`])})),iwe=o((()=>{rwe()}));function q4(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!lwe(n)||`children`in n&&q4(n.children))return!0}return!1}function awe(e){return swe(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?p4(e.value):!1})?[]:[{type:`paragraph`,children:R4(e)}]}}function owe(e){return swe(e.children,t,n);function t(t){let n=J4(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=J4(e),r=J4(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function swe(e,t,n){let r=cwe(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];lwe(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function cwe(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&q4(r.children)?t.push(...owe(r)):t.push(r)}return t}function lwe(e){let t=e.data&&e.data.hName;return t?HCe({type:`element`,tagName:t,properties:{},children:[]}):K4(e)}function J4(e){return o4({...e,children:[]})}var Y4=o((()=>{s4(),KCe(),m4(),iwe(),z4()}));function uwe(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(b4({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||q4(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:W4(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}var dwe=o((()=>{G4(),x4(),Y4()}));function fwe(e,t){let n=R4(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var pwe=o((()=>{z4()}));function mwe(e,t){let n=e.options.quotes||hwe;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}var hwe,gwe=o((()=>{hwe=[`"`]}));function _we(e,t){let n=e.all(t);(e.options.document||q4(n))&&(n=awe(n));let r={type:`root`,children:n};return e.patch(t,r),r}var vwe=o((()=>{Y4()}));function ywe(e,t){let n=DCe(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}var bwe=o((()=>{kCe()}));function xwe(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}var Swe=o((()=>{}));function Cwe(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}var wwe=o((()=>{}));function Twe(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),Ewe)};return e.patch(t,n),n}function Ewe(){return{type:`tableCell`,children:[]}}var Dwe=o((()=>{}));function Owe(e,t){if(e.inTable){let n={type:`text`,value:E4(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=kwe(t),i=e.toSpecificContent(e.all(t),jwe);r&&i.unshift(jwe());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,Awe)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function kwe(e){let t={align:[null],headless:!0},n=0,r=0;return b4(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return jSe;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function Awe(){return{type:`tableCell`,children:[]}}function jwe(){return{type:`tableRow`,children:[]}}var Mwe=o((()=>{N4(),x4()}));function Nwe(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}var Pwe=o((()=>{}));function Fwe(e,t){let n={type:`text`,value:E4(t)};return e.patch(t,n),n}var Iwe=o((()=>{N4()}));function Lwe(e,t){let n={type:`text`,value:``};return e.patch(t,n),n}var Rwe=o((()=>{}));function X4(e,t){return e.all(t)}function Z4(e,t){return e.toFlow(e.all(t))}function Q4(){}var zwe,Bwe,Vwe=o((()=>{zSe(),VSe(),USe(),GSe(),lCe(),dCe(),fCe(),_Ce(),vCe(),yCe(),xCe(),CCe(),TCe(),ECe(),NCe(),YCe(),ZCe(),dwe(),pwe(),gwe(),vwe(),bwe(),Swe(),wwe(),Dwe(),Mwe(),Pwe(),Iwe(),Rwe(),zwe={comment:uCe,doctype:Q4,root:_we,text:Nwe},Bwe={applet:Q4,area:Q4,basefont:Q4,bgsound:Q4,caption:Q4,col:Q4,colgroup:Q4,command:Q4,content:Q4,datalist:Q4,dialog:Q4,element:Q4,embed:Q4,frame:Q4,frameset:Q4,isindex:Q4,keygen:Q4,link:Q4,math:Q4,menu:Q4,menuitem:Q4,meta:Q4,nextid:Q4,noembed:Q4,noframes:Q4,optgroup:Q4,option:Q4,param:Q4,script:Q4,shadow:Q4,source:Q4,spacer:Q4,style:Q4,svg:Q4,template:Q4,title:Q4,track:Q4,abbr:X4,acronym:X4,bdi:X4,bdo:X4,big:X4,blink:X4,button:X4,canvas:X4,cite:X4,data:X4,details:X4,dfn:X4,font:X4,ins:X4,label:X4,map:X4,marquee:X4,meter:X4,nobr:X4,noscript:X4,object:X4,output:X4,progress:X4,rb:X4,rbc:X4,rp:X4,rt:X4,rtc:X4,ruby:X4,slot:X4,small:X4,span:X4,sup:X4,sub:X4,tbody:X4,tfoot:X4,thead:X4,time:X4,address:Z4,article:Z4,aside:Z4,body:Z4,center:Z4,div:Z4,fieldset:Z4,figcaption:Z4,figure:Z4,form:Z4,footer:Z4,header:Z4,hgroup:Z4,html:Z4,legend:Z4,main:Z4,multicol:Z4,nav:Z4,picture:Z4,section:Z4,a:RSe,audio:uwe,b:xwe,base:BSe,blockquote:HSe,br:WSe,code:V4,dir:U4,dl:mCe,dt:H4,dd:H4,del:F4,em:L4,h1:B4,h2:B4,h3:B4,h4:B4,h5:B4,h6:B4,hr:bCe,i:L4,iframe:SCe,img:wCe,image:wCe,input:ACe,kbd:V4,li:H4,listing:P4,mark:L4,ol:U4,p:fwe,plaintext:P4,pre:P4,q:mwe,s:F4,samp:V4,select:ywe,strike:F4,strong:xwe,summary:fwe,table:Owe,td:Cwe,textarea:Fwe,th:Cwe,tr:Twe,tt:V4,u:L4,ul:U4,var:V4,video:uwe,wbr:Lwe,xmp:P4}}));function Hwe(e){return{all:Uwe,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...Bwe,...e.handlers},inTable:!1,nodeHandlers:{...zwe,...e.nodeHandlers},one:Wwe,options:e,patch:Gwe,qNesting:0,resolve:Kwe,toFlow:qwe,toSpecificContent:Jwe}}function Uwe(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function Wwe(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if($4.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if($4.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function Gwe(e,t){e.position&&(t.position=ISe(e))}function Kwe(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function qwe(e){return awe(e)}function Jwe(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var $4,Ywe=o((()=>{w4(),Vwe(),Y4(),$4={}.hasOwnProperty}));function Xwe(e,t){let n=o4(e),r=t||Zwe,i=wSe({newlines:r.newlines===!0}),a=Hwe(r),o;i(n),b4(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},b4(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var Zwe,Qwe=o((()=>{s4(),ESe(),x4(),Ywe(),Zwe={}})),$we=o((()=>{Qwe()}));function eTe(e,t){return e&&`run`in e?async function(n,r){let i=Xwe(n,{...e3,...t});await e.run(i,r)}:function(t){return Xwe(t,{...e3,...e})}}var e3,tTe=o((()=>{$we(),e3={document:!0}})),nTe=o((()=>{tTe()}));function t3(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var rTe=o((()=>{}));function n3(e){return e!==null&&(e<32||e===127)}function r3(e){return e!==null&&e<-2}function i3(e){return e!==null&&(e<0||e===32)}function a3(e){return e===-2||e===-1||e===32}function o3(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var s3,c3,iTe,l3,aTe,oTe,u3,d3,f3=o((()=>{s3=o3(/[A-Za-z]/),c3=o3(/[\dA-Za-z]/),iTe=o3(/[#-'*+\--9=?A-Z^-~]/),l3=o3(/\d/),aTe=o3(/[\dA-Fa-f]/),oTe=o3(/[!-/:-@[-`{-~]/),u3=o3(/\p{P}|\p{S}/u),d3=o3(/\s/)}));function sTe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var cTe=o((()=>{}));function lTe(e,t,n){let r=g4((n||{}).ignore||[]),i=uTe(t),a=-1;for(;++a<i.length;)kSe(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function uTe(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([dTe(e[0]),fTe(e[1])])}return t}function dTe(e){return typeof e==`string`?new RegExp(sTe(e),`g`):e}function fTe(e){return typeof e==`function`?e:function(){return e}}var pTe=o((()=>{cTe(),NSe(),_4()})),mTe=o((()=>{pTe()}));function hTe(){return{transforms:[STe],enter:{literalAutolink:_Te,literalAutolinkEmail:p3,literalAutolinkHttp:p3,literalAutolinkWww:p3},exit:{literalAutolink:xTe,literalAutolinkEmail:bTe,literalAutolinkHttp:vTe,literalAutolinkWww:yTe}}}function gTe(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:m3,notInConstruct:h3},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:m3,notInConstruct:h3},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:m3,notInConstruct:h3}]}}function _Te(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function p3(e){this.config.enter.autolinkProtocol.call(this,e)}function vTe(e){this.config.exit.autolinkProtocol.call(this,e)}function yTe(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function bTe(e){this.config.exit.autolinkEmail.call(this,e)}function xTe(e){this.exit(e)}function STe(e){lTe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,CTe],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,wTe]],{ignore:[`link`,`linkReference`]})}function CTe(e,t,n,r,i){let a=``;if(!DTe(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!TTe(n)))return!1;let o=ETe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function wTe(e,t,n,r){return!DTe(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function TTe(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ETe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=t3(e,`(`),a=t3(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function DTe(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||d3(n)||u3(n))&&(!t||n!==47)}var m3,h3,OTe=o((()=>{rTe(),d1(),f3(),mTe(),m3=`phrasing`,h3=[`autolink`,`link`,`image`,`label`]})),kTe=o((()=>{OTe()}));function g3(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var _3=o((()=>{}));function ATe(){this.buffer()}function jTe(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function MTe(){this.buffer()}function NTe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function PTe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=g3(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FTe(e){this.exit(e)}function ITe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=g3(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LTe(e){this.exit(e)}function RTe(){return`[`}function zTe(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function BTe(){return{enter:{gfmFootnoteCallString:ATe,gfmFootnoteCall:jTe,gfmFootnoteDefinitionLabelString:MTe,gfmFootnoteDefinition:NTe},exit:{gfmFootnoteCallString:PTe,gfmFootnoteCall:FTe,gfmFootnoteDefinitionLabelString:ITe,gfmFootnoteDefinition:LTe}}}function VTe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:zTe},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
133
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?UTe:HTe))),s(),o}}function HTe(e,t,n){return t===0?e:UTe(e,t,n)}function UTe(e,t,n){return(n?``:` `)+e}var WTe=o((()=>{d1(),_3(),zTe.peek=RTe})),GTe=o((()=>{WTe()}));function KTe(){return{canContainEols:[`delete`],enter:{strikethrough:JTe},exit:{strikethrough:YTe}}}function qTe(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:QTe}],handlers:{delete:XTe}}}function JTe(e){this.enter({type:`delete`,children:[]},e)}function YTe(e){this.exit(e)}function XTe(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function ZTe(){return`~`}var QTe,$Te=o((()=>{QTe=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],XTe.peek=ZTe})),eEe=o((()=>{$Te()}));function tEe(e){return e.length}function nEe(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||tEe,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=rEe(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=iEe(r[d]);else{let e=iEe(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
134
|
+
`)}function rEe(e){return e==null?``:String(e)}function iEe(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var aEe=o((()=>{}));function oEe(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&v3.call(t,e)){let n=String(t[e]);i=v3.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var v3,sEe=o((()=>{v3={}.hasOwnProperty}));function cEe(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)cEe(e,t.extensions[n]);for(r in t)if(dEe.call(t,r))switch(r){case`extensions`:break;case`unsafe`:lEe(e[r],t[r]);break;case`join`:lEe(e[r],t[r]);break;case`handlers`:uEe(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function lEe(e,t){t&&e.push(...t)}function uEe(e,t){t&&Object.assign(e,t)}var dEe,fEe=o((()=>{dEe={}.hasOwnProperty}));function pEe(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),mEe);return i(),o}function mEe(e,t,n){return`>`+(n?``:` `)+e}var hEe=o((()=>{}));function gEe(e,t){return _Ee(e,t.inConstruct,!0)&&!_Ee(e,t.notInConstruct,!1)}function _Ee(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}var vEe=o((()=>{}));function yEe(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
135
|
+
`&&gEe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
136
|
+
`}var bEe=o((()=>{vEe()}));function xEe(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}var SEe=o((()=>{}));function y3(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}var CEe=o((()=>{}));function wEe(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var TEe=o((()=>{}));function EEe(e,t,n,r){let i=wEe(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(y3(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,DEe);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(xEe(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
137
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
138
|
+
`),a&&(u+=s.move(a+`
|
|
139
|
+
`)),u+=s.move(c),l(),u}function DEe(e,t,n){return(n?``:` `)+e}var OEe=o((()=>{SEe(),CEe(),TEe()}));function b3(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var x3=o((()=>{}));function kEe(e,t,n,r){let i=b3(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
140
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}var AEe=o((()=>{x3()}));function jEe(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var MEe=o((()=>{}));function S3(e){return`&#x`+e.toString(16).toUpperCase()+`;`}var C3=o((()=>{}));function w3(e){if(e===null||i3(e)||d3(e))return 1;if(u3(e))return 2}var T3=o((()=>{f3()}));function E3(e,t,n){let r=w3(e),i=w3(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}var NEe=o((()=>{T3()}));function PEe(e,t,n,r){let i=jEe(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=E3(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=S3(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=E3(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+S3(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function FEe(e,t,n){return n.options.emphasis||`*`}var IEe=o((()=>{MEe(),C3(),NEe(),PEe.peek=FEe}));function LEe(e,t){let n=!1;return b4(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&W4(e)&&(t.options.setext||n))}var REe=o((()=>{x4(),G4()}));function zEe(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(LEe(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
141
|
+
`,after:`
|
|
142
|
+
`});return r(),t(),o+`
|
|
143
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
144
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
145
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=S3(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}var BEe=o((()=>{C3(),REe()}));function VEe(e){return e.value||``}function HEe(){return`<`}var UEe=o((()=>{VEe.peek=HEe}));function WEe(e,t,n,r){let i=b3(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function GEe(){return`!`}var KEe=o((()=>{x3(),WEe.peek=GEe}));function qEe(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function JEe(){return`!`}var YEe=o((()=>{qEe.peek=JEe}));function XEe(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function ZEe(){return"`"}var QEe=o((()=>{XEe.peek=ZEe}));function $Ee(e,t){let n=W4(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var eDe=o((()=>{G4()}));function tDe(e,t,n,r){let i=b3(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if($Ee(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function nDe(e,t,n){return $Ee(e,n)?`<`:`[`}var rDe=o((()=>{x3(),eDe(),tDe.peek=nDe}));function iDe(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function aDe(){return`[`}var oDe=o((()=>{iDe.peek=aDe}));function D3(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var O3=o((()=>{}));function sDe(e){let t=D3(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}var cDe=o((()=>{O3()}));function lDe(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var uDe=o((()=>{}));function dDe(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var fDe=o((()=>{}));function pDe(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?lDe(n):D3(n),s=e.ordered?o===`.`?`)`:`.`:sDe(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),dDe(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}var mDe=o((()=>{O3(),cDe(),uDe(),fDe()}));function hDe(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}var gDe=o((()=>{}));function _De(e,t,n,r){let i=hDe(n),a=n.bulletCurrent||D3(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}var vDe=o((()=>{O3(),gDe()}));function yDe(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var bDe=o((()=>{}));function xDe(e,t,n,r){return(e.children.some(function(e){return K4(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}var SDe=o((()=>{iwe()}));function CDe(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var wDe=o((()=>{}));function TDe(e,t,n,r){let i=CDe(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=E3(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=S3(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=E3(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+S3(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function EDe(e,t,n){return n.options.strong||`*`}var DDe=o((()=>{wDe(),C3(),NEe(),TDe.peek=EDe}));function ODe(e,t,n,r){return n.safe(e.value,r)}var kDe=o((()=>{}));function ADe(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}var jDe=o((()=>{}));function MDe(e,t,n){let r=(dDe(n)+(n.options.ruleSpaces?` `:``)).repeat(ADe(n));return n.options.ruleSpaces?r.slice(0,-1):r}var NDe=o((()=>{jDe(),fDe()})),k3,PDe=o((()=>{hEe(),bEe(),OEe(),AEe(),IEe(),BEe(),UEe(),KEe(),YEe(),QEe(),rDe(),oDe(),mDe(),vDe(),bDe(),SDe(),DDe(),kDe(),NDe(),k3={blockquote:pEe,break:yEe,code:EEe,definition:kEe,emphasis:PEe,hardBreak:yEe,heading:zEe,html:VEe,image:WEe,imageReference:qEe,inlineCode:XEe,link:tDe,linkReference:iDe,list:pDe,listItem:_De,paragraph:yDe,root:xDe,strong:TDe,text:ODe,thematicBreak:MDe}}));function FDe(e,t,n,r){if(t.type===`code`&&y3(t,r)&&(e.type===`list`||e.type===t.type&&y3(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&LEe(t,r))?void 0:n.spread?1:0}var IDe,LDe=o((()=>{CEe(),REe(),IDe=[FDe]})),A3,RDe,zDe=o((()=>{A3=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],RDe=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
|
|
146
|
+
`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:A3},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
|
|
147
|
+
]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:A3},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
|
|
148
|
+
*])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:A3},{atBreak:!0,character:`+`,after:`(?:[ \r
|
|
149
|
+
])`},{atBreak:!0,character:`-`,after:`(?:[ \r
|
|
150
|
+
-])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
|
|
151
|
+
]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:A3},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:A3},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:A3},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:A3},{atBreak:!0,character:`~`}]}));function j3(e){let t=`&`+e+`;`;M3.innerHTML=t;let n=M3.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}var M3,N3=o((()=>{M3=document.createElement(`i`)}));function BDe(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var VDe=o((()=>{}));function HDe(e){return e.replace(WDe,UDe)}function UDe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return BDe(n.slice(t?2:1),t?16:10)}return j3(n)||e}var WDe,GDe=o((()=>{N3(),VDe(),WDe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi}));function KDe(e){return e.label||!e.identifier?e.label||``:HDe(e.identifier)}var qDe=o((()=>{GDe()}));function JDe(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}var YDe=o((()=>{}));function XDe(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
|
|
152
|
+
`)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=S3(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+S3(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}var ZDe=o((()=>{C3()}));function QDe(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
|
|
153
|
+
`,after:`
|
|
154
|
+
`,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move($De(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function $De(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
|
|
155
|
+
`.repeat(1+a);if(a===!1)return`
|
|
156
|
+
|
|
157
|
+
<!---->
|
|
158
|
+
|
|
159
|
+
`}return`
|
|
160
|
+
|
|
161
|
+
`}var eOe=o((()=>{}));function tOe(e,t){let n=[],r=0,i=0,a;for(;a=nOe.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}var nOe,rOe=o((()=>{nOe=/\r?\n|\r/g}));function iOe(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!gEe(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(aOe);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(oOe(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(S3(r.charCodeAt(e))),c++))}return a.push(oOe(r.slice(c,l),n.after)),a.join(``)}function aOe(e,t){return e-t}function oOe(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}var sOe=o((()=>{C3(),vEe()}));function cOe(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}var lOe=o((()=>{}));function uOe(e,t){let n=t||{},r={associationId:KDe,containerPhrasing:mOe,containerFlow:hOe,createTracker:cOe,compilePattern:JDe,enter:a,handlers:{...k3},handle:void 0,indentLines:tOe,indexStack:[],join:[...IDe],options:{},safe:gOe,stack:[],unsafe:[...RDe]};cEe(r,n),r.options.tightDefinitions&&r.join.push(pOe),r.handle=oEe(`type`,{invalid:dOe,unknown:fOe,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
|
|
162
|
+
`,after:`
|
|
163
|
+
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
164
|
+
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function dOe(e){throw Error("Cannot handle value `"+e+"`, expected node")}function fOe(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function pOe(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function mOe(e,t){return XDe(e,this,t)}function hOe(e,t){return QDe(e,this,t)}function gOe(e,t){return iOe(this,e,t)}var _Oe=o((()=>{sEe(),fEe(),PDe(),LDe(),zDe(),qDe(),YDe(),ZDe(),eOe(),rOe(),sOe(),lOe()})),P3=o((()=>{_Oe(),PDe()}));function vOe(){return{enter:{table:yOe,tableData:SOe,tableHeader:SOe,tableRow:xOe},exit:{codeText:COe,table:bOe,tableData:F3,tableHeader:F3,tableRow:F3}}}function yOe(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function bOe(e){this.exit(e),this.data.inTable=void 0}function xOe(e){this.enter({type:`tableRow`,children:[]},e)}function F3(e){this.exit(e)}function SOe(e){this.enter({type:`tableCell`,children:[]},e)}function COe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,wOe));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function wOe(e,t){return t===`|`?t:e}function TOe(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
165
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
166
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return nEe(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=k3.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}var EOe=o((()=>{d1(),aEe(),P3()})),DOe=o((()=>{EOe()}));function OOe(){return{exit:{taskListCheckValueChecked:AOe,taskListCheckValueUnchecked:AOe,paragraph:jOe}}}function kOe(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:MOe}}}function AOe(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function jOe(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function MOe(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=k3.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}var NOe=o((()=>{d1(),P3()})),POe=o((()=>{NOe()}));function FOe(){return[hTe(),BTe(),KTe(),vOe(),OOe()]}function IOe(e){return{extensions:[gTe(),VTe(e),qTe(),TOe(e),kOe()]}}var LOe=o((()=>{kTe(),GTe(),eEe(),DOe(),POe()})),ROe=o((()=>{LOe()}));function I3(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function L3(e,t){return e.length>0?(I3(e,e.length,0,t),e):t}var R3=o((()=>{}));function zOe(e){let t={},n=-1;for(;++n<e.length;)BOe(t,e[n]);return t}function BOe(e,t){let n;for(n in t){let r=(z3.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){z3.call(r,a)||(r[a]=[]);let e=i[a];VOe(r[a],Array.isArray(e)?e:e?[e]:[])}}}function VOe(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);I3(e,0,0,r)}var z3,HOe=o((()=>{R3(),z3={}.hasOwnProperty}));function UOe(){return{text:J3}}function WOe(e,t,n){let r=this,i,a;return o;function o(t){return!B3(t)||!eke.call(r,r.previous)||V3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return B3(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(nke,u,l)(t):t===45||t===95||c3(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&s3(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function GOe(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!QOe.call(r,r.previous)||V3(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(tke,e.attempt(H3,e.attempt(U3,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function KOe(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&$Oe.call(r,r.previous)&&!V3(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(s3(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||n3(t)||i3(t)||d3(t)||u3(t)?n(t):e.attempt(H3,e.attempt(U3,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function qOe(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function JOe(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(W3,c,s)(t):t===null||i3(t)||d3(t)||t!==45&&u3(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function YOe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(W3,t,a)(o):o===null||i3(o)||d3(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function XOe(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||i3(o)||d3(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||i3(e)||d3(e)?t(e):r(e)}function a(e){return s3(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):s3(t)?(e.consume(t),o):n(t)}}function ZOe(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return c3(e)?n(e):t(e)}}function QOe(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||i3(e)}function $Oe(e){return!s3(e)}function eke(e){return!(e===47||B3(e))}function B3(e){return e===43||e===45||e===46||e===95||c3(e)}function V3(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var tke,H3,U3,W3,nke,G3,K3,q3,J3,Y3,rke=o((()=>{for(f3(),tke={tokenize:qOe,partial:!0},H3={tokenize:JOe,partial:!0},U3={tokenize:YOe,partial:!0},W3={tokenize:XOe,partial:!0},nke={tokenize:ZOe,partial:!0},G3={name:`wwwAutolink`,tokenize:GOe,previous:QOe},K3={name:`protocolAutolink`,tokenize:KOe,previous:$Oe},q3={name:`emailAutolink`,tokenize:WOe,previous:eke},J3={},Y3=48;Y3<123;)J3[Y3]=q3,Y3++,Y3===58?Y3=65:Y3===91&&(Y3=97);J3[43]=q3,J3[45]=q3,J3[46]=q3,J3[95]=q3,J3[72]=[q3,K3],J3[104]=[q3,K3],J3[87]=[q3,G3],J3[119]=[q3,G3]}));function X3(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&c3(e.charCodeAt(n+1))&&c3(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}var Z3=o((()=>{f3()})),ike=o((()=>{rke()}));function Q3(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var $3=o((()=>{}));function ake(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};ske(d,-c),ske(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=L3(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=L3(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=L3(l,Q3(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=L3(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=L3(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,I3(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function oke(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=w3(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=w3(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function ske(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var e6,cke=o((()=>{R3(),T3(),$3(),e6={name:`attention`,resolveAll:ake,tokenize:oke}}));function lke(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return s3(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||c3(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||c3(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||n3(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):iTe(t)?(e.consume(t),l):n(t)}function u(e){return c3(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||c3(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var uke,dke=o((()=>{f3(),uke={name:`autolink`,tokenize:lke}}));function t6(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return a3(r)?(e.enter(n),s(r)):t(r)}function s(r){return a3(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var n6=o((()=>{f3()}));function fke(e,t,n){return r;function r(t){return a3(t)?t6(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||r3(e)?t(e):n(e)}}var r6,i6=o((()=>{n6(),f3(),r6={partial:!0,tokenize:fke}}));function pke(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return a3(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function mke(e,t,n){let r=this;return i;function i(t){return a3(t)?t6(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(a6,t,n)(r)}}function hke(e){e.exit(`blockQuote`)}var a6,gke=o((()=>{n6(),f3(),a6={continuation:{tokenize:mke},exit:hke,name:`blockQuote`,tokenize:pke}}));function _ke(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return oTe(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var o6,vke=o((()=>{f3(),o6={name:`characterEscape`,tokenize:_ke}}));function yke(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=c3,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=aTe,u):(e.enter(`characterReferenceValue`),a=7,o=l3,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===c3&&!j3(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var s6,bke=o((()=>{N3(),f3(),s6={name:`characterReference`,tokenize:yke}}));function xke(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),a3(t)?t6(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||r3(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(c6,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||r3(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):a3(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),t6(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||r3(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||r3(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&a3(t)?t6(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||r3(t)?e.check(c6,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||r3(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),a3(t)?t6(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),a3(t)?t6(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||r3(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Ske(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var c6,l6,Cke=o((()=>{n6(),f3(),c6={partial:!0,tokenize:Ske},l6={concrete:!0,name:`codeFenced`,tokenize:xke}}));function wke(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),t6(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):r3(t)?e.attempt(Eke,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||r3(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Tke(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):r3(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):t6(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):r3(e)?i(e):n(e)}}var u6,Eke,Dke=o((()=>{n6(),f3(),u6={name:`codeIndented`,tokenize:wke},Eke={partial:!0,tokenize:Tke}}));function Oke(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function kke(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ake(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):r3(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||r3(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var jke,Mke=o((()=>{f3(),jke={name:`codeText`,previous:kke,resolve:Oke,tokenize:Ake}}));function d6(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}var Nke,Pke=o((()=>{Nke=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&d6(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),d6(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),d6(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);d6(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);d6(this.left,t.reverse())}}}}));function Fke(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Nke(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ike(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return I3(e,0,1/0,u.slice(0)),!l}function Ike(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Lke=o((()=>{R3(),Pke()}));function Rke(e){return Fke(e),e}function zke(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):r3(t)?e.check(Hke,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Bke(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),t6(e,a,`linePrefix`)}function a(i){if(i===null||r3(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}var Vke,Hke,Uke=o((()=>{n6(),f3(),Lke(),Vke={resolve:Rke,tokenize:zke},Hke={partial:!0,tokenize:Bke}}));function Wke(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||n3(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||r3(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||i3(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||n3(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}var Gke=o((()=>{f3()}));function Kke(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):r3(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||r3(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!a3(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}var qke=o((()=>{f3()}));function Jke(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):r3(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),t6(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||r3(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}var Yke=o((()=>{n6(),f3()}));function f6(e,t){let n;return r;function r(i){return r3(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):a3(i)?t6(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Xke=o((()=>{n6(),f3()}));function Zke(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Kke.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=g3(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return i3(t)?f6(e,l)(t):l(t)}function l(t){return Wke(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(eAe,d,d)(t)}function d(t){return a3(t)?t6(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||r3(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Qke(e,t,n){return r;function r(t){return i3(t)?f6(e,i)(t):n(t)}function i(t){return Jke(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return a3(t)?t6(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||r3(e)?t(e):n(e)}}var $ke,eAe,tAe=o((()=>{Gke(),qke(),n6(),Yke(),Xke(),f3(),_3(),$ke={name:`definition`,tokenize:Zke},eAe={partial:!0,tokenize:Qke}}));function nAe(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return r3(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var rAe,iAe=o((()=>{f3(),rAe={name:`hardBreakEscape`,tokenize:nAe}}));function aAe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},I3(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function oAe(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||i3(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||r3(n)?(e.exit(`atxHeading`),t(n)):a3(n)?t6(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||i3(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var sAe,cAe=o((()=>{n6(),f3(),R3(),sAe={name:`headingAtx`,resolve:aAe,tokenize:oAe}})),lAe,p6,uAe=o((()=>{lAe=`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.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),p6=[`pre`,`script`,`style`,`textarea`]}));function dAe(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function fAe(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:j):s3(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):s3(a)?(e.consume(a),i=4,r.interrupt?t:j):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:j):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return s3(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||i3(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&p6.includes(l)?(i=1,r.interrupt?t(s):O(s)):lAe.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||c3(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return a3(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||s3(t)?(e.consume(t),b):a3(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||c3(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):a3(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):a3(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||r3(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||i3(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||a3(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||r3(t)?O(t):a3(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),te):t===60&&i===1?(e.consume(t),ne):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),j):t===93&&i===5?(e.consume(t),ie):r3(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(gAe,oe,ee)(t)):t===null||r3(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),O)}function ee(t){return e.check(_Ae,k,oe)(t)}function k(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return t===null||r3(t)?ee(t):(e.enter(`htmlFlowData`),O(t))}function te(t){return t===45?(e.consume(t),j):O(t)}function ne(t){return t===47?(e.consume(t),o=``,re):O(t)}function re(t){if(t===62){let n=o.toLowerCase();return p6.includes(n)?(e.consume(t),ae):O(t)}return s3(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):O(t)}function ie(t){return t===93?(e.consume(t),j):O(t)}function j(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),j):O(t)}function ae(t){return t===null||r3(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function pAe(e,t,n){let r=this;return i;function i(t){return r3(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function mAe(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(r6,t,n)}}var hAe,gAe,_Ae,vAe=o((()=>{f3(),uAe(),i6(),hAe={concrete:!0,name:`htmlFlow`,resolveTo:dAe,tokenize:fAe},gAe={partial:!0,tokenize:mAe},_Ae={partial:!0,tokenize:pAe}}));function yAe(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):s3(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):s3(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):r3(t)?(o=d,ne(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?te(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):r3(t)?(o=h,ne(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?te(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?te(t):r3(t)?(o=v,ne(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):r3(t)?(o=y,ne(t)):(e.consume(t),y)}function b(e){return e===62?te(e):y(e)}function x(t){return s3(t)?(e.consume(t),S):n(t)}function S(t){return t===45||c3(t)?(e.consume(t),S):C(t)}function C(t){return r3(t)?(o=C,ne(t)):a3(t)?(e.consume(t),C):te(t)}function w(t){return t===45||c3(t)?(e.consume(t),w):t===47||t===62||i3(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),te):t===58||t===95||s3(t)?(e.consume(t),E):r3(t)?(o=T,ne(t)):a3(t)?(e.consume(t),T):te(t)}function E(t){return t===45||t===46||t===58||t===95||c3(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):r3(t)?(o=D,ne(t)):a3(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ee):r3(t)?(o=O,ne(t)):a3(t)?(e.consume(t),O):(e.consume(t),k)}function ee(t){return t===i?(e.consume(t),i=void 0,A):t===null?n(t):r3(t)?(o=ee,ne(t)):(e.consume(t),ee)}function k(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||i3(t)?T(t):(e.consume(t),k)}function A(e){return e===47||e===62||i3(e)?T(e):n(e)}function te(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ne(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return a3(t)?t6(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var bAe,xAe=o((()=>{n6(),f3(),bAe={name:`htmlText`,tokenize:yAe}}));function SAe(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&I3(e,0,e.length,n),e}function CAe(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=L3(s,e.slice(a+1,a+r+3)),s=L3(s,[[`enter`,u,t]]),s=L3(s,Q3(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=L3(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=L3(s,e.slice(o+1)),s=L3(s,[[`exit`,c,t]]),I3(e,a,e.length,s),e}function wAe(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(g3(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(OAe,u,o?u:d)(t):t===91?e.attempt(kAe,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(AAe,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function TAe(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return i3(t)?f6(e,a)(t):a(t)}function a(t){return t===41?u(t):Wke(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return i3(t)?f6(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Jke(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return i3(t)?f6(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function EAe(e,t,n){let r=this;return i;function i(t){return Kke.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(g3(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function DAe(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var m6,OAe,kAe,AAe,h6=o((()=>{Gke(),qke(),Yke(),Xke(),f3(),R3(),_3(),$3(),m6={name:`labelEnd`,resolveAll:SAe,resolveTo:CAe,tokenize:wAe},OAe={tokenize:TAe},kAe={tokenize:EAe},AAe={tokenize:DAe}}));function jAe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var MAe,NAe=o((()=>{h6(),MAe={name:`labelStartImage`,resolveAll:m6.resolveAll,tokenize:jAe}}));function PAe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var FAe,IAe=o((()=>{h6(),FAe={name:`labelStartLink`,resolveAll:m6.resolveAll,tokenize:PAe}}));function LAe(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),t6(e,t,`linePrefix`)}}var g6,RAe=o((()=>{n6(),g6={name:`lineEnding`,tokenize:LAe}}));function zAe(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||r3(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),a3(t)?t6(e,s,`whitespace`)(t):s(t))}}var _6,BAe=o((()=>{n6(),f3(),_6={name:`thematicBreak`,tokenize:zAe}}));function VAe(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:l3(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(_6,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return l3(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(r6,r.interrupt?n:u,e.attempt(KAe,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return a3(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function HAe(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(r6,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,t6(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!a3(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(qAe,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,t6(e,e.attempt(v6,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function UAe(e,t,n){let r=this;return t6(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function WAe(e){e.exit(this.containerState.type)}function GAe(e,t,n){let r=this;return t6(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!a3(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var v6,KAe,qAe,JAe=o((()=>{n6(),f3(),i6(),BAe(),v6={continuation:{tokenize:HAe},exit:WAe,name:`list`,tokenize:VAe},KAe={partial:!0,tokenize:GAe},qAe={partial:!0,tokenize:UAe}}));function YAe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function XAe(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),a3(t)?t6(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||r3(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var y6,ZAe=o((()=>{n6(),f3(),y6={name:`setextUnderline`,resolveTo:YAe,tokenize:XAe}})),b6=o((()=>{cke(),dke(),i6(),gke(),vke(),bke(),Cke(),Dke(),Mke(),Uke(),tAe(),iAe(),cAe(),vAe(),xAe(),h6(),NAe(),IAe(),RAe(),JAe(),ZAe(),BAe()}));function QAe(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:nje,continuation:{tokenize:rje},exit:ije}},text:{91:{name:`gfmFootnoteCall`,tokenize:tje},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:$Ae,resolveTo:eje}}}}function $Ae(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=g3(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function eje(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function tje(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||i3(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(g3(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return i3(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function nje(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||i3(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=g3(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return i3(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),t6(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function rje(e,t,n){return e.check(r6,t,e.attempt(oje,t,n))}function ije(e){e.exit(`gfmFootnoteDefinition`)}function aje(e,t,n){let r=this;return t6(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}var oje,sje=o((()=>{b6(),n6(),f3(),_3(),oje={tokenize:aje,partial:!0}})),cje=o((()=>{sje()}));function lje(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&I3(o,o.length,0,Q3(s,e.slice(r+1,n),t)),I3(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),I3(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=w3(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=w3(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var uje=o((()=>{R3(),T3(),$3()})),dje=o((()=>{uje()}));function fje(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}var pje,mje=o((()=>{pje=class{constructor(){this.map=[]}add(e,t,n){fje(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}}));function hje(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}var gje=o((()=>{}));function _je(){return{flow:{null:{name:`table`,tokenize:vje,resolveAll:yje}}}}function vje(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):r3(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):a3(t)?t6(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||i3(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,a3(t)?t6(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return a3(t)?t6(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||r3(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return a3(t)?t6(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||r3(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||r3(n)?(e.exit(`tableRow`),t(n)):a3(n)?t6(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||i3(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function yje(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new pje;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(bje(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=x6(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=x6(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=x6(f,t,o,i,n,d)):(o[0]=o[1],d=x6(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&bje(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=hje(t.events,n))}return e}function x6(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},S6(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=S6(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=S6(t.events,n[2]),a=S6(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},S6(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function bje(e,t,n,r,i){let a=[],o=S6(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function S6(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var xje=o((()=>{n6(),f3(),mje(),gje()})),Sje=o((()=>{xje()}));function Cje(){return{text:{91:Eje}}}function wje(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return i3(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return r3(r)?t(r):a3(r)?e.check({tokenize:Tje},t,n)(r):n(r)}}function Tje(e,t,n){return t6(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}var Eje,Dje=o((()=>{n6(),f3(),Eje={name:`tasklistCheck`,tokenize:wje}})),Oje=o((()=>{Dje()}));function kje(e){return zOe([UOe(),QAe(),lje(e),_je(),Cje()])}var Aje=o((()=>{HOe(),ike(),cje(),dje(),Sje(),Oje()}));function jje(e){let t=this,n=e||Mje,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(kje(n)),a.push(FOe()),o.push(IOe(n))}var Mje,Nje=o((()=>{ROe(),Aje(),Mje={}})),Pje=o((()=>{Nje()}));function Fje(e){let t=this;t.compiler=n;function n(n){return uOe(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}var Ije=o((()=>{P3()})),Lje=o((()=>{Ije()}));function Rje(e){if(e)throw e}var zje=o((()=>{})),Bje=s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function C6(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var Vje=o((()=>{}));function Hje(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Uje(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Uje(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Wje=o((()=>{})),Gje=o((()=>{Wje()})),Kje,qje=o((()=>{Kje=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r})}));function w6(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function T6(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function E6(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Jje(e){if(!C6(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Yje(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function D6(e){return Xje(e)?e:new $2(e)}function Xje(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Zje(e){return typeof e==`string`||Qje(e)}function Qje(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var O6,$je,eMe,k6,tMe=o((()=>{zje(),O6=u(Bje(),1),d1(),Vje(),Gje(),pxe(),qje(),$je={}.hasOwnProperty,eMe=class e extends Kje{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Hje()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,O6.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(E6(`data`,this.frozen),this.namespace[e]=t,this):$je.call(this.namespace,e)&&this.namespace[e]||void 0:e?(E6(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=D6(e),n=this.parser||this.Parser;return w6(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),w6(`process`,this.parser||this.Parser),T6(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=D6(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Zje(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),w6(`processSync`,this.parser||this.Parser),T6(`processSync`,this.compiler||this.Compiler),this.process(e,r),Yje(`processSync`,`process`,t),n;function r(e,r){t=!0,Rje(e),n=r}}run(e,t,n){Jje(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=D6(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Yje(`runSync`,`run`,n),r;function i(e,t){Rje(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=D6(t),r=this.compiler||this.Compiler;return T6(`stringify`,r),Jje(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(E6(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,O6.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];C6(o)&&C6(r)&&(r=(0,O6.default)(!0,o,r)),n[i]=[e,r,...a]}}}},k6=new eMe().freeze()})),nMe=o((()=>{tMe()}));function rMe(e,t){return iMe(e,t||{})||{type:`root`,children:[]}}function iMe(e,t){let n=aMe(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function aMe(e,t){switch(e.nodeType){case 1:return uMe(e,t);case 3:return cMe(e);case 8:return lMe(e);case 9:return oMe(e,t);case 10:return sMe();case 11:return oMe(e,t);default:return}}function oMe(e,t){return{type:`root`,children:dMe(e,t)}}function sMe(){return{type:`doctype`}}function cMe(e){return{type:`text`,value:e.nodeValue||``}}function lMe(e){return{type:`comment`,value:e.nodeValue||``}}function uMe(e,t){let n=e.namespaceURI,r=n===d0.svg?c0:s0,i=n===d0.html?e.tagName.toLowerCase():e.tagName,a=n===d0.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,dMe(a,t))}function dMe(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=iMe(n[i],t);e!==void 0&&r.push(e)}return r}var fMe=o((()=>{l0(),f0()})),pMe=o((()=>{fMe()}));function mMe(e){let t=Array.from(e.classList).filter(e=>!e.startsWith(`bn-`))||[];t.length>0?e.className=t.join(` `):e.removeAttribute(`class`)}function hMe(e,t,n,r){let i;if(t)if(typeof t==`string`)i=fX([t],e.pmSchema);else if(Array.isArray(t))i=fX(t,e.pmSchema);else if(t.type===`tableContent`)i=pX(t,e.pmSchema);else throw new _X(t.type);else throw Error(`blockContent is required`);let a=(r?.document??document).createDocumentFragment();for(let t of i)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let i=e.schema.inlineContentSpecs[t.type.name].implementation;if(i){let o=QY(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=i.toExternalHTML?i.toExternalHTML(o,e):i.render.call({renderType:`dom`,props:void 0},o,()=>{},e);if(s){if(a.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,r);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=(e.schema.styleSpecs[r.type.name].implementation.toExternalHTML??e.schema.styleSpecs[r.type.name].implementation.render)(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=mj.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}a.appendChild(n)}else{let e=n.serializeFragment(L.from([t]),r);a.appendChild(e)}return a.childNodes.length===1&&a.firstChild?.nodeType===1&&mMe(a.firstChild),a}function gMe(e,t,n,r,i,a,o,s){var c,l;let u=s?.document??document,d=t.pmSchema.nodes.blockContainer,f=n.props||{};for(let[e,r]of Object.entries(t.schema.blockSchema[n.type].propSchema))!(e in f)&&r.default!==void 0&&(f[e]=r.default);let p=((c=d.spec)?.toDOM)?.call(c,d.create({id:n.id,...f})),m=Array.from(p.dom.attributes),h=t.blockImplementations[n.type].implementation,g=h.toExternalHTML?.call({},{...n,props:f},t,{nestingLevel:o})||h.render.call({},{...n,props:f},t),_=u.createDocumentFragment();if(g.dom.classList.contains(`bn-block-content`)){let e=[...m,...Array.from(g.dom.attributes)].filter(e=>e.name.startsWith(`data`)&&e.name!==`data-content-type`&&e.name!==`data-file-block`&&e.name!==`data-node-view-wrapper`&&e.name!==`data-node-type`&&e.name!==`data-id`&&e.name!==`data-editable`);for(let t of e)g.dom.firstChild.setAttribute(t.name,t.value);mMe(g.dom.firstChild),o>0&&g.dom.firstChild.setAttribute(`data-nesting-level`,o.toString()),_.append(...Array.from(g.dom.childNodes))}else _.append(g.dom),o>0&&g.dom.setAttribute(`data-nesting-level`,o.toString());if(g.contentDOM&&n.content){let e=hMe(t,n.content,r,s);g.contentDOM.appendChild(e)}let v;if(i.has(n.type)?v=`OL`:a.has(n.type)&&(v=`UL`),v){if(e.lastChild?.nodeName!==v){let t=u.createElement(v);v===`OL`&&`start`in f&&f.start&&f?.start!==1&&t.setAttribute(`start`,f.start+``),e.append(t)}e.lastChild.appendChild(_)}else e.append(_);if(n.children&&n.children.length>0){let c=u.createDocumentFragment();if(P6(c,t,n.children,r,i,a,o+1,s),e.lastChild?.nodeName===`UL`||e.lastChild?.nodeName===`OL`)for(;c.firstChild?.nodeName===`UL`||c.firstChild?.nodeName===`OL`;)e.lastChild.lastChild.appendChild(c.firstChild);`childrenDOM`in g&&g.childrenDOM?g.childrenDOM.append(c):t.pmSchema.nodes[n.type].isInGroup(`blockContent`)?e.append(c):(l=g.contentDOM)==null||l.append(c)}}function _Me(e,t){if(t===0)return;let n=e.resolve(t);for(let e=n.depth;e>0;e--){let t=n.node(e);if(YZ(t))return t.attrs.id}}function vMe(e){return e.getMeta(`paste`)?{type:`paste`}:e.getMeta(`uiEvent`)===`drop`?{type:`drop`}:e.getMeta(`history$`)?{type:e.getMeta(`history$`).redo?`redo`:`undo`}:e.getMeta(`y-sync$`)?e.getMeta(`y-sync$`).isUndoRedoOperation?{type:`undo-redo`}:{type:`yjs-remote`}:{type:`local`}}function yMe(e){let t={},n={},r=UY(e);return e.descendants((i,a)=>{if(!YZ(i))return!0;let o=_Me(e,a),s=o??`__root__`;n[s]||(n[s]=[]);let c=$Y(i,r);return t[i.attrs.id]={block:c,parentId:o},n[s].push(i.attrs.id),!0}),{byId:t,childrenByParent:n}}function bMe(e,t){let n=new Set;if(!e||!t)return n;let r=new Set(e),i=t.filter(e=>r.has(e)),a=e.filter(e=>i.includes(e));if(a.length<=1||i.length<=1)return n;let o={};for(let e=0;e<a.length;e++)o[a[e]]=e;let s=i.map(e=>o[e]),c=s.length,l=[],u=[],d=Array(c).fill(-1),f=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n};for(let e=0;e<c;e++){let t=s[e],n=f(l,t);n>0&&(d[e]=u[n-1]),n===l.length?(l.push(t),u.push(e)):(l[n]=t,u[n]=e)}let p=new Set,m=u[u.length-1]??-1;for(;m!==-1;)p.add(m),m=d[m];for(let e=0;e<i.length;e++)p.has(e)||n.add(i[e]);return n}function xMe(e,t=[]){let n=vMe(e),r=MK(e.before,[e,...t]),i=yMe(r.before),a=yMe(r.doc),o=[],s=new Set;Object.keys(a.byId).filter(e=>!(e in i.byId)).forEach(e=>{o.push({type:`insert`,block:a.byId[e].block,source:n,prevBlock:void 0}),s.add(e)}),Object.keys(i.byId).filter(e=>!(e in a.byId)).forEach(e=>{o.push({type:`delete`,block:i.byId[e].block,source:n,prevBlock:void 0}),s.add(e)}),Object.keys(a.byId).filter(e=>e in i.byId).forEach(e=>{let t=i.byId[e],r=a.byId[e];t.parentId===r.parentId?(0,qMe.default)({...t.block,children:void 0},{...r.block,children:void 0})||(o.push({type:`update`,block:r.block,prevBlock:t.block,source:n}),s.add(e)):(o.push({type:`move`,block:r.block,prevBlock:t.block,source:n,prevParent:t.parentId?i.byId[t.parentId]?.block:void 0,currentParent:r.parentId?a.byId[r.parentId]?.block:void 0}),s.add(e))});let c=i.childrenByParent,l=a.childrenByParent,u=new Set([...Object.keys(c),...Object.keys(l)]),d=new Set;return u.forEach(e=>{let t=bMe(c[e],l[e]);t.size!==0&&t.forEach(t=>{let r=i.byId[t],c=a.byId[t];!r||!c||r.parentId!==c.parentId||s.has(t)||(r.parentId??`__root__`)!==e||d.has(t)||(d.add(t),o.push({type:`move`,block:c.block,prevBlock:r.block,source:n,prevParent:r.parentId?i.byId[r.parentId]?.block:void 0,currentParent:c.parentId?a.byId[c.parentId]?.block:void 0}),s.add(t))})}),o}function SMe(e){let t=e.charAt(0)===`#`?e.substring(1,7):e,n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),a=[n/255,r/255,i/255].map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return .2126*a[0]+.7152*a[1]+.0722*a[2]<=.179}function CMe(e){let t=document.createElement(`span`);t.classList.add(`bn-collaboration-cursor__base`);let n=document.createElement(`span`);n.setAttribute(`contentedEditable`,`false`),n.classList.add(`bn-collaboration-cursor__caret`),n.setAttribute(`style`,`background-color: ${e.color}; color: ${SMe(e.color)?`white`:`black`}`);let r=document.createElement(`span`);return r.classList.add(`bn-collaboration-cursor__label`),r.setAttribute(`style`,`background-color: ${e.color}; color: ${SMe(e.color)?`white`:`black`}`),r.insertBefore(document.createTextNode(e.name),null),n.insertBefore(r,null),t.insertBefore(document.createTextNode(``),null),t.insertBefore(n,null),t.insertBefore(document.createTextNode(``),null),t}function wMe(e,t){let n=e.doc;if(e._item===null){let r=Array.from(n.share.keys()).find(t=>n.share.get(t)===e);if(r==null)throw Error(`type does not exist in other ydoc`);return t.get(r,e.constructor)}else{let n=e._item,r=t.store.clients.get(n.id.client)??[];return r[$B(r,n.id.clock)].content.type}}function TMe(e,t){return!e||!t?!1:!!e.closest(`.${t}`)}function EMe(e,t,n,r,i){let a=e.state.doc.resolve(t.pos);if(a.parent.inlineContent||t.orientation===`inline`)return null;let o=a.nodeBefore,s=a.nodeAfter;if(!o&&!s)return null;let c=t.orientation===`block-vertical-left`||t.orientation===`block-vertical-right`,l=c?t.pos:t.pos-(o?o.nodeSize:0),u=e.nodeDOM(l);if(!u)return null;let d=u.getBoundingClientRect();if(c){let e=n/2*r,i=t.orientation===`block-vertical-left`?d.left:d.right;return{left:i-e,right:i+e,top:d.top,bottom:d.bottom}}let f=o?d.bottom:d.top;o&&s&&(f=(f+e.nodeDOM(t.pos).getBoundingClientRect().top)/2);let p=n/2*i;return{left:d.left,right:d.right,top:f-p,bottom:f+p}}function DMe(e,t,n,r){let i=e.coordsAtPos(t.pos),a=n/2*r;return{left:i.left-a,right:i.left+a,top:i.top,bottom:i.bottom}}function OMe(e,t){e.classList.toggle(`prosemirror-dropcursor-inline`,t===`inline`),e.classList.toggle(`prosemirror-dropcursor-block-horizontal`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-left`,t===`block-vertical-left`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-right`,t===`block-vertical-right`),e.classList.toggle(`prosemirror-dropcursor-block`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-vertical`,t===`block-vertical-left`||t===`block-vertical-right`)}function kMe(e){if(!e||e===document.body&&getComputedStyle(e).position===`static`)return{parentLeft:-window.pageXOffset,parentTop:-window.pageYOffset};let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return{parentLeft:t.left-e.scrollLeft*n,parentTop:t.top-e.scrollTop*r}}function AMe(e,t){for(;e&&e.parentElement&&e.parentElement!==t.dom&&e.getAttribute?.call(e,`data-node-type`)!==`blockContainer`;)e=e.parentElement;if(e.getAttribute?.call(e,`data-node-type`)===`blockContainer`)return{node:e,id:e.getAttribute(`data-id`)}}function jMe(){let e=t=>{let n=t.children.length;for(let r=0;r<n;r++){let i=t.children[r];if(i.type===`element`&&(e(i),i.tagName===`u`))if(i.children.length>0){t.children.splice(r,1,...i.children);let e=i.children.length-1;n+=e,r+=e}else t.children.splice(r,1),n--,r--}};return e}function MMe(){let e=t=>{if(t.children&&`length`in t.children&&t.children.length)for(let n=t.children.length-1;n>=0;n--){let r=t.children[n],i=n+1<t.children.length?t.children[n+1]:void 0;r.type===`element`&&r.tagName===`input`&&r.properties?.type===`checkbox`&&i?.type===`element`&&i.tagName===`p`?(i.tagName=`span`,i.children.splice(0,0,rMe(document.createTextNode(` `)))):e(r)}};return e}function NMe(){return e=>{b4(e,`element`,(e,t,n)=>{if(n&&e.tagName===`video`){let r=e.properties?.src||e.properties?.[`data-url`]||``,i=e.properties?.title||e.properties?.[`data-name`]||``;n.children[t]={type:`text`,value:``}}})}}function A6(e){return k6().use(kxe,{fragment:!0}).use(NMe).use(jMe).use(MMe).use(eTe).use(jje).use(Fje,{handlers:{text:e=>e.value}}).processSync(e).value}function PMe(e,t,n,r){return A6(F6(t,n).exportBlocks(e,r))}function FMe(e){let t=[];return e.descendants(e=>{var n;let r=UY(e);return e.type.name===`blockContainer`&&e.firstChild?.type.name===`blockGroup`?!0:e.type.name===`columnList`&&e.childCount===1?((n=e.firstChild)==null||n.forEach(e=>{t.push($Y(e,r))}),!1):e.type.isInGroup(`bnBlock`)?(t.push($Y(e,r)),!1):!0}),t}function IMe(e,t){let n,r,i=t.resolve(e.from).node().type.spec.group===`blockContent`,a=t.resolve(e.to).node().type.spec.group===`blockContent`,o=Math.min(e.$anchor.depth,e.$head.depth);if(i&&a){let i=e.$from.start(o-1),a=e.$to.end(o-1);n=t.resolve(i-1).pos,r=t.resolve(a+1).pos}else n=e.from,r=e.to;return{from:n,to:r}}function LMe(e,t,n=t){t===n&&(n+=e.state.doc.resolve(t+1).node().nodeSize);let r=e.domAtPos(t).node.cloneNode(!0),i=e.domAtPos(t).node,a=(e,t)=>Array.prototype.indexOf.call(e.children,t),o=a(i,e.domAtPos(t+1).node.parentElement),s=a(i,e.domAtPos(n-1).node.parentElement);for(let e=i.childElementCount-1;e>=0;e--)(e>s||e<o)&&r.removeChild(r.children[e]);RMe(e.root),q6=r;let c=q6.getElementsByTagName(`iframe`);for(let e=0;e<c.length;e++){let t=c[e],n=t.parentElement;n&&n.removeChild(t)}let l=e.dom.className.split(` `).filter(e=>e!==`ProseMirror`&&e!==`bn-root`&&e!==`bn-editor`).join(` `);q6.className=q6.className+` bn-drag-preview `+l,e.root instanceof ShadowRoot?e.root.appendChild(q6):e.root.body.appendChild(q6)}function RMe(e){q6!==void 0&&(e instanceof ShadowRoot?e.removeChild(q6):e.body.removeChild(q6),q6=void 0)}function zMe(e,t,n){if(!e.dataTransfer||n.headless)return;let r=n.prosemirrorView,i=JZ(t.id,r.state.doc);if(!i)throw Error(`Block with ID ${t.id} not found`);let a=i.posBeforeNode;if(a!=null){let t=r.state.selection,i=r.state.doc,{from:o,to:s}=IMe(t,i),c=o<=a&&a<s,l=t.$anchor.node()!==t.$head.node()||t instanceof K6;c&&l?(r.dispatch(r.state.tr.setSelection(K6.create(i,o,s))),LMe(r,o,s)):(r.dispatch(r.state.tr.setSelection(iM.create(r.state.doc,a))),LMe(r,a));let u=r.state.selection.content(),d=n.pmSchema,f=r.serializeForClipboard(u).dom.innerHTML,p=F6(d,n),m=FMe(u.content),h=p.exportBlocks(m,{}),g=A6(h);e.dataTransfer.clearData(),e.dataTransfer.setData(`blocknote/html`,f),e.dataTransfer.setData(`text/html`,h),e.dataTransfer.setData(`text/plain`,g),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setDragImage(q6,0,0)}}function j6(e,t,n=!0){let r=e.root.elementsFromPoint(t.left,t.top);for(let i of r)if(e.dom.contains(i))return n&&i.closest(`[data-node-type=columnList]`)?j6(e,{left:t.left+50,top:t.top},!1):AMe(i,e)}function BMe(e,t){if(!t.dom.firstChild)return;let n=t.dom.firstChild.getBoundingClientRect(),r=j6(t,{left:Math.min(Math.max(n.left+10,e.x),n.right-10),top:e.y});if(r)return j6(t,{left:r.node.getBoundingClientRect().right-10,top:e.y},!1)}async function VMe(){return X6||(X6=(async()=>{let[e,t]=await Promise.all([C(()=>import(`./module-CFHRyJc-.js`),[]),C(()=>import(`./native-CUze18dq.js`),[])]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),X6)}async function HMe(e,t){if(!(`text`in e.schema.inlineContentSchema)||e.schema.inlineContentSchema.text!==U$.text)return[];let{emojiData:n,emojiMart:r}=await VMe();return(t.trim()===``?Object.values(n.emojis):await r.SearchIndex.search(t)).map(t=>({id:t.skins[0].native,onItemClick:()=>e.insertInlineContent(t.skins[0].native+` `)}))}function UMe(e){Z6||(Z6=document.createElement(`div`),Z6.innerHTML=`_`,Z6.style.opacity=`0`,Z6.style.height=`1px`,Z6.style.width=`1px`,e instanceof Document?e.body.appendChild(Z6):e.appendChild(Z6))}function WMe(e){Z6&&=(e instanceof Document?e.body.removeChild(Z6):e.removeChild(Z6),void 0)}function M6(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function GMe(e){let t=e;for(;t&&t.nodeName!==`TD`&&t.nodeName!==`TH`&&!t.classList.contains(`tableWrapper`);){if(t.classList.contains(`ProseMirror`))return;let e=t.parentNode;if(!e||!(e instanceof Element))return;t=e}return t.nodeName===`TD`||t.nodeName===`TH`?{type:`cell`,domNode:t,tbodyNode:t.closest(`tbody`)}:{type:`wrapper`,domNode:t,tbodyNode:t.querySelector(`tbody`)}}function KMe(e,t){let n=t.querySelectorAll(e);for(let e=0;e<n.length;e++)n[e].style.visibility=`hidden`}var qMe,JMe,YMe,N6,P6,XMe,F6,I6,L6,R6,z6,ZMe,B6,QMe,$Me,eNe,tNe,V6,nNe,H6,U6,W6,rNe,iNe,aNe,oNe,G6,sNe,cNe,K6,q6,J6,lNe,uNe,Y6,X6,Z6,dNe,Q6,$6,e8,fNe,pNe=o((()=>{mM(),cY(),qMe=u(The(),1),vX(),W$(),dG(),JW(),MU(),YG(),Zj(),p_e(),zP(),bY(),XG(),gj(),jxe(),nTe(),Pje(),Lje(),nMe(),pMe(),x4(),lZ(),w(),JMe=Object.defineProperty,YMe=(e,t,n)=>t in e?JMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,N6=(e,t,n)=>YMe(e,typeof t==`symbol`?t:t+``,n),P6=(e,t,n,r,i,a,o=0,s)=>{for(let c of n)gMe(e,t,c,r,i,a,o,s)},XMe=(e,t,n,r,i,a)=>{let o=(a?.document??document).createDocumentFragment();return P6(o,e,t,n,r,i,0,a),o},F6=(e,t)=>{let n=mj.fromSchema(e);return{exportBlocks:(e,r)=>{let i=XMe(t,e,n,new Set([`numberedListItem`]),new Set([`bulletListItem`,`checkListItem`,`toggleListItem`]),r),a=document.createElement(`div`);return a.append(i),a.innerHTML},exportInlineContent:(e,r)=>{let i=hMe(t,e,n,r),a=document.createElement(`div`);return a.append(i.cloneNode(!0)),a.innerHTML}}},I6=cG(()=>{let e=[];return{key:`blockChange`,prosemirrorPlugins:[new dM({key:new pM(`blockChange`),filterTransaction:t=>{let n;return e.reduce((e,r)=>e===!1?e:r({getChanges(){return n||(n=xMe(t),n)},tr:t})!==!1,!0)}})],subscribe(t){return e.push(t),()=>{e.splice(e.indexOf(t),1)}}}}),L6=cG(({options:e})=>{let t=new Map,n=e.provider&&`awareness`in e.provider&&typeof e.provider.awareness==`object`?e.provider.awareness:void 0;return n&&(`setLocalStateField`in n&&typeof n.setLocalStateField==`function`&&n.setLocalStateField(`user`,e.user),`on`in n&&typeof n.on==`function`&&e.showCursorLabels!==`always`&&n.on(`change`,({updated:e})=>{for(let n of e){let e=t.get(n);e&&(setTimeout(()=>{e.element.setAttribute(`data-active`,``)},10),e.hideTimeout&&clearTimeout(e.hideTimeout),t.set(n,{element:e.element,hideTimeout:setTimeout(()=>{e.element.removeAttribute(`data-active`)},2e3)}))}})),{key:`yCursor`,prosemirrorPlugins:[n?BW(n,{selectionBuilder:LW,cursorBuilder(n,r){let i=t.get(r);if(!i){let a=(e.renderCursor??CMe)(n);e.showCursorLabels!==`always`&&(a.addEventListener(`mouseenter`,()=>{let e=t.get(r);e.element.setAttribute(`data-active`,``),e.hideTimeout&&(clearTimeout(e.hideTimeout),t.set(r,{element:e.element,hideTimeout:void 0}))}),a.addEventListener(`mouseleave`,()=>{let e=t.get(r);t.set(r,{element:e.element,hideTimeout:setTimeout(()=>{e.element.removeAttribute(`data-active`)},2e3)})})),i={element:a,hideTimeout:void 0},t.set(r,i)}return i.element}}):void 0].filter(Boolean),dependsOn:[`ySync`],updateUser(e){n?.setLocalStateField(`user`,e)}}}),R6=cG(({options:e})=>({key:`ySync`,prosemirrorPlugins:[nW(e.fragment)],runsBefore:[`default`]})),z6=cG(()=>({key:`yUndo`,prosemirrorPlugins:[qW()],dependsOn:[`yCursor`,`ySync`],undoCommand:UW,redoCommand:WW})),ZMe=cG(({editor:e,options:t})=>{let n,r=lG({isForked:!1});return{key:`yForkDoc`,store:r,fork(){if(n)return;let i=t.fragment;if(!i)throw Error(`No fragment to fork from`);let a=new $z;hB(a,vB(i.doc));let o=wMe(i,a);n={undoStack:zU.getState(e.prosemirrorState).undoManager.undoStack,originalFragment:i,forkedFragment:o},e.unregisterExtension([z6,L6,R6]);let s={...t,fragment:o};e.registerExtension([R6(s),z6()]),r.setState({isForked:!0})},merge({keepChanges:i}){if(!n)return;e.unregisterExtension([`ySync`,`yCursor`,`yUndo`]);let{originalFragment:a,forkedFragment:o,undoStack:s}=n;if(e.registerExtension([R6(t),L6(t),z6()]),zU.getState(e.prosemirrorState).undoManager.undoStack=s,i){let t=vB(o.doc,wB(a.doc));hB(a.doc,t,e)}n=void 0,r.setState({isForked:!1})}}}),B6=(e,t)=>{t(e),e.forEach(e=>{e instanceof IH&&B6(e,t)})},QMe=(e,t)=>{let n=new Map;return e.forEach(e=>{e instanceof IH&&B6(e,e=>{if(e.nodeName===`blockContainer`&&e.hasAttribute(`id`)){let t=e.getAttribute(`textColor`),r=e.getAttribute(`backgroundColor`),i={textColor:t===gQ.textColor.default?void 0:t,backgroundColor:r===gQ.backgroundColor.default?void 0:r};(i.textColor||i.backgroundColor)&&n.set(e.getAttribute(`id`),i)}})}),n.size===0?!1:(t.doc.descendants((e,r)=>{if(e.type.name===`blockContainer`&&n.has(e.attrs.id)){let i=t.doc.nodeAt(r+1);if(!i)throw Error(`No element found`);t.setNodeMarkup(r+1,void 0,{...i.attrs,...n.get(e.attrs.id)})}}),!0)},$Me=[QMe],eNe=cG(({options:e})=>{let t=!1;return{key:`schemaMigration`,prosemirrorPlugins:[new dM({key:new pM(`schemaMigration`),appendTransaction:(n,r,i)=>{if(t||!n.some(e=>e.getMeta(`y-sync$`))||n.every(e=>!e.docChanged)||!e.fragment.firstChild)return;let a=i.tr;for(let t of $Me)t(e.fragment,a);if(t=!0,a.docChanged)return a}})]}}),tNe=cG(({editor:e,options:t})=>{let n=null,r=null,i=-1,a=null,o={width:t.dropCursor?.width??5,color:t.dropCursor?.color??`#ddeeff`,exclude:t.dropCursor?.exclude??`bn-drag-exclude`,hooks:t.dropCursor?.hooks},s=e=>{e?.pos===n?.pos&&e?.orientation===n?.orientation||(n=e,e==null?(r&&r.parentNode&&r.parentNode.removeChild(r),r=null):c())},c=()=>{if(!n)return;let t=e.prosemirrorView,i=t.dom,a=i.getBoundingClientRect(),s=a.width/i.offsetWidth,c=a.height/i.offsetHeight,l=EMe(t,n,o.width,s,c)??DMe(t,n,o.width,s),u=t.dom.offsetParent;r||(r=u.appendChild(document.createElement(`div`)),r.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,o.color&&(r.style.backgroundColor=o.color)),OMe(r,n.orientation);let{parentLeft:d,parentTop:f}=kMe(u);r.style.left=(l.left-d)/s+`px`,r.style.top=(l.top-f)/c+`px`,r.style.width=(l.right-l.left)/s+`px`,r.style.height=(l.bottom-l.top)/c+`px`},l=e=>{clearTimeout(i),i=window.setTimeout(()=>s(null),e)},u=e=>{let t=e;a=t.target instanceof Element?t.target:null},d=t=>{var n;let r=t;if(a&&TMe(a,o.exclude)||r.target instanceof Element&&TMe(r.target,o.exclude))return;let i=e.prosemirrorView;if(!i.editable)return;let c=i.posAtCoords({left:r.clientX,top:r.clientY}),u=c&&c.inside>=0&&i.state.doc.nodeAt(c.inside),d=u&&u.type.spec.disableDropCursor,f=typeof d==`function`?d(i,c,r):d;if(c&&!f){let t=c.pos;if(i.dragging&&i.dragging.slice){let e=Ede(i.state.doc,t,i.dragging.slice);e!=null&&(t=e)}let a=!i.state.doc.resolve(t).parent.inlineContent,u={pos:t,orientation:a?`block-horizontal`:`inline`},d=u;if((n=o.hooks)!=null&&n.computeDropPosition){let t=o.hooks.computeDropPosition({editor:e,event:r,view:i,defaultPosition:u});if(t===null){s(null);return}d=t}s(d),l(5e3)}},f=t=>{let n=t;(!(n.relatedTarget instanceof Node)||!e.prosemirrorView.dom.contains(n.relatedTarget))&&s(null)},p=()=>{l(20)},m=()=>{l(20),a=null};return{key:`dropCursor`,mount({signal:e,dom:t,root:n}){n.addEventListener(`dragstart`,u,{capture:!0,signal:e}),t.addEventListener(`dragover`,d,{signal:e}),t.addEventListener(`dragleave`,f,{signal:e}),t.addEventListener(`drop`,p,{signal:e}),t.addEventListener(`dragend`,m,{signal:e}),e.addEventListener(`abort`,()=>{clearTimeout(i),s(null)})}}}),V6=cG(({editor:e})=>{let t=lG(!1),n=()=>e.transact(e=>{if(e.selection.empty||e.selection instanceof iM&&(e.selection.node.type.spec.content===`inline*`||e.selection.node.firstChild?.type.spec.content===`inline*`)||e.selection instanceof z&&e.doc.textBetween(e.selection.from,e.selection.to).length===0)return!1;let t=!1;return e.selection.content().content.descendants(e=>(e.type.spec.code&&(t=!0),!t)),!t});return{key:`formattingToolbar`,store:t,mount({dom:r,signal:i}){let a=!1,o=e.onChange(()=>{a||t.setState(n())}),s=e.onSelectionChange(()=>{a||t.setState(n())});r.addEventListener(`pointerdown`,()=>{a=!0,t.setState(!1)},{signal:i}),e.prosemirrorView.root.addEventListener(`pointerup`,()=>{a=!1,e.isFocused()&&t.setState(n())},{signal:i,capture:!0}),r.addEventListener(`pointercancel`,()=>{a=!1},{signal:i,capture:!0}),i.addEventListener(`abort`,()=>{o(),s()})}}}),nNe=cG(()=>({key:`history`,prosemirrorPlugins:[f_e()],undoCommand:c1,redoCommand:l1})),H6=cG(({editor:e})=>{function t(t){let n=e.prosemirrorView.nodeDOM(t);for(;n&&n.parentElement;){if(n.nodeName===`A`)return n;n=n.parentElement}return null}function n(t,n){return e.transact(r=>{let i=r.doc.resolve(t),a=i.marks().find(e=>e.type.name===n);if(!a)return;let o=gK(i,a.type);if(o)return{range:o,mark:a,get text(){return r.doc.textBetween(o.from,o.to)},get position(){return lq(e.prosemirrorView,o.from,o.to).toJSON()}}})}function r(){return e.transact(e=>{let t=e.selection;if(t.empty)return n(t.anchor,`link`)})}return{key:`linkToolbar`,getLinkAtSelection:r,getLinkElementAtPos:t,getMarkAtPos:n,getLinkAtElement(t){return e.transact(()=>n(e.prosemirrorView.posAtDOM(t,0)+1,`link`))},editLink(t,r,i=e.transact(e=>e.selection.anchor)){e.transact(e=>{let a=UY(e),{range:o}=n(i+1,`link`)||{range:{from:e.selection.from,to:e.selection.to}};o&&(e.insertText(r,o.from,o.to),e.addMark(o.from,o.from+r.length,a.mark(`link`,{href:t})))}),e.prosemirrorView.focus()},deleteLink(t=e.transact(e=>e.selection.anchor)){e.transact(e=>{let r=UY(e),{range:i}=n(t+1,`link`)||{range:{from:e.selection.from,to:e.selection.to}};i&&e.removeMark(i.from,i.to,r.marks.link).setMeta(`preventAutolink`,!0)}),e.prosemirrorView.focus()}}}),U6=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`],W6=`https`,rNe=new pM(`node-selection-keyboard`),iNe=cG(()=>({key:`nodeSelectionKeyboard`,prosemirrorPlugins:[new dM({key:rNe,props:{handleKeyDown:(e,t)=>{if(`node`in e.state.selection){if(t.ctrlKey||t.metaKey)return!1;if(t.key.length===1)return t.preventDefault(),!0;if(t.key===`Enter`&&!t.isComposing&&!t.shiftKey&&!t.altKey&&!t.ctrlKey&&!t.metaKey){let t=e.state.tr;return e.dispatch(t.insert(e.state.tr.selection.$to.after(),e.state.schema.nodes.paragraph.createChecked()).setSelection(new z(t.doc.resolve(e.state.tr.selection.$to.after()+1)))),!0}}return!1}}})]})),aNe=new pM(`blocknote-placeholder`),oNe=cG(({editor:e,options:t})=>{let n=t.placeholders;return{key:`placeholder`,prosemirrorPlugins:[new dM({key:aNe,view:t=>{let r=`placeholder-selector-${yY()}`;t.dom.classList.add(r);let i=document.createElement(`style`),a=e._tiptapEditor.options.injectNonce;a&&i.setAttribute(`nonce`,a),t.root instanceof window.ShadowRoot?t.root.append(i):t.root.head.appendChild(i);let o=i.sheet,s=(e=``)=>`.${r} .bn-block-content${e} .bn-inline-content:has(> .ProseMirror-trailingBreak:only-child):before`;try{let{default:e,emptyDocument:t,...r}=n||{};for(let[e,t]of Object.entries(r)){let n=`[data-content-type="${e}"]`;o.insertRule(`${s(n)} { content: ${JSON.stringify(t)}; }`)}o.insertRule(`${s(`[data-is-only-empty-block]`)} { content: ${JSON.stringify(t)}; }`),o.insertRule(`${s(`[data-is-empty-and-focused]`)} { content: ${JSON.stringify(e)}; }`)}catch(e){console.warn(`Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)`,e)}return{destroy:()=>{t.root instanceof window.ShadowRoot?t.root.removeChild(i):t.root.head.removeChild(i)}}},props:{decorations:t=>{let{doc:n,selection:r}=t;if(!e.isEditable||!r.empty||r.$from.parent.type.spec.code)return;let i=[];t.doc.content.size===6&&i.push(TP.node(2,4,{"data-is-only-empty-block":`true`}));let a=r.$anchor,o=a.parent;if(o.content.size===0){let e=a.before();i.push(TP.node(e,e+o.nodeSize,{"data-is-empty-and-focused":`true`}))}return OP.create(n,i)}}})]}}),G6=new pM(`previous-blocks`),sNe={index:`index`,level:`level`,type:`type`,depth:`depth`,"depth-change":`depth-change`},cNe=cG(()=>{let e;return{key:`previousBlockType`,prosemirrorPlugins:[new dM({key:G6,view(t){return{update:async(t,n)=>{this.key?.getState(t.state).updatedBlocks.size>0&&(e=setTimeout(()=>{t.dispatch(t.state.tr.setMeta(G6,{clearUpdate:!0}))},0))},destroy:()=>{e&&clearTimeout(e)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(e,t,n,r){if(t.currentTransactionOldBlockAttrs={},t.updatedBlocks.clear(),!e.docChanged||n.doc.eq(r.doc))return t;let i={},a=NK(n.doc,e=>e.attrs.id),o=new Map(a.map(e=>[e.node.attrs.id,e])),s=NK(r.doc,e=>e.attrs.id);for(let e of s){let a=o.get(e.node.attrs.id),s=a?.node.firstChild,c=e.node.firstChild;if(a&&s&&c){let o={index:c.attrs.index,level:c.attrs.level,type:c.type.name,depth:r.doc.resolve(e.pos).depth},l={index:s.attrs.index,level:s.attrs.level,type:s.type.name,depth:n.doc.resolve(a.pos).depth};i[e.node.attrs.id]=l,t.currentTransactionOldBlockAttrs[e.node.attrs.id]=l,JSON.stringify(l)!==JSON.stringify(o)&&(l[`depth-change`]=l.depth-o.depth,t.updatedBlocks.add(e.node.attrs.id))}}return t.prevTransactionOldBlockAttrs=i,t}},props:{decorations(e){let t=this.getState(e);if(t.updatedBlocks.size===0)return;let n=[];return e.doc.descendants((e,r)=>{if(!e.attrs.id||!t.updatedBlocks.has(e.attrs.id))return;let i=t.currentTransactionOldBlockAttrs[e.attrs.id],a={};for(let[e,t]of Object.entries(i))a[`data-prev-`+sNe[e]]=t||`none`;let o=TP.node(r,r+e.nodeSize,{...a});n.push(o)}),OP.create(e.doc,n)}}})]}}),K6=class e extends eM{constructor(e,t){super(e,t),N6(this,`nodes`);let n=e.node();this.nodes=[],e.doc.nodesBetween(e.pos,t.pos,(e,t,r)=>{if(r!==null&&r.eq(n))return this.nodes.push(e),!1})}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}content(){return new R(L.from(this.nodes),0,0)}eq(t){if(!(t instanceof e)||this.nodes.length!==t.nodes.length||this.from!==t.from||this.to!==t.to)return!1;for(let e=0;e<this.nodes.length;e++)if(!this.nodes[e].eq(t.nodes[e]))return!1;return!0}map(t,n){let r=n.mapResult(this.from),i=n.mapResult(this.to);return i.deleted?eM.near(t.resolve(r.pos)):r.deleted?eM.near(t.resolve(i.pos)):new e(t.resolve(r.pos),t.resolve(i.pos))}toJSON(){return{type:`multiple-node`,anchor:this.anchor,head:this.head}}},eM.jsonID(`multiple-node`,K6),J6=250,lNe=class{constructor(e,t,n){N6(this,`state`),N6(this,`emitUpdate`),N6(this,`mousePos`),N6(this,`hoveredBlock`),N6(this,`menuFrozen`,!1),N6(this,`isDragOrigin`,!1),N6(this,`updateState`,e=>{this.state=e,this.emitUpdate(this.state)}),N6(this,`updateStateFromMousePos`,()=>{var e,t,n,r;if(this.menuFrozen||!this.mousePos)return;let i=this.findClosestEditorElement({clientX:this.mousePos.x,clientY:this.mousePos.y});if(i?.element!==this.pmView.dom||i.distance>J6){(e=this.state)!=null&&e.show&&(this.state.show=!1,this.updateState(this.state));return}let a=BMe(this.mousePos,this.pmView);if(!a||!this.editor.isEditable){(t=this.state)!=null&&t.show&&(this.state.show=!1,this.updateState(this.state));return}if(!((n=this.state)!=null&&n.show&&(r=this.hoveredBlock)!=null&&r.hasAttribute(`data-id`)&&this.hoveredBlock?.getAttribute(`data-id`)===a.id)&&(this.hoveredBlock=a.node,this.editor.isEditable)){let e=a.node.getBoundingClientRect(),t=a.node.closest(`[data-node-type=column]`);this.state={show:!0,referencePos:new DOMRect(t?t.firstElementChild.getBoundingClientRect().x:this.pmView.dom.firstChild.getBoundingClientRect().x,e.y,e.width,e.height),block:this.editor.getBlock(this.hoveredBlock.getAttribute(`data-id`))},this.updateState(this.state)}}),N6(this,`onDragStart`,e=>{let t=e.dataTransfer?.getData(`blocknote/html`);if(!t||this.pmView.dragging)return;let n=document.createElement(`div`);n.innerHTML=t;let r=oj.fromSchema(this.pmView.state.schema).parse(n,{topNode:this.pmView.state.schema.nodes.blockGroup.create()});this.pmView.dragging={slice:new R(r.content,0,0),move:!0}}),N6(this,`findClosestEditorElement`,e=>{let t=Array.from(this.pmView.root.querySelectorAll(`.bn-editor`));if(t.length===0)return null;let n=t[0],r=Number.MAX_VALUE;return t.forEach(t=>{let i=t.querySelector(`.bn-block-group`).getBoundingClientRect(),a=e.clientX<i.left?i.left-e.clientX:e.clientX>i.right?e.clientX-i.right:0,o=e.clientY<i.top?i.top-e.clientY:e.clientY>i.bottom?e.clientY-i.bottom:0,s=Math.sqrt(a**2+o**2);s<r&&(r=s,n=t)}),{element:n,distance:r}}),N6(this,`onDragOver`,e=>{if(e.synthetic||!(this.pmView.dragging!==null||this.isDragOrigin||e.dataTransfer?.types.includes(`blocknote/html`)||e.target instanceof Node&&this.pmView.dom.contains(e.target)))return;let t=this.getDragEventContext(e);if(!t||!t.isDropPoint){this.closeDropCursor();return}t.isDropPoint&&!t.isDropWithinEditorBounds&&this.dispatchSyntheticEvent(e)}),N6(this,`closeDropCursor`,()=>{let e=new Event(`dragleave`,{bubbles:!1});e.synthetic=!0,this.pmView.dom.dispatchEvent(e)}),N6(this,`getDragEventContext`,e=>{var t;if(!(this.pmView.dragging!==null||this.isDragOrigin||e.dataTransfer?.types.includes(`blocknote/html`)||e.target instanceof Node&&this.pmView.dom.contains(e.target)))return;let n=!((t=e.dataTransfer)!=null&&t.types.includes(`blocknote/html`))&&!!this.pmView.dragging,r=!!this.isDragOrigin,i=n||r,a=this.findClosestEditorElement(e);if(!a||a.distance>J6)return;let o=a.element===this.pmView.dom,s=o&&a.distance===0;if(!(!o&&!i))return{isDropPoint:o,isDropWithinEditorBounds:s,isDragOrigin:i}}),N6(this,`onDrop`,e=>{if(e.synthetic||!(this.pmView.dragging!==null||this.isDragOrigin||e.dataTransfer?.types.includes(`blocknote/html`)||e.target instanceof Node&&this.pmView.dom.contains(e.target)))return;let t=this.getDragEventContext(e);if(!t){this.closeDropCursor();return}let{isDropPoint:n,isDropWithinEditorBounds:r,isDragOrigin:i}=t;if(!r&&n&&this.dispatchSyntheticEvent(e),n){if(this.pmView.dragging)return;this.pmView.dispatch(this.pmView.state.tr.setSelection(z.create(this.pmView.state.tr.doc,this.pmView.state.tr.selection.anchor)));return}else if(i){setTimeout(()=>this.pmView.dispatch(this.pmView.state.tr.deleteSelection()),0);return}}),N6(this,`onDragEnd`,e=>{e.synthetic||(this.pmView.dragging=null)}),N6(this,`onKeyDown`,e=>{var t;(t=this.state)!=null&&t.show&&this.editor.isFocused()&&(this.state.show=!1,this.emitUpdate(this.state))}),N6(this,`onMouseMove`,e=>{var t;if(this.menuFrozen)return;this.mousePos={x:e.clientX,y:e.clientY};let n=this.pmView.dom.getBoundingClientRect(),r=this.mousePos.x>n.left&&this.mousePos.x<n.right&&this.mousePos.y>n.top&&this.mousePos.y<n.bottom,i=this.pmView.dom.parentElement;if(r&&e&&e.target&&!(i===e.target||i.contains(e.target))){(t=this.state)!=null&&t.show&&(this.state.show=!1,this.emitUpdate(this.state));return}this.updateStateFromMousePos()}),this.editor=e,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw Error(`Attempting to update uninitialized side menu`);n(this.state)},this.pmView.root.addEventListener(`dragstart`,this.onDragStart),this.pmView.root.addEventListener(`dragover`,this.onDragOver),this.pmView.root.addEventListener(`drop`,this.onDrop,!0),this.pmView.root.addEventListener(`dragend`,this.onDragEnd,!0),this.pmView.root.addEventListener(`mousemove`,this.onMouseMove,!0),this.pmView.root.addEventListener(`keydown`,this.onKeyDown,!0)}dispatchSyntheticEvent(e){let t=new Event(e.type,e),n=this.pmView.dom.firstChild.getBoundingClientRect();t.clientX=e.clientX,t.clientY=e.clientY,t.clientX=Math.min(Math.max(e.clientX,n.left),n.left+n.width),t.clientY=Math.min(Math.max(e.clientY,n.top),n.top+n.height),t.dataTransfer=e.dataTransfer,t.preventDefault=()=>e.preventDefault(),t.synthetic=!0,this.pmView.dom.dispatchEvent(t)}update(e,t){var n;!t.doc.eq(this.pmView.state.doc)&&(n=this.state)!=null&&n.show&&this.updateStateFromMousePos()}destroy(){var e;(e=this.state)!=null&&e.show&&(this.state.show=!1,this.emitUpdate(this.state)),this.pmView.root.removeEventListener(`mousemove`,this.onMouseMove,!0),this.pmView.root.removeEventListener(`dragstart`,this.onDragStart),this.pmView.root.removeEventListener(`dragover`,this.onDragOver),this.pmView.root.removeEventListener(`drop`,this.onDrop,!0),this.pmView.root.removeEventListener(`dragend`,this.onDragEnd,!0),this.pmView.root.removeEventListener(`keydown`,this.onKeyDown,!0)}},uNe=new pM(`SideMenuPlugin`),Y6=cG(({editor:e})=>{let t,n=lG(void 0);return{key:`sideMenu`,store:n,prosemirrorPlugins:[new dM({key:uNe,view:r=>(t=new lNe(e,r,e=>{n.setState({...e})}),t)})],blockDragStart(n,r){t&&(t.isDragOrigin=!0),zMe(n,r,e)},blockDragEnd(){RMe(e.prosemirrorView.root),t&&(t.isDragOrigin=!1),e.blur()},freezeMenu(){t.menuFrozen=!0,t.state.show=!0,t.emitUpdate(t.state)},unfreezeMenu(){t.menuFrozen=!1,t.state.show=!1,t.emitUpdate(t.state)}}}),dNe=class{constructor(e,t,n){N6(this,`state`),N6(this,`emitUpdate`),N6(this,`tableId`),N6(this,`tablePos`),N6(this,`tableElement`),N6(this,`menuFrozen`,!1),N6(this,`mouseState`,`up`),N6(this,`prevWasEditable`,null),N6(this,`viewMousedownHandler`,()=>{this.mouseState=`down`}),N6(this,`mouseUpHandler`,e=>{this.mouseState=`up`,this.mouseMoveHandler(e)}),N6(this,`mouseMoveHandler`,e=>{var t,n,r,i,a,o;if(this.menuFrozen||this.mouseState===`selecting`||!(e.target instanceof Element)||!this.pmView.dom.contains(e.target))return;let s=GMe(e.target);if(s?.type===`cell`&&this.mouseState===`down`&&!((t=this.state)!=null&&t.draggingState)){this.mouseState=`selecting`,(n=this.state)!=null&&n.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!s||!this.editor.isEditable){(r=this.state)!=null&&r.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate());return}if(!s.tbodyNode)return;let c=s.tbodyNode.getBoundingClientRect(),l=AMe(s.domNode,this.pmView);if(!l)return;this.tableElement=l.node;let u,d=this.editor.transact(e=>JZ(l.id,e.doc));if(!d)throw Error(`Block with ID ${l.id} not found`);let f=$Y(d.node,this.editor.pmSchema,this.editor.schema.blockSchema,this.editor.schema.inlineContentSchema,this.editor.schema.styleSchema);if(iQ(this.editor,`table`)&&(this.tablePos=d.posBeforeNode+1,u=f),!u)return;this.tableId=l.id;let p=s.domNode.closest(`.tableWrapper`)?.querySelector(`.table-widgets-container`);if(s?.type===`wrapper`){let t=e.clientY>=c.bottom-1&&e.clientY<c.bottom+20,n=e.clientX>=c.right-1&&e.clientX<c.right+20,r=this.state?.block.id!==u.id||e.clientX>c.right||e.clientY>c.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:t,showAddOrRemoveColumnsButton:n,referencePosTable:c,block:u,widgetContainer:p,colIndex:r||(i=this.state)==null?void 0:i.colIndex,rowIndex:r||(a=this.state)==null?void 0:a.rowIndex,referencePosCell:r||(o=this.state)==null?void 0:o.referencePosCell}}else{let e=M6(s.domNode),t=M6(s.domNode.parentElement),n=s.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===l.id&&this.state.rowIndex===t&&this.state.colIndex===e)return;this.state={show:!0,showAddOrRemoveColumnsButton:e===u.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:t===u.content.rows.length-1,referencePosTable:c,block:u,draggingState:void 0,referencePosCell:n,colIndex:e,rowIndex:t,widgetContainer:p}}return this.emitUpdate(),!1}),N6(this,`dragOverHandler`,e=>{if(this.state?.draggingState===void 0)return;e.preventDefault(),e.dataTransfer.dropEffect=`move`,KMe(`.prosemirror-dropcursor-block, .prosemirror-dropcursor-inline`,this.pmView.root);let t={left:Math.min(Math.max(e.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(e.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},n=this.pmView.root.elementsFromPoint(t.left,t.top).filter(e=>e.tagName===`TD`||e.tagName===`TH`);if(n.length===0)return;let r=n[0],i=!1,a=M6(r.parentElement),o=M6(r),s=this.state.draggingState.draggedCellOrientation===`row`?this.state.rowIndex:this.state.colIndex,c=(this.state.draggingState.draggedCellOrientation===`row`?a:o)!==s;(this.state.rowIndex!==a||this.state.colIndex!==o)&&(this.state.rowIndex=a,this.state.colIndex=o,this.state.referencePosCell=r.getBoundingClientRect(),i=!0);let l=this.state.draggingState.draggedCellOrientation===`row`?t.top:t.left;this.state.draggingState.mousePos!==l&&(this.state.draggingState.mousePos=l,i=!0),i&&this.emitUpdate(),c&&this.editor.transact(e=>e.setMeta(Q6,!0))}),N6(this,`dropHandler`,e=>{if(this.mouseState=`up`,this.state===void 0||this.state.draggingState===void 0)return!1;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw Error(`Attempted to drop table row or column, but no table block was hovered prior.`);e.preventDefault();let{draggingState:t,colIndex:n,rowIndex:r}=this.state,i=this.state.block.content.columnWidths;if(t.draggedCellOrientation===`row`){if(!cX(this.state.block,t.originalIndex,r))return!1;let e=jhe(this.state.block,t.originalIndex,r);this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,rows:e}})}else{if(!lX(this.state.block,t.originalIndex,n))return!1;let e=Ahe(this.state.block,t.originalIndex,n),[r]=i.splice(t.originalIndex,1);i.splice(n,0,r),this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,columnWidths:i,rows:e}})}return this.editor.setTextCursorPosition(this.state.block.id),!0}),this.editor=e,this.pmView=t,this.emitUpdate=()=>{if(!this.state)throw Error(`Attempting to update uninitialized image toolbar`);n(this.state)},t.dom.addEventListener(`mousemove`,this.mouseMoveHandler),t.dom.addEventListener(`mousedown`,this.viewMousedownHandler),window.addEventListener(`mouseup`,this.mouseUpHandler),t.root.addEventListener(`dragover`,this.dragOverHandler),t.root.addEventListener(`drop`,this.dropHandler)}update(){var e;if(!this.state||!this.state.show)return;if(this.state.block=this.editor.getBlock(this.state.block.id),!this.state.block||this.state.block.type!==`table`||!((e=this.tableElement)!=null&&e.isConnected)){this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate();return}let{height:t,width:n}=rX(this.state.block);this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=t&&(this.state.rowIndex=t-1),this.state.colIndex>=n&&(this.state.colIndex=n-1));let r=this.tableElement.querySelector(`tbody`);if(!r)throw Error(`Table block does not contain a 'tbody' HTML element. This should never happen.`);if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){let e=r.children[this.state.rowIndex].children[this.state.colIndex];e?this.state.referencePosCell=e.getBoundingClientRect():(this.state.rowIndex=void 0,this.state.colIndex=void 0)}this.state.referencePosTable=r.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener(`mousemove`,this.mouseMoveHandler),window.removeEventListener(`mouseup`,this.mouseUpHandler),this.pmView.dom.removeEventListener(`mousedown`,this.viewMousedownHandler),this.pmView.root.removeEventListener(`dragover`,this.dragOverHandler),this.pmView.root.removeEventListener(`drop`,this.dropHandler)}},Q6=new pM(`TableHandlesPlugin`),$6=cG(({editor:e})=>{let t,n=lG(void 0);return{key:`tableHandles`,store:n,prosemirrorPlugins:[new dM({key:Q6,view:r=>(t=new dNe(e,r,e=>{n.setState(e.block?{...e,draggingState:e.draggingState?{...e.draggingState}:void 0}:void 0)}),t),props:{decorations:e=>{if(t===void 0||t.state===void 0||t.state.draggingState===void 0||t.tablePos===void 0)return;let n=t.state.draggingState.draggedCellOrientation===`row`?t.state.rowIndex:t.state.colIndex;if(n===void 0)return;let r=[],{block:i,draggingState:a}=t.state,{originalIndex:o,draggedCellOrientation:s}=a;if(n===o||!i||s===`row`&&!cX(i,o,n)||s===`col`&&!lX(i,o,n))return OP.create(e.doc,r);let c=e.doc.resolve(t.tablePos+1);return t.state.draggingState.draggedCellOrientation===`row`?aX(t.state.block,n).forEach(({row:t,col:i})=>{let a=e.doc.resolve(c.posAtIndex(t)+1),s=e.doc.resolve(a.posAtIndex(i)+1),l=s.node(),u=s.pos+(n>o?l.nodeSize-2:0);r.push(TP.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.left=`0`,e.style.right=`0`,n>o?e.style.bottom=`-2px`:e.style.top=`-3px`,e.style.height=`4px`,e}))}):oX(t.state.block,n).forEach(({row:t,col:i})=>{let a=e.doc.resolve(c.posAtIndex(t)+1),s=e.doc.resolve(a.posAtIndex(i)+1),l=s.node(),u=s.pos+(n>o?l.nodeSize-2:0);r.push(TP.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.top=`0`,e.style.bottom=`0`,n>o?e.style.right=`-2px`:e.style.left=`-3px`,e.style.width=`4px`,e}))}),OP.create(e.doc,r)}}})],colDragStart(n){if(t===void 0||t.state===void 0||t.state.colIndex===void 0)throw Error(`Attempted to drag table column, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`col`,originalIndex:t.state.colIndex,mousePos:n.clientX},t.emitUpdate(),e.transact(e=>e.setMeta(Q6,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.colIndex,newIndex:t.state.colIndex,tablePos:t.tablePos})),!e.headless&&(UMe(e.prosemirrorView.root),n.dataTransfer.setDragImage(Z6,0,0),n.dataTransfer.effectAllowed=`move`)},rowDragStart(n){if(t.state===void 0||t.state.rowIndex===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`row`,originalIndex:t.state.rowIndex,mousePos:n.clientY},t.emitUpdate(),e.transact(e=>e.setMeta(Q6,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.rowIndex,newIndex:t.state.rowIndex,tablePos:t.tablePos})),!e.headless&&(UMe(e.prosemirrorView.root),n.dataTransfer.setDragImage(Z6,0,0),n.dataTransfer.effectAllowed=`copyMove`)},dragEnd(){if(t.state===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState=void 0,t.emitUpdate(),e.transact(e=>e.setMeta(Q6,null)),!e.headless&&WMe(e.prosemirrorView.root)},freezeHandles(){t.menuFrozen=!0},unfreezeHandles(){t.menuFrozen=!1},getCellsAtRowHandle(e,t){return aX(e,t)},getCellsAtColumnHandle(e,t){return oX(e,t)},setCellSelection(e,n,r=n){if(!t)throw Error(`Table handles view not initialized`);let i=e.doc.resolve(t.tablePos+1),a=e.doc.resolve(i.posAtIndex(n.row)+1),o=e.doc.resolve(a.posAtIndex(n.col)),s=e.doc.resolve(i.posAtIndex(r.row)+1),c=e.doc.resolve(s.posAtIndex(r.col)),l=e.tr;return l.setSelection(new nZ(o,c)),e.apply(l)},addRowOrColumn(t,n){e.exec((e,r)=>{let i=this.setCellSelection(e,n.orientation===`row`?{row:t,col:0}:{row:0,col:t});return n.orientation===`row`?n.side===`above`?tge(i,r):nge(i,r):n.side===`left`?Xhe(i,r):Zhe(i,r)})},removeRowOrColumn(t,n){return n===`row`?e.exec((e,n)=>ige(this.setCellSelection(e,{row:t,col:0}),n)):e.exec((e,n)=>$he(this.setCellSelection(e,{row:0,col:t}),n))},mergeCells(t){return e.exec((e,n)=>oge(t?this.setCellSelection(e,t.relativeStartCell,t.relativeEndCell):e,n))},splitCell(t){return e.exec((e,n)=>sge(t?this.setCellSelection(e,t):e,n))},getCellSelection(){return e.transact(e=>{let t=e.selection,n=t.$from,r=t.$to;if(oQ(t)){let{ranges:e}=t;e.forEach(e=>{n=e.$from.min(n??e.$from),r=e.$to.max(r??e.$to)})}else if(n=e.doc.resolve(t.$from.pos-t.$from.parentOffset-1),r=e.doc.resolve(t.$to.pos-t.$to.parentOffset-1),n.pos===0||r.pos===0)return;let i=e.doc.resolve(n.pos-n.parentOffset-1),a=e.doc.resolve(r.pos-r.parentOffset-1),o=e.doc.resolve(i.pos-i.parentOffset-1),s=n.index(i.depth),c=i.index(o.depth),l=r.index(a.depth),u=a.index(o.depth),d=[];for(let e=c;e<=u;e++)for(let t=s;t<=l;t++)d.push({row:e,col:t});return{from:{row:c,col:s},to:{row:u,col:l},cells:d}})},getMergeDirection(t){return e.transact(e=>{let n=oQ(e.selection)?e.selection:void 0;if(!n||!t||n.ranges.length<=1)return;let r=this.getCellSelection();if(r)return Phe(r.from,r.to,t)?`vertical`:`horizontal`})},cropEmptyRowsOrColumns(e,t){return Mhe(e,t)},addRowsOrColumns(e,t,n){return Nhe(e,t,n)}}}),e8=new pM(`trailingNode`),fNe=cG(()=>({key:`trailingNode`,prosemirrorPlugins:[new dM({key:e8,appendTransaction:(e,t,n)=>{let{doc:r,tr:i,schema:a}=n,o=e8.getState(n),s=r.content.size-2,c=a.nodes.blockContainer,l=a.nodes.paragraph;if(o)return i.insert(s,c.create(void 0,l.create()))},state:{init:(e,t)=>{},apply:(e,t)=>{if(!e.docChanged)return t;let n=e.doc.lastChild;if(!n||n.type.name!==`blockGroup`)throw Error(`Expected blockGroup`);if(n=n.lastChild,!n||n.type.name!==`blockContainer`)return!0;let r=n.firstChild;if(!r)throw Error(`Expected blockContent`);return n.nodeSize>4||r.type.spec.content!==`inline*`}}})]}))})),mNe=o((()=>{pNe(),W$(),mG()})),hNe=s((e=>{var t=p();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),t8=s(((e,t)=>{t.exports=hNe()})),gNe=s((e=>{var t=p(),n=t8();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),_Ne=s(((e,t)=>{t.exports=gNe()}));function vNe(e,t=e=>e){return(0,xNe.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,yNe)}function yNe(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=bNe(e);if(n.length!==bNe(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function bNe(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var xNe,SNe=o((()=>{xNe=_Ne(),sG()}));function CNe(e){let t=TNe(e),{roots:n,nonRoots:r}=ENe(t),i=[];for(;n.size;){i.push(n);let r=new Set;for(let i of n){let n=e.get(i);if(n)for(let e of n){let n=t.get(e);if(n===void 0)continue;let i=n-1;t.set(e,i),i===0&&r.add(e)}}n=r}if(r=ENe(t).nonRoots,r.size)throw Error(`Cycle(s) detected; toposort only works on acyclic graphs. Cyclic nodes: ${Array.from(r).join(`, `)}`);return i}function wNe(e){return CNe(DNe(e))}function TNe(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,0);for(let e of r){let n=t.get(e)??0;t.set(e,n+1)}}return t}function ENe(e){let t=new Set,n=new Set;for(let[r,i]of e.entries())i===0?t.add(r):n.add(r);return{roots:t,nonRoots:n}}function DNe(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,new Set);for(let e of r)t.has(e)||t.set(e,new Set),t.get(e).add(n)}return t}function ONe(){return new Map}function kNe(e,t,n){return e.has(t)||e.set(t,new Set),e.get(t).add(n),e}function ANe(e){let t=ONe();for(let n of e)Array.isArray(n.runsBefore)&&n.runsBefore.length>0?n.runsBefore.forEach(e=>{kNe(t,n.key,e)}):kNe(t,`default`,n.key);let n=wNe(t),r=n.findIndex(e=>e.has(`default`));return e=>91+(n.findIndex(t=>t.has(e))+r)*10}function jNe(e){return e&&Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var MNe,NNe,n8,PNe,r8,FNe=o((()=>{W$(),MNe=Object.defineProperty,NNe=(e,t,n)=>t in e?MNe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n8=(e,t,n)=>NNe(e,typeof t==`symbol`?t:t+``,n),PNe=class{constructor(e){n8(this,`BlockNoteEditor`,`only for types`),n8(this,`Block`,`only for types`),n8(this,`PartialBlock`,`only for types`),n8(this,`inlineContentSpecs`),n8(this,`styleSpecs`),n8(this,`blockSpecs`),n8(this,`blockSchema`),n8(this,`inlineContentSchema`),n8(this,`styleSchema`),this.opts=e;let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a}init(){let e=ANe(Object.entries({...this.opts.blockSpecs,...this.opts.inlineContentSpecs,...this.opts.styleSpecs}).map(([e,t])=>({key:e,runsBefore:t.implementation?.runsBefore??[]}))),t=Object.fromEntries(Object.entries(this.opts.blockSpecs).map(([t,n])=>[t,qge(n.config,n.implementation,n.extensions,e(t))])),n=Object.fromEntries(Object.entries(this.opts.inlineContentSpecs).map(([t,n])=>typeof n.config==`object`?[t,{...n,implementation:{...n.implementation,node:n.implementation?.node.extend({priority:e(t)})}}]:[t,n])),r=Object.fromEntries(Object.entries(this.opts.styleSpecs).map(([t,n])=>[t,{...n,implementation:{...n.implementation,mark:n.implementation?.mark.extend({priority:e(t)})}}]));return{blockSpecs:t,blockSchema:Object.fromEntries(Object.entries(t).map(([e,t])=>[e,t.config])),inlineContentSpecs:jNe(n),styleSpecs:jNe(r),inlineContentSchema:HZ(n),styleSchema:KZ(r)}}extend(e){Object.assign(this.opts.blockSpecs,e.blockSpecs),Object.assign(this.opts.inlineContentSpecs,e.inlineContentSpecs),Object.assign(this.opts.styleSpecs,e.styleSpecs);let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();return this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a,this}},r8=class e extends PNe{static create(t){return new e({blockSpecs:t?.blockSpecs??R$,inlineContentSpecs:t?.inlineContentSpecs??H$,styleSpecs:t?.styleSpecs??V$})}}})),INe,LNe=o((()=>{INe={slash_menu:{heading:{title:`Heading 1`,subtext:`Top-level heading`,aliases:[`h`,`heading1`,`h1`],group:`Headings`},heading_2:{title:`Heading 2`,subtext:`Key section heading`,aliases:[`h2`,`heading2`,`subheading`],group:`Headings`},heading_3:{title:`Heading 3`,subtext:`Subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`],group:`Headings`},heading_4:{title:`Heading 4`,subtext:`Minor subsection heading`,aliases:[`h4`,`heading4`,`subheading4`],group:`Subheadings`},heading_5:{title:`Heading 5`,subtext:`Small subsection heading`,aliases:[`h5`,`heading5`,`subheading5`],group:`Subheadings`},heading_6:{title:`Heading 6`,subtext:`Lowest-level heading`,aliases:[`h6`,`heading6`,`subheading6`],group:`Subheadings`},toggle_heading:{title:`Toggle Heading 1`,subtext:`Toggleable top-level heading`,aliases:[`h`,`heading1`,`h1`,`collapsable`],group:`Subheadings`},toggle_heading_2:{title:`Toggle Heading 2`,subtext:`Toggleable key section heading`,aliases:[`h2`,`heading2`,`subheading`,`collapsable`],group:`Subheadings`},toggle_heading_3:{title:`Toggle Heading 3`,subtext:`Toggleable subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`,`collapsable`],group:`Subheadings`},quote:{title:`Quote`,subtext:`Quote or excerpt`,aliases:[`quotation`,`blockquote`,`bq`],group:`Basic blocks`},toggle_list:{title:`Toggle List`,subtext:`List with hideable sub-items`,aliases:[`li`,`list`,`toggleList`,`toggle list`,`collapsable list`],group:`Basic blocks`},numbered_list:{title:`Numbered List`,subtext:`List with ordered items`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`],group:`Basic blocks`},bullet_list:{title:`Bullet List`,subtext:`List with unordered items`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`],group:`Basic blocks`},check_list:{title:`Check List`,subtext:`List with checkboxes`,aliases:[`ul`,`li`,`list`,`checklist`,`check list`,`checked list`,`checkbox`],group:`Basic blocks`},paragraph:{title:`Paragraph`,subtext:`The body of your document`,aliases:[`p`,`paragraph`],group:`Basic blocks`},code_block:{title:`Code Block`,subtext:`Code block with syntax highlighting`,aliases:[`code`,`pre`],group:`Basic blocks`},page_break:{title:`Page Break`,subtext:`Page separator`,aliases:[`page`,`break`,`separator`],group:`Basic blocks`},table:{title:`Table`,subtext:`Table with editable cells`,aliases:[`table`],group:`Advanced`},image:{title:`Image`,subtext:`Resizable image with caption`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`url`],group:`Media`},video:{title:`Video`,subtext:`Resizable video with caption`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`url`],group:`Media`},audio:{title:`Audio`,subtext:`Embedded audio with caption`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`url`],group:`Media`},file:{title:`File`,subtext:`Embedded file`,aliases:[`file`,`upload`,`embed`,`media`,`url`],group:`Media`},emoji:{title:`Emoji`,subtext:`Search for and insert an emoji`,aliases:[`emoji`,`emote`,`emotion`,`face`],group:`Others`},divider:{title:`Divider`,subtext:`Visually divide blocks`,aliases:[`divider`,`hr`,`line`,`horizontal rule`],group:`Basic blocks`}},placeholders:{default:`Enter text or type '/' for commands`,heading:`Heading`,toggleListItem:`Toggle`,bulletListItem:`List`,numberedListItem:`List`,checkListItem:`List`,emptyDocument:void 0,new_comment:`Write a comment...`,edit_comment:`Edit comment...`,comment_reply:`Add comment...`},file_blocks:{add_button_text:{image:`Add image`,video:`Add video`,audio:`Add audio`,file:`Add file`}},toggle_blocks:{add_block_button:`Empty toggle. Click to add a block.`},side_menu:{add_block_label:`Add block`,drag_handle_label:`Open block menu`},drag_handle:{delete_menuitem:`Delete`,colors_menuitem:`Colors`,header_row_menuitem:`Header row`,header_column_menuitem:`Header column`},table_handle:{delete_column_menuitem:`Delete column`,delete_row_menuitem:`Delete row`,add_left_menuitem:`Add column left`,add_right_menuitem:`Add column right`,add_above_menuitem:`Add row above`,add_below_menuitem:`Add row below`,split_cell_menuitem:`Split cell`,merge_cells_menuitem:`Merge cells`,background_color_menuitem:`Background color`},suggestion_menu:{no_items_title:`No items found`},color_picker:{text_title:`Text`,background_title:`Background`,colors:{default:`Default`,gray:`Gray`,brown:`Brown`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,blue:`Blue`,purple:`Purple`,pink:`Pink`}},formatting_toolbar:{bold:{tooltip:`Bold`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Italic`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Underline`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Strike`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Colors`},link:{tooltip:`Create link`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Edit caption`,input_placeholder:`Edit caption`},file_replace:{tooltip:{image:`Replace image`,video:`Replace video`,audio:`Replace audio`,file:`Replace file`}},file_rename:{tooltip:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`},input_placeholder:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`}},file_download:{tooltip:{image:`Download image`,video:`Download video`,audio:`Download audio`,file:`Download file`}},file_delete:{tooltip:{image:`Delete image`,video:`Delete video`,audio:`Delete audio`,file:`Delete file`}},file_preview_toggle:{tooltip:`Toggle preview`},nest:{tooltip:`Nest block`,secondary_tooltip:`Tab`},unnest:{tooltip:`Unnest block`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Align text left`},align_center:{tooltip:`Align text center`},align_right:{tooltip:`Align text right`},align_justify:{tooltip:`Justify text`},table_cell_merge:{tooltip:`Merge cells`},comment:{tooltip:`Add comment`}},file_panel:{upload:{title:`Upload`,file_placeholder:{image:`Upload image`,video:`Upload video`,audio:`Upload audio`,file:`Upload file`},upload_error:`Error: Upload failed`},embed:{title:`Embed`,embed_button:{image:`Embed image`,video:`Embed video`,audio:`Embed audio`,file:`Embed file`},url_placeholder:`Enter URL`}},link_toolbar:{delete:{tooltip:`Remove link`},edit:{text:`Edit link`,tooltip:`Edit`},open:{tooltip:`Open in new tab`},form:{title_placeholder:`Edit title`,url_placeholder:`Edit URL`}},comments:{edited:`edited`,save_button_text:`Save`,cancel_button_text:`Cancel`,actions:{add_reaction:`Add reaction`,resolve:`Resolve`,edit_comment:`Edit comment`,delete_comment:`Delete comment`,more_actions:`More actions`},reactions:{reacted_by:`Reacted by`},sidebar:{marked_as_resolved:`Marked as resolved`,more_replies:e=>`${e} more replies`}},generic:{ctrl_shortcut:`Ctrl`}}}));function RNe(e){return function(t,n,r,i){let a=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);a+=n[0].slice(e+n[1].length),r+=e;let t=r-i;t>0&&(a=n[0].slice(e-t,e)+a,r=i)}return t.tr.insertText(a,r,i)}}function zNe({rules:e}){let t=new dM({state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return BNe(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&BNe(n,r.pos,r.pos,``,e,t)})}}},isInputRules:!0});return t}function BNe(e,t,n,r,i,a){if(e.composing)return!1;let o=e.state.tr.insertText(r,t,n),s=o.mapping.map(t),c=o.mapping.map(n),l=null,u=o.doc.resolve(s),d=u.parent.textBetween(Math.max(0,u.parentOffset-VNe),u.parentOffset,null,``);for(let t=0;t<i.length;t++){let n=i[t];if(!n.inCodeMark&&u.marks().some(e=>e.type.spec.code))continue;if(u.parent.type.spec.code){if(!n.inCode)continue}else if(n.inCode===`only`)continue;let f=n.match.exec(d);if(!f||f[0].length<r.length)continue;l??=e.state.apply(o);let p=n.handler(l,f,s-f[0].length,c);if(p)return e.dispatch(o),e.dispatch(d_e(e.state.tr)),n.undoable&&p.setMeta(a,{transform:p,from:s,to:c,text:r}),e.dispatch(p),!0}return!1}var i8,VNe,HNe=o((()=>{u1(),mM(),i8=class{match;handler;undoable;inCode;inCodeMark;constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?RNe(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}},VNe=500})),UNe=o((()=>{HNe(),new i8(/--$/,`—`,{inCodeMark:!1}),new i8(/\.\.\.$/,`…`,{inCodeMark:!1}),new i8(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`,{inCodeMark:!1}),new i8(/"$/,`”`,{inCodeMark:!1}),new i8(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`,{inCodeMark:!1}),new i8(/'$/,`’`,{inCodeMark:!1})})),WNe=o((()=>{HNe(),UNe()}));function GNe(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function KNe(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||GNe(e.type))return!0;if(e.inlineContent)return!1}}return!0}function qNe(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||GNe(e.type))return!0;if(e.inlineContent)return!1}}return!0}function JNe(){return new dM({props:{decorations:ZNe,createSelectionBetween(e,t,n){return t.pos==n.pos&&o8.valid(n)?new o8(n):null},handleClick:YNe,handleKeyDown:$Ne,handleDOMEvents:{beforeinput:XNe}}})}function a8(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof z){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=o8.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new o8(c))),!0):!1}}function YNe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!o8.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&iM.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new o8(r))),!0)}function XNe(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof o8))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=L.empty;for(let e=r.length-1;e>=0;e--)i=L.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new R(i,0,0));return a.setSelection(z.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function ZNe(e){if(!(e.selection instanceof o8))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,OP.create(e.doc,[TP.widget(e.selection.head,t,{key:`gapcursor`})])}var o8,QNe,$Ne,ePe=o((()=>{cK(),mM(),gj(),zP(),o8=class e extends eM{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):eM.near(r)}content(){return R.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new QNe(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!KNe(e)||!qNe(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!iM.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}},o8.prototype.visible=!1,o8.findFrom=o8.findGapCursorFrom,eM.jsonID(`gapcursor`,o8),QNe=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return o8.valid(t)?new o8(t):eM.near(t)}},$Ne=aK({ArrowLeft:a8(`horiz`,-1),ArrowRight:a8(`horiz`,1),ArrowUp:a8(`vert`,-1),ArrowDown:a8(`vert`,1)})})),tPe=o((()=>{ePe()})),nPe,rPe=o((()=>{cY(),tPe(),nPe=GJ.create({name:`gapCursor`,addProseMirrorPlugins(){return[JNe()]},extendNodeSchema(e){return{allowGapCursor:BK(B(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}})}));function iPe(e,t){return e in t||(t[e]=[]),t[e]}function s8(e,t,n){t[m8]&&(t[_8]=!0,t[v8]=!0),t[h8]&&(t[_8]=!0,t[g8]=!0),t[_8]&&(t[v8]=!0),t[g8]&&(t[v8]=!0),t[v8]&&(t[y8]=!0),t[b8]&&(t[y8]=!0);for(let r in t){let t=iPe(r,n);t.indexOf(e)<0&&t.push(e)}}function aPe(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function c8(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}function oPe(e=[]){let t={};c8.groups=t;let n=new c8;F5??=lPe(vPe),I5??=lPe(yPe),X(n,`'`,e5),X(n,`{`,L8),X(n,`}`,R8),X(n,`[`,z8),X(n,`]`,B8),X(n,`(`,V8),X(n,`)`,H8),X(n,`<`,U8),X(n,`>`,W8),X(n,`(`,G8),X(n,`)`,K8),X(n,`「`,q8),X(n,`」`,J8),X(n,`『`,Y8),X(n,`』`,X8),X(n,`<`,Z8),X(n,`>`,Q8),X(n,`&`,$8),X(n,`*`,t5),X(n,`@`,n5),X(n,"`",i5),X(n,`^`,a5),X(n,`:`,o5),X(n,`,`,s5),X(n,`$`,c5),X(n,`.`,l5),X(n,`=`,u5),X(n,`!`,d5),X(n,`-`,f5),X(n,`%`,p5),X(n,`|`,m5),X(n,`+`,h5),X(n,`#`,g5),X(n,`?`,_5),X(n,`"`,v5),X(n,`/`,x5),X(n,`;`,b5),X(n,`~`,S5),X(n,`_`,C5),X(n,`\\`,r5),X(n,`・`,y5);let r=C8(n,A5,P8,{[m8]:!0});C8(r,A5,r);let i=C8(r,D5,D8,{[_8]:!0}),a=C8(r,O5,O8,{[v8]:!0}),o=C8(n,D5,T8,{[h8]:!0});C8(o,A5,i),C8(o,D5,o),C8(i,A5,i),C8(i,D5,i);let s=C8(n,O5,E8,{[g8]:!0});C8(s,D5),C8(s,A5,a),C8(s,O5,s),C8(a,A5,a),C8(a,D5),C8(a,O5,a);let c=X(n,N5,I8,{[x8]:!0}),l=X(n,M5,F8,{[x8]:!0}),u=C8(n,j5,F8,{[x8]:!0});X(n,P5,u),X(l,N5,c),X(l,P5,u),C8(l,j5,u),X(u,M5),X(u,N5),C8(u,j5,u),X(u,P5,u);let d=C8(n,k5,w5,{[b8]:!0});X(d,`#`),C8(d,k5,d),X(d,SPe,d);let f=X(d,CPe);X(f,`#`),C8(f,k5,d);let p=[[D5,o],[A5,i]],m=[[D5,null],[O5,s],[A5,a]];for(let e=0;e<F5.length;e++)l8(n,F5[e],A8,T8,p);for(let e=0;e<I5.length;e++)l8(n,I5[e],j8,E8,m);s8(A8,{tld:!0,ascii:!0},t),s8(j8,{utld:!0,alpha:!0},t),l8(n,`file`,M8,T8,p),l8(n,`mailto`,M8,T8,p),l8(n,`http`,N8,T8,p),l8(n,`https`,N8,T8,p),l8(n,`ftp`,N8,T8,p),l8(n,`ftps`,N8,T8,p),s8(M8,{scheme:!0,ascii:!0},t),s8(N8,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[bPe]:!0}:{[xPe]:!0};r.indexOf(`-`)>=0?i[y8]=!0:D5.test(r)?A5.test(r)?i[_8]=!0:i[h8]=!0:i[m8]=!0,w8(n,r,r,i)}return w8(n,`localhost`,k8,{ascii:!0}),n.jd=new c8(T5),{start:n,tokens:Object.assign({groups:t},E5)}}function sPe(e,t){let n=cPe(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function cPe(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function l8(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new c8(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new c8(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function lPe(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}function u8(e,t=null){let n=Object.assign({},L5);e&&(n=Object.assign(n,e instanceof u8?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function uPe(e){return e}function dPe(e,t){this.t=`token`,this.v=e,this.tk=t}function d8(e,t){class n extends dPe{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}function fPe({groups:e}){let t=e.domain.concat([$8,t5,n5,r5,i5,a5,c5,u5,f5,P8,p5,m5,h5,g5,x5,T5,S5,C5]),n=[e5,o5,s5,l5,d5,p5,_5,v5,b5,U8,W8,L8,R8,B8,z8,V8,H8,G8,K8,q8,J8,Y8,X8,Z8,Q8],r=[$8,e5,t5,r5,i5,a5,c5,u5,f5,L8,R8,p5,m5,h5,g5,_5,x5,T5,S5,C5],i=V5(),a=X(i,S5);S8(a,r,a),S8(a,e.domain,a);let o=V5(),s=V5(),c=V5();S8(i,e.domain,o),S8(i,e.scheme,s),S8(i,e.slashscheme,c),S8(o,r,a),S8(o,e.domain,o);let l=X(o,n5);X(a,n5,l),X(s,n5,l),X(c,n5,l);let u=X(a,l5);S8(u,r,a),S8(u,e.domain,a);let d=V5();S8(l,e.domain,d),S8(d,e.domain,d);let f=X(d,l5);S8(f,e.domain,d);let p=V5(R5);S8(f,e.tld,p),S8(f,e.utld,p),X(l,k8,p);let m=X(d,f5);X(m,f5,m),S8(m,e.domain,d),S8(p,e.domain,d),X(p,l5,f),X(p,f5,m),S8(X(p,o5),e.numeric,R5);let h=X(o,f5),g=X(o,l5);X(h,f5,h),S8(h,e.domain,o),S8(g,r,a),S8(g,e.domain,o);let _=V5(B5);S8(g,e.tld,_),S8(g,e.utld,_),S8(_,e.domain,o),S8(_,r,a),X(_,l5,g),X(_,f5,h),X(_,n5,l);let v=X(_,o5),y=V5(B5);S8(v,e.numeric,y);let b=V5(B5),x=V5();S8(b,t,b),S8(b,n,x),S8(x,t,b),S8(x,n,x),X(_,x5,b),X(y,x5,b);let S=X(s,o5),C=X(X(X(c,o5),x5),x5);S8(s,e.domain,o),X(s,l5,g),X(s,f5,h),S8(c,e.domain,o),X(c,l5,g),X(c,f5,h),S8(S,e.domain,b),X(S,x5,b),X(S,_5,b),S8(C,e.domain,b),S8(C,t,b),X(C,x5,b);let w=[[L8,R8],[z8,B8],[V8,H8],[U8,W8],[G8,K8],[q8,J8],[Y8,X8],[Z8,Q8]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=X(b,r);X(x,r,a),X(a,i,b);let o=V5(B5);S8(a,t,o);let s=V5();S8(a,n),S8(o,t,o),S8(o,n,s),S8(s,t,o),S8(s,n,s),X(o,i,b),X(s,i,b)}return X(i,k8,_),X(i,I8,wPe),{start:i,tokens:E5}}function pPe(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(f8(z5,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(f8(e,t,r))}}return o.length>0&&a.push(f8(z5,t,o)),a}function f8(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}function mPe(){return c8.groups={},H5.scanner=null,H5.parser=null,H5.tokenQueue=[],H5.pluginQueue=[],H5.customSchemes=[],H5.initialized=!1,H5}function hPe(e,t=!1){if(H5.initialized&&TPe(`linkifyjs: already initialized - will not register custom scheme "${e}" ${EPe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
167
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
168
|
+
2. Cannot start or end with "-"
|
|
169
|
+
3. "-" cannot repeat`);H5.customSchemes.push([e,t])}function gPe(){H5.scanner=oPe(H5.customSchemes);for(let e=0;e<H5.tokenQueue.length;e++)H5.tokenQueue[e][1]({scanner:H5.scanner});H5.parser=fPe(H5.scanner.tokens);for(let e=0;e<H5.pluginQueue.length;e++)H5.pluginQueue[e][1]({scanner:H5.scanner,parser:H5.parser});return H5.initialized=!0,H5}function p8(e){return H5.initialized||gPe(),pPe(H5.parser.start,e,sPe(H5.scanner.start,e))}function _Pe(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new u8(n),i=p8(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var vPe,yPe,m8,h8,g8,_8,v8,y8,b8,bPe,xPe,x8,S8,C8,w8,X,T8,E8,D8,O8,k8,A8,j8,M8,N8,P8,F8,I8,L8,R8,z8,B8,V8,H8,U8,W8,G8,K8,q8,J8,Y8,X8,Z8,Q8,$8,e5,t5,n5,r5,i5,a5,o5,s5,c5,l5,u5,d5,f5,p5,m5,h5,g5,_5,v5,y5,b5,x5,S5,C5,w5,T5,E5,D5,O5,k5,A5,j5,M5,N5,SPe,CPe,P5,F5,I5,L5,R5,z5,wPe,B5,V5,TPe,EPe,H5,DPe=o((()=>{vPe=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,yPe=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,m8=`numeric`,h8=`ascii`,g8=`alpha`,_8=`asciinumeric`,v8=`alphanumeric`,y8=`domain`,b8=`emoji`,bPe=`scheme`,xPe=`slashscheme`,x8=`whitespace`,c8.groups={},c8.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=c8.groups;let i;return t&&t.j?i=t:(i=new c8(t),n&&r&&s8(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=c8.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new c8,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new c8,a&&(r&&(o.t&&typeof o.t==`string`?s8(a,Object.assign(aPe(o.t,r),n),r):n&&s8(a,n,r)),o.t=a),i.j[e]=o,o}},S8=(e,t,n,r,i)=>e.ta(t,n,r,i),C8=(e,t,n,r,i)=>e.tr(t,n,r,i),w8=(e,t,n,r,i)=>e.ts(t,n,r,i),X=(e,t,n,r,i)=>e.tt(t,n,r,i),T8=`WORD`,E8=`UWORD`,D8=`ASCIINUMERICAL`,O8=`ALPHANUMERICAL`,k8=`LOCALHOST`,A8=`TLD`,j8=`UTLD`,M8=`SCHEME`,N8=`SLASH_SCHEME`,P8=`NUM`,F8=`WS`,I8=`NL`,L8=`OPENBRACE`,R8=`CLOSEBRACE`,z8=`OPENBRACKET`,B8=`CLOSEBRACKET`,V8=`OPENPAREN`,H8=`CLOSEPAREN`,U8=`OPENANGLEBRACKET`,W8=`CLOSEANGLEBRACKET`,G8=`FULLWIDTHLEFTPAREN`,K8=`FULLWIDTHRIGHTPAREN`,q8=`LEFTCORNERBRACKET`,J8=`RIGHTCORNERBRACKET`,Y8=`LEFTWHITECORNERBRACKET`,X8=`RIGHTWHITECORNERBRACKET`,Z8=`FULLWIDTHLESSTHAN`,Q8=`FULLWIDTHGREATERTHAN`,$8=`AMPERSAND`,e5=`APOSTROPHE`,t5=`ASTERISK`,n5=`AT`,r5=`BACKSLASH`,i5=`BACKTICK`,a5=`CARET`,o5=`COLON`,s5=`COMMA`,c5=`DOLLAR`,l5=`DOT`,u5=`EQUALS`,d5=`EXCLAMATION`,f5=`HYPHEN`,p5=`PERCENT`,m5=`PIPE`,h5=`PLUS`,g5=`POUND`,_5=`QUERY`,v5=`QUOTE`,y5=`FULLWIDTHMIDDLEDOT`,b5=`SEMI`,x5=`SLASH`,S5=`TILDE`,C5=`UNDERSCORE`,w5=`EMOJI`,T5=`SYM`,E5=Object.freeze({__proto__:null,ALPHANUMERICAL:O8,AMPERSAND:$8,APOSTROPHE:e5,ASCIINUMERICAL:D8,ASTERISK:t5,AT:n5,BACKSLASH:r5,BACKTICK:i5,CARET:a5,CLOSEANGLEBRACKET:W8,CLOSEBRACE:R8,CLOSEBRACKET:B8,CLOSEPAREN:H8,COLON:o5,COMMA:s5,DOLLAR:c5,DOT:l5,EMOJI:w5,EQUALS:u5,EXCLAMATION:d5,FULLWIDTHGREATERTHAN:Q8,FULLWIDTHLEFTPAREN:G8,FULLWIDTHLESSTHAN:Z8,FULLWIDTHMIDDLEDOT:y5,FULLWIDTHRIGHTPAREN:K8,HYPHEN:f5,LEFTCORNERBRACKET:q8,LEFTWHITECORNERBRACKET:Y8,LOCALHOST:k8,NL:I8,NUM:P8,OPENANGLEBRACKET:U8,OPENBRACE:L8,OPENBRACKET:z8,OPENPAREN:V8,PERCENT:p5,PIPE:m5,PLUS:h5,POUND:g5,QUERY:_5,QUOTE:v5,RIGHTCORNERBRACKET:J8,RIGHTWHITECORNERBRACKET:X8,SCHEME:M8,SEMI:b5,SLASH:x5,SLASH_SCHEME:N8,SYM:T5,TILDE:S5,TLD:A8,UNDERSCORE:C5,UTLD:j8,UWORD:E8,WORD:T8,WS:F8}),D5=/[a-z]/,O5=/\p{L}/u,k5=/\p{Emoji}/u,A5=/\d/,j5=/\s/,M5=`\r`,N5=`
|
|
170
|
+
`,SPe=`️`,CPe=``,P5=``,F5=null,I5=null,L5={defaultProtocol:`http`,events:null,format:uPe,formatHref:uPe,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null},u8.prototype={o:L5,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:L5[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}},dPe.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=L5.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}},R5=d8(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),z5=d8(`text`),wPe=d8(`nl`),B5=d8(`url`,{isLink:!0,toHref(e=L5.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==k8&&e[1].t===o5}}),V5=e=>new c8(e),TPe=typeof console<`u`&&console&&console.warn||(()=>{}),EPe=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,H5={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1},p8.scan=sPe}));function OPe(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function kPe(e){return new dM({key:new pM(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(tq(MK(n.doc,[...t])).forEach(({newRange:t})=>{let n=PK(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!NPe.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(MPe).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=p8(n).map(t=>t.toObject(e.defaultProtocol));if(!OPe(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{nq(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function APe(e){return new dM({key:new pM(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=eq(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function jPe(e){return new dM({key:new pM(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=_Pe(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function U5(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(PPe,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var W5,MPe,NPe,PPe,FPe,IPe=o((()=>{cY(),DPe(),YG(),W5=`[\0- \xA0 -\u2029 ]`,MPe=new RegExp(W5),NPe=RegExp(`${W5}$`),PPe=new RegExp(W5,`g`),FPe=RJ.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){hPe(e);return}hPe(e.scheme,e.optionalSlashes)})},onDestroy(){mPe()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!U5(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!U5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!U5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,WK(this.options.HTMLAttributes,e),0]:[`a`,WK(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!U5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!U5(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addPasteRules(){return[_q({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=_Pe(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!U5(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(kPe({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!U5(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(APe({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(jPe({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}})})),LPe,RPe=o((()=>{cY(),LPe=sY.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``})}));function zPe(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),t6(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return r3(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var BPe,VPe=o((()=>{n6(),f3(),BPe={tokenize:zPe}}));function HPe(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return I3(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(G5,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(G5,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return r3(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;I3(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function UPe(e,t,n){return t6(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var WPe,G5,GPe=o((()=>{n6(),f3(),R3(),WPe={tokenize:HPe},G5={tokenize:UPe}}));function KPe(e){let t=this,n=e.attempt(r6,r,e.attempt(this.parser.constructs.flowInitial,i,t6(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Vke,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var qPe,JPe=o((()=>{b6(),n6(),qPe={tokenize:KPe}}));function YPe(e){return{resolveAll:XPe(e===`text`?ZPe:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function XPe(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function ZPe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var QPe,$Pe,eFe,tFe=o((()=>{QPe={resolveAll:XPe()},$Pe=YPe(`string`),eFe=YPe(`text`)})),nFe=c({attentionMarkers:()=>uFe,contentInitial:()=>iFe,disable:()=>dFe,document:()=>rFe,flow:()=>oFe,flowInitial:()=>aFe,insideSpan:()=>lFe,string:()=>sFe,text:()=>cFe}),rFe,iFe,aFe,oFe,sFe,cFe,lFe,uFe,dFe,fFe=o((()=>{b6(),tFe(),rFe={42:v6,43:v6,45:v6,48:v6,49:v6,50:v6,51:v6,52:v6,53:v6,54:v6,55:v6,56:v6,57:v6,62:a6},iFe={91:$ke},aFe={[-2]:u6,[-1]:u6,32:u6},oFe={35:sAe,42:_6,45:[y6,_6],60:hAe,61:y6,95:_6,96:l6,126:l6},sFe={38:s6,92:o6},cFe={[-5]:g6,[-4]:g6,[-3]:g6,33:MAe,38:s6,42:e6,60:[uke,bAe],91:FAe,92:[rAe,o6],93:m6,95:e6,96:jke},lFe={null:[e6,QPe]},uFe={null:[42,95]},dFe={null:[]}}));function pFe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=L3(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Q3(a,l.events,l),l.events):[]}function f(e,t){return hFe(p(e),t)}function p(e){return mFe(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){r3(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&I3(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function mFe(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function hFe(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
171
|
+
`;break;case-3:o=`\r
|
|
172
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}var gFe=o((()=>{f3(),R3(),$3()}));function _Fe(e){let t={constructs:zOe([nFe,...(e||{}).extensions||[]]),content:n(BPe),defined:[],document:n(WPe),flow:n(qPe),lazy:{},string:n($Pe),text:n(eFe)};return t;function n(e){return n;function n(n){return pFe(t,e,n)}}}var vFe=o((()=>{HOe(),VPe(),GPe(),JPe(),tFe(),fFe(),gFe()}));function yFe(e){for(;!Fke(e););return e}var bFe=o((()=>{Lke()}));function xFe(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(K5.lastIndex=u,c=K5.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var K5,SFe=o((()=>{K5=/[\0\t\n\r]/g})),CFe=o((()=>{vFe(),bFe(),SFe()}));function wFe(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),TFe(n)(yFe(_Fe(n).document().write(xFe()(e,t,!0))))}function TFe(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(me),characterEscape:T,characterReference:T,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ve),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:se,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:de,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(A),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(ee),htmlFlowData:E,htmlText:c(k),htmlTextData:E,image:c(ne),label:ie,labelText:re,lineEnding:D,link:c(te),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:j,resourceTitleString:ae,resource:oe,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};EFe(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];J5.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||OFe).call(a,void 0,e[0])}for(r.position={start:q5(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:q5(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:q5(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||OFe).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+W2({start:e.start,end:e.end})+`): it’s not open`);n.position.end=q5(e.end)}function u(){return W4(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=g3(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Oe(),n.position={start:q5(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=q5(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=q5(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=HDe(t),n.identifier=g3(t).toLowerCase()}function ie(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function oe(){this.data.inReference=void 0}function se(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=g3(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function ue(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=BDe(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=j3(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=q5(e.end)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[]}}function he(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function _e(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ve(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function q5(e){return{line:e.line,column:e.column,offset:e.offset}}function EFe(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?EFe(e,r):DFe(e,r)}}function DFe(e,t){let n;for(n in t)if(J5.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function OFe(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+W2({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+W2({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+W2({start:t.start,end:t.end})+`) is still open`)}var J5,kFe=o((()=>{G4(),CFe(),VDe(),GDe(),_3(),N3(),qbe(),J5={}.hasOwnProperty})),AFe=o((()=>{kFe()}));function jFe(e){let t=this;t.parser=n;function n(n){return wFe(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var MFe=o((()=>{AFe()})),NFe=o((()=>{MFe()}));function PFe(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}var FFe=o((()=>{}));function IFe(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
173
|
+
`}]}var LFe=o((()=>{}));function RFe(e,t){let n=t.value?t.value+`
|
|
174
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}var zFe=o((()=>{}));function BFe(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var VFe=o((()=>{}));function HFe(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var UFe=o((()=>{}));function WFe(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=X3(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}var GFe=o((()=>{Z3()}));function KFe(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var qFe=o((()=>{}));function JFe(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}var YFe=o((()=>{}));function XFe(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}var ZFe=o((()=>{}));function QFe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XFe(e,t);let i={src:X3(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}var $Fe=o((()=>{Z3(),ZFe()}));function eIe(e,t){let n={src:X3(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}var tIe=o((()=>{Z3()}));function nIe(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}var rIe=o((()=>{}));function iIe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return XFe(e,t);let i={href:X3(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}var aIe=o((()=>{Z3(),ZFe()}));function oIe(e,t){let n={href:X3(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}var sIe=o((()=>{Z3()}));function cIe(e,t,n){let r=e.all(t),i=n?lIe(n):uIe(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
175
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
176
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function lIe(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=uIe(n[r])}return t}function uIe(e){return e.spread??e.children.length>1}var dIe=o((()=>{}));function fIe(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}var pIe=o((()=>{}));function mIe(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var hIe=o((()=>{}));function gIe(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}var _Ie=o((()=>{}));function vIe(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var yIe=o((()=>{}));function bIe(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=C4(t.children[1]),o=S4(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}var xIe=o((()=>{w4()}));function SIe(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}var CIe=o((()=>{}));function wIe(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var TIe=o((()=>{}));function EIe(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(DIe(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(DIe(t.slice(i),i>0,!1)),a.join(``)}function DIe(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Y5||t===X5;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Y5||t===X5;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}var Y5,X5,OIe=o((()=>{Y5=9,X5=32}));function kIe(e,t){let n={type:`text`,value:EIe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}var AIe=o((()=>{OIe()}));function jIe(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var MIe=o((()=>{}));function Z5(){}var Q5,NIe=o((()=>{FFe(),LFe(),zFe(),VFe(),UFe(),GFe(),qFe(),YFe(),$Fe(),tIe(),rIe(),aIe(),sIe(),dIe(),pIe(),hIe(),_Ie(),yIe(),xIe(),CIe(),TIe(),AIe(),MIe(),Q5={blockquote:PFe,break:IFe,code:RFe,delete:BFe,emphasis:HFe,footnoteReference:WFe,heading:KFe,html:JFe,imageReference:QFe,image:eIe,inlineCode:nIe,linkReference:iIe,link:oIe,listItem:cIe,list:fIe,paragraph:mIe,root:gIe,strong:vIe,table:bIe,tableCell:wIe,tableRow:SIe,text:kIe,thematicBreak:jIe,toml:Z5,yaml:Z5,definition:Z5,footnoteDefinition:Z5}}));function PIe(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function FIe(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function IIe(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||PIe,r=e.options.footnoteBackLabel||FIe,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=X3(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...o4(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
177
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
178
|
+
`}]}}var LIe=o((()=>{s4(),Z3()}));function RIe(e,t){let n=t||WIe,r=new Map,i=new Map,a={all:s,applyData:BIe,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Q5,...n.handlers},one:o,options:n,patch:zIe,wrap:HIe};return b4(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if($5.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=o4(n);return r.children=a.all(e),r}return o4(e)}return(a.options.unknownHandler||VIe)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=UIe(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=UIe(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function zIe(e,t){e.position&&(t.position=ISe(e))}function BIe(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,o4(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function VIe(e,t){let n=t.data||{},r=`value`in t&&!($5.call(n,`hProperties`)||$5.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function HIe(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
179
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
180
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
181
|
+
`}),n}function UIe(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}var $5,WIe,GIe=o((()=>{s4(),x4(),w4(),NIe(),$5={}.hasOwnProperty,WIe={}}));function KIe(e,t){let n=RIe(e,t),r=n.one(e,void 0),i=IIe(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
182
|
+
`},i)),a}var qIe=o((()=>{d1(),LIe(),GIe()})),JIe=o((()=>{NIe(),qIe()}));function YIe(e,t){return e&&`run`in e?async function(n,r){let i=KIe(n,{file:r,...t});await e.run(i,r)}:function(n,r){return KIe(n,{file:r,...e||t})}}var XIe=o((()=>{JIe()})),ZIe=o((()=>{JIe(),XIe()})),QIe,$Ie=o((()=>{QIe=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]}));function eLe(e,t){if(e=e.replace(t.subset?tLe(t.subset):rLe,r),t.subset||t.escapeOnly)return e;return e.replace(iLe,n).replace(aLe,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function tLe(e){let t=e7.get(e);return t||(t=nLe(e),e7.set(e,t)),t}function nLe(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(oLe,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var rLe,iLe,aLe,oLe,e7,sLe=o((()=>{rLe=/["&'<>`]/g,iLe=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,aLe=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,oLe=/[|\\{}()[\]^$+*?.]/g,e7=new WeakMap}));function cLe(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!lLe.test(String.fromCharCode(t))?r:r+`;`}var lLe,uLe=o((()=>{lLe=/[\dA-Fa-f]/}));function dLe(e,t,n){let r=`&#`+String(e);return n&&t&&!fLe.test(String.fromCharCode(t))?r:r+`;`}var fLe,pLe=o((()=>{fLe=/\d/})),mLe,hLe=o((()=>{mLe=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`)})),t7,gLe=o((()=>{t7={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`}})),_Le,vLe=o((()=>{_Le=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`]}));function yLe(e,t,n,r){let i=String.fromCharCode(e);if(n7.call(r7,i)){let e=r7[i],a=`&`+e;return n&&mLe.includes(e)&&!_Le.includes(e)&&(!r||t&&t!==61&&bLe.test(String.fromCharCode(t)))?a:a+`;`}return``}var n7,r7,i7,bLe,xLe=o((()=>{for(i7 in hLe(),gLe(),vLe(),n7={}.hasOwnProperty,r7={},t7)n7.call(t7,i7)&&(r7[t7[i7]]=i7);bLe=/[^\dA-Za-z]/}));function SLe(e,t,n){let r=cLe(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=yLe(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=dLe(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}var CLe=o((()=>{uLe(),pLe(),xLe()}));function a7(e,t){return eLe(e,Object.assign({format:SLe},t))}var wLe=o((()=>{sLe(),CLe()})),o7=o((()=>{wLe()}));function TLe(e,t,n,r){return r.settings.bogusComments?`<?`+a7(e.value,Object.assign({},r.settings.characterReferences,{subset:DLe}))+`>`:`<!--`+e.value.replace(ELe,i)+`-->`;function i(e){return a7(e,Object.assign({},r.settings.characterReferences,{subset:OLe}))}}var ELe,DLe,OLe,kLe=o((()=>{o7(),ELe=/^>|^->|<!--|-->|--!>|<!-$/g,DLe=[`>`],OLe=[`<`,`>`]}));function ALe(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var jLe=o((()=>{}));function MLe(e){return t;function t(t,n,r){let i=t?t.children:NLe,a=(n||0)+e,o=i[a];if(!r)for(;o&&p4(o);)a+=e,o=i[a];return o}}var s7,c7,NLe,PLe=o((()=>{m4(),s7=MLe(1),c7=MLe(-1),NLe=[]}));function FLe(e){return t;function t(t,n,r){return ILe.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var ILe,LLe=o((()=>{ILe={}.hasOwnProperty}));function l7(e,t,n){let r=s7(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&p4(r.value.charAt(0)))}function RLe(e,t,n){let r=s7(n,t);return!r||r.type!==`comment`}function zLe(e,t,n){let r=s7(n,t);return!r||r.type!==`comment`}function BLe(e,t,n){let r=s7(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function VLe(e,t,n){let r=s7(n,t);return!r||r.type===`element`&&r.tagName===`li`}function HLe(e,t,n){let r=s7(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function ULe(e,t,n){let r=s7(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function WLe(e,t,n){let r=s7(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function GLe(e,t,n){let r=s7(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function KLe(e,t,n){let r=s7(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function qLe(e,t,n){let r=s7(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function JLe(e,t,n){let r=s7(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function YLe(e,t,n){return!s7(n,t)}function XLe(e,t,n){let r=s7(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function ZLe(e,t,n){let r=s7(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var u7,QLe=o((()=>{m4(),PLe(),LLe(),u7=FLe({body:zLe,caption:l7,colgroup:l7,dd:ULe,dt:HLe,head:l7,html:RLe,li:VLe,optgroup:GLe,option:KLe,p:BLe,rp:WLe,rt:WLe,tbody:JLe,td:ZLe,tfoot:YLe,th:ZLe,thead:qLe,tr:XLe})}));function $Le(e){let t=s7(e,-1);return!t||t.type!==`comment`}function eRe(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function tRe(e){let t=s7(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&p4(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function nRe(e,t,n){let r=c7(n,t),i=s7(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&u7(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function rRe(e,t,n){let r=c7(n,t),i=s7(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&u7(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var iRe,aRe=o((()=>{m4(),PLe(),QLe(),LLe(),iRe=FLe({body:tRe,colgroup:nRe,head:eRe,html:$Le,tbody:rRe})}));function oRe(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=X1);let l=sRe(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!iRe(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!u7(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function sRe(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=cRe(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function cRe(e,t,n){let r=G1(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=e.settings.allowDangerousCharacters?0:1,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=a7(r.attribute,Object.assign({},e.settings.characterReferences,{subset:d7.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?w_e:O_e)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=a7(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:d7.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&t3(n,o)>t3(n,e.alternative)&&(o=e.alternative),s=o+a7(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?d7.single:d7.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var d7,lRe=o((()=>{rTe(),$1(),Z1(),n0(),o7(),QLe(),aRe(),d7={name:[[`
|
|
183
|
+
\f\r &/=>`.split(``),`
|
|
184
|
+
\f\r "&'/=>\``.split(``)],[`\0
|
|
185
|
+
\f\r "&'/<=>`.split(``),`\0
|
|
186
|
+
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
187
|
+
\f\r &>`.split(``),`\0
|
|
188
|
+
\f\r "&'<=>\``.split(``)],[`\0
|
|
189
|
+
\f\r "&'<=>\``.split(``),`\0
|
|
190
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]}}));function uRe(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:a7(e.value,Object.assign({},r.settings.characterReferences,{subset:dRe}))}var dRe,fRe=o((()=>{o7(),dRe=[`<`,`&`]}));function pRe(e,t,n,r){return r.settings.allowDangerousHtml?e.value:uRe(e,t,n,r)}var mRe=o((()=>{fRe()}));function hRe(e,t,n,r){return r.all(e)}var gRe=o((()=>{}));function _Re(e){throw Error("Expected node, not `"+e+"`")}function vRe(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var yRe,bRe=o((()=>{sEe(),kLe(),jLe(),lRe(),mRe(),gRe(),fRe(),yRe=oEe(`type`,{invalid:_Re,unknown:vRe,handlers:{comment:TLe,doctype:ALe,element:oRe,raw:pRe,root:hRe,text:uRe}})}));function xRe(e,t){let n=t||wRe,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:SRe,all:CRe,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||QIe,characterReferences:n.characterReferences||TRe,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?X1:Y1,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function SRe(e,t,n){return yRe(e,t,n,this)}function CRe(e){let t=[],n=e&&e.children||ERe,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var wRe,TRe,ERe,DRe=o((()=>{$Ie(),Z1(),bRe(),wRe={},TRe={},ERe=[]})),ORe=o((()=>{DRe()}));function kRe(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return xRe(e,n)}}var ARe=o((()=>{ORe()})),jRe=o((()=>{ARe()}));function MRe(e,t,n,r=`before`){let i=typeof n==`string`?n:n.id,a=UY(e),o=t.map(e=>hX(e,a)),s=JZ(i,e.doc);if(!s)throw Error(`Block with ID ${i} not found`);let c=s.posBeforeNode;return r===`after`&&(c+=s.node.nodeSize),e.step(new Gj(c,c,new R(L.from(o),0,0))),o.map(e=>$Y(e,a))}function f7(e){if(!e||e.type.name!==`column`)throw Error(`Invalid columnPos: does not point to column node.`);let t=e.firstChild;if(!t)throw Error(`Invalid column: does not have child node.`);let n=t.firstChild;if(!n)throw Error(`Invalid blockContainer: does not have child node.`);return e.childCount===1&&t.childCount===1&&n.type.name===`paragraph`&&n.content.content.length===0}function NRe(e,t){let n=e.doc.resolve(t),r=n.nodeAfter;if(!r||r.type.name!==`columnList`)throw Error(`Invalid columnListPos: does not point to columnList node.`);for(let t=r.childCount-1;t>=0;t--){let r=e.doc.resolve(n.pos+1).posAtIndex(t),i=e.doc.resolve(r).nodeAfter;if(!i||i.type.name!==`column`)throw Error(`Invalid columnPos: does not point to column node.`);f7(i)&&e.delete(r,r+i.nodeSize)}}function p7(e,t){NRe(e,t);let n=e.doc.resolve(t).nodeAfter;if(!n||n.type.name!==`columnList`)throw Error(`Invalid columnListPos: does not point to columnList node.`);if(n.childCount>2)return;if(n.childCount<2)throw Error(`Invalid columnList: contains fewer than two children.`);let r=t+1,i=e.doc.resolve(r).nodeAfter,a=t+n.nodeSize-1,o=e.doc.resolve(a).nodeBefore;if(!i||!o)throw Error(`Invalid columnList: does not contain children.`);let s=f7(i),c=f7(o);if(s&&c){e.delete(t,t+n.nodeSize);return}if(s){e.step(new Kj(t,t+n.nodeSize,a-o.nodeSize+1,a-1,R.empty,0,!1));return}if(c){e.step(new Kj(t,t+n.nodeSize,r+1,r+i.nodeSize-1,R.empty,0,!1));return}}function PRe(e,t,n){let r=UY(e),i=n.map(e=>hX(e,r)),a=new Set(t.map(e=>typeof e==`string`?e:e.id)),o=[],s=new Set,c=typeof t[0]==`string`?t[0]:t[0].id,l=0;if(e.doc.descendants((t,u)=>{if(a.size===0)return!1;if(!t.type.isInGroup(`bnBlock`)||!a.has(t.attrs.id))return!0;if(o.push($Y(t,r)),a.delete(t.attrs.id),n.length>0&&t.attrs.id===c){let t=e.doc.nodeSize;e.insert(u,i);let n=e.doc.nodeSize;l+=t-n}let d=e.doc.nodeSize,f=e.doc.resolve(u-l);f.node().type.name===`column`?s.add(f.before(-1)):f.node().type.name===`columnList`&&s.add(f.before()),f.node().type.name===`blockGroup`&&f.node(f.depth-1).type.name!==`doc`&&f.node().childCount===1?e.delete(f.before(),f.after()):e.delete(u-l,u-l+t.nodeSize);let p=e.doc.nodeSize;return l+=d-p,!1}),a.size>0){let e=[...a].join(`
|
|
191
|
+
`);throw Error(`Blocks with the following IDs could not be found in the editor: `+e)}return s.forEach(t=>p7(e,t)),{insertedBlocks:i.map(e=>$Y(e,r)),removedBlocks:o}}function FRe(e,t,n,r,i){let a;if(t)if(typeof t==`string`)a=fX([t],e.pmSchema,r);else if(Array.isArray(t))a=fX(t,e.pmSchema,r);else if(t.type===`tableContent`)a=pX(t,e.pmSchema);else throw new _X(t.type);else throw Error(`blockContent is required`);let o=(i?.document??document).createDocumentFragment();for(let t of a)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let r=e.schema.inlineContentSpecs[t.type.name].implementation;if(r){let a=QY(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=r.render.call({renderType:`dom`,props:void 0},a,()=>{},e);if(s){if(o.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,i);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=e.schema.styleSpecs[r.type.name].implementation.render(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=mj.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}o.appendChild(n)}else{let e=n.serializeFragment(L.from([t]),i);o.appendChild(e)}return o}function IRe(e,t,n,r){var i,a,o,s;let c=e.pmSchema.nodes.blockContainer,l=t.props||{};for(let[n,r]of Object.entries(e.schema.blockSchema[t.type].propSchema))!(n in l)&&r.default!==void 0&&(l[n]=r.default);let u=t.children||[],d=e.blockImplementations[t.type].implementation.render.call({renderType:`dom`,props:void 0},{...t,props:l,children:u},e);if(d.contentDOM&&t.content){let i=FRe(e,t.content,n,t.type,r);d.contentDOM.appendChild(i)}if(e.pmSchema.nodes[t.type].isInGroup(`bnBlock`)){if(t.children&&t.children.length>0){let a=LRe(e,t.children,n,r);(i=d.contentDOM)==null||i.append(a)}return d.dom}let f=((a=c.spec)?.toDOM)?.call(a,c.create({id:t.id,...l}));return(o=f.contentDOM)==null||o.appendChild(d.dom),t.children&&t.children.length>0&&((s=f.contentDOM)==null||s.appendChild(g7(e,t.children,n,r))),f.dom}function LRe(e,t,n,r){let i=(r?.document??document).createDocumentFragment();for(let a of t){let t=IRe(e,a,n,r);i.appendChild(t)}return i}function RRe(e){return e.transact(e=>{let t=LY(e.doc,e.selection.anchor);if(e.selection instanceof nZ)return{type:`cell`,anchorBlockId:t.node.attrs.id,anchorCellOffset:e.selection.$anchorCell.pos-t.posBeforeNode,headCellOffset:e.selection.$headCell.pos-t.posBeforeNode};if(e.selection instanceof iM)return{type:`node`,anchorBlockId:t.node.attrs.id};{let n=LY(e.doc,e.selection.head);return{type:`text`,anchorBlockId:t.node.attrs.id,headBlockId:n.node.attrs.id,anchorOffset:e.selection.anchor-t.posBeforeNode,headOffset:e.selection.head-n.posBeforeNode}}})}function zRe(e,t){let n=JZ(t.anchorBlockId,e.doc)?.posBeforeNode;if(n===void 0)throw Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);let r;if(t.type===`cell`)r=nZ.create(e.doc,n+t.anchorCellOffset,n+t.headCellOffset);else if(t.type===`node`)r=iM.create(e.doc,n+1);else{let i=JZ(t.headBlockId,e.doc)?.posBeforeNode;if(i===void 0)throw Error(`Could not find block with ID ${t.headBlockId} to update selection`);r=z.create(e.doc,n+t.anchorOffset,i+t.headOffset)}e.setSelection(r)}function m7(e){return e.map(e=>e.type===`columnList`?e.children.map(e=>m7(e.children)).flat():{...e,children:m7(e.children)}).flat()}function BRe(e,t,n){e.transact(r=>{let i=e.getSelection()?.blocks||[e.getTextCursorPosition().block],a=RRe(e);e.removeBlocks(i),e.insertBlocks(m7(i),t,n),zRe(r,a)})}function VRe(e){return!e||e.type!==`columnList`}function HRe(e,t,n){let r,i;if(t?t.children.length>0?(r=t.children[t.children.length-1],i=`after`):(r=t,i=`before`):n&&(r=n,i=`before`),!r||!i)return;let a=e.getParentBlock(r);return VRe(a)?{referenceBlock:r,placement:i}:HRe(e,i===`after`?r:e.getPrevBlock(r),a)}function URe(e,t,n){let r,i;if(t?t.children.length>0?(r=t.children[0],i=`before`):(r=t,i=`after`):n&&(r=n,i=`after`),!r||!i)return;let a=e.getParentBlock(r);return VRe(a)?{referenceBlock:r,placement:i}:URe(e,i===`before`?r:e.getNextBlock(r),a)}function WRe(e){e.transact(()=>{let t=e.getSelection()?.blocks[0]||e.getTextCursorPosition().block,n=HRe(e,e.getPrevBlock(t),e.getParentBlock(t));n&&BRe(e,n.referenceBlock,n.placement)})}function GRe(e){e.transact(()=>{let t=e.getSelection(),n=t?.blocks[t?.blocks.length-1]||e.getTextCursorPosition().block,r=URe(e,e.getNextBlock(n),e.getParentBlock(n));r&&BRe(e,r.referenceBlock,r.placement)})}function KRe(e,t,n){let{$from:r,$to:i}=e.selection,a=r.blockRange(i,e=>e.childCount>0&&(e.type.name===`blockGroup`||e.type.name===`column`));if(!a)return!1;let o=a.startIndex;if(o===0)return!1;let s=a.parent.child(o-1);if(s.type!==t)return!1;let c=s.lastChild&&s.lastChild.type===n,l=L.from(c?t.create():null),u=new R(L.from(t.create(null,L.from(n.create(null,l)))),c?3:1,0),d=a.start,f=a.end;return e.step(new Kj(d-(c?3:1),f,d,f,u,1,!0)).scrollIntoView(),!0}function qRe(e){return e.transact(t=>KRe(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup))}function JRe(e){e._tiptapEditor.commands.liftListItem(`blockContainer`)}function YRe(e){return e.transact(e=>{let{bnBlock:t}=HY(e);return e.doc.resolve(t.beforePos).nodeBefore!==null})}function XRe(e){return e.transact(e=>{let{bnBlock:t}=HY(e);return e.doc.resolve(t.beforePos).depth>1})}function ZRe(e,t){let n=typeof t==`string`?t:t.id,r=UY(e),i=JZ(n,e);if(i)return $Y(i.node,r)}function QRe(e,t){let n=JZ(typeof t==`string`?t:t.id,e),r=UY(e);if(!n)return;let i=e.resolve(n.posBeforeNode).nodeBefore;if(i)return $Y(i,r)}function $Re(e,t){let n=JZ(typeof t==`string`?t:t.id,e),r=UY(e);if(!n)return;let i=e.resolve(n.posBeforeNode+n.node.nodeSize).nodeAfter;if(i)return $Y(i,r)}function eze(e,t){let n=typeof t==`string`?t:t.id,r=UY(e),i=JZ(n,e);if(!i)return;let a=e.resolve(i.posBeforeNode),o=a.node(),s=a.node(-1),c=s.type.name===`doc`?void 0:o.type.name===`blockGroup`?s:o;if(c)return $Y(c,r)}function tze(e){return!!e.getMeta(`y-sync$`)}function nze(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function rze(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||``)}function ize(e){e.querySelectorAll(`li > ul, li > ol`).forEach(e=>{let t=nze(e),n=e.parentElement,r=Array.from(n.childNodes).slice(t+1);e.remove(),r.forEach(e=>{e.remove()}),n.insertAdjacentElement(`afterend`,e),r.reverse().forEach(t=>{if(rze(t))return;let n=document.createElement(`li`);n.append(t),e.insertAdjacentElement(`afterend`,n)}),n.childNodes.length===0&&n.remove()})}function aze(e){e.querySelectorAll(`li + ul, li + ol`).forEach(e=>{let t=e.previousElementSibling,n=document.createElement(`div`);t.insertAdjacentElement(`afterend`,n),n.append(t);let r=document.createElement(`div`);for(r.setAttribute(`data-node-type`,`blockGroup`),n.append(r);n.nextElementSibling?.nodeName===`UL`||n.nextElementSibling?.nodeName===`OL`;)r.append(n.nextElementSibling)})}function oze(){return Xze||=document.implementation.createHTMLDocument(`title`)}function sze(e){if(typeof e==`string`){let t=oze().createElement(`div`);t.innerHTML=e,e=t}return ize(e),aze(e),e}function cze(e){let t=e.ownerDocument.createTreeWalker(e,128),n;for(;n=t.nextNode();)if(/^\s*notionvc:/.test(n.nodeValue||``))return!0;return!1}function lze(e){let t=new Set([`PRE`,`CODE`]),n=e.ownerDocument.createTreeWalker(e,4,{acceptNode(n){let r=n.parentElement;for(;r&&r!==e;){if(t.has(r.tagName))return 2;r=r.parentElement}return 1}}),r=[],i;for(;i=n.nextNode();)r.push(i);for(let e of r)e.nodeValue&&/[\r\n]/.test(e.nodeValue)&&(e.nodeValue=e.nodeValue.replace(/[ \t\r\n\f]+/g,` `))}function uze(e){cze(e)||lze(e)}function dze(e,t){let n=sze(e);uze(n);let r=oj.fromSchema(t).parse(n,{topNode:t.nodes.blockGroup.create()}),i=[];for(let e=0;e<r.childCount;e++)i.push($Y(r.child(e),t));return i}function fze(e,t){let n=t.value?t.value:``,r={};t.lang&&(r[`data-language`]=t.lang);let i={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:`element`,tagName:`pre`,properties:{},children:[i]},e.patch(t,i),i}function pze(e,t){var n;let r=String(t?.url||``),i=t!=null&&t.title?String(t.title):void 0,a={type:`element`,tagName:`video`,properties:{src:r,"data-name":i,"data-url":r,controls:!0},children:[]};return(n=e.patch)==null||n.call(e,t,a),a=e.applyData?e.applyData(t,a):a,a}function mze(e){return k6().use(jFe).use(jje).use(YIe,{handlers:{...Q5,image:(e,t)=>Vge(String(t?.url||``))?pze(e,t):Q5.image(e,t),code:fze,blockquote:(e,t)=>{let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!1)};return e.patch(t,n),e.applyData(t,n)}}}).use(kRe).processSync(e).value}function hze(e,t){return dze(mze(e),t)}function gze(e,t){if(!e.startsWith(`.`)||!t.startsWith(`.`))throw Error(`The strings provided are not valid file extensions.`);return e===t}function _ze(e,t){let n=e.split(`/`),r=t.split(`/`);if(n.length!==2)throw Error(`The string ${e} is not a valid MIME type.`);if(r.length!==2)throw Error(`The string ${t} is not a valid MIME type.`);return n[1]===`*`||r[1]===`*`?n[0]===r[0]:(n[0]===`*`||r[0]===`*`||n[0]===r[0])&&n[1]===r[1]}function vze(e,t,n,r=`after`){let i;return i=Array.isArray(t.content)&&t.content.length===0?e.updateBlock(t,n).id:e.insertBlocks([n],t,r)[0].id,i}async function yze(e,t){if(!t.uploadFile){console.warn(`Attempted ot insert file, but uploadFile is not set in the BlockNote editor options`);return}let n=`dataTransfer`in e?e.dataTransfer:e.clipboardData;if(n===null)return;let r=null;for(let e of _7)if(n.types.includes(e)){r=e;break}if(r!==`Files`)return;let i=n.items;if(i){e.preventDefault();for(let n=0;n<i.length;n++){let r=`file`;for(let e of Object.values(t.schema.blockSpecs))for(let t of e.implementation.meta?.fileBlockAccept||[]){let a=t.startsWith(`.`),o=i[n].getAsFile();if(o&&(!a&&o.type&&_ze(i[n].type,t)||a&&gze(`.`+o.name.split(`.`).pop(),t))){r=e.config.type;break}}let a=i[n].getAsFile();if(a){let n={type:r,props:{name:a.name}},i;if(e.type===`paste`){let e=t.getTextCursorPosition().block;i=vze(t,e,n)}else if(e.type===`drop`){let r={left:e.clientX,top:e.clientY},a=t.prosemirrorView.posAtCoords(r);if(!a)return;i=t.transact(e=>{let i=LY(e.doc,a.pos),o=(t.domElement?.querySelector(`[data-id="${i.node.attrs.id}"]`))?.getBoundingClientRect();return vze(t,t.getBlock(i.node.attrs.id),n,o&&(o.top+o.bottom)/2>r.top?`before`:`after`)})}else return;let o=await t.uploadFile(a,i),s=typeof o==`string`?{props:{url:o}}:{...o};t.updateBlock(i,s)}}}}async function bze(e,t){let{schema:n}=t.state;if(!e.clipboardData)return!1;let r=e.clipboardData.getData(`text/plain`);if(!r)return!1;if(!n.nodes.codeBlock)return t.pasteText(r),!0;let i=e.clipboardData.getData(`vscode-editor-data`),a=(i?JSON.parse(i):void 0)?.mode;return a?(t.pasteHTML(`<pre><code class="language-${a}">${r.replace(/\r\n?/g,`
|
|
192
|
+
`)}</code></pre>`),!0):!1}function xze({event:e,editor:t,prioritizeMarkdownOverHTML:n,plainTextAsMarkdown:r}){if(t.transact(e=>e.selection.$from.parent.type.spec.code&&e.selection.$to.parent.type.spec.code)){let n=e.clipboardData?.getData(`text/plain`);if(n)return t.pasteText(n),!0}let i;for(let t of _7)if(e.clipboardData.types.includes(t)){i=t;break}if(!i)return!0;if(i===`vscode-editor-data`)return bze(e,t.prosemirrorView),!0;if(i===`Files`)return yze(e,t),!0;let a=e.clipboardData.getData(i);if(i===`blocknote/html`)return t.pasteHTML(a,!0),!0;if(i===`text/markdown`)return t.pasteMarkdown(a),!0;if(n){let n=e.clipboardData.getData(`text/plain`);if(fBe(n))return t.pasteMarkdown(n),!0}return i===`text/html`?(t.pasteHTML(a),!0):r?(t.pasteMarkdown(a),!0):(t.pasteText(a),!0)}function Sze(e,t,n){let r=!1,i=e.state.selection instanceof nZ;if(!i){let n=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,i=[];for(let e=0;e<n.childCount;e++)i.push(n.child(e));r=i.find(e=>e.type.isInGroup(`bnBlock`)||e.type.name===`blockGroup`||e.type.spec.group===`blockContent`)===void 0,r&&(t=n)}let a,o=F6(e.state.schema,n);if(i){t.firstChild?.type.name===`table`&&(t=t.firstChild.content);let e=XY(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=`<table>${o.exportInlineContent(e,{})}</table>`}else if(r){let e=ZY(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=o.exportInlineContent(e,{})}else{let e=FMe(t);a=o.exportBlocks(e,{})}return a}function Cze(e,t){`node`in e.state.selection&&e.state.selection.node.type.spec.group===`blockContent`&&t.transact(t=>t.setSelection(new iM(t.doc.resolve(e.state.selection.from-1))));let n=e.serializeForClipboard(e.state.selection.content()).dom.innerHTML,r=e.state.selection.content().content,i=Sze(e,r,t);return{clipboardHTML:n,externalHTML:i,markdown:A6(i)}}function wze(e,t){let n=[WJ.ClipboardTextSerializer,WJ.Commands,WJ.Editable,WJ.FocusEvents,WJ.Tabindex,nPe,gX.configure({types:[`blockContainer`,`columnList`,`column`],setIdAttribute:t.setIdAttribute}),gBe,LPe,bBe,xBe,SBe,FPe.extend({inclusive:!1}).configure({defaultProtocol:W6,protocols:T7?[]:U6}),...Object.values(e.schema.styleSpecs).map(t=>t.implementation.mark.configure({editor:e})),wBe,hBe,CBe,GJ.create({name:`OverrideEscape`,addKeyboardShortcuts:()=>({Escape:()=>{var t;return(t=e.getExtension(L$))!=null&&t.shown()?!1:(e.blur(),!0)}})}),OBe,EBe.configure({editor:e,domAttributes:t.domAttributes}),yBe.configure({editor:e,tabBehavior:t.tabBehavior}),DBe.configure({domAttributes:t.domAttributes}),...Object.values(e.schema.inlineContentSpecs).filter(e=>e.config!==`link`&&e.config!==`text`).map(t=>t.implementation.node.configure({editor:e})),...Object.values(e.schema.blockSpecs).flatMap(n=>[...`node`in n.implementation?[n.implementation.node.configure({editor:e,domAttributes:t.domAttributes})]:[]]),mBe(e),pBe(e,t.pasteHandler||(e=>e.defaultPasteHandler())),Qze(e)];return T7=!0,n}function Tze(e,t){let n=[I6(),tNe(t),SQ(t),V6(t),H6(t),iNe(),oNe(t),pG(t),Y6(t),L$(t),...t.trailingBlock===!1?[]:[fNe()]];return t.collaboration?n.push(kBe(t.collaboration)):n.push(nNe()),`table`in e.schema.blockSpecs&&n.push($6(t)),t.animations!==!1&&n.push(cNe()),n}function Eze(e,t){let{$from:n,$to:r}=t;if(n.pos>n.start()&&n.pos<e.content.size){let t=e.textBetween(n.pos,n.pos+1);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(n.start(),n.pos).match(/[\w\p{P}]+$/u);t&&(n=e.resolve(n.pos-t[0].length))}}if(r.pos<r.end()&&r.pos>0){let t=e.textBetween(r.pos-1,r.pos);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(r.pos,r.end()).match(/^[\w\p{P}]+/u);t&&(r=e.resolve(r.pos+t[0].length))}}return{$from:n,$to:r,from:n.pos,to:r.pos}}function Dze(e){let t=UY(e);if(e.selection.empty||`node`in e.selection)return;let n=e.doc.resolve(LY(e.doc,e.selection.from).posBeforeNode),r=e.doc.resolve(LY(e.doc,e.selection.to).posBeforeNode),i=(r,i)=>{let a=n.posAtIndex(r,i),o=e.doc.resolve(a).nodeAfter;if(!o)throw Error(`Error getting selection - node not found at position ${a}`);return $Y(o,t)},a=[],o=n.sharedDepth(r.pos),s=n.index(o),c=r.index(o);if(n.depth>o){a.push($Y(n.nodeAfter,t));for(let e=n.depth;e>o;e--)if(n.node(e).type.isInGroup(`childContainer`)){let t=n.index(e)+1,r=n.node(e).childCount;for(let n=t;n<r;n++)a.push(i(n,e))}}else a.push(i(s,o));for(let e=s+1;e<=c;e++)a.push(i(e,o));if(a.length===0)throw Error(`Error getting selection - selection doesn't span any blocks (${e.selection})`);return{blocks:a}}function Oze(e,t,n){let r=typeof t==`string`?t:t.id,i=typeof n==`string`?n:n.id,a=GY(UY(e));if(r===i)throw Error(`Attempting to set selection with the same anchor and head blocks (id ${r})`);let o=JZ(r,e.doc);if(!o)throw Error(`Block with ID ${r} not found`);let s=JZ(i,e.doc);if(!s)throw Error(`Block with ID ${i} not found`);let c=zY(o),l=zY(s),u=a.blockSchema[c.blockNoteType],d=a.blockSchema[l.blockNoteType];if(!c.isBlockContainer||u.content===`none`)throw Error(`Attempting to set selection anchor in block without content (id ${r})`);if(!l.isBlockContainer||d.content===`none`)throw Error(`Attempting to set selection anchor in block without content (id ${i})`);let f,p;if(u.content===`table`){let e=eZ.get(c.blockContent.node);f=c.blockContent.beforePos+e.positionAt(0,0,c.blockContent.node)+1+2}else f=c.blockContent.beforePos+1;if(d.content===`table`){let t=eZ.get(l.blockContent.node),n=l.blockContent.beforePos+t.positionAt(t.height-1,t.width-1,l.blockContent.node)+1;p=n+e.doc.resolve(n).nodeAfter.nodeSize-2}else p=l.blockContent.afterPos-1;e.setSelection(z.create(e.doc,f,p))}function kze(e,t=!1){let n=UY(e),r=t?Eze(e.doc,e.selection):e.selection,i=r.$from,a=r.$to;for(;a.parentOffset>=a.parent.nodeSize-2&&a.depth>0;)a=e.doc.resolve(a.pos+1);for(;a.parentOffset===0&&a.depth>0;)a=e.doc.resolve(a.pos-1);for(;i.parentOffset===0&&i.depth>0;)i=e.doc.resolve(i.pos-1);for(;i.parentOffset>=i.parent.nodeSize-2&&i.depth>0;)i=e.doc.resolve(i.pos+1);let o=khe(e.doc.slice(i.pos,a.pos,!0),n);return{_meta:{startPos:i.pos,endPos:a.pos},...o}}function Aze(e){let{bnBlock:t}=HY(e),n=UY(e.doc),r=e.doc.resolve(t.beforePos),i=r.nodeBefore,a=e.doc.resolve(t.afterPos).nodeAfter,o;return r.depth>1&&(o=r.node(),o.type.isInGroup(`bnBlock`)||(o=r.node(r.depth-1))),{block:$Y(t.node,n),prevBlock:i===null?void 0:$Y(i,n),nextBlock:a===null?void 0:$Y(a,n),parentBlock:o===void 0?void 0:$Y(o,n)}}function jze(e,t,n=`start`){let r=typeof t==`string`?t:t.id,i=GY(UY(e.doc)),a=JZ(r,e.doc);if(!a)throw Error(`Block with ID ${r} not found`);let o=zY(a),s=i.blockSchema[o.blockNoteType].content;if(o.isBlockContainer){let t=o.blockContent;if(s===`none`){e.setSelection(iM.create(e.doc,t.beforePos));return}if(s===`inline`)n===`start`?e.setSelection(z.create(e.doc,t.beforePos+1)):e.setSelection(z.create(e.doc,t.afterPos-1));else if(s===`table`)n===`start`?e.setSelection(z.create(e.doc,t.beforePos+4)):e.setSelection(z.create(e.doc,t.afterPos-4));else throw new _X(s)}else jze(e,(n===`start`?o.childContainer.node.firstChild:o.childContainer.node.lastChild).attrs.id,n)}function Mze(e,t,n,r={updateSelection:!0}){let{from:i,to:a}=typeof t==`number`?{from:t,to:t}:{from:t.from,to:t.to},o=!0,s=!0,c=``;if(n.forEach(e=>{e.check(),o&&e.isText&&e.marks.length===0?c+=e.text:o=!1,s=s?e.isBlock:!1}),i===a&&s){let{parent:t}=e.doc.resolve(i);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(--i,a+=1)}return o?e.insertText(c,i,a):e.replaceWith(i,a,n),r.updateSelection&&TK(e,e.steps.length-1,-1),!0}function Nze(e){return FK(e.state.selection.$from,e=>e.type.name===`tableCell`||e.type.name===`tableHeader`)!==void 0}function Pze(e,t){let n=t.nodes.hardBreak,r=L.empty;return e.forEach(e=>{e.isTextblock&&e.childCount>0?(r=r.append(e.content),r=r.addToEnd(n.create())):e.isText?r=r.addToEnd(e):e.isBlock&&e.childCount>0&&(r=r.append(Pze(e.content,t)),r=r.addToEnd(n.create()))}),r.lastChild?.type===n&&(r=r.cut(0,r.size-1)),r}function Fze(e,t){let n=[];return e.forEach((e,r,i)=>{i!==t&&n.push(e)}),L.from(n)}function Ize(e,t){let n=[];for(let r=0;r<e.childCount;r++)if(e.child(r).type.name===`tableRow`)if(n.length>0&&n[n.length-1].type.name===`table`){let t=n[n.length-1],i=t.copy(t.content.addToEnd(e.child(r)));n[n.length-1]=i}else{let i=t.nodes.table.createChecked(void 0,e.child(r));n.push(i)}else n.push(e.child(r));return e=L.from(n),e}function Lze(e,t){let n=L.from(e.content);if(n=Ize(n,t.state.schema),Nze(t)){let e=!1;if(n.descendants(t=>{t.type.isInGroup(`tableContent`)&&(e=!0)}),!e&&!t.state.schema.nodes.tableParagraph.validContent(n))return new R(Pze(n,t.state.schema),0,0)}if(!Rze(n,t))return new R(n,e.openStart,e.openEnd);for(let e=0;e<n.childCount;e++)if(n.child(e).type.spec.group===`blockContent`){let r=[n.child(e)];if(e+1<n.childCount&&n.child(e+1).type.name===`blockGroup`){let t=n.child(e+1).child(0).child(0);(t.type.name===`bulletListItem`||t.type.name===`numberedListItem`||t.type.name===`checkListItem`)&&(r.push(n.child(e+1)),n=Fze(n,e+1))}let i=t.state.schema.nodes.blockContainer.createChecked(void 0,r);n=n.replaceChild(e,i)}return new R(n,e.openStart,e.openEnd)}function Rze(e,t){let n=e.childCount===1,r=e.firstChild?.type.spec.content===`inline*`,i=e.firstChild?.type.spec.content===`tableRow+`;if(n){if(r)return!1;if(i){let e=VY(t.state);if(e.isBlockContainer)return e.blockContent.node.type.spec.content!==`tableRow+`}}return!0}var zze,Bze,h7,g7,Vze,Hze,Uze,Wze,Gze,Kze,qze,Jze,Yze,Xze,Zze,_7,Qze,$ze,eBe,tBe,nBe,rBe,iBe,aBe,oBe,sBe,cBe,lBe,uBe,dBe,fBe,pBe,v7,y7,mBe,hBe,gBe,b7,x7,S7,C7,_Be,vBe,w7,yBe,bBe,xBe,SBe,CBe,wBe,TBe,EBe,DBe,OBe,kBe,T7,ABe,jBe,MBe,NBe,PBe,FBe,IBe=o((()=>{gj(),Zj(),vX(),W$(),pNe(),FNe(),cY(),pY(),XG(),LNe(),WNe(),lK(),dG(),rPe(),IPe(),RPe(),mM(),lZ(),mG(),Pje(),NFe(),ZIe(),jRe(),nMe(),YG(),zze=Object.defineProperty,Bze=(e,t,n)=>t in e?zze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h7=(e,t,n)=>Bze(e,typeof t==`symbol`?t:t+``,n),g7=(e,t,n,r)=>{var i;let a=e.pmSchema.nodes.blockGroup,o=a.spec.toDOM(a.create({})),s=LRe(e,t,n,r);return(i=o.contentDOM)==null||i.appendChild(s),o.dom},Vze=e=>(e.querySelectorAll(`[data-content-type="numberedListItem"]`).forEach(e=>{let t=(e.closest(`.bn-block-outer`)?.previousElementSibling)?.querySelector(`[data-content-type="numberedListItem"]`);if(!t)e.setAttribute(`data-index`,e.getAttribute(`data-start`)||`1`);else{let n=t.getAttribute(`data-index`);e.setAttribute(`data-index`,(parseInt(n||`0`)+1).toString())}}),e),Hze=e=>(e.querySelectorAll(`[data-content-type="checkListItem"] input`).forEach(e=>{e.disabled=!0}),e),Uze=e=>(e.querySelectorAll(`.bn-toggle-wrapper[data-show-children="false"]`).forEach(e=>{e.setAttribute(`data-show-children`,`true`)}),e),Wze=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{e.setAttribute(`style`,`--default-cell-min-width: 120px;`),e.setAttribute(`data-show-children`,`true`)}),e),Gze=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{var t;let n=document.createElement(`div`);n.className=`tableWrapper`;let r=document.createElement(`div`);r.className=`tableWrapper-inner`,n.appendChild(r),(t=e.parentElement)==null||t.appendChild(n),n.appendChild(e)}),e),Kze=e=>(e.querySelectorAll(`.bn-inline-content:empty`).forEach(e=>{let t=document.createElement(`span`);t.className=`ProseMirror-trailingBreak`,t.setAttribute(`style`,`display: inline-block;`),e.appendChild(t)}),e),qze=(e,t)=>{let n=mj.fromSchema(e),r=[Vze,Hze,Uze,Wze,Gze,Kze];return{serializeBlocks:(e,i)=>{let a=g7(t,e,n,i);for(let e of r)a=e(a);return a.outerHTML}}},Jze=class{constructor(e){this.editor=e}get document(){return this.editor.transact(e=>Ohe(e.doc,this.editor.pmSchema))}getBlock(e){return this.editor.transact(t=>ZRe(t.doc,e))}getPrevBlock(e){return this.editor.transact(t=>QRe(t.doc,e))}getNextBlock(e){return this.editor.transact(t=>$Re(t.doc,e))}getParentBlock(e){return this.editor.transact(t=>eze(t.doc,e))}forEachBlock(e,t=!1){let n=this.document.slice();t&&n.reverse();function r(n){for(let i of n)if(e(i)===!1||!r(t?i.children.slice().reverse():i.children))return!1;return!0}r(n)}insertBlocks(e,t,n=`before`){return this.editor.transact(r=>MRe(r,e,t,n))}updateBlock(e,t){return this.editor.transact(n=>Zge(n,e,t))}removeBlocks(e){return this.editor.transact(t=>PRe(t,e,[]).removedBlocks)}replaceBlocks(e,t){return this.editor.transact(n=>PRe(n,e,t))}canNestBlock(){return YRe(this.editor)}nestBlock(){qRe(this.editor)}canUnnestBlock(){return XRe(this.editor)}unnestBlock(){JRe(this.editor)}moveBlocksUp(){return WRe(this.editor)}moveBlocksDown(){return GRe(this.editor)}},Yze=class extends fY{constructor(e){super(),this.editor=e,e.on(`create`,()=>{e._tiptapEditor.on(`update`,({transaction:t,appendedTransactions:n})=>{this.emit(`onChange`,{editor:e,transaction:t,appendedTransactions:n})}),e._tiptapEditor.on(`selectionUpdate`,({transaction:t})=>{this.emit(`onSelectionChange`,{editor:e,transaction:t})}),e._tiptapEditor.on(`mount`,()=>{this.emit(`onMount`,{editor:e})}),e._tiptapEditor.on(`unmount`,()=>{this.emit(`onUnmount`,{editor:e})})})}onChange(e,t=!0){let n=({transaction:n,appendedTransactions:r})=>{!t&&tze(n)||e(this.editor,{getChanges(){return xMe(n,r)}})};return this.on(`onChange`,n),()=>{this.off(`onChange`,n)}}onSelectionChange(e,t=!1){let n=n=>{!t&&tze(n.transaction)||e(this.editor)};return this.on(`onSelectionChange`,n),()=>{this.off(`onSelectionChange`,n)}}onMount(e){return this.on(`onMount`,e),()=>{this.off(`onMount`,e)}}onUnmount(e){return this.on(`onUnmount`,e),()=>{this.off(`onUnmount`,e)}}},Xze=null,Zze=class{constructor(e){this.editor=e}blocksToHTMLLossy(e=this.editor.document){return F6(this.editor.pmSchema,this.editor).exportBlocks(e,{})}blocksToFullHTML(e=this.editor.document){return qze(this.editor.pmSchema,this.editor).serializeBlocks(e,{})}tryParseHTMLToBlocks(e){return dze(e,this.editor.pmSchema)}blocksToMarkdownLossy(e=this.editor.document){return PMe(e,this.editor.pmSchema,this.editor,{})}tryParseMarkdownToBlocks(e){return hze(e,this.editor.pmSchema)}pasteHTML(e,t=!1){var n;let r=e;if(!t){let t=this.tryParseHTMLToBlocks(e);r=this.blocksToFullHTML(t)}r&&((n=this.editor.prosemirrorView)==null||n.pasteHTML(r))}pasteText(e){return this.editor.prosemirrorView?.pasteText(e)}pasteMarkdown(e){let t=mze(e);return this.pasteHTML(t)}},_7=[`vscode-editor-data`,`blocknote/html`,`text/markdown`,`text/html`,`text/plain`,`Files`],Qze=e=>GJ.create({name:`dropFile`,addProseMirrorPlugins(){return[new dM({props:{handleDOMEvents:{drop(t,n){if(!e.isEditable)return;let r=null;for(let e of _7)if(n.dataTransfer.types.includes(e)){r=e;break}return r===null?!0:r===`Files`?(yze(n,e),!0):!1}}}})]}}),$ze=/(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/,eBe=/(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/,tBe=/\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/,nBe=/(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/,rBe=/(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/,iBe=/(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/,aBe=/\n{2} {0,3}-{2,48}\n{2}/,oBe=/(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/,sBe=/(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/,cBe=/(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/,lBe=/^\s*\|(.+\|)+\s*$/m,uBe=/^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m,dBe=/^\s*\|(.+\|)+\s*$/m,fBe=e=>$ze.test(e)||eBe.test(e)||tBe.test(e)||nBe.test(e)||rBe.test(e)||iBe.test(e)||aBe.test(e)||oBe.test(e)||sBe.test(e)||cBe.test(e)||lBe.test(e)||uBe.test(e)||dBe.test(e),pBe=(e,t)=>GJ.create({name:`pasteFromClipboard`,addProseMirrorPlugins(){return[new dM({props:{handleDOMEvents:{paste(n,r){if(r.preventDefault(),e.isEditable)return t({event:r,editor:e,defaultPasteHandler:({prioritizeMarkdownOverHTML:t=!0,plainTextAsMarkdown:n=!0}={})=>xze({event:r,editor:e,prioritizeMarkdownOverHTML:t,plainTextAsMarkdown:n})})}}}})]}}),v7=()=>{let e=window.getSelection();if(!e||e.isCollapsed)return!0;let t=e.focusNode;for(;t;){if(t instanceof HTMLElement&&t.getAttribute(`contenteditable`)===`false`)return!0;t=t.parentElement}return!1},y7=(e,t,n)=>{n.preventDefault(),n.clipboardData.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=Cze(t,e);n.clipboardData.setData(`blocknote/html`,r),n.clipboardData.setData(`text/html`,i),n.clipboardData.setData(`text/plain`,a)},mBe=e=>GJ.create({name:`copyToClipboard`,addProseMirrorPlugins(){return[new dM({props:{handleDOMEvents:{copy(t,n){return v7()||y7(e,t,n),!0},cut(t,n){return v7()||(y7(e,t,n),t.editable&&t.dispatch(t.state.tr.deleteSelection())),!0},dragstart(t,n){if(!(`node`in t.state.selection)||t.state.selection.node.type.spec.group!==`blockContent`)return;e.transact(e=>e.setSelection(new iM(e.doc.resolve(t.state.selection.from-1)))),n.preventDefault(),n.dataTransfer.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=Cze(t,e);return n.dataTransfer.setData(`blocknote/html`,r),n.dataTransfer.setData(`text/html`,i),n.dataTransfer.setData(`text/plain`,a),!0}}}})]}}),hBe=GJ.create({name:`blockBackgroundColor`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{backgroundColor:yQ()}}]}}),gBe=sY.create({name:`hardBreak`,inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,priority:10,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,WK(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
193
|
+
`}}),b7=(e,t)=>{var n;let r=e.resolve(t),i=r.depth-1,a=r.before(i),o=e.resolve(a).nodeAfter;return o?(n=o.type.spec.group)!=null&&n.includes(`bnBlock`)?BY(e.resolve(a)):b7(e,a):void 0},x7=(e,t)=>{let n=e.resolve(t),r=n.index();if(r===0)return;let i=n.posAtIndex(r-1);return BY(e.resolve(i))},S7=(e,t)=>{let n=e.resolve(t),r=n.index();if(r===n.node().childCount-1)return;let i=n.posAtIndex(r+1);return BY(e.resolve(i))},C7=(e,t)=>{for(;t.childContainer;){let n=t.childContainer.node,r=e.resolve(t.childContainer.beforePos+1).posAtIndex(n.childCount-1);t=BY(e.resolve(r))}return t},_Be=(e,t)=>e.isBlockContainer&&e.blockContent.node.type.spec.content===`inline*`&&e.blockContent.node.childCount>0&&t.isBlockContainer&&t.blockContent.node.type.spec.content===`inline*`,vBe=(e,t,n,r)=>{if(!r.isBlockContainer)throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but next block is not a block container`);if(r.childContainer){let n=e.doc.resolve(r.childContainer.beforePos+1),i=e.doc.resolve(r.childContainer.afterPos-1),a=n.blockRange(i);if(t){let t=e.doc.resolve(r.bnBlock.beforePos);e.tr.lift(a,t.depth)}}if(t){if(!n.isBlockContainer)throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but previous block is not a block container`);t(e.tr.delete(n.blockContent.afterPos-1,r.blockContent.beforePos+1))}return!0},w7=e=>({state:t,dispatch:n})=>{let r=BY(t.doc.resolve(e)),i=x7(t.doc,r.bnBlock.beforePos);if(!i)return!1;let a=C7(t.doc,i);return _Be(a,r)?vBe(t,n,a,r):!1},yBe=GJ.create({priority:50,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({chain:e,commands:t})=>[()=>t.deleteSelection(),()=>t.undoInputRule(),()=>t.command(({state:e})=>{let n=VY(e);if(!n.isBlockContainer)return!1;let r=e.selection.from===n.blockContent.beforePos+1,i=n.blockContent.node.type.name===`paragraph`;return r&&!i?t.command(mQ(n.bnBlock.beforePos,{type:`paragraph`,props:{}})):!1}),()=>t.command(({state:e})=>{let n=VY(e);if(!n.isBlockContainer)return!1;let{blockContent:r}=n;return e.selection.from===r.beforePos+1?t.liftListItem(`blockContainer`):!1}),()=>t.command(({state:t})=>{let n=VY(t);if(!n.isBlockContainer)return!1;let{bnBlock:r,blockContent:i}=n,a=x7(t.doc,n.bnBlock.beforePos);if(!a||!a.isBlockContainer||a.blockContent.node.type.spec.content!==`inline*`)return!1;let o=t.selection.from===i.beforePos+1,s=t.selection.empty,c=r.beforePos;return o&&s?e().command(w7(c)).scrollIntoView().run():!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=VY(e);if(!r.isBlockContainer)return!1;let i=x7(e.doc,r.bnBlock.beforePos);if(!i||i.isBlockContainer)return!1;if(n){let e=i.bnBlock.afterPos-1,n=t.doc.resolve(e-1);return t.delete(r.bnBlock.beforePos,r.bnBlock.afterPos),t.insert(n.pos,r.bnBlock.node),t.setSelection(z.near(t.doc.resolve(n.pos+1))),!0}return!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=VY(e);if(!r.isBlockContainer||t.selection.from!==r.blockContent.beforePos+1)return!1;let i=t.doc.resolve(r.bnBlock.beforePos);if(i.nodeBefore||i.node().type.name!==`column`)return!1;let a=t.doc.resolve(r.bnBlock.beforePos),o=t.doc.resolve(a.before()),s=o.before();return n&&(t.delete(r.bnBlock.beforePos,r.bnBlock.afterPos),p7(t,s),o.pos===s+1?(t.insert(s,r.bnBlock.node),t.setSelection(z.near(t.doc.resolve(s)))):(t.insert(o.pos-1,r.bnBlock.node),t.setSelection(z.near(t.doc.resolve(o.pos))))),!0}),()=>t.command(({state:t})=>{let n=VY(t);if(!n.isBlockContainer)return!1;if(n.blockContent.node.childCount===0&&n.blockContent.node.type.spec.content===`inline*`){let r=x7(t.doc,n.bnBlock.beforePos);if(!r||!r.isBlockContainer)return!1;let i=e();if(n.childContainer&&i.insertContentAt(n.bnBlock.afterPos,n.childContainer?.node.content),r.blockContent.node.type.spec.content===`tableRow+`){let e=n.bnBlock.beforePos-1-1-1-1-1;i=i.setTextSelection(e)}else if(r.blockContent.node.type.spec.content===``)i=i.setNodeSelection(r.blockContent.beforePos);else{let e=r.blockContent.afterPos-1;i=i.setTextSelection(e)}return i.deleteRange({from:n.bnBlock.beforePos,to:n.bnBlock.afterPos}).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=VY(t);if(!n.isBlockContainer)return!1;let r=t.selection.from===n.blockContent.beforePos+1,i=t.selection.empty,a=x7(t.doc,n.bnBlock.beforePos);if(a&&r&&i){let r=C7(t.doc,a);if(!r.isBlockContainer)return!1;if(r.blockContent.node.type.spec.content===``||r.blockContent.node.type.spec.content===`inline*`&&r.blockContent.node.childCount===0)return e().cut({from:n.bnBlock.beforePos,to:n.bnBlock.afterPos},r.bnBlock.afterPos).deleteRange({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos}).run()}return!1})]),t=()=>this.editor.commands.first(({chain:e,commands:t})=>[()=>t.deleteSelection(),()=>t.command(({state:t})=>{let n=VY(t);if(!n.isBlockContainer||!n.childContainer)return!1;let{blockContent:r,childContainer:i}=n,a=t.selection.from===r.afterPos-1,o=t.selection.empty,s=BY(t.doc.resolve(i.beforePos+1));if(!s.isBlockContainer)return!1;if(a&&o){let n=s.blockContent.node,a=n.type.spec.content===`inline*`,o=r.node.type.spec.content===`inline*`;return e().insertContentAt(s.bnBlock.afterPos,s.childContainer?.node.content||L.empty).deleteRange(i.node.childCount===1?{from:i.beforePos,to:i.afterPos}:{from:s.bnBlock.beforePos,to:s.bnBlock.afterPos}).insertContentAt(t.selection.from,a&&o?n.content:null).setTextSelection(t.selection.from).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=VY(t);if(!n.isBlockContainer)return!1;let{bnBlock:r,blockContent:i}=n,a=S7(t.doc,n.bnBlock.beforePos);if(!a||!a.isBlockContainer)return!1;let o=t.selection.from===i.afterPos-1,s=t.selection.empty,c=r.afterPos;return o&&s?e().command(w7(c)).scrollIntoView().run():!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=VY(e);if(!r.isBlockContainer)return!1;let i=S7(e.doc,r.bnBlock.beforePos);if(!i||i.isBlockContainer)return!1;if(n){let e=i.bnBlock.beforePos+1,n=t.doc.resolve(e+1);return t.delete(n.pos,n.pos+n.nodeAfter.nodeSize),p7(t,i.bnBlock.beforePos),t.insert(r.bnBlock.afterPos,n.nodeAfter),t.setSelection(z.near(t.doc.resolve(n.pos))),!0}return!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=VY(e);if(!r.isBlockContainer||t.selection.from!==r.blockContent.afterPos-1)return!1;let i=t.doc.resolve(r.bnBlock.afterPos);if(i.nodeAfter||i.node().type.name!==`column`)return!1;let a=t.doc.resolve(r.bnBlock.afterPos),o=t.doc.resolve(a.after()),s=o.after();if(n){let e=o.pos===s-1?s:o.pos+1,n=BY(t.doc.resolve(e));t.delete(n.bnBlock.beforePos,n.bnBlock.afterPos),p7(t,s-o.node().nodeSize),t.insert(a.pos,n.bnBlock.node),t.setSelection(z.near(t.doc.resolve(e)))}return!0}),()=>t.command(({state:t})=>{let n=VY(t);if(!n.isBlockContainer)return!1;let{blockContent:r}=n,i=t.selection.from===r.afterPos-1,a=t.selection.empty;if(i&&a){let i=(e,t)=>{let n=S7(e,t);if(n)return n;let r=b7(e,t);if(r)return i(e,r.bnBlock.beforePos)},a=i(t.doc,n.bnBlock.beforePos);if(!a||!a.isBlockContainer)return!1;let o=a.blockContent.node,s=o.type.spec.content===`inline*`,c=r.node.type.spec.content===`inline*`;return e().insertContentAt(a.bnBlock.afterPos,a.childContainer?.node.content||L.empty).deleteRange({from:a.bnBlock.beforePos,to:a.bnBlock.afterPos}).insertContentAt(t.selection.from,s&&c?o.content:null).setTextSelection(t.selection.from).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=VY(t);if(!n.isBlockContainer)return!1;if(n.blockContent.node.childCount===0&&n.blockContent.node.type.spec.content===`inline*`){let r=S7(t.doc,n.bnBlock.beforePos);if(!r||!r.isBlockContainer)return!1;let i=e();if(r.blockContent.node.type.spec.content===`tableRow+`){let e=n.bnBlock.afterPos+1+1+1+1+1;i=i.setTextSelection(e)}else i=r.blockContent.node.type.spec.content===``?i.setNodeSelection(r.blockContent.beforePos):i.setTextSelection(r.blockContent.beforePos+1);return i.deleteRange({from:n.bnBlock.beforePos,to:n.bnBlock.afterPos}).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=VY(t);if(!n.isBlockContainer)return!1;let r=t.selection.from===n.blockContent.afterPos-1,i=t.selection.empty,a=S7(t.doc,n.bnBlock.beforePos);if(!a||!a.isBlockContainer)return!1;if(a&&r&&i&&(a.blockContent.node.type.spec.content===``||a.blockContent.node.type.spec.content===`inline*`&&a.blockContent.node.childCount===0)){let t=a.bnBlock.node.lastChild.content;return e().deleteRange({from:a.bnBlock.beforePos,to:a.bnBlock.afterPos}).insertContentAt(n.bnBlock.afterPos,a.bnBlock.node.childCount===2?t:null).run()}return!1})]),n=(e=!1)=>this.editor.commands.first(({commands:t,tr:n})=>[()=>t.command(({state:e})=>{let n=VY(e);if(!n.isBlockContainer)return!1;let{bnBlock:r,blockContent:i}=n,{depth:a}=e.doc.resolve(r.beforePos),o=e.selection.$anchor.parentOffset===0,s=e.selection.anchor===e.selection.head,c=i.node.childCount===0;return o&&s&&c&&a>1?t.liftListItem(`blockContainer`):!1}),()=>t.command(({state:t})=>{let r=VY(t),i=this.options.editor.schema.blockSchema[r.blockNoteType].meta?.hardBreakShortcut??`shift+enter`;if(i===`none`)return!1;if(i===`shift+enter`&&e||i===`enter`){let e=n.storedMarks||n.selection.$head.marks().filter(e=>this.editor.extensionManager.splittableMarks.includes(e.type.name));return n.insert(n.selection.head,n.doc.type.schema.nodes.hardBreak.create()).ensureMarks(e),!0}return!1}),()=>t.command(({state:e,dispatch:t,tr:n})=>{let r=VY(e);if(!r.isBlockContainer)return!1;let{bnBlock:i,blockContent:a}=r,o=e.selection.$anchor.parentOffset===0,s=e.selection.anchor===e.selection.head,c=a.node.childCount===0;if(o&&s&&c){let a=i.afterPos,o=a+2;if(t){let t=e.schema.nodes.blockContainer.createAndFill(void 0,[e.schema.nodes.paragraph.createAndFill()||void 0,r.childContainer?.node].filter(e=>e!==void 0));n.insert(a,t).setSelection(new z(n.doc.resolve(o))).scrollIntoView(),r.childContainer&&n.delete(r.childContainer.beforePos,r.childContainer.afterPos)}return!0}return!1}),()=>t.command(({state:e,chain:t})=>{let n=VY(e);if(!n.isBlockContainer)return!1;let{blockContent:r}=n,i=e.selection.$anchor.parentOffset===0;return r.node.childCount===0?!1:(t().deleteSelection().command(i$(e.selection.from,i,i)).run(),!0)})]);return{Backspace:e,Delete:t,Enter:()=>n(),"Shift-Enter":()=>n(!0),Tab:()=>{var e;return this.options.tabBehavior!==`prefer-indent`&&((e=this.options.editor.getExtension(V6))!=null&&e.store.state||this.options.editor.getExtension(SQ)?.store.state!==void 0)?!1:qRe(this.options.editor)},"Shift-Tab":()=>{var e;return this.options.tabBehavior!==`prefer-indent`&&((e=this.options.editor.getExtension(V6))!=null&&e.store.state||this.options.editor.getExtension(SQ)?.store.state!==void 0)?!1:this.editor.commands.liftListItem(`blockContainer`)},"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0),"Mod-z":()=>this.options.editor.undo(),"Mod-y":()=>this.options.editor.redo(),"Shift-Mod-z":()=>this.options.editor.redo()}}}),bBe=RJ.create({name:`insertion`,inclusive:!1,excludes:`deletion modification insertion`,addAttributes(){return{id:{default:null,validate:`number`}}},extendMarkSchema(e){return e.name===`insertion`?{blocknoteIgnore:!0,inclusive:!1,toDOM(e,t){return[`ins`,{"data-id":String(e.attrs.id),"data-inline":String(t),...!t&&{style:`display: contents`}},0]},parseDOM:[{tag:`ins`,getAttrs(e){return e.dataset.id?{id:parseInt(e.dataset.id,10)}:!1}}]}:{}}}),xBe=RJ.create({name:`deletion`,inclusive:!1,excludes:`insertion modification deletion`,addAttributes(){return{id:{default:null,validate:`number`}}},extendMarkSchema(e){return e.name===`deletion`?{blocknoteIgnore:!0,inclusive:!1,toDOM(e,t){return[`del`,{"data-id":String(e.attrs.id),"data-inline":String(t),...!t&&{style:`display: contents`}},0]},parseDOM:[{tag:`del`,getAttrs(e){return e.dataset.id?{id:parseInt(e.dataset.id,10)}:!1}}]}:{}}}),SBe=RJ.create({name:`modification`,inclusive:!1,excludes:`deletion insertion`,addAttributes(){return{id:{default:null,validate:`number`},type:{validate:`string`},attrName:{default:null,validate:`string|null`},previousValue:{default:null},newValue:{default:null}}},extendMarkSchema(e){return e.name===`modification`?{blocknoteIgnore:!0,inclusive:!1,toDOM(e,t){return[t?`span`:`div`,{"data-type":`modification`,"data-id":String(e.attrs.id),"data-mod-type":e.attrs.type,"data-mod-prev-val":JSON.stringify(e.attrs.previousValue),"data-mod-new-val":JSON.stringify(e.attrs.newValue)},0]},parseDOM:[{tag:`span[data-type='modification']`,getAttrs(e){return e.dataset.id?{id:parseInt(e.dataset.id,10),type:e.dataset.modType,previousValue:e.dataset.modPrevVal,newValue:e.dataset.modNewVal}:!1}},{tag:`div[data-type='modification']`,getAttrs(e){return e.dataset.id?{id:parseInt(e.dataset.id,10),type:e.dataset.modType,previousValue:e.dataset.modPrevVal}:!1}}]}:{}}}),CBe=GJ.create({name:`textAlignment`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{textAlignment:{default:`left`,parseHTML:e=>e.getAttribute(`data-text-alignment`),renderHTML:e=>e.textAlignment===`left`?{}:{"data-text-alignment":e.textAlignment}}}}]}}),wBe=GJ.create({name:`blockTextColor`,addGlobalAttributes(){return[{types:[`table`,`tableCell`,`tableHeader`],attributes:{textColor:bQ()}}]}}),TBe={blockColor:`data-block-color`,blockStyle:`data-block-style`,id:`data-id`,depth:`data-depth`,depthChange:`data-depth-change`},EBe=sY.create({name:`blockContainer`,group:`blockGroupChild bnBlock`,content:`blockContent blockGroup?`,priority:50,defining:!0,marks:`insertion modification deletion`,parseHTML(){return[{tag:`div[data-node-type=`+this.name+`]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t={};for(let[n,r]of Object.entries(TBe))e.getAttribute(r)&&(t[n]=e.getAttribute(r));return t}},{tag:`div[data-node-type="blockOuter"]`,skip:!0}]},renderHTML({HTMLAttributes:e}){let t=document.createElement(`div`);t.className=`bn-block-outer`,t.setAttribute(`data-node-type`,`blockOuter`);for(let[n,r]of Object.entries(e))n!==`class`&&t.setAttribute(n,r);let n={...this.options.domAttributes?.block||{},...e},r=document.createElement(`div`);r.className=IZ(`bn-block`,n.class),r.setAttribute(`data-node-type`,this.name);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);return t.appendChild(r),{dom:t,contentDOM:r}}}),DBe=sY.create({name:`blockGroup`,group:`childContainer`,content:`blockGroupChild+`,marks:`deletion insertion modification`,parseHTML(){return[{tag:`div`,getAttrs:e=>typeof e==`string`?!1:e.getAttribute(`data-node-type`)===`blockGroup`?null:!1}]},renderHTML({HTMLAttributes:e}){let t={...this.options.domAttributes?.blockGroup||{},...e},n=document.createElement(`div`);n.className=IZ(`bn-block-group`,t.class),n.setAttribute(`data-node-type`,`blockGroup`);for(let[e,r]of Object.entries(t))e!==`class`&&n.setAttribute(e,r);return{dom:n,contentDOM:n}}}),OBe=sY.create({name:`doc`,topNode:!0,content:`blockGroup`,marks:`insertion modification deletion`}),kBe=cG(({options:e})=>({key:`collaboration`,blockNoteExtensions:[ZMe(e),L6(e),R6(e),z6(),eNe(e)]})),T7=!1,ABe=class{constructor(e,t){h7(this,`disabledExtensions`,new Set),h7(this,`extensions`,[]),h7(this,`abortMap`,new Map),h7(this,`extensionFactories`,new Map),h7(this,`extensionPlugins`,new Map),this.editor=e,this.options=t,e.onMount(()=>{for(let t of this.extensions)if(t.mount){let n=new window.AbortController,r=t.mount({dom:e.prosemirrorView.dom,root:e.prosemirrorView.root,signal:n.signal});r&&n.signal.addEventListener(`abort`,()=>{r()}),this.abortMap.set(t,n)}}),e.onUnmount(()=>{for(let[e,t]of this.abortMap.entries())this.abortMap.delete(e),t.abort()}),this.disabledExtensions=new Set(t.disableExtensions||[]);for(let e of Tze(this.editor,this.options))this.addExtension(e);for(let e of this.options.extensions??[])this.addExtension(e);for(let e of Object.values(this.editor.schema.blockSpecs))for(let t of e.extensions??[])this.addExtension(t)}registerExtension(e){var t;let n=[].concat(e).filter(Boolean);if(!n.length){console.warn(`No extensions found to register`,e);return}let r=n.map(e=>this.addExtension(e)).filter(Boolean),i=new Set;for(let e of r)e!=null&&e.tiptapExtensions&&console.warn(`Extension ${e.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),(t=e?.inputRules)!=null&&t.length&&console.warn(`Extension ${e.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),this.getProsemirrorPluginsFromExtension(e).plugins.forEach(e=>{i.add(e)});this.updatePlugins(e=>[...e,...i])}addExtension(e){let t;if(t=typeof e==`function`?e({editor:this.editor}):e,!(!t||this.disabledExtensions.has(t.key))){if(typeof e==`function`){let e=t[uG];typeof e==`function`&&this.extensionFactories.set(e,t)}if(this.extensions.push(t),t.blockNoteExtensions)for(let e of t.blockNoteExtensions)this.addExtension(e);return t}}resolveExtensions(e){let t=[];if(typeof e==`function`){let n=this.extensionFactories.get(e);n&&t.push(n)}else if(Array.isArray(e))for(let n of e)t.push(...this.resolveExtensions(n));else if(typeof e==`object`&&`key`in e)t.push(e);else if(typeof e==`string`){let n=this.extensions.find(t=>t.key===e);n&&t.push(n)}return t}unregisterExtension(e){var t;let n=this.resolveExtensions(e);if(!n.length){console.warn(`No extensions found to unregister`,e);return}let r=!1,i=new Set;for(let a of n)this.extensions=this.extensions.filter(e=>e!==a),this.extensionFactories.forEach((e,t)=>{e===a&&this.extensionFactories.delete(t)}),(t=this.abortMap.get(a))==null||t.abort(),this.abortMap.delete(a),this.extensionPlugins.get(a)?.forEach(e=>{i.add(e)}),this.extensionPlugins.delete(a),a.tiptapExtensions&&!r&&(r=!0,console.warn(`Extension ${a.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`,e));this.updatePlugins(e=>e.filter(e=>!i.has(e)))}updatePlugins(e){let t=this.editor.prosemirrorState,n=t.reconfigure({plugins:e(t.plugins.slice())});this.editor.prosemirrorView.updateState(n)}getTiptapExtensions(){let e=wze(this.editor,this.options).filter(e=>!this.disabledExtensions.has(e.name)),t=ANe(this.extensions),n=new Map;for(let r of this.extensions){r.tiptapExtensions&&e.push(...r.tiptapExtensions);let i=t(r.key),{plugins:a,inputRules:o}=this.getProsemirrorPluginsFromExtension(r);a.length&&e.push(GJ.create({name:r.key,priority:i,addProseMirrorPlugins:()=>a})),o.length&&(n.has(i)||n.set(i,[]),n.get(i).push(...o))}e.push(GJ.create({name:`blocknote-input-rules`,addProseMirrorPlugins(){let e=[];return Array.from(n.keys()).sort().reverse().forEach(t=>{e.push(...n.get(t))}),[zNe({rules:e})]}}));for(let t of this.options._tiptapOptions?.extensions??[])e.push(t);return e}getProsemirrorPluginsFromExtension(e){var t,n,r;let i=[...e.prosemirrorPlugins??[]],a=[];return!((t=e.prosemirrorPlugins)!=null&&t.length)&&!Object.keys(e.keyboardShortcuts||{}).length&&!((n=e.inputRules)!=null&&n.length)?{plugins:i,inputRules:a}:(this.extensionPlugins.set(e,i),(r=e.inputRules)!=null&&r.length&&a.push(...e.inputRules.map(e=>new i8(e.find,(t,n,r,i)=>{let a=e.replace({match:n,range:{from:r,to:i},editor:this.editor});if(a){let e=this.editor.getTextCursorPosition();if(this.editor.schema.blockSchema[e.block.type].content!==`inline`)return null;let n=HY(t.tr),o=t.tr.deleteRange(r,i);return XZ(o,n.bnBlock.beforePos,a),o}return null}))),Object.keys(e.keyboardShortcuts||{}).length&&i.push(iK(Object.fromEntries(Object.entries(e.keyboardShortcuts).map(([e,t])=>[e,()=>t({editor:this.editor})])))),{plugins:i,inputRules:a})}getExtensions(){return new Map(this.extensions.map(e=>[e.key,e]))}getExtension(e){if(typeof e==`string`)return this.extensions.find(t=>t.key===e)||void 0;if(typeof e==`function`)return this.extensionFactories.get(e)||void 0;throw Error(`Invalid extension type: ${typeof e}`)}hasExtension(e){return typeof e==`string`?this.extensions.some(t=>t.key===e):typeof e==`object`&&`key`in e?this.extensions.some(t=>t.key===e.key):typeof e==`function`?this.extensionFactories.has(e):!1}},jBe=class{constructor(e){this.editor=e}getSelection(){return this.editor.transact(e=>Dze(e))}getSelectionCutBlocks(e=!1){return this.editor.transact(t=>kze(t,e))}setSelection(e,t){return this.editor.transact(n=>Oze(n,e,t))}getTextCursorPosition(){return this.editor.transact(e=>Aze(e))}setTextCursorPosition(e,t=`start`){return this.editor.transact(n=>jze(n,e,t))}getSelectionBoundingBox(){if(!this.editor.prosemirrorView)return;let{selection:e}=this.editor.prosemirrorState,{ranges:t}=e,n=Math.min(...t.map(e=>e.$from.pos)),r=Math.max(...t.map(e=>e.$to.pos));if(Xme(e)){let e=this.editor.prosemirrorView.nodeDOM(n);if(e)return e.getBoundingClientRect()}return lq(this.editor.prosemirrorView,n,r).toJSON()}},MBe=class{constructor(e){h7(this,`activeTransaction`,null),h7(this,`isInCan`,!1),this.editor=e}can(e){try{return this.isInCan=!0,e()}finally{this.isInCan=!1}}exec(e){if(this.activeTransaction)throw Error("`exec` should not be called within a `transact` call, move the `exec` call outside of the `transact` call");if(this.isInCan)return this.canExec(e);let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,e=>this.prosemirrorView.dispatch(e),n)}canExec(e){if(this.activeTransaction)throw Error("`canExec` should not be called within a `transact` call, move the `canExec` call outside of the `transact` call");let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,void 0,n)}transact(e){if(this.activeTransaction)return e(this.activeTransaction);try{this.activeTransaction=this.editor._tiptapEditor.state.tr;let t=e(this.activeTransaction),n=this.activeTransaction;return this.activeTransaction=null,n&&(n.docChanged||n.selectionSet||n.scrolledIntoView||n.storedMarksSet||!n.isGeneric)&&this.prosemirrorView.dispatch(n),t}finally{this.activeTransaction=null}}get prosemirrorState(){if(this.activeTransaction)throw Error("`prosemirrorState` should not be called within a `transact` call, move the `prosemirrorState` call outside of the `transact` call or use `editor.transact` to read the current editor state");return this.editor._tiptapEditor.state}get prosemirrorView(){return this.editor._tiptapEditor.view}isFocused(){return this.prosemirrorView?.hasFocus()||!1}focus(){var e;(e=this.prosemirrorView)==null||e.focus()}get isEditable(){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error(`no editor, but also not headless?`);return!1}return this.editor._tiptapEditor.isEditable===void 0?!0:this.editor._tiptapEditor.isEditable}set isEditable(e){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error(`no editor, but also not headless?`);return}this.editor._tiptapEditor.options.editable!==e&&this.editor._tiptapEditor.setEditable(e)}undo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.undoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.undoCommand);throw Error(`No undo plugin found`)}redo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.redoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.redoCommand);throw Error(`No redo plugin found`)}},NBe=class{constructor(e){this.editor=e}insertInlineContent(e,{updateSelection:t=!1}={}){let n=fX(e,this.editor.pmSchema);this.editor.transact(e=>{Mze(e,{from:e.selection.from,to:e.selection.to},n,{updateSelection:t})})}getActiveStyles(){return this.editor.transact(e=>{let t={},n=e.selection.$to.marks();for(let e of n){let n=this.editor.schema.styleSchema[e.type.name];if(!n){e.type.name!==`link`&&!e.type.spec.blocknoteIgnore&&console.warn(`mark not found in styleschema`,e.type.name);continue}n.propSchema===`boolean`?t[n.type]=!0:t[n.type]=e.attrs.stringValue}return t})}addStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.setMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.setMark(t,{stringValue:n});else throw new _X(e.propSchema)}}removeStyles(e){for(let t of Object.keys(e))this.editor._tiptapEditor.commands.unsetMark(t)}toggleStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.toggleMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.toggleMark(t,{stringValue:n});else throw new _X(e.propSchema)}}getSelectedText(){return this.editor.transact(e=>e.doc.textBetween(e.selection.from,e.selection.to))}getSelectedLinkUrl(){return this.editor._tiptapEditor.getAttributes(`link`).href}createLink(e,t){if(e===``)return;let n=this.editor.pmSchema.mark(`link`,{href:e});this.editor.transact(e=>{let{from:r,to:i}=e.selection;t?e.insertText(t,r,i).addMark(r,r+t.length,n):e.setSelection(z.create(e.doc,i)).addMark(r,i,n)})}},PBe={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1},FBe=class e extends fY{constructor(e){super(),h7(this,`pmSchema`),h7(this,`_tiptapEditor`),h7(this,`elementRenderer`,null),h7(this,`blockCache`,new WeakMap),h7(this,`dictionary`),h7(this,`schema`),h7(this,`blockImplementations`),h7(this,`inlineContentImplementations`),h7(this,`styleImplementations`),h7(this,`uploadFile`),h7(this,`onUploadStartCallbacks`,[]),h7(this,`onUploadEndCallbacks`,[]),h7(this,`resolveFileUrl`),h7(this,`settings`),h7(this,`_blockManager`),h7(this,`_eventManager`),h7(this,`_exportManager`),h7(this,`_extensionManager`),h7(this,`_selectionManager`),h7(this,`_stateManager`),h7(this,`_styleManager`),h7(this,`unregisterExtension`,(...e)=>this._extensionManager.unregisterExtension(...e)),h7(this,`registerExtension`,(...e)=>this._extensionManager.registerExtension(...e)),h7(this,`getExtension`,(...e)=>this._extensionManager.getExtension(...e)),h7(this,`mount`,e=>{this._tiptapEditor.mount({mount:e})}),h7(this,`unmount`,()=>{this._tiptapEditor.unmount()}),this.options=e,this.dictionary=e.dictionary||INe,this.settings={tables:{splitCells:e?.tables?.splitCells??!1,cellBackgroundColor:e?.tables?.cellBackgroundColor??!1,cellTextColor:e?.tables?.cellTextColor??!1,headers:e?.tables?.headers??!1}};let t={defaultStyles:!0,schema:e.schema||r8.create(),...e,placeholders:{...this.dictionary.placeholders,...e.placeholders}};if(this.schema=t.schema,this.blockImplementations=t.schema.blockSpecs,this.inlineContentImplementations=t.schema.inlineContentSpecs,this.styleImplementations=t.schema.styleSpecs,t.uploadFile){let e=t.uploadFile;this.uploadFile=async(t,n)=>{this.onUploadStartCallbacks.forEach(e=>e.apply(this,[n]));try{return await e(t,n)}finally{this.onUploadEndCallbacks.forEach(e=>e.apply(this,[n]))}}}this.resolveFileUrl=t.resolveFileUrl,this._eventManager=new Yze(this),this._extensionManager=new ABe(this,t);let n=this._extensionManager.getTiptapExtensions(),r=this._extensionManager.hasExtension(`ySync`)||this._extensionManager.hasExtension(`liveblocksExtension`);r&&t.initialContent&&console.warn(`When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider`);let i={...PBe,...t._tiptapOptions,element:null,autofocus:t.autofocus??!1,extensions:n,editorProps:{...t._tiptapOptions?.editorProps,attributes:{tabIndex:`0`,...t._tiptapOptions?.editorProps?.attributes,...t.domAttributes?.editor,class:IZ(`bn-editor`,t.defaultStyles?`bn-default-styles`:``,t.domAttributes?.editor?.class||``)},transformPasted:Lze}};try{let e=t.initialContent||(r?[{type:`paragraph`,id:`initialBlockId`}]:[{type:`paragraph`,id:gX.options.generateID()}]);if(!Array.isArray(e)||e.length===0)throw Error(`initialContent must be a non-empty array of blocks, received: `+e);let n=Wme(i.extensions),a=AK({type:`doc`,content:[{type:`blockGroup`,content:e.map(e=>hX(e,n,this.schema.styleSchema).toJSON())}]},n,i.parseOptions);this._tiptapEditor=new aY({...i,content:a.toJSON()}),this.pmSchema=this._tiptapEditor.schema}catch(e){throw Error("Error creating document from blocks passed as `initialContent`",{cause:e})}let a,o=this.pmSchema.nodes.doc.createAndFill;this.pmSchema.nodes.doc.createAndFill=(...e)=>{if(a)return a;let t=o.apply(this.pmSchema.nodes.doc,e),n=JSON.parse(JSON.stringify(t.toJSON()));return n.content[0].content[0].attrs.id=`initialBlockId`,a=tj.fromJSON(this.pmSchema,n),a},this.pmSchema.cached.blockNoteEditor=this,this._blockManager=new Jze(this),this._exportManager=new Zze(this),this._selectionManager=new jBe(this),this._stateManager=new MBe(this),this._styleManager=new NBe(this),this.emit(`create`)}static create(t){return new e(t??{})}get extensions(){return this._extensionManager.getExtensions()}exec(e){return this._stateManager.exec(e)}canExec(e){return this._stateManager.canExec(e)}transact(e){return this._stateManager.transact(e)}get prosemirrorState(){return this._stateManager.prosemirrorState}get prosemirrorView(){return this._stateManager.prosemirrorView}get domElement(){if(!this.headless)return this.prosemirrorView?.dom}isFocused(){return this.headless?!1:this.prosemirrorView?.hasFocus()||!1}get headless(){return!this._tiptapEditor.isInitialized}focus(){this.headless||this.prosemirrorView.focus()}blur(){var e;this.headless||(e=this.domElement)==null||e.blur()}onUploadStart(e){return this.onUploadStartCallbacks.push(e),()=>{let t=this.onUploadStartCallbacks.indexOf(e);t>-1&&this.onUploadStartCallbacks.splice(t,1)}}onUploadEnd(e){return this.onUploadEndCallbacks.push(e),()=>{let t=this.onUploadEndCallbacks.indexOf(e);t>-1&&this.onUploadEndCallbacks.splice(t,1)}}get topLevelBlocks(){return this.document}get document(){return this._blockManager.document}getBlock(e){return this._blockManager.getBlock(e)}getPrevBlock(e){return this._blockManager.getPrevBlock(e)}getNextBlock(e){return this._blockManager.getNextBlock(e)}getParentBlock(e){return this._blockManager.getParentBlock(e)}forEachBlock(e,t=!1){this._blockManager.forEachBlock(e,t)}onEditorContentChange(e){this._tiptapEditor.on(`update`,e)}onEditorSelectionChange(e){this._tiptapEditor.on(`selectionUpdate`,e)}onBeforeChange(e){return this._extensionManager.getExtension(I6).subscribe(e)}getTextCursorPosition(){return this._selectionManager.getTextCursorPosition()}setTextCursorPosition(e,t=`start`){return this._selectionManager.setTextCursorPosition(e,t)}getSelection(){return this._selectionManager.getSelection()}getSelectionCutBlocks(e=!1){return this._selectionManager.getSelectionCutBlocks(e)}setSelection(e,t){return this._selectionManager.setSelection(e,t)}get isEditable(){return this._stateManager.isEditable}set isEditable(e){this._stateManager.isEditable=e}insertBlocks(e,t,n=`before`){return this._blockManager.insertBlocks(e,t,n)}updateBlock(e,t){return this._blockManager.updateBlock(e,t)}removeBlocks(e){return this._blockManager.removeBlocks(e)}replaceBlocks(e,t){return this._blockManager.replaceBlocks(e,t)}undo(){return this._stateManager.undo()}redo(){return this._stateManager.redo()}insertInlineContent(e,{updateSelection:t=!1}={}){this._styleManager.insertInlineContent(e,{updateSelection:t})}getActiveStyles(){return this._styleManager.getActiveStyles()}addStyles(e){this._styleManager.addStyles(e)}removeStyles(e){this._styleManager.removeStyles(e)}toggleStyles(e){this._styleManager.toggleStyles(e)}getSelectedText(){return this._styleManager.getSelectedText()}getSelectedLinkUrl(){return this._styleManager.getSelectedLinkUrl()}createLink(e,t){this._styleManager.createLink(e,t)}canNestBlock(){return this._blockManager.canNestBlock()}nestBlock(){this._blockManager.nestBlock()}canUnnestBlock(){return this._blockManager.canUnnestBlock()}unnestBlock(){this._blockManager.unnestBlock()}moveBlocksUp(){return this._blockManager.moveBlocksUp()}moveBlocksDown(){return this._blockManager.moveBlocksDown()}blocksToHTMLLossy(e=this.document){return this._exportManager.blocksToHTMLLossy(e)}blocksToFullHTML(e=this.document){return this._exportManager.blocksToFullHTML(e)}tryParseHTMLToBlocks(e){return this._exportManager.tryParseHTMLToBlocks(e)}blocksToMarkdownLossy(e=this.document){return this._exportManager.blocksToMarkdownLossy(e)}tryParseMarkdownToBlocks(e){return this._exportManager.tryParseMarkdownToBlocks(e)}onChange(e,t){return this._eventManager.onChange(e,t)}onSelectionChange(e,t){return this._eventManager.onSelectionChange(e,t)}onMount(e){this._eventManager.onMount(e)}onUnmount(e){this._eventManager.onUnmount(e)}getSelectionBoundingBox(){return this._selectionManager.getSelectionBoundingBox()}get isEmpty(){let e=this.document;return e.length===0||e.length===1&&e[0].type===`paragraph`&&e[0].content.length===0}pasteHTML(e,t=!1){this._exportManager.pasteHTML(e,t)}pasteText(e){return this._exportManager.pasteText(e)}pasteMarkdown(e){return this._exportManager.pasteMarkdown(e)}}}));function LBe(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:VBe.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}function RBe({editor:e,instance:t,children:n}){let r=e??t;if(!r)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,k7.useMemo)(()=>({editor:r}),[r]),a=(0,k7.useMemo)(()=>({editor:r}),[r]);return(0,A7.jsx)(j7.Provider,{value:a,children:(0,A7.jsx)(M7.Provider,{value:i,children:n})})}function zBe({...e}){let{editor:t}=eVe();return(0,A7.jsx)(XBe,{editor:t,...e})}var BBe,E7,VBe,HBe,D7,O7,UBe,WBe,GBe,k7,A7,KBe,qBe,JBe,YBe,XBe,ZBe,j7,QBe,$Be,M7,eVe,tVe=o((()=>{BBe=u(p(),1),E7=u(p(),1),VBe=u(_(),1),HBe=t8(),D7=N(),p(),t8(),p(),_Ne(),N(),O7=u(p(),1),N(),UBe=u(p(),1),WBe=N(),GBe=u(p(),1),p(),_(),N(),N(),cY(),p(),N(),k7=u(p(),1),A7=N(),cY(),KBe=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},qBe=({contentComponent:e})=>{let t=(0,HBe.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,D7.jsx)(D7.Fragment,{children:Object.values(t)})},JBe=class extends E7.Component{constructor(e){super(e),this.editorContentRef=E7.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=LBe(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,D7.jsxs)(D7.Fragment,{children:[(0,D7.jsx)(`div`,{ref:KBe(t,this.editorContentRef),...n}),e?.contentComponent&&(0,D7.jsx)(qBe,{contentComponent:e.contentComponent})]})}},YBe=(0,E7.forwardRef)((e,t)=>{let n=E7.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return E7.createElement(JBe,{key:n,innerRef:t,...e})}),XBe=E7.memo(YBe),ZBe=typeof window>`u`,ZBe||typeof window<`u`&&window.next,j7=(0,BBe.createContext)({editor:null}),j7.Consumer,QBe=(0,O7.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),$Be=()=>(0,O7.useContext)(QBe),UBe.forwardRef((e,t)=>{let{onDragStart:n}=$Be();return(0,WBe.jsx)(e.as||`div`,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})}),GBe.createContext({markViewContentRef:()=>{}}),M7=(0,k7.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}}),M7.displayName=`TiptapContext`,eVe=()=>(0,k7.useContext)(M7),RBe.displayName=`Tiptap`,zBe.displayName=`Tiptap.Content`,Object.assign(RBe,{Content:zBe})}));function N7(e){return(0,Z.useContext)(Q7)}function P7(e){let t=N7();if(!(t!=null&&t.editor))throw Error(`useBlockNoteEditor was called outside of a BlockNoteContext provider or BlockNoteView component`);return t.editor}function F7(e,t){let n=(t?.editor??P7()).getExtension(e);if(!n)throw Error(`Extension not found`,{cause:{plugin:e}});return n}function I7(e,t){let{store:n}=F7(e,t);if(!n)throw Error(`Store not found on plugin`,{cause:{plugin:e}});return vNe(n,t?.selector)}function nVe(e){let t=new DOMRect,n=`getBoundingClientRect`in e?()=>e.getBoundingClientRect():()=>e.element.getBoundingClientRect();return()=>e.element&&(e.cacheMountedBoundingClientRect??!0)?(e.element.isConnected&&(t=n()),t):n()}function L7(){return(0,Z.useContext)(t9)}function R7(){return N7().editor.dictionary}function rVe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function iVe(){if(qHe)return o9;qHe=1;var e=Z.default;function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var n=typeof Object.is==`function`?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function s(e,t){var n=t(),s=r({inst:{value:n,getSnapshot:t}}),l=s[0].inst,u=s[1];return a(function(){l.value=n,l.getSnapshot=t,c(l)&&u({inst:l})},[e,n,t]),i(function(){return c(l)&&u({inst:l}),e(function(){c(l)&&u({inst:l})})},[e]),o(n),n}function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch{return!0}}function l(e,t){return t()}var u=typeof window>`u`||typeof window.document>`u`||typeof window.document.createElement>`u`?l:s;return o9.useSyncExternalStore=e.useSyncExternalStore===void 0?u:e.useSyncExternalStore,o9}function aVe(){return JHe||(JHe=1,a9.exports=iVe()),a9.exports}function oVe(){if(YHe)return i9;YHe=1;var e=Z.default,t=aVe();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,s=e.useMemo,c=e.useDebugValue;return i9.useSyncExternalStoreWithSelector=function(e,t,n,l,u){var d=a(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,a=e,e=l(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return o=t}return o=e}if(t=o,r(a,e))return t;var n=l(e);return u!==void 0&&u(t,n)?(a=e,t):(a=e,o=n)}var i=!1,a,o,s=n===void 0?null:n;return[function(){return e(t())},s===null?void 0:function(){return e(s())}]},[t,n,l,u]);var p=i(e,d[0],d[1]);return o(function(){f.hasValue=!0,f.value=p},[p]),c(p),p},i9}function z7(e){let t=N7(),n=e.editor||t?.editor||null,r=e.on||`all`,[i]=(0,Z.useState)(()=>new QHe(n)),a=XHe.useSyncExternalStoreWithSelector(i.subscribe,i.getSnapshot,i.getServerSnapshot,e.selector,e.equalityFn??KHe);return ZHe(()=>i.watch(n,r),[n,i,r]),(0,Z.useDebugValue)(a),a}function sVe(e,t){if(e==null)return{};var n=cVe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cVe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function B7(){return B7=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},B7.apply(this,arguments)}function lVe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lVe(Object(n),!0).forEach(function(t){uVe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lVe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uVe(e,t,n){return t=dVe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dVe(e){var t=fVe(e,`string`);return typeof t==`symbol`?t:t+``}function fVe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function pVe(e){return e&&e.map((e,t)=>Z.createElement(e.tag,V7({key:t},e.attr),pVe(e.child)))}function H7(e){return t=>Z.createElement(mVe,B7({attr:V7({},e.attr)},t),pVe(e.child))}function mVe(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=sVe(e,$He),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),Z.createElement(`svg`,B7({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:V7(V7({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&Z.createElement(`title`,null,i),e.children)};return l9===void 0?t(c9):Z.createElement(l9.Consumer,null,e=>t(e))}function hVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 7V11L2 6L8 1V5H13C17.4183 5 21 8.58172 21 13C21 17.4183 17.4183 21 13 21H4V19H13C16.3137 19 19 16.3137 19 13C19 9.68629 16.3137 7 13 7H8Z`},child:[]}]})(e)}function gVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.29117 20.8242L2 22L3.17581 16.7088C2.42544 15.3056 2 13.7025 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C10.2975 22 8.6944 21.5746 7.29117 20.8242ZM7.58075 18.711L8.23428 19.0605C9.38248 19.6745 10.6655 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 13.3345 4.32549 14.6175 4.93949 15.7657L5.28896 16.4192L4.63416 19.3658L7.58075 18.711Z`},child:[]}]})(e)}function _Ve(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.24264 17.9967H3V13.754L14.435 2.319C14.8256 1.92848 15.4587 1.92848 15.8492 2.319L18.6777 5.14743C19.0682 5.53795 19.0682 6.17112 18.6777 6.56164L7.24264 17.9967ZM3 19.9967H21V21.9967H3V19.9967Z`},child:[]}]})(e)}function vVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z`},child:[]}]})(e)}function yVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z`},child:[]}]})(e)}function bVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z`},child:[]}]})(e)}function xVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z`},child:[]}]})(e)}function SVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z`},child:[]}]})(e)}function CVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z`},child:[]}]})(e)}function wVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z`},child:[]}]})(e)}function TVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3.41436 5.99995L5.70726 3.70706L4.29304 2.29285L0.585938 5.99995L4.29304 9.70706L5.70726 8.29285L3.41436 5.99995ZM9.58594 5.99995L7.29304 3.70706L8.70726 2.29285L12.4144 5.99995L8.70726 9.70706L7.29304 8.29285L9.58594 5.99995ZM14.0002 2.99995H21.0002C21.5524 2.99995 22.0002 3.44767 22.0002 3.99995V20C22.0002 20.5522 21.5524 21 21.0002 21H3.00015C2.44787 21 2.00015 20.5522 2.00015 20V12H4.00015V19H20.0002V4.99995H14.0002V2.99995Z`},child:[]}]})(e)}function EVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5.55397 22H3.3999L10.9999 3H12.9999L20.5999 22H18.4458L16.0458 16H7.95397L5.55397 22ZM8.75397 14H15.2458L11.9999 5.88517L8.75397 14Z`},child:[]}]})(e)}function U7(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM21.0005 8V20H19.0005L19 10.204L17 10.74V8.67L19.5005 8H21.0005Z`},child:[]}]})(e)}function W7(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 8C20.5711 8 22.25 9.67893 22.25 11.75C22.25 12.6074 21.9623 13.3976 21.4781 14.0292L21.3302 14.2102L18.0343 18H22V20H15L14.9993 18.444L19.8207 12.8981C20.0881 12.5908 20.25 12.1893 20.25 11.75C20.25 10.7835 19.4665 10 18.5 10C17.5818 10 16.8288 10.7071 16.7558 11.6065L16.75 11.75H14.75C14.75 9.67893 16.4289 8 18.5 8Z`},child:[]}]})(e)}function G7(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8L21.9984 10L19.4934 12.883C21.0823 13.3184 22.25 14.7728 22.25 16.5C22.25 18.5711 20.5711 20.25 18.5 20.25C16.674 20.25 15.1528 18.9449 14.8184 17.2166L16.7821 16.8352C16.9384 17.6413 17.6481 18.25 18.5 18.25C19.4665 18.25 20.25 17.4665 20.25 16.5C20.25 15.5335 19.4665 14.75 18.5 14.75C18.214 14.75 17.944 14.8186 17.7056 14.9403L16.3992 13.3932L19.3484 10H15V8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function DVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM22 8V16H23.5V18H22V20H20V18H14.5V16.66L19.5 8H22ZM20 11.133L17.19 16H20V11.133Z`},child:[]}]})(e)}function OVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8V10H17.6769L17.2126 12.6358C17.5435 12.5472 17.8912 12.5 18.25 12.5C20.4591 12.5 22.25 14.2909 22.25 16.5C22.25 18.7091 20.4591 20.5 18.25 20.5C16.4233 20.5 14.8827 19.2756 14.4039 17.6027L16.3271 17.0519C16.5667 17.8881 17.3369 18.5 18.25 18.5C19.3546 18.5 20.25 17.6046 20.25 16.5C20.25 15.3954 19.3546 14.5 18.25 14.5C17.6194 14.5 17.057 14.7918 16.6904 15.2478L14.8803 14.3439L16 8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function kVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21.097 8L18.499 12.5C20.7091 12.5 22.5 14.2909 22.5 16.5C22.5 18.7091 20.7091 20.5 18.5 20.5C16.2909 20.5 14.5 18.7091 14.5 16.5C14.5 15.7636 14.699 15.0737 15.0461 14.4811L18.788 8H21.097ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 14.5C17.3954 14.5 16.5 15.3954 16.5 16.5C16.5 17.6046 17.3954 18.5 18.5 18.5C19.6046 18.5 20.5 17.6046 20.5 16.5C20.5 15.3954 19.6046 14.5 18.5 14.5Z`},child:[]}]})(e)}function AVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM3 12.5L7 9V16L3 12.5Z`},child:[]}]})(e)}function jVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM7 12.5L3 16V9L7 12.5Z`},child:[]}]})(e)}function MVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z`},child:[]}]})(e)}function NVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z`},child:[]}]})(e)}function PVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 17H22V19H19V22H17V17ZM7 7H2V5H5V2H7V7ZM18.364 15.5355L16.9497 14.1213L18.364 12.7071C20.3166 10.7545 20.3166 7.58866 18.364 5.63604C16.4113 3.68342 13.2455 3.68342 11.2929 5.63604L9.87868 7.05025L8.46447 5.63604L9.87868 4.22183C12.6123 1.48816 17.0445 1.48816 19.7782 4.22183C22.5118 6.9555 22.5118 11.3877 19.7782 14.1213L18.364 15.5355ZM15.5355 18.364L14.1213 19.7782C11.3877 22.5118 6.9555 22.5118 4.22183 19.7782C1.48816 17.0445 1.48816 12.6123 4.22183 9.87868L5.63604 8.46447L7.05025 9.87868L5.63604 11.2929C3.68342 13.2455 3.68342 16.4113 5.63604 18.364C7.58866 20.3166 10.7545 20.3166 12.7071 18.364L14.1213 16.9497L15.5355 18.364ZM14.8284 7.75736L16.2426 9.17157L9.17157 16.2426L7.75736 14.8284L14.8284 7.75736Z`},child:[]}]})(e)}function FVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M18.3638 15.5355L16.9496 14.1213L18.3638 12.7071C20.3164 10.7545 20.3164 7.58866 18.3638 5.63604C16.4112 3.68341 13.2453 3.68341 11.2927 5.63604L9.87849 7.05025L8.46428 5.63604L9.87849 4.22182C12.6122 1.48815 17.0443 1.48815 19.778 4.22182C22.5117 6.95549 22.5117 11.3876 19.778 14.1213L18.3638 15.5355ZM15.5353 18.364L14.1211 19.7782C11.3875 22.5118 6.95531 22.5118 4.22164 19.7782C1.48797 17.0445 1.48797 12.6123 4.22164 9.87868L5.63585 8.46446L7.05007 9.87868L5.63585 11.2929C3.68323 13.2455 3.68323 16.4113 5.63585 18.364C7.58847 20.3166 10.7543 20.3166 12.7069 18.364L14.1211 16.9497L15.5353 18.364ZM14.8282 7.75736L16.2425 9.17157L9.17139 16.2426L7.75717 14.8284L14.8282 7.75736Z`},child:[]}]})(e)}function IVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z`},child:[]}]})(e)}function LVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM5 3V6H6V7H3V6H4V4H3V3H5ZM3 14V11.5H5V11H3V10H6V12.5H4V13H6V14H3ZM5 19.5H3V18.5H5V18H3V17H6V21H3V20H5V19.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function RVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM4.5 6.5C3.67157 6.5 3 5.82843 3 5C3 4.17157 3.67157 3.5 4.5 3.5C5.32843 3.5 6 4.17157 6 5C6 5.82843 5.32843 6.5 4.5 6.5ZM4.5 13.5C3.67157 13.5 3 12.8284 3 12C3 11.1716 3.67157 10.5 4.5 10.5C5.32843 10.5 6 11.1716 6 12C6 12.8284 5.32843 13.5 4.5 13.5ZM4.5 20.4C3.67157 20.4 3 19.7284 3 18.9C3 18.0716 3.67157 17.4 4.5 17.4C5.32843 17.4 6 18.0716 6 18.9C6 19.7284 5.32843 20.4 4.5 20.4ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function zVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z`},child:[]}]})(e)}function BVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20C20.5523 3 21 3.44772 21 4V20ZM19 11V5H13.001V7H15L12 10L9 7H11V5H5V11H7V13H5V19H11V17H9L12 14L15 17H13.001V19H19V13H17V11H19ZM11 13H9V11H11V13ZM15 13H13V11H15V13Z`},child:[]}]})(e)}function VVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 4H3V6H21V4ZM21 11H8V13H21V11ZM21 18H8V20H21V18ZM5 11H3V20H5V11Z`},child:[]}]})(e)}function HVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17.1538 14C17.3846 14.5161 17.5 15.0893 17.5 15.7196C17.5 17.0625 16.9762 18.1116 15.9286 18.867C14.8809 19.6223 13.4335 20 11.5862 20C9.94674 20 8.32335 19.6185 6.71592 18.8555V16.6009C8.23538 17.4783 9.7908 17.917 11.3822 17.917C13.9333 17.917 15.2128 17.1846 15.2208 15.7196C15.2208 15.0939 15.0049 14.5598 14.5731 14.1173C14.5339 14.0772 14.4939 14.0381 14.4531 14H3V12H21V14H17.1538ZM13.076 11H7.62908C7.4566 10.8433 7.29616 10.6692 7.14776 10.4778C6.71592 9.92084 6.5 9.24559 6.5 8.45207C6.5 7.21602 6.96583 6.165 7.89749 5.299C8.82916 4.43299 10.2706 4 12.2219 4C13.6934 4 15.1009 4.32808 16.4444 4.98426V7.13591C15.2448 6.44921 13.9293 6.10587 12.4978 6.10587C10.0187 6.10587 8.77917 6.88793 8.77917 8.45207C8.77917 8.87172 8.99709 9.23796 9.43293 9.55079C9.86878 9.86362 10.4066 10.1135 11.0463 10.3004C11.6665 10.4816 12.3431 10.7148 13.076 11H13.076Z`},child:[]}]})(e)}function UVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 10V14H19V10H13ZM11 10H5V14H11V10ZM13 19H19V16H13V19ZM11 19V16H5V19H11ZM13 5V8H19V5H13ZM11 5H5V8H11V5ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z`},child:[]}]})(e)}function K7(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 6V21H11V6H5V4H19V6H13Z`},child:[]}]})(e)}function WVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 3V12C8 14.2091 9.79086 16 12 16C14.2091 16 16 14.2091 16 12V3H18V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V3H8ZM4 20H20V22H4V20Z`},child:[]}]})(e)}function GVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z`},child:[]}]})(e)}function KVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z`},child:[]}]})(e)}function qVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 15V18H24V20H21V23H19V20H16V18H19V15H21ZM21.0082 3C21.556 3 22 3.44495 22 3.9934L22.0007 13.3417C21.3749 13.1204 20.7015 13 20 13V5H4L4.001 19L13.2929 9.70715C13.6528 9.34604 14.22 9.31823 14.6123 9.62322L14.7065 9.70772L18.2521 13.2586C15.791 14.0069 14 16.2943 14 19C14 19.7015 14.1204 20.3749 14.3417 21.0007L2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082ZM8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7Z`},child:[]}]})(e)}function JVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V5.757L19 7.757V5H5V13.1L9 9.1005L13.328 13.429L12.0012 14.7562L11.995 18.995L16.2414 19.0012L17.571 17.671L18.8995 19H19V16.242L21 14.242V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM21.7782 7.80761L23.1924 9.22183L15.4142 17L13.9979 16.9979L14 15.5858L21.7782 7.80761ZM15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7Z`},child:[]}]})(e)}function YVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 18V20H2V18H22ZM2 3.5L10 8.5L2 13.5V3.5ZM22 11V13H12V11H22ZM22 4V6H12V4H22Z`},child:[]}]})(e)}function XVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z`},child:[]}]})(e)}function ZVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z`},child:[]}]})(e)}function QVe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z`},child:[]}]})(e)}function $Ve(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function eHe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function tHe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM14 9H19L12 16L5 9H10V3H14V9Z`},child:[]}]})(e)}function nHe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V12L17.206 8.207L11.2071 14.2071L9.79289 12.7929L15.792 6.793L12 3H21Z`},child:[]}]})(e)}function rHe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z`},child:[]}]})(e)}function iHe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11V13H19V11H5Z`},child:[]}]})(e)}function aHe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM8 13C8 15.2091 9.79086 17 12 17C14.2091 17 16 15.2091 16 13H8ZM8 11C8.82843 11 9.5 10.3284 9.5 9.5C9.5 8.67157 8.82843 8 8 8C7.17157 8 6.5 8.67157 6.5 9.5C6.5 10.3284 7.17157 11 8 11ZM16 11C16.8284 11 17.5 10.3284 17.5 9.5C17.5 8.67157 16.8284 8 16 8C15.1716 8 14.5 8.67157 14.5 9.5C14.5 10.3284 15.1716 11 16 11Z`},child:[]}]})(e)}function oHe(e){return H7({attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM8 13H16C16 15.2091 14.2091 17 12 17C9.79086 17 8 15.2091 8 13ZM8 11C7.17157 11 6.5 10.3284 6.5 9.5C6.5 8.67157 7.17157 8 8 8C8.82843 8 9.5 8.67157 9.5 9.5C9.5 10.3284 8.82843 11 8 11ZM16 11C15.1716 11 14.5 10.3284 14.5 9.5C14.5 8.67157 15.1716 8 16 8C16.8284 8 17.5 8.67157 17.5 9.5C17.5 10.3284 16.8284 11 16 11Z`},child:[]}]})(e)}function sHe(e,t){return e in t.schema.styleSchema&&t.schema.styleSchema[e].type===e&&t.schema.styleSchema[e].propSchema===`boolean`}function q7(e,t){return`${e}Color`in t.schema.styleSchema&&t.schema.styleSchema[`${e}Color`].type===`${e}Color`&&t.schema.styleSchema[`${e}Color`].propSchema===`string`}function cHe(e){return`link`in e.schema.inlineContentSchema&&e.schema.inlineContentSchema.link===`link`}function J7(e,t){try{let n=new URL(e,t);if(n.protocol!==`javascript:`)return n.href}catch{}return`#`}function lHe(e){return H7({attr:{viewBox:`0 0 1024 1024`},child:[{tag:`path`,attr:{d:`M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z`},child:[]},{tag:`path`,attr:{d:`M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z`},child:[]}]})(e)}function uHe(e){return H7({attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0V0z`},child:[]},{tag:`path`,attr:{d:`M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z`},child:[]}]})(e)}function dHe(e){return H7({attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`m7 10 5 5 5-5z`},child:[]}]})(e)}async function fHe(e,t){return(await HMe(e,t)).map(({id:e,onItemClick:t})=>({id:e,onItemClick:t,icon:e}))}function pHe(e){let t=L7(),n=R7(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o,columns:s}=e,c=i===`loading-initial`||i===`loading`?(0,Q.jsx)(t.GridSuggestionMenu.Loader,{className:`bn-grid-suggestion-menu-loader`,columns:s}):null,l=(0,Z.useMemo)(()=>{let e=[];for(let n=0;n<r.length;n++){let i=r[n];e.push((0,Q.jsx)(t.GridSuggestionMenu.Item,{className:`bn-grid-suggestion-menu-item`,item:i,id:`bn-grid-suggestion-menu-item-${n}`,isSelected:n===a,onClick:()=>o?.(i)},i.id))}return e},[t,r,o,a]);return(0,Q.jsxs)(t.GridSuggestionMenu.Root,{id:`bn-grid-suggestion-menu`,columns:s,className:`bn-grid-suggestion-menu`,children:[c,l,l.length===0&&e.loadingState===`loaded`&&(0,Q.jsx)(t.GridSuggestionMenu.EmptyItem,{className:`bn-grid-suggestion-menu-empty-item`,columns:s,children:n.suggestion_menu.no_items_title})]})}function mHe(e,t,n,r=3){let i=(0,Z.useRef)(0);(0,Z.useEffect)(()=>{t!==void 0&&(e.length>0?i.current=t.length:t.length-i.current>r&&n())},[n,r,e.length,t])}function hHe(e,t){let[n,r]=(0,Z.useState)([]),[i,a]=(0,Z.useState)(!1),o=(0,Z.useRef)(void 0),s=(0,Z.useRef)(void 0);return(0,Z.useEffect)(()=>{let n=e;o.current=e,a(!0),t(e).then(e=>{o.current===n&&(r(e),a(!1),s.current=n)})},[e,t]),{items:n||[],usedQuery:s.current,loadingState:s.current===void 0?`loading-initial`:i?`loading`:`loaded`}}function gHe(e,t,n,r,i){let[a,o]=(0,Z.useState)(0),s=r!==void 0&&r>1;return(0,Z.useEffect)(()=>{let t=e=>(e.key===`ArrowLeft`&&(e.preventDefault(),n.length&&o((a-1+n.length)%n.length)),e.key===`ArrowRight`&&(e.preventDefault(),n.length&&o((a+1+n.length)%n.length)),e.key===`ArrowUp`?(e.preventDefault(),n.length&&o((a-r+n.length)%n.length),!0):e.key===`ArrowDown`?(e.preventDefault(),n.length&&o((a+r)%n.length),!0):e.key===`Enter`&&!e.isComposing?(e.stopPropagation(),e.preventDefault(),n.length&&i?.(n[a]),!0):!1),s=e.domElement;return s?.addEventListener(`keydown`,t,!0),()=>{s?.removeEventListener(`keydown`,t,!0)}},[e.domElement,n,a,i,r,s]),(0,Z.useEffect)(()=>{o(0)},[t]),{selectedIndex:n.length===0?void 0:a}}function _He(e){let t=N7().setContentEditableProps,n=P7(),{getItems:r,gridSuggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c,columns:l}=e,u=(0,Z.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:d,usedQuery:f,loadingState:p}=hHe(a,r);mHe(d,f,s);let{selectedIndex:m}=gHe(n,a,d,l,u);return(0,Z.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,Z.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":m?`bn-suggestion-menu-item-`+m:void 0})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,m]),(0,Q.jsx)(i,{items:d,onItemClick:u,loadingState:p,selectedIndex:m,columns:l})}function vHe(e){let t=P7(),{triggerCharacter:n,gridSuggestionMenuComponent:r,columns:i,shouldOpen:a,minQueryLength:o,onItemClick:s,getItems:c}=e,l=(0,Z.useMemo)(()=>s||(e=>{e.onItemClick(t)}),[t,s]),u=(0,Z.useMemo)(()=>c||(async e=>await fHe(t,e)),[t,c]),d=F7(L$);(0,Z.useEffect)(()=>{d.addSuggestionMenu({triggerCharacter:n,shouldOpen:a})},[d,n,a]);let f=I7(L$),p=I7(L$,{selector:e=>({element:t.domElement?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),m=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:f?.show&&f?.triggerCharacter===n,onOpenChange:e=>{e||d.closeMenu()},placement:`bottom-start`,middleware:[rp(10),cp({allowedPlacements:[`bottom-start`,`top-start`],padding:10}),ip(),sp({apply({elements:e,availableHeight:t}){e.floating.style.maxHeight=`${Math.max(0,t)}px`},padding:10})],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:70},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,f?.show,f?.triggerCharacter,d,n]);return!f||!f.ignoreQueryLength&&o&&(f.query.startsWith(` `)||f.query.length<o)?null:(0,Q.jsx)($7,{reference:p,...m,children:n&&(0,Q.jsx)(_He,{query:f.query,closeMenu:d.closeMenu,clearQuery:d.clearQuery,getItems:u,columns:i,gridSuggestionMenuComponent:r||pHe,onItemClick:l})})}function yHe(e){let t=L7(),n=R7(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o}=e,s=i===`loading-initial`||i===`loading`?(0,Q.jsx)(t.SuggestionMenu.Loader,{className:`bn-suggestion-menu-loader`}):null,c=(0,Z.useMemo)(()=>{let e,n=[];for(let i=0;i<r.length;i++){let s=r[i];s.group!==e&&(e=s.group,n.push((0,Q.jsx)(t.SuggestionMenu.Label,{className:`bn-suggestion-menu-label`,children:e},e))),n.push((0,Q.jsx)(t.SuggestionMenu.Item,{className:IZ(`bn-suggestion-menu-item`,s.size===`small`?`bn-suggestion-menu-item-small`:``),item:s,id:`bn-suggestion-menu-item-${i}`,isSelected:i===a,onClick:()=>o?.(s)},s.title))}return n},[t,r,o,a]);return(0,Q.jsxs)(t.SuggestionMenu.Root,{id:`bn-suggestion-menu`,className:`bn-suggestion-menu`,children:[c,c.length===0&&(e.loadingState===`loading`||e.loadingState===`loaded`)&&(0,Q.jsx)(t.SuggestionMenu.EmptyItem,{className:`bn-suggestion-menu-item`,children:n.suggestion_menu.no_items_title}),s]})}function bHe(e,t){let[n,r]=(0,Z.useState)(0);return{selectedIndex:n,setSelectedIndex:r,handler:i=>{if(i.key===`ArrowUp`)return i.preventDefault(),e.length&&r((n-1+e.length)%e.length),!0;if(i.key===`ArrowDown`)return i.preventDefault(),e.length&&r((n+1)%e.length),!0;if(i.key===`PageUp`)return i.preventDefault(),e.length&&r(0),!0;if(i.key===`PageDown`)return i.preventDefault(),e.length&&r(e.length-1),!0;let a=xHe(i)?i.nativeEvent.isComposing:i.isComposing;return i.key===`Enter`&&!a?(i.preventDefault(),i.stopPropagation(),e.length&&t?.(e[n]),!0):!1}}}function xHe(e){return e.nativeEvent!==void 0}function SHe(e,t,n,r,i){let{selectedIndex:a,setSelectedIndex:o,handler:s}=bHe(n,r);return(0,Z.useEffect)(()=>{let t=i||e.domElement;return t?.addEventListener(`keydown`,s,!0),()=>{t?.removeEventListener(`keydown`,s,!0)}},[e.domElement,n,a,r,i,s]),(0,Z.useEffect)(()=>{o(0)},[t,o]),{selectedIndex:n.length===0?void 0:a}}function CHe(e){let t=N7().setContentEditableProps,n=P7(),{getItems:r,suggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c}=e,l=(0,Z.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:u,usedQuery:d,loadingState:f}=hHe(a,r);mHe(u,d,s);let{selectedIndex:p}=SHe(n,a,u,l);return(0,Z.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,Z.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":p?`bn-suggestion-menu-item-`+p:void 0})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,p]),(0,Q.jsx)(i,{items:u,onItemClick:l,loadingState:f,selectedIndex:p})}function wHe(e){return i_e(e).map(e=>{let t=PUe[e.key];return{...e,icon:(0,Q.jsx)(t,{size:18})}})}function THe(e){let t=P7(),{triggerCharacter:n,suggestionMenuComponent:r,shouldOpen:i,minQueryLength:a,onItemClick:o,getItems:s}=e,c=(0,Z.useMemo)(()=>o||(e=>{e.onItemClick(t)}),[t,o]),l=(0,Z.useMemo)(()=>s||(async e=>a_e(wHe(t),e)),[t,s]),u=F7(L$);(0,Z.useEffect)(()=>{u.addSuggestionMenu({triggerCharacter:n,shouldOpen:i})},[u,n,i]);let d=I7(L$),f=I7(L$,{selector:e=>({element:t.domElement?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),p=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:d?.show&&d?.triggerCharacter===n,onOpenChange:e=>{e||u.closeMenu()},placement:`bottom-start`,middleware:[rp(10),cp({allowedPlacements:[`bottom-start`,`top-start`],padding:10}),ip(),sp({apply({elements:e,availableHeight:t}){e.floating.style.maxHeight=`${Math.max(0,t)}px`},padding:10})],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:80},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,d?.show,d?.triggerCharacter,u,n]);return!d||!d.ignoreQueryLength&&a&&(d.query.startsWith(` `)||d.query.length<a)?null:(0,Q.jsx)($7,{reference:f,...p,children:n&&(0,Q.jsx)(CHe,{query:d.query,closeMenu:u.closeMenu,clearQuery:u.clearQuery,getItems:l,suggestionMenuComponent:r||yHe,onItemClick:c})})}function EHe(e){let t=P7();if(!t)throw Error(`BlockNoteDefaultUI must be used within a BlockNoteContext.Provider`);return(0,Q.jsxs)(Q.Fragment,{children:[t.getExtension(V6)&&e.formattingToolbar!==!1&&(0,Q.jsx)(y9,{}),t.getExtension(H6)&&e.linkToolbar!==!1&&(0,Q.jsx)(wUe,{}),t.getExtension(L$)&&e.slashMenu!==!1&&(0,Q.jsx)(THe,{triggerCharacter:`/`,shouldOpen:e=>!e.selection.$from.parent.type.isInGroup(`tableContent`)}),t.getExtension(L$)&&e.emojiPicker!==!1&&(0,Q.jsx)(vHe,{triggerCharacter:`:`,columns:10,minQueryLength:2}),t.getExtension(Y6)&&e.sideMenu!==!1&&(0,Q.jsx)(NUe,{}),t.getExtension(SQ)&&e.filePanel!==!1&&(0,Q.jsx)(GHe,{}),t.getExtension($6)&&e.tableHandles!==!1&&(0,Q.jsx)(qUe,{}),t.getExtension(DY)&&e.comments!==!1&&(0,Q.jsxs)(Z.Suspense,{children:[(0,Q.jsx)(JUe,{}),(0,Q.jsx)(YUe,{})]})]})}function DHe(e,t){let n=N7();t||=n?.editor,(0,Z.useEffect)(()=>{if(!t)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return t.onChange(e)},[e,t])}function OHe(e,t,n){let r=N7();t||=r?.editor,(0,Z.useEffect)(()=>{if(!t)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return t.onSelectionChange(e,n)},[e,t,n])}function kHe(){return(0,Z.useContext)(S9)}function AHe(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:(0,X7.createPortal)(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}function jHe(e,t){let{editor:n,className:r,theme:i,children:a,editable:o,onSelectionChange:s,onChange:c,formattingToolbar:l,linkToolbar:u,slashMenu:d,emojiPicker:f,sideMenu:p,filePanel:m,tableHandles:h,comments:g,autoFocus:_,renderEditor:v=!0,...y}=e,[b,x]=(0,Z.useState)(),S=N7(),C=x9(),w=S?.colorSchemePreference||C,T=i||(w===`dark`?`dark`:`light`);DHe(c||C9,n),OHe(s||C9,n);let E=(0,Z.useCallback)(e=>{n.elementRenderer=e},[n]),D=(0,Z.useMemo)(()=>({...S,editor:n,setContentEditableProps:x,colorSchemePreference:T}),[S,n,T]),O=(0,Z.useMemo)(()=>({editorProps:{autoFocus:_,contentEditableProps:b,editable:o},defaultUIProps:{formattingToolbar:l,linkToolbar:u,slashMenu:d,emojiPicker:f,sideMenu:p,filePanel:m,tableHandles:h,comments:g}}),[_,b,o,l,u,d,f,p,m,h,g]);return(0,Q.jsx)(Q7.Provider,{value:D,children:(0,Q.jsxs)(S9.Provider,{value:O,children:[(0,Q.jsx)(ZUe,{ref:E}),(0,Q.jsx)(QUe,{className:r,renderEditor:v,editorColorScheme:T,ref:t,...y,children:a})]})})}async function MHe(){return E9||(E9=(async()=>{let[e,t]=await Promise.all([C(()=>import(`./module-CFHRyJc-.js`),[]),C(()=>import(`./native-CUze18dq.js`),[])]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),E9)}function NHe(e){let t=(0,Z.useRef)(null),n=(0,Z.useRef)(null);return n.current&&n.current.update(e),(0,Z.useEffect)(()=>((async()=>{let{emojiMart:r}=await MHe();n.current=new r.Picker({...e,ref:t})})(),()=>{n.current=null}),[]),Z.createElement(`div`,{ref:t})}function PHe(e){return Y7([e]).get(e)}function Y7(e){let t=F7(DY).userStore,n=(0,Z.useCallback)(()=>{let n=new Map;for(let r of e){let e=t.getUser(r);e&&n.set(r,e)}return n},[t,e]),r=(0,Z.useMemo)(()=>({current:n()}),[n]);return(0,Z.useSyncExternalStore)((0,Z.useCallback)(i=>{let a=t.subscribe(e=>{r.current=n(),i()});return t.loadUsers(e),a},[t,n,e,r]),()=>r.current)}function FHe(){let e=F7(DY),t=L7(),n=R7(),r=w9({trailingBlock:!1,dictionary:{...n,placeholders:{emptyDocument:n.placeholders.new_comment}},schema:e.commentEditorSchema||O9});return(0,Q.jsx)(t.Comments.Card,{className:`bn-thread`,children:(0,Q.jsx)(T9,{autoFocus:!0,editable:!0,editor:r,actions:({isEmpty:n})=>(0,Q.jsx)(t.Generic.Toolbar.Root,{className:IZ(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:(0,Q.jsx)(t.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:`Save`,variant:`compact`,isDisabled:n,onClick:async()=>{await e.createThread({initialComment:{body:r.document}}),e.stopPendingComment()},children:`Save`})})})})}function IHe(e){let t=P7(),n=F7(DY),r=I7(DY,{editor:t,selector:e=>e.pendingComment}),i=z7({editor:t,selector:({editor:e})=>r?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),a=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:e=>{e||(n.stopPendingComment(),t.focus())},placement:`bottom`,middleware:[rp(10),ip(),op()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!1},elementProps:{style:{zIndex:60},...e.floatingUIOptions?.elementProps}}),[n,t,r,e.floatingUIOptions]),o=e.floatingComposer||FHe;return(0,Q.jsx)(s9,{position:i,...a,children:(0,Q.jsx)(o,{})})}function LHe(){let e=F7(DY).threadStore,t=(0,Z.useRef)(void 0);return t.current||=e.getThreads(),(0,Z.useSyncExternalStore)((0,Z.useCallback)(n=>e.subscribe(e=>{t.current=e,n()}),[e]),()=>t.current)}function RHe(e){let t=P7(),n=F7(DY),r=I7(DY,{editor:t,selector:e=>e.selectedThreadId?{id:e.selectedThreadId,position:e.threadPositions.get(e.selectedThreadId)}:void 0}),i=LHe(),a=(0,Z.useMemo)(()=>r?i.get(r.id):void 0,[r,i]),o=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:(e,r,i)=>{i===`escape-key`&&t.focus(),e||n.selectThread(void 0)},placement:`bottom`,middleware:[rp(10),ip(),op()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:30},...e.floatingUIOptions?.elementProps}}),[n,t,e.floatingUIOptions,r]),s=e.floatingThread||k9;return(0,Q.jsx)(s9,{position:r?.position,...o,children:a&&(0,Q.jsx)(s,{thread:a,selected:!0})})}function zHe(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top<r.top,a=n.bottom>r.bottom;return i&&a?`both`:i?`top`:a?`bottom`:`none`}function BHe(e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}var Z,Q,X7,VHe,HHe,Z7,Q7,$7,e9,t9,UHe,WHe,n9,GHe,KHe,r9,i9,a9,o9,qHe,JHe,YHe,XHe,ZHe,QHe,s9,c9,l9,$He,eUe,u9,d9,f9,p9,tUe,m9,h9,nUe,rUe,iUe,aUe,oUe,sUe,cUe,lUe,uUe,dUe,fUe,pUe,mUe,hUe,gUe,_Ue,vUe,g9,_9,v9,yUe,y9,bUe,xUe,SUe,CUe,wUe,TUe,EUe,DUe,OUe,kUe,AUe,jUe,MUe,NUe,PUe,FUe,IUe,LUe,RUe,zUe,BUe,b9,VUe,HUe,UUe,WUe,GUe,KUe,qUe,JUe,YUe,x9,S9,XUe,ZUe,C9,QUe,$Ue,eWe,tWe,w9,T9,E9,D9,nWe,rWe,iWe,aWe,O9,oWe,sWe,cWe,k9,lWe,A9=o((()=>{Z=u(p(),1),Q=N(),whe(),mNe(),Im(),SNe(),IBe(),cY(),X7=u(_(),1),tVe(),y(),w(),VHe=Object.defineProperty,HHe=(e,t,n)=>t in e?VHe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z7=(e,t,n)=>HHe(e,typeof t==`symbol`?t:t+``,n),Q7=(0,Z.createContext)(void 0),$7=e=>{var t;let{refs:n,floatingStyles:r,context:i}=Bp({whileElementsMounted:jf,...e.useFloatingOptions}),{isMounted:a,styles:o}=Yp(i,e.useTransitionStylesProps),{status:s}=Jp(i,e.useTransitionStatusProps),{getFloatingProps:c}=Wp([Rp(i,e.useDismissProps),bp(i,{enabled:!1,...e.useHoverProps})]),l=(0,Z.useRef)(``),u=(0,Z.useRef)(null),d=pp([u,n.setFloating]);if((0,Z.useEffect)(()=>{if(e.reference){let t=`element`in e.reference?e.reference.element:void 0;t!==void 0&&n.setReference(t),n.setPositionReference({getBoundingClientRect:nVe(e.reference),contextElement:t})}},[e.reference,n]),(0,Z.useEffect)(()=>{var e;(s===`initial`||s===`open`)&&(e=u.current)!=null&&e.innerHTML&&(l.current=u.current.innerHTML)},[s,e.reference,e.children]),!a)return!1;let f={...e.elementProps,style:{display:`flex`,...e.elementProps?.style,zIndex:`calc(var(--bn-ui-base-z-index) + ${e.elementProps?.style?.zIndex||0})`,...r,...o},...c()};return s===`close`?(0,Q.jsx)(`div`,{ref:d,...f,dangerouslySetInnerHTML:{__html:l.current}}):(t=e.focusManagerProps)!=null&&t.disabled?(0,Q.jsx)(`div`,{ref:d,...f,children:e.children}):(0,Q.jsx)(Lp,{...e.focusManagerProps,context:i,children:(0,Q.jsx)(`div`,{ref:d,...f,children:e.children})})},e9=e=>{let{blockId:t,children:n,...r}=e,i=P7();return(0,Q.jsx)($7,{reference:(0,Z.useMemo)(()=>i.transact(e=>{if(!t)return;let n=JZ(t,e.doc);if(!n)return;let{node:r}=i.prosemirrorView.domAtPos(n.posBeforeNode+1);if(r instanceof Element)return{element:r}}),[i,t]),...r,children:t!==void 0&&n})},t9=(0,Z.createContext)(void 0),UHe=e=>{let t=L7(),n=R7(),r=P7(),i=r.getBlock(e.blockId),[a,o]=(0,Z.useState)(``),s=(0,Z.useCallback)(e=>{o(e.currentTarget.value)},[]),c=(0,Z.useCallback)(e=>{e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),r.updateBlock(i.id,{props:{name:zZ(a),url:a}}))},[r,i.id,a]),l=(0,Z.useCallback)(()=>{r.updateBlock(i.id,{props:{name:zZ(a),url:a}})},[r,i.id,a]);return(0,Q.jsxs)(t.FilePanel.TabPanel,{className:`bn-tab-panel`,children:[(0,Q.jsx)(t.FilePanel.TextInput,{className:`bn-text-input`,placeholder:n.file_panel.embed.url_placeholder,value:a,onChange:s,onKeyDown:c,"data-test":`embed-input`}),(0,Q.jsx)(t.FilePanel.Button,{className:`bn-button`,onClick:l,"data-test":`embed-input-button`,children:n.file_panel.embed.embed_button[i.type]||n.file_panel.embed.embed_button.file})]})},WHe=e=>{var t;let n=L7(),r=R7(),{setLoading:i}=e,a=P7(),o=a.getBlock(e.blockId),[s,c]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{s&&setTimeout(()=>{c(!1)},3e3)},[s]);let l=(0,Z.useCallback)(t=>{if(t===null)return;async function n(t){if(i(!0),a.uploadFile!==void 0)try{let n=await a.uploadFile(t,e.blockId);typeof n==`string`&&(n={props:{name:t.name,url:n}}),a.updateBlock(e.blockId,n)}catch{c(!0)}finally{i(!1)}}n(t)},[e.blockId,a,i]),u=a.schema.blockSpecs[o.type],d=(t=u.implementation.meta?.fileBlockAccept)!=null&&t.length?u.implementation.meta.fileBlockAccept.join(`,`):`*/*`;return(0,Q.jsxs)(n.FilePanel.TabPanel,{className:`bn-tab-panel`,children:[(0,Q.jsx)(n.FilePanel.FileInput,{className:`bn-file-input`,"data-test":`upload-input`,accept:d,placeholder:r.file_panel.upload.file_placeholder[o.type]||r.file_panel.upload.file_placeholder.file,value:null,onChange:l}),s&&(0,Q.jsx)(`div`,{className:`bn-error-text`,children:r.file_panel.upload.upload_error})]})},n9=e=>{let t=L7(),n=R7(),r=P7(),[i,a]=(0,Z.useState)(!1),o=e.tabs??[...r.uploadFile===void 0?[]:[{name:n.file_panel.upload.title,tabPanel:(0,Q.jsx)(WHe,{blockId:e.blockId,setLoading:a})}],{name:n.file_panel.embed.title,tabPanel:(0,Q.jsx)(UHe,{blockId:e.blockId})}],[s,c]=(0,Z.useState)(e.defaultOpenTab||o[0].name);return(0,Q.jsx)(t.FilePanel.Root,{className:`bn-panel`,defaultOpenTab:s,openTab:s,setOpenTab:c,tabs:o,loading:i})},GHe=e=>{let t=P7(),n=F7(SQ),r=I7(SQ),i=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:(e,r,i)=>{e||n.closeMenu(),i===`escape-key`&&t.focus()},middleware:[rp(10),op()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:90},...e.floatingUIOptions?.elementProps}}),[r,t,n,e.floatingUIOptions]),a=e.filePanel||n9;return(0,Q.jsx)(e9,{blockId:r,...i,children:r&&(0,Q.jsx)(a,{blockId:r})})},KHe=rVe(function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!(o===`_owner`&&t.$$typeof)&&!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),r9={exports:{}},i9={},a9={exports:{}},o9={},r9.exports=oVe(),XHe=r9.exports,ZHe=typeof window<`u`?Z.useLayoutEffect:Z.useEffect,QHe=class{constructor(e){Z7(this,`transactionNumber`,0),Z7(this,`lastTransactionNumber`,0),Z7(this,`lastSnapshot`),Z7(this,`editor`),Z7(this,`subscribers`,new Set),this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e,t){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},n=this.editor._tiptapEditor,r={all:`transaction`,selection:`selectionUpdate`,change:`update`};return n.on(r[t],e),()=>{n.off(r[t],e)}}}},s9=e=>{let{position:t,children:n,...r}=e,{from:i,to:a}=t||{},o=P7();return(0,Q.jsx)($7,{reference:(0,Z.useMemo)(()=>{if(!(i===void 0||a===void 0))return{element:o.domElement?.firstElementChild||void 0,getBoundingClientRect:()=>lq(o.prosemirrorView,i,a??i)}},[o,i,a]),...r,children:t!==void 0&&n})},c9={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},l9=Z.createContext&&Z.createContext(c9),$He=[`attr`,`size`,`title`],eUe={bold:wVe,italic:NVe,underline:WVe,strike:HVe,code:vVe},u9=e=>{let t=R7(),n=L7(),r=P7(),i=z7({editor:r,selector:({editor:t})=>{if(!(!t.isEditable||!sHe(e.basicTextStyle,t)||!(t.getSelection()?.blocks||[t.getTextCursorPosition().block]).find(e=>e.content!==void 0)))return e.basicTextStyle in t.getActiveStyles()?{active:!0}:{active:!1}}}),a=(0,Z.useCallback)(e=>{r.focus(),r.toggleStyles({[e]:!0})},[r,e]);if(i===void 0)return null;let o=eUe[e.basicTextStyle];return(0,Q.jsx)(n.FormattingToolbar.Button,{className:`bn-button`,"data-test":e.basicTextStyle,onClick:()=>a(e.basicTextStyle),isSelected:i.active,label:t.formatting_toolbar[e.basicTextStyle].tooltip,mainTooltip:t.formatting_toolbar[e.basicTextStyle].tooltip,secondaryTooltip:FZ(t.formatting_toolbar[e.basicTextStyle].secondary_tooltip,t.generic.ctrl_shortcut),icon:(0,Q.jsx)(o,{})})},d9=e=>{let t=e.textColor||`default`,n=e.backgroundColor||`default`,r=e.size||16,i=(0,Z.useMemo)(()=>({pointerEvents:`none`,fontSize:(r*.75).toString()+`px`,height:r.toString()+`px`,lineHeight:r.toString()+`px`,textAlign:`center`,width:r.toString()+`px`}),[r]);return(0,Q.jsx)(`div`,{className:`bn-color-icon`,"data-background-color":n,"data-text-color":t,style:i,children:`A`})},f9=[`default`,`gray`,`brown`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`],p9=e=>{let t=L7(),n=R7();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(()=>e.text?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(t.Generic.Menu.Label,{children:n.color_picker.text_title}),f9.map(r=>(0,Q.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick&&e.onClick(),e.text.setColor(r)},"data-test":`text-color-`+r,icon:(0,Q.jsx)(d9,{textColor:r,size:e.iconSize}),checked:e.text.color===r,children:n.color_picker.colors[r]},`text-color-`+r))]}):null,{}),(0,Q.jsx)(()=>e.background?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(t.Generic.Menu.Label,{children:n.color_picker.background_title}),f9.map(r=>(0,Q.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick&&e.onClick(),e.background.setColor(r)},"data-test":`background-color-`+r,icon:(0,Q.jsx)(d9,{backgroundColor:r,size:e.iconSize}),checked:e.background.color===r,children:n.color_picker.colors[r]},`background-color-`+r))]}):null,{})]})},tUe=()=>{let e=L7(),t=R7(),n=P7(),r=q7(`text`,n),i=q7(`background`,n),a=z7({editor:n,selector:({editor:e})=>{if(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return;let t=q7(`text`,e),n=q7(`background`,e);if(!(!t&&!n))return{textColor:t?e.getActiveStyles().textColor||`default`:void 0,backgroundColor:n?e.getActiveStyles().backgroundColor||`default`:void 0}}}),o=(0,Z.useCallback)(e=>{if(!r)throw Error(`Tried to set text color, but style does not exist in editor schema.`);e===`default`?n.removeStyles({textColor:e}):n.addStyles({textColor:e}),setTimeout(()=>{n.focus()})},[n,r]),s=(0,Z.useCallback)(e=>{if(!i)throw Error(`Tried to set background color, but style does not exist in editor schema.`);e===`default`?n.removeStyles({backgroundColor:e}):n.addStyles({backgroundColor:e}),setTimeout(()=>{n.focus()})},[i,n]);return a===void 0?null:(0,Q.jsxs)(e.Generic.Menu.Root,{children:[(0,Q.jsx)(e.Generic.Menu.Trigger,{children:(0,Q.jsx)(e.FormattingToolbar.Button,{className:`bn-button`,"data-test":`colors`,label:t.formatting_toolbar.colors.tooltip,mainTooltip:t.formatting_toolbar.colors.tooltip,icon:(0,Q.jsx)(d9,{textColor:a.textColor,backgroundColor:a.backgroundColor,size:20})})}),(0,Q.jsx)(e.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,Q.jsx)(p9,{text:a.textColor?{color:a.textColor,setColor:o}:void 0,background:a.backgroundColor?{color:a.backgroundColor,setColor:s}:void 0})})]})},m9=e=>{for(let t of U6)if(e.startsWith(t))return e;return`${W6}://${e}`},h9=e=>{let t=L7(),n=R7(),{editLink:r}=F7(H6),{url:i,text:a,showTextField:o}=e,[s,c]=(0,Z.useState)(i),[l,u]=(0,Z.useState)(a);(0,Z.useEffect)(()=>{c(i),u(a)},[a,i]);let d=(0,Z.useCallback)(t=>{var n,i;t.key===`Enter`&&!t.nativeEvent.isComposing&&(t.preventDefault(),r(m9(s),l,e.range.from),(n=e.setToolbarOpen)==null||n.call(e,!1),(i=e.setToolbarPositionFrozen)==null||i.call(e,!1))},[r,s,l,e]),f=(0,Z.useCallback)(e=>c(e.currentTarget.value),[]),p=(0,Z.useCallback)(e=>u(e.currentTarget.value),[]),m=(0,Z.useCallback)(()=>{var t,n;r(m9(s),l,e.range.from),(t=e.setToolbarOpen)==null||t.call(e,!1),(n=e.setToolbarPositionFrozen)==null||n.call(e,!1)},[r,s,l,e]);return(0,Q.jsxs)(t.Generic.Form.Root,{children:[(0,Q.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`url`,icon:(0,Q.jsx)(FVe,{}),autoFocus:!0,placeholder:n.link_toolbar.form.url_placeholder,value:s,onKeyDown:d,onChange:f,onSubmit:m}),o!==!1&&(0,Q.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`title`,icon:(0,Q.jsx)(K7,{}),placeholder:n.link_toolbar.form.title_placeholder,value:l,onKeyDown:d,onChange:p,onSubmit:m})]})},nUe=()=>{let e=P7(),t=L7(),n=R7(),r=F7(V6),{showSelection:i}=F7(pG),[a,o]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>(i(a,`createLinkButton`),()=>i(!1,`createLinkButton`)),[a,i]);let s=z7({editor:e,selector:({editor:e})=>{if(!(!e.isEditable||!cHe(e)||oQ(e.prosemirrorState.selection)||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0)))return{url:e.getSelectedLinkUrl(),text:e.getSelectedText(),range:{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}}}});return(0,Z.useEffect)(()=>{o(!1)},[s]),(0,Z.useEffect)(()=>{let t=e=>{(e.ctrlKey||e.metaKey)&&e.key===`k`&&(o(!0),e.preventDefault())},n=e.domElement;return n?.addEventListener(`keydown`,t),()=>{n?.removeEventListener(`keydown`,t)}},[e.domElement]),s===void 0?null:(0,Q.jsxs)(t.Generic.Popover.Root,{open:a,onOpenChange:o,children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`createLink`,label:n.formatting_toolbar.link.tooltip,mainTooltip:n.formatting_toolbar.link.tooltip,secondaryTooltip:FZ(n.formatting_toolbar.link.secondary_tooltip,n.generic.ctrl_shortcut),icon:(0,Q.jsx)(FVe,{}),onClick:()=>o(e=>!e)})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,Q.jsx)(h9,{url:s.url||``,text:s.text,range:s.range,showTextField:!1,setToolbarOpen:e=>r.store.setState(e)})})]})},rUe=()=>{let e=R7(),t=L7(),n=P7(),r=z7({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(aQ(n,e,n.type,{url:`string`,caption:`string`}))return n}}),[i,a]=(0,Z.useState)();(0,Z.useEffect)(()=>{r!==void 0&&a(r.props.caption)},[r]);let o=(0,Z.useCallback)(e=>a(e.currentTarget.value),[]),s=(0,Z.useCallback)(e=>{r!==void 0&&iQ(n,r.type,{caption:`string`})&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),n.updateBlock(r.id,{props:{caption:i}}))},[r,i,n]);return r===void 0?null:(0,Q.jsxs)(t.Generic.Popover.Root,{children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_caption.tooltip,mainTooltip:e.formatting_toolbar.file_caption.tooltip,icon:(0,Q.jsx)(MVe,{})})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,Q.jsx)(t.Generic.Form.Root,{children:(0,Q.jsx)(t.Generic.Form.TextInput,{name:`file-caption`,icon:(0,Q.jsx)(MVe,{}),value:i||``,autoFocus:!0,placeholder:e.formatting_toolbar.file_caption.input_placeholder,onKeyDown:s,onChange:o})})})]})},iUe=()=>{let e=R7(),t=L7(),n=P7(),r=z7({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(aQ(n,e,n.type,{url:`string`}))return n}}),i=(0,Z.useCallback)(()=>{r!==void 0&&(n.focus(),n.removeBlocks([r.id]))},[r,n]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,mainTooltip:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,icon:(0,Q.jsx)($Ve,{}),onClick:i})},aUe=()=>{let e=R7(),t=L7(),n=P7(),r=z7({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(aQ(n,e,n.type,{url:`string`,name:`string`}))return n}}),[i,a]=(0,Z.useState)();(0,Z.useEffect)(()=>{r!==void 0&&a(r.props.name)},[r]);let o=(0,Z.useCallback)(e=>a(e.currentTarget.value),[]),s=(0,Z.useCallback)(e=>{r!==void 0&&iQ(n,r.type,{name:`string`})&&e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),n.updateBlock(r.id,{props:{name:i}}))},[r,i,n]);return r===void 0?null:(0,Q.jsxs)(t.Generic.Popover.Root,{children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_rename.tooltip[r.type]||e.formatting_toolbar.file_rename.tooltip.file,mainTooltip:e.formatting_toolbar.file_rename.tooltip[r.type]||e.formatting_toolbar.file_rename.tooltip.file,icon:(0,Q.jsx)(EVe,{})})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,Q.jsx)(t.Generic.Form.Root,{children:(0,Q.jsx)(t.Generic.Form.TextInput,{name:`file-name`,icon:(0,Q.jsx)(EVe,{}),value:i||``,autoFocus:!0,placeholder:e.formatting_toolbar.file_rename.input_placeholder[r.type]||e.formatting_toolbar.file_rename.input_placeholder.file,onKeyDown:s,onChange:o})})})]})},oUe=()=>{let e=R7(),t=L7(),n=z7({editor:P7(),selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(aQ(n,e,n.type,{url:`string`}))return n}});return n===void 0?null:(0,Q.jsxs)(t.Generic.Popover.Root,{position:`bottom`,children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,mainTooltip:e.formatting_toolbar.file_replace.tooltip[n.type]||e.formatting_toolbar.file_replace.tooltip.file,label:e.formatting_toolbar.file_replace.tooltip[n.type]||e.formatting_toolbar.file_replace.tooltip.file,icon:(0,Q.jsx)(JVe,{})})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-panel-popover`,variant:`panel-popover`,children:(0,Q.jsx)(n9,{blockId:n.id})})]})},sUe=()=>{let e=R7(),t=L7(),n=P7(),r=z7({editor:n,selector:({editor:e})=>{if(!(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0)))return{canNestBlock:e.canNestBlock()}}}),i=(0,Z.useCallback)(()=>{r!==void 0&&r.canNestBlock&&(n.focus(),n.nestBlock())},[n,r]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`nestBlock`,onClick:i,isDisabled:!r.canNestBlock,label:e.formatting_toolbar.nest.tooltip,mainTooltip:e.formatting_toolbar.nest.tooltip,secondaryTooltip:FZ(e.formatting_toolbar.nest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,Q.jsx)(jVe,{})})},cUe=()=>{let e=R7(),t=L7(),n=P7(),r=z7({editor:n,selector:({editor:e})=>{if(!(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0)))return{canUnnestBlock:e.canUnnestBlock()}}}),i=(0,Z.useCallback)(()=>{r!==void 0&&r.canUnnestBlock&&(n.focus(),n.unnestBlock())},[n,r]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`unnestBlock`,onClick:i,isDisabled:!r.canUnnestBlock,label:e.formatting_toolbar.unnest.tooltip,mainTooltip:e.formatting_toolbar.unnest.tooltip,secondaryTooltip:FZ(e.formatting_toolbar.unnest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,Q.jsx)(AVe,{})})},lUe=e=>[{name:e.slash_menu.paragraph.title,type:`paragraph`,icon:K7},{name:e.slash_menu.heading.title,type:`heading`,props:{level:1,isToggleable:!1},icon:U7},{name:e.slash_menu.heading_2.title,type:`heading`,props:{level:2,isToggleable:!1},icon:W7},{name:e.slash_menu.heading_3.title,type:`heading`,props:{level:3,isToggleable:!1},icon:G7},{name:e.slash_menu.heading_4.title,type:`heading`,props:{level:4,isToggleable:!1},icon:DVe},{name:e.slash_menu.heading_5.title,type:`heading`,props:{level:5,isToggleable:!1},icon:OVe},{name:e.slash_menu.heading_6.title,type:`heading`,props:{level:6,isToggleable:!1},icon:kVe},{name:e.slash_menu.toggle_heading.title,type:`heading`,props:{level:1,isToggleable:!0},icon:U7},{name:e.slash_menu.toggle_heading_2.title,type:`heading`,props:{level:2,isToggleable:!0},icon:W7},{name:e.slash_menu.toggle_heading_3.title,type:`heading`,props:{level:3,isToggleable:!0},icon:G7},{name:e.slash_menu.quote.title,type:`quote`,icon:VVe},{name:e.slash_menu.toggle_list.title,type:`toggleListItem`,icon:YVe},{name:e.slash_menu.bullet_list.title,type:`bulletListItem`,icon:RVe},{name:e.slash_menu.numbered_list.title,type:`numberedListItem`,icon:LVe},{name:e.slash_menu.check_list.title,type:`checkListItem`,icon:IVe}],uUe=e=>{let t=L7(),n=P7(),r=z7({editor:n,selector:({editor:e})=>e.getSelection()?.blocks||[e.getTextCursorPosition().block]}),i=r[0],a=(0,Z.useMemo)(()=>(e.items||lUe(n.dictionary)).filter(e=>iQ(n,e.type,Object.fromEntries(Object.entries(e.props||{}).map(([e,t])=>[e,typeof t])))),[n,e.items]),o=(0,Z.useMemo)(()=>a.map(e=>{let t=e.icon,a=e.type===i.type,o=Object.entries(e.props||{}).filter(([e,t])=>t!==i.props[e]).length===0;return{text:e.name,icon:(0,Q.jsx)(t,{size:16}),onClick:()=>{n.focus(),n.transact(()=>{for(let t of r)n.updateBlock(t,{type:e.type,props:e.props})})},isSelected:a&&o}}),[n,a,i.props,i.type,r]);return!(0,Z.useMemo)(()=>o.find(e=>e.isSelected)!==void 0,[o])||!n.isEditable?null:(0,Q.jsx)(t.FormattingToolbar.Select,{className:`bn-select`,items:o})},dUe=()=>{let e=R7(),t=L7(),n=F7(`comments`),{store:r}=F7(V6),i=(0,Z.useCallback)(()=>{n.startPendingComment(),r.setState(!1)},[n,r]);return(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,Q.jsx)(gVe,{}),onClick:i})},fUe=()=>P7().getExtension(`comments`)?(0,Q.jsx)(dUe,{}):null,pUe=()=>{let e=R7(),t=L7(),n=P7(),r=(0,Z.useCallback)(()=>{n._tiptapEditor.chain().focus().addPendingComment().run()},[n]);return!n._tiptapEditor.commands.addPendingComment||!n.isEditable?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,Q.jsx)(gVe,{}),onClick:r})},mUe=()=>{let e=R7(),t=L7(),n=P7(),r=z7({editor:n,selector:({editor:e})=>{let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(aQ(n,e,n.type,{url:`string`}))return n}}),i=(0,Z.useCallback)(()=>{r!==void 0&&(n.focus(),n.resolveFileUrl?n.resolveFileUrl(r.props.url).then(e=>window.open(J7(e,window.location.href))):window.open(J7(r.props.url,window.location.href)))},[r,n]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,mainTooltip:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,icon:(0,Q.jsx)(tHe,{}),onClick:i})},hUe=()=>{let e=R7(),t=L7(),n=P7(),r=z7({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(aQ(n,e,n.type,{url:`string`,showPreview:`boolean`}))return n}}),i=(0,Z.useCallback)(()=>{r!==void 0&&iQ(n,r.type,{showPreview:`boolean`})&&n.updateBlock(r.id,{props:{showPreview:!r.props.showPreview}})},[r,n]);return r===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:`Toggle preview`,mainTooltip:e.formatting_toolbar.file_preview_toggle.tooltip,icon:(0,Q.jsx)(qVe,{}),isSelected:r.props.showPreview,onClick:i})},gUe=()=>{let e=R7(),t=L7(),n=P7(),r=F7($6),i=z7({editor:n,selector:({editor:e})=>{if(!e.isEditable||!e.settings.tables.splitCells)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(n.type===`table`)return{mergeDirection:r.getMergeDirection(n)}}}),a=(0,Z.useCallback)(()=>{r?.mergeCells()},[r]);return i===void 0?null:(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.table_cell_merge.tooltip,mainTooltip:e.formatting_toolbar.table_cell_merge.tooltip,icon:i.mergeDirection===`horizontal`?(0,Q.jsx)(zVe,{}):(0,Q.jsx)(BVe,{}),onClick:a})},_Ue=()=>P7().getExtension($6)?(0,Q.jsx)(gUe,{}):null,vUe={left:SVe,center:bVe,right:CVe,justify:xVe},g9=e=>{let t=L7(),n=R7(),r=P7(),i=z7({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block],n=t[0];if(aQ(n,e,n.type,{textAlignment:gQ.textAlignment}))return{textAlignment:n.props.textAlignment,blocks:t};if(t.length===1&&aQ(n,e,`table`))return e.getExtension($6)?.getCellSelection()?{textAlignment:jY(n.content.rows[0].cells[0]).props.textAlignment,blocks:[n]}:void 0}}),a=(0,Z.useCallback)(e=>{if(i!==void 0){r.focus();for(let t of i.blocks)if(aQ(t,r,t.type,{textAlignment:gQ.textAlignment})&&iQ(r,t.type,{textAlignment:gQ.textAlignment}))r.updateBlock(t,{props:{textAlignment:e}});else if(t.type===`table`){let n=r.getExtension($6)?.getCellSelection();if(!n)continue;let i=t.content.rows.map(e=>({...e,cells:e.cells.map(e=>jY(e))}));n.cells.forEach(({row:t,col:n})=>{i[t].cells[n].props.textAlignment=e}),r.updateBlock(t,{type:`table`,content:{...t.content,type:`tableContent`,rows:i}}),r.setTextCursorPosition(t)}}},[r,i]);if(i===void 0)return null;let o=vUe[e.textAlignment];return(0,Q.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`alignText${e.textAlignment.slice(0,1).toUpperCase()+e.textAlignment.slice(1)}`,onClick:()=>a(e.textAlignment),isSelected:i.textAlignment===e.textAlignment,label:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,mainTooltip:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,icon:(0,Q.jsx)(o,{})})},_9=e=>[(0,Q.jsx)(uUe,{items:e},`blockTypeSelect`),(0,Q.jsx)(_Ue,{},`tableCellMergeButton`),(0,Q.jsx)(rUe,{},`fileCaptionButton`),(0,Q.jsx)(oUe,{},`replaceFileButton`),(0,Q.jsx)(aUe,{},`fileRenameButton`),(0,Q.jsx)(iUe,{},`fileDeleteButton`),(0,Q.jsx)(mUe,{},`fileDownloadButton`),(0,Q.jsx)(hUe,{},`filePreviewButton`),(0,Q.jsx)(u9,{basicTextStyle:`bold`},`boldStyleButton`),(0,Q.jsx)(u9,{basicTextStyle:`italic`},`italicStyleButton`),(0,Q.jsx)(u9,{basicTextStyle:`underline`},`underlineStyleButton`),(0,Q.jsx)(u9,{basicTextStyle:`strike`},`strikeStyleButton`),(0,Q.jsx)(g9,{textAlignment:`left`},`textAlignLeftButton`),(0,Q.jsx)(g9,{textAlignment:`center`},`textAlignCenterButton`),(0,Q.jsx)(g9,{textAlignment:`right`},`textAlignRightButton`),(0,Q.jsx)(tUe,{},`colorStyleButton`),(0,Q.jsx)(sUe,{},`nestBlockButton`),(0,Q.jsx)(cUe,{},`unnestBlockButton`),(0,Q.jsx)(nUe,{},`createLinkButton`),(0,Q.jsx)(fUe,{},`addCommentButton`),(0,Q.jsx)(pUe,{},`addTiptapCommentButton`)],v9=e=>(0,Q.jsx)(L7().FormattingToolbar.Root,{className:`bn-toolbar bn-formatting-toolbar`,children:e.children||_9(e.blockTypeSelectItems)}),yUe=e=>{switch(e){case`left`:return`top-start`;case`center`:return`top`;case`right`:return`top-end`;default:return`top-start`}},y9=e=>{let t=P7(),n=F7(V6,{editor:t}),r=I7(V6,{editor:t}),i=z7({editor:t,selector:({editor:e})=>n.store.state?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),a=z7({editor:t,selector:({editor:e})=>{let t=e.getTextCursorPosition().block;return aQ(t,e,t.type,{textAlignment:gQ.textAlignment})?yUe(t.props.textAlignment):`top-start`}}),o=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:r,onOpenChange:(e,r,i)=>{n.store.setState(e),i===`escape-key`&&t.focus()},placement:a,middleware:[rp(10),ip(),op()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:40},...e.floatingUIOptions?.elementProps}}),[r,a,e.floatingUIOptions,n.store,t]),s=e.formattingToolbar||v9;return(0,Q.jsx)(s9,{position:i,...o,children:r&&(0,Q.jsx)(s,{})})},bUe=e=>{let t=L7(),n=R7(),{deleteLink:r}=F7(H6);return(0,Q.jsx)(t.LinkToolbar.Button,{className:`bn-button`,label:n.link_toolbar.delete.tooltip,mainTooltip:n.link_toolbar.delete.tooltip,isSelected:!1,onClick:()=>{var t;r(e.range.from),(t=e.setToolbarOpen)==null||t.call(e,!1)},icon:(0,Q.jsx)(PVe,{})})},xUe=e=>{let t=L7(),n=R7();return(0,Q.jsxs)(t.Generic.Popover.Root,{onOpenChange:e.setToolbarPositionFrozen,children:[(0,Q.jsx)(t.Generic.Popover.Trigger,{children:(0,Q.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:n.link_toolbar.edit.tooltip,isSelected:!1,children:n.link_toolbar.edit.text})}),(0,Q.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,Q.jsx)(h9,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen})})]})},SUe=e=>{let t=L7(),n=R7();return(0,Q.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:n.link_toolbar.open.tooltip,label:n.link_toolbar.open.tooltip,isSelected:!1,onClick:()=>{window.open(J7(e.url,window.location.href),`_blank`)},icon:(0,Q.jsx)(nHe,{})})},CUe=e=>(0,Q.jsx)(L7().LinkToolbar.Root,{className:`bn-toolbar bn-link-toolbar`,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xUe,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen}),(0,Q.jsx)(SUe,{url:e.url}),(0,Q.jsx)(bUe,{range:e.range,setToolbarOpen:e.setToolbarOpen})]})}),wUe=e=>{let t=P7(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(!1),o=F7(H6),[s,c]=(0,Z.useState)(void 0);(0,Z.useEffect)(()=>{let e=()=>{let e=o.getLinkAtSelection();if(!e){c(void 0),i||r(!1);return}c({cursorType:`text`,url:e.mark.attrs.href,text:e.text,range:e.range,element:o.getLinkElementAtPos(e.range.from)}),i||r(!0)},n=e=>{if(s!==void 0&&s.cursorType===`text`||!(e.target instanceof HTMLElement))return;let t=o.getLinkAtElement(e.target);t&&c({cursorType:`mouse`,url:t.mark.attrs.href,text:t.text,range:t.range,element:o.getLinkElementAtPos(t.range.from)})},a=t.onChange(e),l=t.onSelectionChange(e),u=t.domElement;return u?.addEventListener(`mouseover`,n),()=>{a(),l(),u?.removeEventListener(`mouseover`,n)}},[t,t.domElement,o,s,i]);let l=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:n,onOpenChange:(e,n,a)=>{i||s!==void 0&&s.cursorType===`text`&&a===`hover`||(a===`escape-key`&&t.focus(),r(e))},placement:`top-start`,middleware:[rp(10),op()],...e.floatingUIOptions?.useFloatingOptions},useHoverProps:{enabled:s!==void 0&&s.cursorType===`mouse`,delay:{open:250,close:250},handleClose:fee(),...e.floatingUIOptions?.useHoverProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:50},...e.floatingUIOptions?.elementProps}}),[t,s,e.floatingUIOptions,n,i]),u=(0,Z.useMemo)(()=>s!=null&&s.element?{element:s.element}:void 0,[s?.element]);if(!t.isEditable)return null;let d=e.linkToolbar||CUe;return(0,Q.jsx)($7,{reference:u,...l,children:s&&(0,Q.jsx)(d,{url:s.url,text:s.text,range:s.range,setToolbarOpen:r,setToolbarPositionFrozen:a})})},TUe=()=>{let e=L7(),t=R7(),n=P7(),r=F7(L$),i=I7(Y6,{editor:n,selector:e=>e?.block}),a=(0,Z.useCallback)(()=>{if(i===void 0)return;let e=i.content;if(e!==void 0&&Array.isArray(e)&&e.length===0)n.setTextCursorPosition(i),r.openSuggestionMenu(`/`);else{let e=n.insertBlocks([{type:`paragraph`}],i,`after`)[0];n.setTextCursorPosition(e),r.openSuggestionMenu(`/`)}},[i,n,r]);return i===void 0?null:(0,Q.jsx)(e.SideMenu.Button,{className:`bn-button`,label:t.side_menu.add_block_label,icon:(0,Q.jsx)(lHe,{size:24,onClick:a,"data-test":`dragHandleAdd`})})},EUe=e=>{let t=L7(),n=P7(),r=I7(Y6,{editor:n,selector:e=>e?.block});return r===void 0||!aQ(r,n,r.type,{textColor:`string`})&&!aQ(r,n,r.type,{backgroundColor:`string`})?null:(0,Q.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children})}),(0,Q.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,Q.jsx)(p9,{iconSize:18,text:aQ(r,n,r.type,{textColor:`string`})&&iQ(n,r.type,{textColor:`string`})?{color:r.props.textColor,setColor:e=>n.updateBlock(r,{type:r.type,props:{textColor:e}})}:void 0,background:aQ(r,n,r.type,{backgroundColor:`string`})&&iQ(n,r.type,{backgroundColor:`string`})?{color:r.props.backgroundColor,setColor:e=>n.updateBlock(r,{props:{backgroundColor:e}})}:void 0})})]})},DUe=e=>{let t=L7(),n=P7(),r=I7(Y6,{editor:n,selector:e=>e?.block});return r===void 0?null:(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>n.removeBlocks([r]),children:e.children})},OUe=e=>{let t=L7(),n=P7(),r=I7(Y6,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerRows;return(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerRows:i?void 0:1}})},children:e.children})},kUe=e=>{let t=L7(),n=P7(),r=I7(Y6,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerCols;return(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerCols:i?void 0:1}})},children:e.children})},AUe=e=>{let t=L7(),n=R7();return(0,Q.jsx)(t.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-drag-handle-menu`,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(DUe,{children:n.drag_handle.delete_menuitem}),(0,Q.jsx)(EUe,{children:n.drag_handle.colors_menuitem}),(0,Q.jsx)(OUe,{children:n.drag_handle.header_row_menuitem}),(0,Q.jsx)(kUe,{children:n.drag_handle.header_column_menuitem})]})})},jUe=e=>{let t=L7(),n=R7(),r=F7(Y6),i=I7(Y6,{selector:e=>e?.block});if(i===void 0)return null;let a=e.dragHandleMenu||AUe;return(0,Q.jsxs)(t.Generic.Menu.Root,{onOpenChange:e=>{e?r.freezeMenu():r.unfreezeMenu()},position:`left`,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{children:(0,Q.jsx)(t.SideMenu.Button,{label:n.side_menu.drag_handle_label,draggable:!0,onDragStart:e=>r.blockDragStart(e,i),onDragEnd:r.blockDragEnd,className:`bn-button`,icon:(0,Q.jsx)(uHe,{size:24,"data-test":`dragHandle`})})}),(0,Q.jsx)(a,{children:e.children})]})},MUe=e=>{let t=L7(),n=P7(),r=I7(Y6,{editor:n,selector:e=>e?.block}),i=(0,Z.useMemo)(()=>{var e;if(r===void 0)return{};let t={"data-block-type":r.type};return r.type===`heading`&&(t[`data-level`]=r.props.level.toString()),(e=n.schema.blockSpecs[r.type].implementation.meta)!=null&&e.fileBlockAccept&&(r.props.url?t[`data-url`]=`true`:t[`data-url`]=`false`),t},[r,n.schema.blockSpecs]);return(0,Q.jsx)(t.SideMenu.Root,{className:`bn-side-menu`,...i,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(TUe,{}),(0,Q.jsx)(jUe,{dragHandleMenu:e.dragHandleMenu})]})})},NUe=e=>{let{show:t,block:n}=I7(Y6,{selector:e=>e===void 0?void 0:{show:e.show,block:e.block}})||{},r=(0,Z.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:t,placement:`left-start`,...e.floatingUIOptions?.useFloatingOptions},useDismissProps:{enabled:!1,...e.floatingUIOptions?.useDismissProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:20},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,t]),i=e.sideMenu||MUe;return(0,Q.jsx)(e9,{blockId:t?n?.id:void 0,...r,children:n?.id&&(0,Q.jsx)(i,{})})},PUe={heading:U7,heading_2:W7,heading_3:G7,heading_4:DVe,heading_5:OVe,heading_6:kVe,toggle_heading:U7,toggle_heading_2:W7,toggle_heading_3:G7,quote:VVe,toggle_list:YVe,numbered_list:LVe,bullet_list:RVe,check_list:IVe,paragraph:K7,table:UVe,image:KVe,video:GVe,audio:XVe,file:yVe,emoji:aHe,code_block:TVe,divider:iHe},FUe=(e,t=.3)=>{let n=Math.floor(e)+t,r=Math.ceil(e)-t;return e>=n&&e<=r?Math.round(e):e<n?Math.floor(e):Math.ceil(e)},IUe=e=>{let t=L7(),n=P7(),r=F7($6),i=I7($6,{selector:e=>e?.block}),a=(0,Z.useRef)(!1),[o,s]=(0,Z.useState)(),c=(0,Z.useCallback)(t=>{r.freezeHandles(),e.hideOtherElements(!0),i&&(s({originalContent:i.content,originalCroppedContent:{rows:r.cropEmptyRowsOrColumns(i,e.orientation===`addOrRemoveColumns`?`columns`:`rows`)},startPos:e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY}),a.current=!1,t.preventDefault())},[i,e,r]),l=(0,Z.useCallback)(()=>{!i||a.current||n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns(i,`columns`,1):r.addRowsOrColumns(i,`rows`,1)}})},[i,n,e.orientation,r]);return(0,Z.useEffect)(()=>{let t=t=>{if(!i)return;if(!o)throw Error(`editingState is undefined`);a.current=!0;let s=(e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY)-o.startPos,c=e.orientation===`addOrRemoveColumns`?o.originalCroppedContent.rows[0]?.cells.length??0:o.originalCroppedContent.rows.length,l=e.orientation===`addOrRemoveColumns`?o.originalContent.rows[0]?.cells.length??0:o.originalContent.rows.length,u=e.orientation===`addOrRemoveColumns`?i.content.rows[0].cells.length:i.content.rows.length,d=l+FUe(s/(e.orientation===`addOrRemoveColumns`?120:31),.3);d>=c&&d>0&&d!==u&&(n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`columns`,d-c):r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`rows`,d-c)}}),i.content&&n.setTextCursorPosition(i))};return o&&window.addEventListener(`mousemove`,t),()=>{window.removeEventListener(`mousemove`,t)}},[i,o,n,e.orientation,r]),(0,Z.useEffect)(()=>{let t=()=>{e.hideOtherElements(!1),r.unfreezeHandles(),s(void 0)};return o&&window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mouseup`,t)}},[o,e,r]),n.isEditable?(0,Q.jsx)(t.TableHandle.ExtendButton,{className:IZ(`bn-extend-button`,e.orientation===`addOrRemoveColumns`?`bn-extend-button-add-remove-columns`:`bn-extend-button-add-remove-rows`,o===null?``:`bn-extend-button-editing`),onClick:l,onMouseDown:c,children:e.children||(0,Q.jsx)(ZVe,{size:18,"data-test":`extendButton`})}):null},LUe=e=>{let t=L7(),n=R7(),r=P7(),{block:i,colIndex:a,rowIndex:o}=I7($6,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})}),s=(e,t)=>{if(i===void 0||a===void 0||o===void 0)return;let n=i.content.rows.map(e=>({...e,cells:e.cells.map(e=>jY(e))}));t===`text`?n[o].cells[a].props.textColor=e:n[o].cells[a].props.backgroundColor=e,r.updateBlock(i,{type:`table`,content:{...i.content,rows:n}}),r.setTextCursorPosition(i)};if(i===void 0||a===void 0||o===void 0)return null;let c=i.content.rows[o]?.cells?.[a];return!c||r.settings.tables.cellTextColor===!1&&r.settings.tables.cellBackgroundColor===!1?null:(0,Q.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||n.drag_handle.colors_menuitem})}),(0,Q.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,Q.jsx)(p9,{iconSize:18,text:r.settings.tables.cellTextColor?{color:NY(c)?c.props.textColor:`default`,setColor:e=>s(e,`text`)}:void 0,background:r.settings.tables.cellBackgroundColor?{color:NY(c)?c.props.backgroundColor:`default`,setColor:e=>s(e,`background`)}:void 0})})]})},RUe=()=>{let e=L7(),t=R7(),n=P7(),r=F7($6),{block:i,colIndex:a,rowIndex:o}=I7($6,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})});if(i===void 0||a===void 0||o===void 0)return null;let s=i.content.rows[o]?.cells?.[a];return!s||!NY(s)||FY(s)===1&&PY(s)===1||!n.settings.tables.splitCells?null:(0,Q.jsx)(e.Generic.Menu.Item,{onClick:()=>{r.splitCell({row:o,col:a})},children:t.table_handle.split_cell_menuitem})},zUe=e=>(0,Q.jsx)(L7().Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-table-handle-menu`,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(RUe,{}),(0,Q.jsx)(LUe,{})]})}),BUe=e=>{let t=L7(),n=P7(),r=F7($6),i=e.tableCellMenu||zUe;return!n.settings.tables.splitCells&&!n.settings.tables.cellBackgroundColor&&!n.settings.tables.cellTextColor?null:(0,Q.jsxs)(t.Generic.Menu.Root,{onOpenChange:t=>{t?(r.freezeHandles(),e.hideOtherElements(!0)):(r.unfreezeHandles(),e.hideOtherElements(!1),n.focus())},position:`right`,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{children:(0,Q.jsx)(t.Generic.Menu.Button,{className:`bn-table-cell-handle`,children:e.children||(0,Q.jsx)(dHe,{size:12,"data-test":`tableCellHandle`})})}),(0,Q.jsx)(i,{})]})},b9=e=>{let t=L7(),n=R7(),r=F7($6),i=I7($6,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,Q.jsx)(t.Generic.Menu.Item,{onClick:()=>{r.addRowOrColumn(i,e.orientation===`row`?{orientation:`row`,side:e.side}:{orientation:`column`,side:e.side})},children:n.table_handle[`add_${e.side}_menuitem`]})},VUe=e=>{let t=L7(),n=R7(),r=F7($6),i=I7($6,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,Q.jsx)(t.Generic.Menu.Item,{onClick:()=>r.removeRowOrColumn(i,e.orientation),children:e.orientation===`row`?n.table_handle.delete_row_menuitem:n.table_handle.delete_column_menuitem})},HUe=e=>{let t=L7(),n=R7(),r=P7(),i=F7($6),{block:a,index:o}=I7($6,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})}),s=(0,Z.useMemo)(()=>i===void 0||a===void 0||o===void 0?[]:e.orientation===`row`?i.getCellsAtRowHandle(a,o):i.getCellsAtColumnHandle(a,o),[a,o,e.orientation,i]),c=(e,t)=>{if(a===void 0)return;let n=a.content.rows.map(e=>({...e,cells:e.cells.map(e=>jY(e))}));s.forEach(({row:r,col:i})=>{t===`text`?n[r].cells[i].props.textColor=e:n[r].cells[i].props.backgroundColor=e}),r.updateBlock(a,{type:`table`,content:{...a.content,rows:n}}),r.setTextCursorPosition(a)};if(!s||!s[0]||!i||r.settings.tables.cellTextColor===!1&&r.settings.tables.cellBackgroundColor===!1)return null;let l=jY(s[0].cell);return(0,Q.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,children:[(0,Q.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||n.drag_handle.colors_menuitem})}),(0,Q.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,Q.jsx)(p9,{iconSize:18,text:r.settings.tables.cellTextColor?{color:s.every(({cell:e})=>NY(e)&&e.props.textColor===l.props.textColor)?l.props.textColor:`default`,setColor:e=>{c(e,`text`)}}:void 0,background:r.settings.tables.cellBackgroundColor?{color:s.every(({cell:e})=>NY(e)&&e.props.backgroundColor===l.props.backgroundColor)?l.props.backgroundColor:`default`,setColor:e=>c(e,`background`)}:void 0})})]})},UUe=e=>{let t=L7(),n=R7(),r=P7(),i=F7($6),{block:a,index:o}=I7($6,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})});if(i===void 0||a===void 0||o!==0||e.orientation!==`row`||!r.settings.tables.headers)return null;let s=!!a.content.headerRows;return(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerRows:s?void 0:1}})},children:n.drag_handle.header_row_menuitem})},WUe=e=>{let t=L7(),n=R7(),r=P7(),i=F7($6),a=I7($6,{selector:e=>e?.block}),o=I7($6,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});if(!i||o!==0||!a||e.orientation!==`column`||!r.settings.tables.headers)return null;let s=!!a.content.headerCols;return(0,Q.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerCols:s?void 0:1}})},children:n.drag_handle.header_column_menuitem})},GUe=e=>(0,Q.jsx)(L7().Generic.Menu.Dropdown,{className:`bn-table-handle-menu`,children:e.children||(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(VUe,{orientation:e.orientation}),(0,Q.jsx)(b9,{orientation:e.orientation,side:e.orientation===`row`?`above`:`left`}),(0,Q.jsx)(b9,{orientation:e.orientation,side:e.orientation===`row`?`below`:`right`}),(0,Q.jsx)(UUe,{orientation:e.orientation}),(0,Q.jsx)(WUe,{orientation:e.orientation}),(0,Q.jsx)(HUe,{orientation:e.orientation})]})}),KUe=e=>{let t=P7(),n=L7(),[r,i]=(0,Z.useState)(!1),a=e.tableHandleMenu||GUe,o=F7($6),s=I7($6),c=(0,Z.useMemo)(()=>!o||!s||!s.block||s.block.type!==`table`?!1:e.orientation===`column`?o.getCellsAtColumnHandle(s.block,s.colIndex).every(({cell:e})=>PY(e)===1):o.getCellsAtRowHandle(s.block,s.rowIndex).every(({cell:e})=>FY(e)===1),[e.orientation,s,o]);return s?(0,Q.jsxs)(n.Generic.Menu.Root,{onOpenChange:n=>{n?(o.freezeHandles(),e.hideOtherElements(!0)):(o.unfreezeHandles(),e.hideOtherElements(!1),t.focus())},position:`right`,children:[(0,Q.jsx)(n.Generic.Menu.Trigger,{children:(0,Q.jsx)(n.TableHandle.Root,{className:IZ(`bn-table-handle`,r?`bn-table-handle-dragging`:``,c?``:`bn-table-handle-not-draggable`),draggable:c,onDragStart:t=>{i(!0),e.hideOtherElements(!0),e.orientation===`column`?o.colDragStart(t):o.rowDragStart(t)},onDragEnd:()=>{o.dragEnd(),e.hideOtherElements(!1),i(!1)},style:e.orientation===`column`?{transform:`rotate(0.25turn)`}:void 0,children:e.children||(0,Q.jsx)(uHe,{size:24,"data-test":`tableHandle`})})}),(0,Q.jsx)(a,{orientation:e.orientation})]}):null},qUe=e=>{let t=P7(),[n,r]=(0,Z.useState)(),i=I7($6),a=(0,Z.useMemo)(()=>{let e={};if(i===void 0)return{};let n=JZ(i.block.id,t.prosemirrorState.doc);if(!n)return{};let r=n.posBeforeNode+1,a=t.prosemirrorView.domAtPos(r+1).node;if(!(a instanceof Element))return{};if(e.tableReference={element:a},i.rowIndex===void 0||i.colIndex===void 0)return e;let o=t.prosemirrorState.doc.resolve(r+1).posAtIndex(i.rowIndex),s=t.prosemirrorState.doc.resolve(o+1).posAtIndex(i.colIndex),c=t.prosemirrorView.domAtPos(s+1).node;return c instanceof Element?(e.cellReference={element:c},e.rowReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(e.x,i.draggingState&&i.draggingState.draggedCellOrientation===`row`?i.draggingState.mousePos-t.height/2:t.y,e.width,t.height)}},e.columnReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(i.draggingState&&i.draggingState.draggedCellOrientation===`col`?i.draggingState.mousePos-t.width/2:t.x,e.y,t.width,e.height)}},e):{}},[t,i]),o=(0,Z.useMemo)(()=>i===void 0?void 0:{rowTableHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`),placement:`left`,middleware:[rp(-10)]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},columnTableHandle:{useFloatingOptions:{open:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`),placement:`top`,middleware:[rp(-12)]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},tableCellHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`),placement:`top-end`,middleware:[rp({mainAxis:-15,crossAxis:-1})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendRowsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`),placement:`bottom`,middleware:[sp({apply({rects:e,elements:t}){Object.assign(t.floating.style,{width:`${e.reference.width}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendColumnsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`),placement:`right`,middleware:[sp({apply({rects:e,elements:t}){Object.assign(t.floating.style,{height:`${e.reference.height}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}}},[n,i]);if(!i)return null;let s=e.tableHandle||KUe,c=e.extendButton||IUe,l=e.tableCellHandle||BUe;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)($7,{reference:a?.rowReference,...o?.rowTableHandle,children:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`)&&(0,Q.jsx)(s,{orientation:`row`,hideOtherElements:e=>r(e?`rowTableHandle`:void 0)})}),(0,Q.jsx)($7,{reference:a?.columnReference,...o?.columnTableHandle,children:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`)&&(0,Q.jsx)(s,{orientation:`column`,hideOtherElements:e=>r(e?`columnTableHandle`:void 0)})}),(0,Q.jsx)($7,{reference:a?.cellReference,...o?.tableCellHandle,children:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`)&&(0,Q.jsx)(l,{hideOtherElements:e=>r(e?`tableCellHandle`:void 0)})}),(0,Q.jsx)($7,{reference:a?.tableReference,...o?.extendRowsButton,children:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`)&&(0,Q.jsx)(c,{orientation:`addOrRemoveRows`,hideOtherElements:e=>r(e?`extendRowsButton`:void 0)})}),(0,Q.jsx)($7,{reference:a?.tableReference,...o?.extendColumnsButton,children:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`)&&(0,Q.jsx)(c,{orientation:`addOrRemoveColumns`,hideOtherElements:e=>r(e?`extendColumnsButton`:void 0)})})]})},JUe=(0,Z.lazy)(()=>Promise.resolve().then(()=>cWe)),YUe=(0,Z.lazy)(()=>Promise.resolve().then(()=>lWe)),x9=()=>{let e=(0,Z.useMemo)(()=>window.matchMedia?.call(window,`(prefers-color-scheme: dark)`),[]),t=(0,Z.useMemo)(()=>window.matchMedia?.call(window,`(prefers-color-scheme: light)`),[]),n=e?.matches,r=t?.matches,[i,a]=(0,Z.useState)(n?`dark`:r?`light`:`no-preference`);return(0,Z.useEffect)(()=>{a(n?`dark`:r?`light`:`no-preference`)},[n,r]),(0,Z.useEffect)(()=>{if(typeof e?.addEventListener==`function`){let n=({matches:e})=>e&&a(`dark`),r=({matches:e})=>e&&a(`light`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,r),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,r)}}else{let n=()=>a(e.matches?`dark`:t.matches?`light`:`no-preference`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,n),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,n)}}},[e,t]),window.matchMedia,i},S9=(0,Z.createContext)(void 0),XUe=({contentComponent:e})=>{let t=(0,Z.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Q.jsx)(Q.Fragment,{children:Object.values(t)})},ZUe=(0,Z.forwardRef)((e,t)=>{let[n,r]=(0,Z.useState)();return(0,Z.useImperativeHandle)(t,()=>(e,t)=>{(0,X7.flushSync)(()=>{r({node:e,container:t})}),r(void 0)},[]),(0,Q.jsx)(Q.Fragment,{children:n&&(0,X7.createPortal)(n.node,n.container)})}),C9=()=>{},QUe=Z.forwardRef(({className:e,renderEditor:t,editorColorScheme:n,children:r,...i},a)=>(0,Q.jsx)(`div`,{className:IZ(`bn-container`,n,e),"data-color-scheme":n,...i,ref:a,children:t?(0,Q.jsx)(eWe,{children:r}):r})),$Ue=Z.forwardRef(jHe),eWe=e=>{let t=kHe(),n=P7(),r=(0,Z.useMemo)(()=>AHe(),[]),i=(0,Z.useCallback)(e=>{n.isEditable=t.editorProps.editable!==!1,n._tiptapEditor.contentComponent=r,e?n.mount(e):n.unmount()},[t.editorProps.editable,n,r]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(XUe,{contentComponent:r}),(0,Q.jsx)(tWe,{...t.editorProps,...e,mount:i}),(0,Q.jsx)(EHe,{...t.defaultUIProps}),e.children]})},tWe=e=>{let{autoFocus:t,mount:n,contentEditableProps:r}=e;return(0,Q.jsx)(`div`,{"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"data-bn-autofocus":t,ref:n,...r})},UQ(),w9=(e={},t=[])=>(0,Z.useMemo)(()=>{let t=FBe.create(e);return window&&(window.ProseMirror=t._tiptapEditor),t},t),T9=e=>{let[t,n]=(0,Z.useState)(!1),r=z7({editor:e.editor,selector:({editor:e})=>e.isEmpty}),i=L7(),a=(0,Z.useCallback)(()=>{n(!0)},[]),o=(0,Z.useCallback)(()=>{n(!1)},[]);return(0,Z.useEffect)(()=>{e.editable&&e.autoFocus&&e.editor.focus()},[e.autoFocus,e.editable,e.editor]),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(i.Comments.Editor,{autoFocus:e.autoFocus,className:`bn-comment-editor`,editor:e.editor,onFocus:a,onBlur:o,editable:e.editable}),e.actions&&(0,Q.jsx)(`div`,{className:`bn-comment-actions-wrapper`,children:(0,Q.jsx)(e.actions,{isFocused:t,isEmpty:r})})]})},D9=e=>{let[t,n]=(0,Z.useState)(!1),r=L7(),i=P7(),a=N7();return(0,Q.jsxs)(r.Generic.Popover.Root,{open:t,children:[(0,Q.jsx)(r.Generic.Popover.Trigger,{children:(0,Q.jsx)(`div`,{onClick:r=>{var i;r.preventDefault(),r.stopPropagation(),n(!t),(i=e.onOpenChange)==null||i.call(e,!t)},style:{display:`flex`,justifyContent:`center`,alignItems:`center`},children:e.children})}),i.domElement?.parentElement&&(0,X7.createPortal)((0,Q.jsx)(r.Generic.Popover.Content,{className:`bn-emoji-picker-popover`,variant:`panel-popover`,children:(0,Q.jsx)(NHe,{perLine:7,onClickOutside:()=>{var t;n(!1),(t=e.onOpenChange)==null||t.call(e,!1)},onEmojiSelect:t=>{var r;e.onEmojiSelect(t),n(!1),(r=e.onOpenChange)==null||r.call(e,!1)},theme:a?.colorSchemePreference})}),i.domElement.parentElement)]})},nWe=e=>{let t=L7(),n=R7(),r=F7(DY),i=e.comment.reactions.find(t=>t.emoji===e.emoji);if(!i)throw Error(`Trying to render reaction badge for non-existing reaction`);let[a,o]=(0,Z.useState)([]),s=Y7(a);return(0,Q.jsx)(t.Generic.Badge.Root,{className:IZ(`bn-badge`,`bn-comment-reaction`),text:i.userIds.length.toString(),icon:i.emoji,isSelected:r.threadStore.auth.canDeleteReaction(e.comment,i.emoji),onClick:()=>e.onReactionSelect(i.emoji),onMouseEnter:()=>o(i.userIds),mainTooltip:n.comments.reactions.reacted_by,secondaryTooltip:`${Array.from(s.values()).map(e=>e.username).join(`
|
|
194
|
+
`)}`},i.emoji)},{textColor:rWe,backgroundColor:iWe,...aWe}=V$,O9=r8.create({blockSpecs:{paragraph:_$()},styleSpecs:aWe}),oWe=({comment:e,thread:t,showResolveButton:n})=>{let r=F7(DY),i=R7(),a=w9({initialContent:e.body,trailingBlock:!1,dictionary:{...i,placeholders:{emptyDocument:i.placeholders.edit_comment}},schema:r.commentEditorSchema||O9}),o=L7(),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),d=r.threadStore,f=(0,Z.useCallback)(()=>{c(!0)},[]),p=(0,Z.useCallback)(()=>{a.replaceBlocks(a.document,e.body),c(!1)},[a,e.body]),m=(0,Z.useCallback)(async n=>{await d.updateComment({commentId:e.id,comment:{body:a.document},threadId:t.id}),c(!1)},[e,t.id,a,d]),h=(0,Z.useCallback)(async()=>{await d.deleteComment({commentId:e.id,threadId:t.id})},[e,t.id,d]),g=(0,Z.useCallback)(async n=>{d.auth.canAddReaction(e,n)?await d.addReaction({threadId:t.id,commentId:e.id,emoji:n}):d.auth.canDeleteReaction(e,n)&&await d.deleteReaction({threadId:t.id,commentId:e.id,emoji:n})},[d,e,t.id]),_=(0,Z.useCallback)(async()=>{await d.resolveThread({threadId:t.id})},[t.id,d]),v=(0,Z.useCallback)(async()=>{await d.unresolveThread({threadId:t.id})},[t.id,d]),y=PHe(e.userId);if(!e.body)return null;let b,x=d.auth.canAddReaction(e),S=d.auth.canDeleteComment(e),C=d.auth.canUpdateComment(e),w=n&&(t.resolved?d.auth.canUnresolveThread(t):d.auth.canResolveThread(t));s||(b=(0,Q.jsxs)(o.Generic.Toolbar.Root,{className:IZ(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:[x&&(0,Q.jsx)(D9,{onEmojiSelect:e=>g(e.native),onOpenChange:u,children:(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.add_reaction,variant:`compact`,children:(0,Q.jsx)(oHe,{size:16})},`add-reaction`)}),w&&(t.resolved?(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:`Re-open`,variant:`compact`,onClick:v,children:(0,Q.jsx)(hVe,{size:16})},`reopen`):(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.resolve,variant:`compact`,onClick:_,children:(0,Q.jsx)(QVe,{size:16})},`resolve`)),(S||C)&&(0,Q.jsxs)(o.Generic.Menu.Root,{position:`bottom-start`,children:[(0,Q.jsx)(o.Generic.Menu.Trigger,{children:(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.more_actions,variant:`compact`,children:(0,Q.jsx)(rHe,{size:16})},`more-actions`)}),(0,Q.jsxs)(o.Generic.Menu.Dropdown,{className:`bn-menu-dropdown`,children:[C&&(0,Q.jsx)(o.Generic.Menu.Item,{icon:(0,Q.jsx)(_Ve,{}),onClick:f,children:i.comments.actions.edit_comment},`edit-comment`),S&&(0,Q.jsx)(o.Generic.Menu.Item,{icon:(0,Q.jsx)(eHe,{}),onClick:h,children:i.comments.actions.delete_comment},`delete-comment`)]})]})]}));let T=e.createdAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`});if(!e.body)throw Error(`soft deletes are not yet supported`);return(0,Q.jsx)(o.Comments.Comment,{authorInfo:y??`loading`,timeString:T,edited:e.updatedAt.getTime()!==e.createdAt.getTime(),showActions:`hover`,actions:b,className:`bn-thread-comment`,emojiPickerOpen:l,children:(0,Q.jsx)(T9,{autoFocus:s,editor:a,editable:s,actions:e.reactions.length>0||s?({isEmpty:t})=>(0,Q.jsxs)(Q.Fragment,{children:[e.reactions.length>0&&!s&&(0,Q.jsxs)(o.Generic.Badge.Group,{className:IZ(`bn-badge-group`,`bn-comment-reactions`),children:[e.reactions.map(t=>(0,Q.jsx)(nWe,{comment:e,emoji:t.emoji,onReactionSelect:g},t.emoji)),x&&(0,Q.jsx)(D9,{onEmojiSelect:e=>g(e.native),onOpenChange:u,children:(0,Q.jsx)(o.Generic.Badge.Root,{className:IZ(`bn-badge`,`bn-comment-add-reaction`),text:`+`,icon:(0,Q.jsx)(oHe,{size:16}),mainTooltip:i.comments.actions.add_reaction})})]}),s&&(0,Q.jsxs)(o.Generic.Toolbar.Root,{variant:`action-toolbar`,className:IZ(`bn-action-toolbar`,`bn-comment-actions`),children:[(0,Q.jsx)(o.Generic.Toolbar.Button,{mainTooltip:i.comments.save_button_text,variant:`compact`,onClick:m,isDisabled:t,children:i.comments.save_button_text}),(0,Q.jsx)(o.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:i.comments.cancel_button_text,variant:`compact`,onClick:p,children:i.comments.cancel_button_text})]})]}):void 0})})},sWe=({thread:e,maxCommentsBeforeCollapse:t})=>{let n=L7(),r=R7(),i=Y7(e.resolvedBy?[e.resolvedBy]:[]),a=e.comments.map((t,n)=>(0,Q.jsx)(oWe,{thread:e,comment:t,showResolveButton:n===0},t.id+JSON.stringify(t.body||`{}`)));if(e.resolved&&e.resolvedUpdatedAt&&e.resolvedBy){if(!i.get(e.resolvedBy))throw Error(`User ${e.resolvedBy} resolved thread ${e.id}, but their data could not be found.`);let t=e.comments.findLastIndex(t=>e.resolvedUpdatedAt.getTime()>t.createdAt.getTime())+1;a.splice(t,0,(0,Q.jsx)(n.Comments.Comment,{className:`bn-thread-comment`,authorInfo:e.resolvedBy&&i.get(e.resolvedBy)||`loading`,timeString:e.resolvedUpdatedAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`}),edited:!1,showActions:!1,children:(0,Q.jsx)(`div`,{className:`bn-resolved-text`,children:r.comments.sidebar.marked_as_resolved})},`resolved-comment`))}return t&&a.length>t&&a.splice(1,a.length-2,(0,Q.jsx)(n.Comments.ExpandSectionsPrompt,{className:`bn-thread-expand-prompt`,children:r.comments.sidebar.more_replies(e.comments.length-2)},`expand-prompt`)),a},cWe=Object.freeze(Object.defineProperty({__proto__:null,default:IHe},Symbol.toStringTag,{value:`Module`})),k9=({thread:e,selected:t,referenceText:n,maxCommentsBeforeCollapse:r,onFocus:i,onBlur:a,tabIndex:o})=>{let s=L7(),c=R7(),l=F7(DY),u=w9({trailingBlock:!1,dictionary:{...c,placeholders:{emptyDocument:c.placeholders.comment_reply}},schema:l.commentEditorSchema||O9}),d=(0,Z.useCallback)(async()=>{await l.threadStore.addComment({comment:{body:u.document},threadId:e.id}),u.removeBlocks(u.document)},[l,u,e.id]);return(0,Q.jsxs)(s.Comments.Card,{className:`bn-thread`,headerText:n,onFocus:i,onBlur:a,selected:t,tabIndex:o,children:[(0,Q.jsx)(s.Comments.CardSection,{className:`bn-thread-comments`,children:(0,Q.jsx)(sWe,{thread:e,maxCommentsBeforeCollapse:t?void 0:r||5})}),t&&(0,Q.jsx)(s.Comments.CardSection,{className:`bn-thread-composer`,children:(0,Q.jsx)(T9,{autoFocus:!1,editable:!0,editor:u,actions:({isEmpty:e})=>e?null:(0,Q.jsx)(s.Generic.Toolbar.Root,{variant:`action-toolbar`,className:IZ(`bn-action-toolbar`,`bn-comment-actions`),children:(0,Q.jsx)(s.Generic.Toolbar.Button,{mainTooltip:c.comments.save_button_text,variant:`compact`,isDisabled:e,onClick:d,children:c.comments.save_button_text})})})})]})},lWe=Object.freeze(Object.defineProperty({__proto__:null,default:RHe},Symbol.toStringTag,{value:`Module`})),Z.memo(({thread:e,selectedThreadId:t,maxCommentsBeforeCollapse:n,referenceText:r})=>{let i=F7(DY),a=(0,Z.useCallback)(t=>{t.target.closest(`.bn-action-toolbar`)||i.selectThread(e.id)},[i,e.id]),o=(0,Z.useCallback)(e=>{if(!e.relatedTarget||e.relatedTarget.closest(`.bn-action-toolbar`))return;let t=e.target instanceof Node?e.target:null,n=e.relatedTarget instanceof Node?e.relatedTarget.closest(`.bn-thread`):null;(!t||!n||!n.contains(t))&&i.selectThread(void 0)},[i]);return(0,Q.jsx)(k9,{thread:e,selected:e.id===t,referenceText:r,maxCommentsBeforeCollapse:n,onFocus:a,onBlur:o,tabIndex:0})})}));function uWe(e,t){if(e==null)return{};var n=dWe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dWe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function j9(){return j9=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j9.apply(this,arguments)}function fWe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function M9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?fWe(Object(n),!0).forEach(function(t){pWe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fWe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pWe(e,t,n){return t=mWe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mWe(e){var t=hWe(e,`string`);return typeof t==`symbol`?t:t+``}function hWe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gWe(e){return e&&e.map((e,t)=>N9.createElement(e.tag,M9({key:t},e.attr),gWe(e.child)))}function _We(e){return t=>N9.createElement(vWe,j9({attr:M9({},e.attr)},t),gWe(e.child))}function vWe(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=uWe(e,oGe),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),N9.createElement(`svg`,j9({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:M9(M9({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&N9.createElement(`title`,null,i),e.children)};return V9===void 0?t(B9):N9.createElement(V9.Consumer,null,e=>t(e))}function yWe(e){return _We({attr:{viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`},child:[{tag:`path`,attr:{fillRule:`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,clipRule:`evenodd`},child:[]}]})(e)}var $,N9,P9,F9,bWe,xWe,I9,L9,SWe,CWe,wWe,TWe,EWe,DWe,OWe,kWe,AWe,jWe,MWe,NWe,PWe,FWe,IWe,LWe,RWe,zWe,BWe,VWe,HWe,UWe,WWe,GWe,KWe,qWe,R9,JWe,YWe,XWe,ZWe,QWe,$We,eGe,tGe,nGe,rGe,iGe,aGe,z9,B9,V9,oGe,H9,sGe,U9,W9,G9,cGe=o((()=>{$=N(),IBe(),A9(),hre(),N9=u(p(),1),la(),P9=(e,t,n=!1)=>{let r=[];function i(e,r=`--bn`){for(let a in e){let o=`${r}-${a.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}`;typeof e[a]==`object`?i(e[a],o):(typeof e[a]==`number`&&(e[a]=`${e[a]}px`),n?t.style.removeProperty(o):t.style.setProperty(o,e[a].toString()))}}return i(e),r},F9=(e,t)=>P9(e,t),bWe={colors:{editor:{text:void 0,background:void 0},menu:{text:void 0,background:void 0},tooltip:{text:void 0,background:void 0},hovered:{text:void 0,background:void 0},selected:{text:void 0,background:void 0},disabled:{text:void 0,background:void 0},shadow:void 0,border:void 0,sideMenu:void 0,highlights:{gray:{text:void 0,background:void 0},brown:{text:void 0,background:void 0},red:{text:void 0,background:void 0},orange:{text:void 0,background:void 0},yellow:{text:void 0,background:void 0},green:{text:void 0,background:void 0},blue:{text:void 0,background:void 0},purple:{text:void 0,background:void 0},pink:{text:void 0,background:void 0}}},borderRadius:void 0,fontFamily:void 0},xWe=e=>P9(bWe,e,!0),I9=e=>(0,$.jsxs)(Oy,{gap:0,className:`bn-tooltip`,children:[(0,$.jsx)(Kg,{size:`sm`,lineClamp:5,children:e.mainTooltip}),e.secondaryTooltip&&(0,$.jsx)(Kg,{size:`xs`,lineClamp:5,children:e.secondaryTooltip})]}),L9=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,mainTooltip:i,secondaryTooltip:a,icon:o,isSelected:s,isDisabled:c,onClick:l,label:u,variant:d,...f}=e;IY(f,!1);let[p,m]=(0,N9.useState)(!1),h=r?(0,$.jsx)(D_,{"aria-label":u,className:n,onMouseDown:e=>{fQ()&&e.currentTarget.focus()},onClick:e=>{m(!0),l?.(e)},onPointerLeave:()=>m(!1),"aria-pressed":s,"data-selected":s||void 0,"data-test":i?i.slice(0,1).toLowerCase()+i.replace(/\s+/g,``).slice(1):void 0,size:d===`compact`?`compact-xs`:`xs`,disabled:c||!1,ref:t,...f,children:r}):(0,$.jsx)(cg,{className:n,"aria-label":u,onMouseDown:e=>{fQ()&&e.currentTarget.focus()},onClick:e=>{m(!0),l?.(e)},onPointerLeave:()=>m(!1),"aria-pressed":s,"data-selected":s||void 0,"data-test":i?i.slice(0,1).toLowerCase()+i.replace(/\s+/g,``).slice(1):void 0,size:d===`compact`?20:30,disabled:c||!1,ref:t,...f,children:o});return i?(0,$.jsx)(xy,{disabled:p,withinPortal:!1,label:(0,$.jsx)(I9,{mainTooltip:i,secondaryTooltip:a}),children:h}):h}),SWe=(0,N9.forwardRef)((e,t)=>{let{className:n,text:r,icon:i,isSelected:a,mainTooltip:o,secondaryTooltip:s,onClick:c,onMouseEnter:l,...u}=e;IY(u,!1);let[d,f]=(0,N9.useState)(!1),p=(0,$.jsxs)(J_,{className:n,checked:a===!0,wrapperProps:{onMouseEnter:l,onMouseLeave:()=>f(!1),onClick:e=>{f(!0),c?.(e)}},variant:`light`,icon:null,ref:t,children:[(0,$.jsx)(`span`,{children:i}),(0,$.jsx)(`span`,{children:r})]});return!o||d?p:(0,$.jsx)(xy,{refProp:`rootRef`,withinPortal:!1,label:(0,$.jsx)(I9,{mainTooltip:o,secondaryTooltip:s}),children:p})}),CWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IY(i),(0,$.jsx)(hg,{className:n,ref:t,children:r})}),wWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,headerText:i,selected:a,onFocus:o,onBlur:s,tabIndex:c,...l}=e;return IY(l,!1),(0,$.jsxs)(R_,{className:IZ(n,a?`selected`:``),onFocus:o,onBlur:s,tabIndex:c,ref:t,children:[i&&(0,$.jsx)(Kg,{className:`bn-header-text`,children:i}),r]})}),TWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IY(i,!1),(0,$.jsx)(R_.Section,{className:n,ref:t,children:r})}),EWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IY(i,!1),(0,$.jsx)($_,{className:n,label:(0,$.jsx)(Kg,{children:r}),ref:t})}),DWe=(0,N9.forwardRef)((e,t)=>{let{authorInfo:n,timeString:r,edited:i,...a}=e,o=R7();return IY(a,!1),n===`loading`?(0,$.jsxs)(hg,{children:[(0,$.jsx)(Ey,{height:24,width:24}),(0,$.jsx)(`div`,{children:(0,$.jsx)(Ey,{height:12,width:100})})]}):(0,$.jsxs)(hg,{children:[(0,$.jsx)(u_,{src:n.avatarUrl,alt:n.username,radius:`xl`,size:`sm`,color:`initials`}),(0,$.jsxs)(Kg,{fz:`sm`,fw:`bold`,children:[n.username,(0,$.jsxs)(Kg,{fz:`xs`,c:`dimmed`,span:!0,ml:`xs`,children:[r,` `,i&&`(${o.comments.edited})`]})]})]})}),OWe=(0,N9.forwardRef)((e,t)=>{let{className:n,showActions:r,authorInfo:i,timeString:a,edited:o,actions:s,emojiPickerOpen:c,children:l,...u}=e,{hovered:d,ref:f}=$i(),p=BHe([t,f]);return IY(u,!1),(0,$.jsxs)(hg,{pos:`relative`,ref:p,className:n,children:[s&&(r===!0||r===void 0||r===`hover`&&d||c)?(0,$.jsx)(hg,{style:{position:`absolute`,right:0,top:0,zIndex:10},children:s}):null,(0,$.jsx)(DWe,{...e}),l]})}),kWe=(0,N9.forwardRef)((e,t)=>{let{className:n,autoFocus:r,onFocus:i,onBlur:a,editor:o,editable:s,...c}=e;IY(c,!1);let l=N7();return(0,$.jsx)(U9,{autoFocus:r,className:n,editor:e.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:s,theme:l?.colorSchemePreference,ref:t,onFocus:i,onBlur:a,children:(0,$.jsx)(y9,{formattingToolbar:AWe})})}),AWe=()=>(0,$.jsx)(v9,{blockTypeSelectItems:[],children:_9([]).filter(e=>e.key!==`nestBlockButton`&&e.key!==`unnestBlockButton`)}),jWe=(0,N9.forwardRef)((e,t)=>{let{className:n,name:r,label:i,variant:a,icon:o,value:s,autoFocus:c,placeholder:l,disabled:u,onKeyDown:d,onChange:f,onSubmit:p,autoComplete:m,"aria-activedescendant":h,rightSection:g,..._}=e;return IY(_),(0,$.jsx)(By,{size:`xs`,className:IZ(n||``,a===`large`?`bn-mt-input-large`:``),ref:t,name:r,label:i,leftSection:o,value:s,autoFocus:c,"data-autofocus":c?`true`:void 0,rightSection:g,placeholder:l,disabled:u,onKeyDown:d,onChange:f,onSubmit:p,autoComplete:m,"aria-activedescendant":h})}),MWe=(0,N9.createContext)(void 0),NWe=e=>{let{children:t,onOpenChange:n,position:r,sub:i,...a}=e;return IY(a),i?(0,$.jsx)(Jv.Sub,{transitionProps:{duration:250,exitDelay:250},withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onChange:n,position:r,children:t}):(0,$.jsx)(Jv,{withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onChange:n,position:r,returnFocus:!1,children:t})},PWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,checked:a,subTrigger:o,onClick:s,...c}=e;return IY(c,!1),o?(0,$.jsx)(Jv.Sub.Item,{className:n,ref:t,leftSection:i,rightSection:a?(0,$.jsx)(qg,{size:10}):a===!1?(0,$.jsx)(`div`,{className:`bn-tick-space`}):null,onClick:s,...c,children:r}):(0,$.jsx)(Jv.Item,{className:n,ref:t,leftSection:i,rightSection:a?(0,$.jsx)(qg,{size:10}):a===!1?(0,$.jsx)(`div`,{className:`bn-tick-space`}):null,onClick:s,...c,children:r})}),FWe=e=>{let{children:t,sub:n,...r}=e;return IY(r),n?(0,$.jsx)(Jv.Sub.Target,{children:t}):(0,$.jsx)(Jv.Target,{children:t})},IWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,sub:i,...a}=e;IY(a);let o=(0,N9.useContext)(MWe);return i?(0,$.jsx)(Jv.Sub.Dropdown,{className:n,ref:t,onMouseOver:o?.onMenuMouseOver,onMouseLeave:o?.onMenuMouseLeave,children:r}):(0,$.jsx)(Jv.Dropdown,{className:n,ref:t,onMouseOver:o?.onMenuMouseOver,onMouseLeave:o?.onMenuMouseLeave,children:r})}),LWe=(0,N9.forwardRef)((e,t)=>{let{className:n,...r}=e;return IY(r),(0,$.jsx)(Jv.Divider,{className:n,ref:t})}),RWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IY(i),(0,$.jsx)(Jv.Label,{className:n,ref:t,children:r})}),zWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;return IY(u,!1),i?(0,$.jsx)(cg,{size:24,className:n,ref:t,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,"aria-label":l,...u,children:i}):(0,$.jsx)(D_,{className:n,ref:t,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,"aria-label":l,...u,children:r})}),BWe=(0,N9.forwardRef)((e,t)=>{let{className:n,tabs:r,defaultOpenTab:i,openTab:a,setOpenTab:o,loading:s,...c}=e;return IY(c),(0,$.jsx)(hg,{className:n,ref:t,children:(0,$.jsxs)(zy,{value:a,defaultValue:i,onChange:o,children:[s&&(0,$.jsx)(mv,{visible:s}),(0,$.jsx)(zy.List,{children:r.map(e=>(0,$.jsx)(zy.Tab,{"data-test":`${e.name.toLowerCase()}-tab`,value:e.name,children:e.name},e.name))}),r.map(e=>(0,$.jsx)(zy.Panel,{value:e.name,children:e.tabPanel},e.name))]})})}),VWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,onClick:i,label:a,...o}=e;return IY(o),(0,$.jsx)(D_,{size:`xs`,"aria-label":a,className:n,ref:t,onClick:i,...o,children:r})}),HWe=(0,N9.forwardRef)((e,t)=>{let{className:n,accept:r,value:i,placeholder:a,onChange:o,...s}=e;return IY(s),(0,$.jsx)(lv,{size:`xs`,className:n,ref:t,accept:r,value:i,placeholder:a,onChange:o,...s})}),UWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IY(i),(0,$.jsx)(`div`,{className:n,ref:t,children:r})}),WWe=(0,N9.forwardRef)((e,t)=>{let{className:n,value:r,placeholder:i,onKeyDown:a,onChange:o,...s}=e;return IY(s),(0,$.jsx)(By,{size:`xs`,"data-test":`embed-input`,className:n,ref:t,value:r,placeholder:i,onKeyDown:a,onChange:o})}),GWe=e=>{let{open:t,onOpenChange:n,position:r,children:i,...a}=e;return IY(a),(0,$.jsx)(Nh,{middlewares:{size:{padding:20}},withinPortal:!1,opened:t,onChange:n,position:r,zIndex:1e4,children:i})},KWe=e=>{let{children:t,...n}=e;return IY(n),(0,$.jsx)(Ah,{children:t})},qWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,variant:i,...a}=e;return IY(a),(0,$.jsx)(Eh,{className:n,ref:t,children:r})}),R9=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IY(i,!1),(0,$.jsx)(hg,{align:`center`,gap:0,className:n,ref:t,...i,children:r})}),JWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;return IY(u,!1),i?(0,$.jsx)(cg,{size:24,className:n,ref:t,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,"aria-label":l,...u,children:i}):(0,$.jsx)(D_,{className:n,ref:t,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,"aria-label":l,...u,children:r})}),YWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,id:i,...a}=e;return IY(a),(0,$.jsx)(Oy,{gap:0,className:n,ref:t,id:i,role:`listbox`,children:r})}),XWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IY(i),(0,$.jsx)(hg,{className:n,ref:t,children:(0,$.jsx)(hg,{className:`bn-mt-suggestion-menu-item-title`,children:r})})}),ZWe=(0,N9.forwardRef)((e,t)=>{let{className:n,isSelected:r,onClick:i,item:a,id:o,...s}=e;IY(s);let c=(0,N9.useRef)(null);return(0,N9.useEffect)(()=>{!c.current||!r||zHe(c.current,c.current.closest(`.bn-suggestion-menu, #ai-suggestion-menu`))!==`none`&&c.current.scrollIntoView({block:`nearest`})},[r]),(0,$.jsxs)(hg,{gap:0,className:n,ref:Wi(t,c),id:o,role:`option`,onMouseDown:e=>e.preventDefault(),onClick:i,"aria-selected":r||void 0,children:[a.icon&&(0,$.jsx)(hg,{className:`bn-mt-suggestion-menu-item-section`,"data-position":`left`,children:a.icon}),(0,$.jsxs)(Oy,{gap:0,className:`bn-mt-suggestion-menu-item-body`,children:[(0,$.jsx)(Kg,{className:`bn-mt-suggestion-menu-item-title`,children:a.title}),(0,$.jsx)(Kg,{className:`bn-mt-suggestion-menu-item-subtitle`,children:a.subtext})]}),a.badge&&(0,$.jsx)(hg,{"data-position":`right`,className:`bn-mt-suggestion-menu-item-section`,children:(0,$.jsx)(m_,{size:`xs`,children:a.badge})})]})}),QWe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return IY(i),(0,$.jsx)(hg,{className:n,ref:t,children:r})}),$We=(0,N9.forwardRef)((e,t)=>{let{className:n,...r}=e;return IY(r),(0,$.jsx)(eg,{className:n,type:`dots`,size:16,ref:t})}),eGe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,id:i,columns:a,...o}=e;return IY(o),(0,$.jsx)(`div`,{className:n,style:{gridTemplateColumns:`repeat(${a}, 1fr)`},ref:t,id:i,role:`grid`,children:r})}),tGe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return IY(a),(0,$.jsx)(hg,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:(0,$.jsx)(hg,{className:`bn-mt-suggestion-menu-item-title`,children:r})})}),nGe=(0,N9.forwardRef)((e,t)=>{let{className:n,isSelected:r,onClick:i,item:a,id:o,...s}=e;IY(s);let c=(0,N9.useRef)(null);return(0,N9.useEffect)(()=>{!c.current||!r||zHe(c.current,c.current.closest(`.bn-grid-suggestion-menu`))!==`none`&&c.current.scrollIntoView({block:`nearest`})},[r]),(0,$.jsx)(`div`,{className:n,ref:Wi(t,c),id:o,role:`option`,onClick:i,"aria-selected":r||void 0,children:a.icon})}),rGe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return IY(a),(0,$.jsx)(eg,{className:n,style:{gridColumn:`1 / ${i+1}`},type:`dots`,ref:t})}),iGe=(0,N9.forwardRef)((e,t)=>{let{children:n,className:r,onMouseDown:i,onClick:a,...o}=e;return IY(o,!1),(0,$.jsx)(D_,{className:r,ref:t,onMouseDown:i,onClick:a,...o,children:n})}),aGe=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,draggable:i,onDragStart:a,onDragEnd:o,style:s,label:c,...l}=e;return IY(l,!1),(0,$.jsx)(D_,{className:n,ref:t,"aria-label":c,draggable:i,onDragStart:a,onDragEnd:o,style:s,...l,children:r})}),z9=(0,N9.forwardRef)((e,t)=>{let{className:n,children:r,onMouseEnter:i,onMouseLeave:a,variant:o,...s}=e;IY(s);let{ref:c,focused:l}=oa();return(0,$.jsx)(Ig,{className:n,ref:Wi(t,c,Ni(l)),role:`toolbar`,onMouseEnter:i,onMouseLeave:a,gap:o===`action-toolbar`?2:void 0,children:r})}),B9={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},V9=N9.createContext&&N9.createContext(B9),oGe=[`attr`,`size`,`title`],H9=(0,N9.forwardRef)((e,t)=>{let{className:n,items:r,isDisabled:i,...a}=e;IY(a);let o=r.filter(e=>e.isSelected)[0];return o?(0,$.jsxs)(Jv,{withinPortal:!1,transitionProps:{exitDuration:0},disabled:i,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},children:[(0,$.jsx)(Jv.Target,{children:(0,$.jsx)(D_,{onMouseDown:e=>{fQ()&&e.currentTarget.focus()},leftSection:o.icon,rightSection:(0,$.jsx)(yWe,{}),size:`xs`,variant:`subtle`,disabled:i,children:o.text})}),(0,$.jsx)(Jv.Dropdown,{className:n,ref:t,children:r.map(e=>(0,$.jsx)(Jv.Item,{onClick:e.onClick,leftSection:e.icon,rightSection:e.isSelected?(0,$.jsx)(qg,{size:10,className:`bn-tick-icon`}):(0,$.jsx)(`div`,{className:`bn-tick-space`}),disabled:e.isDisabled,children:e.text},e.text))})]}):null}),sGe={FormattingToolbar:{Root:z9,Button:L9,Select:H9},FilePanel:{Root:BWe,Button:VWe,FileInput:HWe,TabPanel:UWe,TextInput:WWe},GridSuggestionMenu:{Root:eGe,Item:nGe,EmptyItem:tGe,Loader:rGe},LinkToolbar:{Root:z9,Button:L9,Select:H9},SideMenu:{Root:R9,Button:JWe},SuggestionMenu:{Root:YWe,Item:ZWe,EmptyItem:XWe,Label:QWe,Loader:$We},TableHandle:{Root:aGe,ExtendButton:iGe},Generic:{Badge:{Root:SWe,Group:CWe},Form:{Root:e=>(0,$.jsx)(`div`,{children:e.children}),TextInput:jWe},Menu:{Root:NWe,Trigger:FWe,Dropdown:IWe,Divider:LWe,Label:RWe,Item:PWe,Button:zWe},Popover:{Root:GWe,Trigger:KWe,Content:qWe},Toolbar:{Root:z9,Button:L9,Select:H9}},Comments:{Comment:OWe,Editor:kWe,Card:wWe,CardSection:TWe,ExpandSectionsPrompt:EWe}},U9=e=>{let{className:t,theme:n,...r}=e,i=N7(),a=x9(),o=i?.colorSchemePreference||a,s=(0,N9.useCallback)(e=>{if(e&&(xWe(e),typeof n==`object`)){if(`light`in n&&`dark`in n){F9(n[o===`dark`?`dark`:`light`],e);return}F9(n,e);return}},[o,n]),c=(0,N9.useContext)(Ia),l=typeof n==`string`?n:o===`no-preference`?`light`:o,u=(0,$.jsx)(t9.Provider,{value:sGe,children:(0,$.jsx)($Ue,{"data-mantine-color-scheme":l,className:IZ(`bn-mantine`,t||``),theme:typeof n==`object`?void 0:n,...r,ref:s})});return c?u:(0,$.jsx)(fs,{withCssVariables:!1,getRootElement:()=>{},children:u})},W9=[`#FFFFFF`,`#EFEFEF`,`#CFCFCF`,`#AFAFAF`,`#7F7F7F`,`#3F3F3F`,`#1F1F1F`,`#161616`,`#0F0F0F`,`#000000`],G9={colors:{editor:{text:W9[5],background:W9[0]},menu:{text:W9[5],background:W9[0]},tooltip:{text:W9[5],background:W9[1]},hovered:{text:W9[5],background:W9[1]},selected:{text:W9[0],background:W9[5]},disabled:{text:W9[3],background:W9[1]},shadow:W9[2],border:W9[1],sideMenu:W9[2],highlights:hQ},borderRadius:6,fontFamily:`"Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif`},W9[2],W9[6],W9[2],W9[6],W9[2],W9[7],W9[2],W9[7],W9[2],W9[8],W9[5],W9[7],W9[8],W9[7],W9[4],G9.borderRadius,G9.fontFamily})),lGe=o((()=>{})),uGe=o((()=>{}));function dGe(e){let t=e.match(pGe);if(!t)return{frontmatter:{},body:e};let n=t[1],r={};for(let e of n.split(`
|
|
195
|
+
`)){let t=e.indexOf(`:`);if(t===-1)continue;let n=e.slice(0,t).trim(),i=e.slice(t+1).trim();/^-?\d+(\.\d+)?$/.test(i)&&(i=Number(i)),r[n]=i}return{frontmatter:r,body:e.slice(t[0].length)}}function fGe(e,t){let n=Object.keys(e);return n.length===0?t:`---\n${n.map(t=>`${t}: ${e[t]}`).join(`
|
|
196
|
+
`)}\n---\n${t}`}var pGe,mGe=o((()=>{pGe=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/}));function hGe(){let[e,t]=(0,K9.useState)(()=>document.documentElement.getAttribute(`data-theme`)||`light`);return(0,K9.useEffect)(()=>{let e=new MutationObserver(()=>{t(document.documentElement.getAttribute(`data-theme`)||`light`)});return e.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>e.disconnect()},[]),e}var K9,gGe=o((()=>{K9=u(p())})),_Ge=o((()=>{}));function vGe({docPath:e}){let t=e.split(`/`);return(0,q9.jsx)(`span`,{className:`breadcrumb`,children:t.map((e,n)=>{let r=t.slice(0,n+1).join(`/`),i=n===t.length-1;return(0,q9.jsxs)(`span`,{className:`breadcrumb-segment`,children:[n>0&&(0,q9.jsx)(`span`,{className:`breadcrumb-sep`,children:`/`}),i?(0,q9.jsx)(`span`,{className:`breadcrumb-current`,children:e}):(0,q9.jsx)(Vn,{to:`/doc/${r}`,className:`breadcrumb-link`,children:e})]},r)})})}var q9,yGe=o((()=>{p(),Xn(),_Ge(),q9=N()})),bGe=o((()=>{}));function xGe({content:e,docPath:t,onSave:n,onDelete:r,isFolder:i,fullWidth:a,onToggleWidth:o}){let s=(0,J9.useRef)(null),c=(0,J9.useRef)({}),l=(0,J9.useRef)(null),u=hGe(),d=w9({initialContent:void 0,uploadFile:async e=>(await wre(e)).url});(0,J9.useMemo)(()=>{if(d&&e!==void 0){let{frontmatter:t,body:n}=dGe(e);c.current=t,(async()=>{try{let e=await d.tryParseMarkdownToBlocks(n);d.replaceBlocks(d.document,e)}catch{d.replaceBlocks(d.document,[{type:`paragraph`,content:[{type:`text`,text:n}]}])}})()}},[d,e]);let f=(0,J9.useCallback)(async()=>{clearTimeout(s.current),s.current=setTimeout(async()=>{let e=await d.blocksToMarkdownLossy(d.document);n(fGe(c.current,e))},1e3)},[d,n]);return(0,Y9.jsxs)(`div`,{className:`editor-container`,children:[(0,Y9.jsxs)(`div`,{className:`editor-toolbar`,children:[(0,Y9.jsx)(vGe,{docPath:t}),(0,Y9.jsxs)(`div`,{className:`editor-toolbar-actions`,children:[(0,Y9.jsx)(`button`,{className:`editor-width-btn`,onClick:o,title:a?`Narrow view`:`Full width`,children:a?(0,Y9.jsx)(kA,{size:16}):(0,Y9.jsx)(TA,{size:16})}),!i&&(0,Y9.jsx)(`button`,{className:`editor-delete-btn`,onClick:r,title:`Delete document`,children:(0,Y9.jsx)(lA,{size:16})})]})]}),(0,Y9.jsx)(`div`,{className:`editor-blocknote`,ref:l,children:(0,Y9.jsx)(U9,{editor:d,onChange:f,theme:u})})]})}var J9,Y9,SGe=o((()=>{J9=u(p()),A9(),cGe(),lGe(),uGe(),mGe(),gGe(),Uy(),NA(),yGe(),bGe(),Y9=N()})),CGe=o((()=>{}));function wGe({folderPath:e,onTreeChange:t,fullWidth:n,onToggleWidth:r}){let[i,a]=(0,X9.useState)(null),[o,s]=(0,X9.useState)(!0),c=(0,X9.useRef)(null),l=(0,X9.useRef)({}),u=(0,X9.useRef)(null),d=hGe(),f=w9({initialContent:void 0,uploadFile:async e=>(await wre(e)).url});(0,X9.useEffect)(()=>{e&&(s(!0),Sre(e).then(e=>{if(a(e),f&&e.content){let{frontmatter:t,body:n}=dGe(e.content);l.current=t,(async()=>{try{let e=await f.tryParseMarkdownToBlocks(n);f.replaceBlocks(f.document,e)}catch{f.replaceBlocks(f.document,[{type:`paragraph`,content:[{type:`text`,text:n}]}])}})()}}).catch(()=>a(null)).finally(()=>s(!1)))},[e,f]);let p=(0,X9.useCallback)(async()=>{clearTimeout(c.current),c.current=setTimeout(async()=>{let n=await f.blocksToMarkdownLossy(f.document);await Cre(e,fGe(l.current,n)),t()},1e3)},[f,e,t]);return o?(0,Z9.jsx)(`div`,{className:`loading`,children:`Loading...`}):i?(0,Z9.jsxs)(`div`,{className:`folder-view`,children:[(0,Z9.jsxs)(`div`,{className:`editor-toolbar`,children:[(0,Z9.jsx)(vGe,{docPath:e}),(0,Z9.jsx)(`div`,{className:`editor-toolbar-actions`,children:(0,Z9.jsx)(`button`,{className:`editor-width-btn`,onClick:r,title:n?`Narrow view`:`Full width`,children:n?(0,Z9.jsx)(kA,{size:16}):(0,Z9.jsx)(TA,{size:16})})})]}),(0,Z9.jsx)(`div`,{className:`folder-editor`,ref:u,children:(0,Z9.jsx)(U9,{editor:f,onChange:p,theme:d})}),i.children&&i.children.length>0&&(0,Z9.jsxs)(`div`,{className:`folder-children`,children:[(0,Z9.jsx)(`h3`,{className:`folder-children-title`,children:`Contents`}),(0,Z9.jsx)(`ul`,{className:`folder-children-list`,children:i.children.map(e=>(0,Z9.jsx)(`li`,{className:`folder-child-item`,children:(0,Z9.jsxs)(Vn,{to:`/doc/${e.path}`,className:`folder-child-link`,children:[(0,Z9.jsx)(`span`,{className:`folder-child-icon`,children:e.type===`folder`?(0,Z9.jsx)($k,{size:18}):(0,Z9.jsx)(Xk,{size:18})}),(0,Z9.jsx)(`span`,{className:`folder-child-name`,children:e.title||e.name})]})},e.path))})]})]}):(0,Z9.jsx)(`div`,{className:`not-found`,children:`Folder not found.`})}var X9,Z9,TGe=o((()=>{X9=u(p()),Xn(),A9(),cGe(),lGe(),uGe(),Uy(),mGe(),gGe(),NA(),yGe(),CGe(),Z9=N()})),EGe=o((()=>{}));function DGe({onTreeChange:e,fullWidth:t,onToggleWidth:n}){let r=Fe(),i=Ne(),a=r[`*`]||``,[o,s]=(0,Q9.useState)(null),[c,l]=(0,Q9.useState)(!1);(0,Q9.useEffect)(()=>{if(!a){s(null);return}l(!0),yre(a).then(e=>s(e)).catch(()=>s(null)).finally(()=>l(!1))},[a]);let u=(0,Q9.useCallback)(async t=>{await Vy(a,t),e()},[a,e]),d=(0,Q9.useCallback)(async()=>{confirm(`Delete this document?`)&&(await bre(a),e(),i(`/`))},[a,i,e]),f=(0,Q9.useCallback)(async()=>{let t=prompt(`Document name:`);if(!t)return;let n=t.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``);await xre(a);let r=`${a}/${n}`;await Vy(r,`# ${t}\n\n`),e(),i(`/doc/${r}`)},[a,e,i]);return a?c?(0,$9.jsx)(`div`,{className:`loading`,children:`Loading...`}):o?o.isFolder?(0,$9.jsx)(wGe,{folderPath:a,onTreeChange:e,fullWidth:t,onToggleWidth:n},a):(0,$9.jsx)(xGe,{content:o.content,docPath:a,onSave:u,onDelete:d,onAddChild:f,isFolder:!1,fullWidth:t,onToggleWidth:n},a):(0,$9.jsx)(`div`,{className:`not-found`,children:`Document not found.`}):(0,$9.jsxs)(`div`,{className:`welcome`,children:[(0,$9.jsx)(`h1`,{children:`Doku`}),(0,$9.jsx)(`p`,{children:`Select a document from the sidebar or create a new one.`})]})}function OGe(){let[e,t]=(0,Q9.useState)([]),[n,r]=(0,Q9.useState)(`Doku`),[i,a]=(0,Q9.useState)(280),[o,s]=(0,Q9.useState)(()=>localStorage.getItem(`doku-full-width`)===`true`),c=Ne(),l=(0,Q9.useCallback)(()=>{vre().then(t).catch(console.error)},[]);return(0,Q9.useEffect)(()=>{l(),_re().then(e=>r(e.projectName)).catch(()=>{})},[l]),(0,$9.jsxs)($9.Fragment,{children:[(0,$9.jsx)(uue,{tree:e,projectName:n,onNewDoc:(0,Q9.useCallback)(async(e=``)=>{let t=prompt(`Document name:`);if(!t)return;let n=t.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``);if(!e){await Vy(n,`# ${t}\n\n`),l(),c(`/doc/${n}`);return}await xre(e);let r=`${e}/${n}`;await Vy(r,`# ${t}\n\n`),l(),c(`/doc/${r}`)},[l,c]),onSearchSelect:(0,Q9.useCallback)(e=>{c(`/doc/${e}`)},[c]),sidebarWidth:i,onResize:a}),(0,$9.jsx)(`main`,{className:`main-content`,children:(0,$9.jsx)(`div`,{className:`editor-area ${o?`full-width`:``}`,children:(0,$9.jsxs)(Qe,{children:[(0,$9.jsx)(Xe,{path:`/`,element:(0,$9.jsx)(DGe,{onTreeChange:l,fullWidth:o,onToggleWidth:()=>{s(e=>{let t=!e;return localStorage.setItem(`doku-full-width`,t),t})}})}),(0,$9.jsx)(Xe,{path:`/doc/*`,element:(0,$9.jsx)(DGe,{onTreeChange:l,fullWidth:o,onToggleWidth:()=>{s(e=>{let t=!e;return localStorage.setItem(`doku-full-width`,t),t})}})})]})})})]})}var Q9,$9,kGe=o((()=>{Q9=u(p()),Xn(),due(),SGe(),TGe(),Uy(),EGe(),$9=N()})),AGe=o((()=>{}));s((()=>{var e=u(p()),t=u(y());Xn(),hre(),gre(),kGe(),AGe();var n=N();t.createRoot(document.getElementById(`root`)).render((0,n.jsx)(e.StrictMode,{children:(0,n.jsx)(fs,{children:(0,n.jsx)(jt,{children:(0,n.jsx)(OGe,{})})})}))}))();export{o as t};
|