@case-framework/survey-ui 0.6.2 → 0.8.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/README.md +40 -34
- package/dist/src/index.d.ts +7 -13
- package/dist/src/lib/survey-assets.d.ts +2 -0
- package/dist/src/modules/survey-player/index.d.ts +2 -0
- package/dist/src/modules/survey-player/registry.d.ts +23 -0
- package/dist/src/modules/survey-player/survey-context.d.ts +1 -1
- package/dist/src/modules/survey-player/survey-item/survey-item-types/placeholder-item-renderers.d.ts +1 -1
- package/dist/src/modules/survey-player/survey-player.d.ts +1 -1
- package/dist/survey-ui.cjs +47 -0
- package/dist/survey-ui.cjs.map +1 -0
- package/dist/survey-ui.css +1 -1
- package/dist/survey-ui.js +14136 -0
- package/dist/survey-ui.js.map +1 -0
- package/package.json +25 -64
- package/dist/default-item-cores-C6VK2LFe.js +0 -10
- package/dist/default-item-cores-C6VK2LFe.js.map +0 -1
- package/dist/default-item-cores-gdu37TFX.mjs +0 -3988
- package/dist/default-item-cores-gdu37TFX.mjs.map +0 -1
- package/dist/item-core-registry.cjs.js +0 -2
- package/dist/item-core-registry.cjs.js.map +0 -1
- package/dist/item-core-registry.es.js +0 -11
- package/dist/item-core-registry.es.js.map +0 -1
- package/dist/src/components/c-ui/alert-provider.d.ts +0 -18
- package/dist/src/components/c-ui/dot-background.d.ts +0 -72
- package/dist/src/components/c-ui/filepicker-dropzone.d.ts +0 -38
- package/dist/src/components/c-ui/loading-button.d.ts +0 -9
- package/dist/src/components/common/content-editable-plain.d.ts +0 -17
- package/dist/src/components/common/sortable-tree.d.ts +0 -59
- package/dist/src/components/hooks/use-button-shortcut.d.ts +0 -18
- package/dist/src/components/hooks/use-document-keydown.d.ts +0 -7
- package/dist/src/components/rich-text/content-policy.d.ts +0 -19
- package/dist/src/components/rich-text/index.d.ts +0 -6
- package/dist/src/components/rich-text/nodes/rich-text-image-node.d.ts +0 -40
- package/dist/src/components/rich-text/nodes/rich-text-info-box-node.d.ts +0 -45
- package/dist/src/components/rich-text/nodes/survey-rich-text-heading-node.d.ts +0 -27
- package/dist/src/components/rich-text/rich-text-block-editor.d.ts +0 -8
- package/dist/src/components/rich-text/rich-text-editor-context.d.ts +0 -23
- package/dist/src/components/rich-text/rich-text-survey-content.d.ts +0 -7
- package/dist/src/components/rich-text/types.d.ts +0 -6
- package/dist/src/components/rich-text-editor/index.d.ts +0 -3
- package/dist/src/components/rich-text-editor/plugins/command-handler-plugin.d.ts +0 -5
- package/dist/src/components/rich-text-editor/plugins/editable-mode-plugin.d.ts +0 -3
- package/dist/src/components/rich-text-editor/plugins/floating-toolbar-plugin.d.ts +0 -11
- package/dist/src/components/rich-text-editor/plugins/image-dialog-plugin.d.ts +0 -4
- package/dist/src/components/rich-text-editor/plugins/info-box-popover-plugin.d.ts +0 -6
- package/dist/src/components/rich-text-editor/plugins/link-popover-plugin.d.ts +0 -6
- package/dist/src/components/rich-text-editor/plugins/rich-text-image-asset-deletion-plugin.d.ts +0 -1
- package/dist/src/components/rich-text-editor/plugins/slash-command-menu-plugin.d.ts +0 -15
- package/dist/src/components/rich-text-editor/plugins/sync-editor-value-plugin.d.ts +0 -4
- package/dist/src/components/rich-text-editor/rich-text-editor-utils.d.ts +0 -205
- package/dist/src/components/rich-text-editor/rich-text-editor.d.ts +0 -43
- package/dist/src/components/rich-text-editor/rich-text-image-editor-commands.d.ts +0 -12
- package/dist/src/components/rich-text-editor/rich-text-info-box-commands.d.ts +0 -20
- package/dist/src/components/rich-text-editor/style-control-icon.d.ts +0 -5
- package/dist/src/components/ui/alert.d.ts +0 -10
- package/dist/src/components/ui/badge.d.ts +0 -9
- package/dist/src/components/ui/breadcrumb.d.ts +0 -11
- package/dist/src/components/ui/card.d.ts +0 -11
- package/dist/src/components/ui/command.d.ts +0 -18
- package/dist/src/components/ui/context-menu.d.ts +0 -31
- package/dist/src/components/ui/dialog.d.ts +0 -20
- package/dist/src/components/ui/dropdown-menu.d.ts +0 -29
- package/dist/src/components/ui/kbd.d.ts +0 -3
- package/dist/src/components/ui/resizable.d.ts +0 -7
- package/dist/src/components/ui/scroll-area.d.ts +0 -5
- package/dist/src/components/ui/skeleton.d.ts +0 -2
- package/dist/src/components/ui/sonner.d.ts +0 -3
- package/dist/src/components/ui/tabs.d.ts +0 -11
- package/dist/src/components/ui/toggle-group.d.ts +0 -10
- package/dist/src/components/ui/toggle.d.ts +0 -9
- package/dist/src/components/ui/tooltip.d.ts +0 -7
- package/dist/src/dev/_components/nav-input.d.ts +0 -35
- package/dist/src/dev/app.d.ts +0 -2
- package/dist/src/dev/localizations/de.d.ts +0 -2
- package/dist/src/dev/main.d.ts +0 -0
- package/dist/src/item-core-registry.d.ts +0 -4
- package/dist/src/modules/default-item-registry/default-registry-entries.d.ts +0 -2
- package/dist/src/modules/default-item-registry/index.d.ts +0 -19
- package/dist/src/modules/default-item-registry/item-authoring-state.d.ts +0 -15
- package/dist/src/modules/default-item-registry/items/choice/editor/card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/choice/editor/option-create.d.ts +0 -11
- package/dist/src/modules/default-item-registry/items/choice/editor/option-edit-dialog.d.ts +0 -21
- package/dist/src/modules/default-item-registry/items/choice/editor/option-editor-fields.d.ts +0 -17
- package/dist/src/modules/default-item-registry/items/choice/editor/response-options-list.d.ts +0 -20
- package/dist/src/modules/default-item-registry/items/choice/expression-registry.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/choice/preview/item.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/choice/search-adapter.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/form/editor/card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/form/editor/config-editor.d.ts +0 -12
- package/dist/src/modules/default-item-registry/items/form/editor/field-edit-dialog.d.ts +0 -10
- package/dist/src/modules/default-item-registry/items/form/editor/field-group-header-dialog.d.ts +0 -12
- package/dist/src/modules/default-item-registry/items/form/editor/field-group-layout-dialog.d.ts +0 -9
- package/dist/src/modules/default-item-registry/items/form/editor/field-item-preview.d.ts +0 -15
- package/dist/src/modules/default-item-registry/items/form/editor/field-key-dialog.d.ts +0 -10
- package/dist/src/modules/default-item-registry/items/form/editor/field-sort-dialog.d.ts +0 -11
- package/dist/src/modules/default-item-registry/items/form/editor/field-type-shared.d.ts +0 -12
- package/dist/src/modules/default-item-registry/items/form/editor/response-field-groups-list.d.ts +0 -16
- package/dist/src/modules/default-item-registry/items/form/preview/item.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/form/search-adapter.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/info/editor-card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/info/preview/item.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/info/search-adapter.d.ts +0 -2
- package/dist/src/modules/default-item-registry/items/structure/group/editor-card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/structure/page-break/editor-card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/structure/preview-renderers.d.ts +0 -3
- package/dist/src/modules/default-item-registry/items/structure/root/editor-card.d.ts +0 -3
- package/dist/src/modules/default-item-registry/shared/preview/question-header.d.ts +0 -6
- package/dist/src/modules/default-item-registry/shared/preview/utils.d.ts +0 -3
- package/dist/src/modules/default-item-registry/shared/question-editor/deferred-localized-rich-text-field.d.ts +0 -26
- package/dist/src/modules/default-item-registry/shared/question-editor/header-editor.d.ts +0 -6
- package/dist/src/modules/default-item-registry/shared/question-editor/layout.d.ts +0 -8
- package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-editors.d.ts +0 -23
- package/dist/src/modules/default-item-registry/shared/question-editor/rich-text-policies.d.ts +0 -8
- package/dist/src/modules/default-item-registry/shared/question-editor/toolbar.d.ts +0 -10
- package/dist/src/modules/survey-editor/ai/create-provider.d.ts +0 -22
- package/dist/src/modules/survey-editor/ai/types.d.ts +0 -11
- package/dist/src/modules/survey-editor/ai/use-survey-assistant-integration.d.ts +0 -16
- package/dist/src/modules/survey-editor/assets/index.d.ts +0 -4
- package/dist/src/modules/survey-editor/assets/survey-image-asset-manager.d.ts +0 -4
- package/dist/src/modules/survey-editor/assets/use-survey-assets.d.ts +0 -4
- package/dist/src/modules/survey-editor/assets/utils.d.ts +0 -5
- package/dist/src/modules/survey-editor/assistant/apply.d.ts +0 -24
- package/dist/src/modules/survey-editor/assistant/index.d.ts +0 -2
- package/dist/src/modules/survey-editor/assistant/snapshot.d.ts +0 -39
- package/dist/src/modules/survey-editor/editor-card/add-items/constants.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-actions.d.ts +0 -24
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-add-item-target.d.ts +0 -9
- package/dist/src/modules/survey-editor/editor-card/add-items/hooks/use-option-group-navigation.d.ts +0 -20
- package/dist/src/modules/survey-editor/editor-card/add-items/types.d.ts +0 -21
- package/dist/src/modules/survey-editor/editor-card/add-items/views/back-button.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/add-items/views/blank-item-view.d.ts +0 -13
- package/dist/src/modules/survey-editor/editor-card/add-items/views/entry-view.d.ts +0 -15
- package/dist/src/modules/survey-editor/editor-card/add-items/views/item-type-grid-view.d.ts +0 -30
- package/dist/src/modules/survey-editor/editor-card/add-items/views/structure-view.d.ts +0 -16
- package/dist/src/modules/survey-editor/editor-card/add-items.d.ts +0 -1
- package/dist/src/modules/survey-editor/editor-card/copy-item-dropdown-menu.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/delete-item-context-menu.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/delete-item-dropdown-menu.d.ts +0 -7
- package/dist/src/modules/survey-editor/editor-card/editor-card-tab-trigger.d.ts +0 -15
- package/dist/src/modules/survey-editor/editor-card/expression-pseudo-code.d.ts +0 -8
- package/dist/src/modules/survey-editor/editor-card/group-items.d.ts +0 -2
- package/dist/src/modules/survey-editor/editor-card/hooks/use-armed-shortcut-sequence.d.ts +0 -11
- package/dist/src/modules/survey-editor/editor-card/hooks/use-group-list-keyboard.d.ts +0 -30
- package/dist/src/modules/survey-editor/editor-card/index.d.ts +0 -2
- package/dist/src/modules/survey-editor/editor-card/item-authoring-state-preview.d.ts +0 -16
- package/dist/src/modules/survey-editor/editor-card/item-color-menu.d.ts +0 -6
- package/dist/src/modules/survey-editor/editor-card/item-color-selector.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/item-editor-card-skeleton.d.ts +0 -2
- package/dist/src/modules/survey-editor/editor-card/item-editor-card.d.ts +0 -34
- package/dist/src/modules/survey-editor/editor-card/item-editor-context.d.ts +0 -23
- package/dist/src/modules/survey-editor/editor-card/item-expression-overview.d.ts +0 -33
- package/dist/src/modules/survey-editor/editor-card/item-key-editor.d.ts +0 -9
- package/dist/src/modules/survey-editor/editor-card/item-label-preview-and-editor.d.ts +0 -10
- package/dist/src/modules/survey-editor/editor-card/item-preview.d.ts +0 -8
- package/dist/src/modules/survey-editor/editor-card/item-sibling-navigation.d.ts +0 -5
- package/dist/src/modules/survey-editor/editor-card/item-type-icon-with-tooltip.d.ts +0 -8
- package/dist/src/modules/survey-editor/editor-card/survey-player-item-preview.d.ts +0 -6
- package/dist/src/modules/survey-editor/editor-instance-provider.d.ts +0 -9
- package/dist/src/modules/survey-editor/hooks/useClipboardValue.d.ts +0 -2
- package/dist/src/modules/survey-editor/hooks/useDeleteItem.d.ts +0 -11
- package/dist/src/modules/survey-editor/hooks/useEditor.d.ts +0 -12
- package/dist/src/modules/survey-editor/hooks/useEditorStateChange.d.ts +0 -18
- package/dist/src/modules/survey-editor/hooks/useKeyboardShortcuts.d.ts +0 -7
- package/dist/src/modules/survey-editor/index.d.ts +0 -20
- package/dist/src/modules/survey-editor/localization/date-fns.d.ts +0 -5
- package/dist/src/modules/survey-editor/localization/default-all.d.ts +0 -2
- package/dist/src/modules/survey-editor/localization/default-en.d.ts +0 -3
- package/dist/src/modules/survey-editor/localization/default-nl.d.ts +0 -2
- package/dist/src/modules/survey-editor/localization/index.d.ts +0 -5
- package/dist/src/modules/survey-editor/localization/runtime.d.ts +0 -4
- package/dist/src/modules/survey-editor/navigation/location.d.ts +0 -6
- package/dist/src/modules/survey-editor/navigation/navigation-provider.d.ts +0 -12
- package/dist/src/modules/survey-editor/navigation/navigation.d.ts +0 -22
- package/dist/src/modules/survey-editor/navigation/types.d.ts +0 -23
- package/dist/src/modules/survey-editor/primitives/input-with-ai-popover.d.ts +0 -35
- package/dist/src/modules/survey-editor/registry/authoring-state.d.ts +0 -17
- package/dist/src/modules/survey-editor/registry/index.d.ts +0 -8
- package/dist/src/modules/survey-editor/registry/registry-mappers.d.ts +0 -25
- package/dist/src/modules/survey-editor/registry/search-adapter.d.ts +0 -19
- package/dist/src/modules/survey-editor/registry/types.d.ts +0 -218
- package/dist/src/modules/survey-editor/routes/editor/_components/assistant-authoring-lock.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-assistant-slot-context.d.ts +0 -6
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-assistant-slot.d.ts +0 -8
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-mode-switch.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/_components/editor-workspace.d.ts +0 -30
- package/dist/src/modules/survey-editor/routes/editor/_components/footer.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/_components/history-stack.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/_components/main.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/_components/workspace-presets.d.ts +0 -75
- package/dist/src/modules/survey-editor/routes/editor/asset-manager/index.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/index.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/breadcrumbs-nav.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/item-editor-toolbar.d.ts +0 -6
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/language-picker.d.ts +0 -2
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/search-trigger.d.ts +0 -3
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/item-editor-toolbar/survey-search.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/survey-outline.d.ts +0 -3
- package/dist/src/modules/survey-editor/routes/editor/item-editor/_components/survey-workspace.d.ts +0 -12
- package/dist/src/modules/survey-editor/routes/editor/item-editor/index.d.ts +0 -6
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/index.d.ts +0 -7
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/page-break-divider.d.ts +0 -6
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/preview-controls.d.ts +0 -15
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/preview-tree.d.ts +0 -26
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/survey-preview-canvas.d.ts +0 -16
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/survey-preview-item.d.ts +0 -13
- package/dist/src/modules/survey-editor/routes/editor/preview-mode/use-preview-preferences.d.ts +0 -14
- package/dist/src/modules/survey-editor/routes/editor/translation-mode/index.d.ts +0 -2
- package/dist/src/modules/survey-editor/session-file.d.ts +0 -13
- package/dist/src/modules/survey-editor/store/editor-store-context.d.ts +0 -10
- package/dist/src/modules/survey-editor/store/editor-store-provider.d.ts +0 -7
- package/dist/src/modules/survey-editor/store/editor-store.d.ts +0 -109
- package/dist/src/modules/survey-editor/store/use-editor-store.d.ts +0 -4
- package/dist/src/modules/survey-editor/store/useItemNavigation.d.ts +0 -7
- package/dist/src/modules/survey-editor/survey-editor-config.d.ts +0 -38
- package/dist/src/modules/survey-editor/survey-editor.d.ts +0 -40
- package/dist/src/modules/survey-editor/utils/item-type-infos.d.ts +0 -23
- package/dist/src/modules/survey-editor/workspace.d.ts +0 -17
- package/dist/src/modules/survey-player/survey-item/survey-item-types/question-wrapper.d.ts +0 -5
- package/dist/survey-editor-animations.css +0 -87
- package/dist/survey-editor-animations.css.d.ts +0 -2
- package/dist/survey-editor-defaults.css +0 -15
- package/dist/survey-editor-defaults.css.d.ts +0 -2
- package/dist/survey-ui.cjs.js +0 -199
- package/dist/survey-ui.cjs.js.map +0 -1
- package/dist/survey-ui.es.js +0 -57954
- package/dist/survey-ui.es.js.map +0 -1
- package/dist/vite.svg +0 -1
- /package/dist/src/{components/rich-text/rich-text-link-utils.d.ts → lib/rich-text-link-url.d.ts} +0 -0
package/dist/survey-ui.cjs.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(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},c=(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},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const u=require(`./default-item-cores-C6VK2LFe.js`);let d=require(`react`),f=l(d,1);d=l(d);let p=require(`react-dom`);p=l(p,1);let m=require(`react/jsx-runtime`);function h(e,t,n){let r=u.X(e,n?.in);return isNaN(t)?u.Z(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function g(e,t,n){let r=u.X(e,n?.in);if(isNaN(t))return u.Z(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=u.Z(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}function _(e,t,n){return h(e,t*7,n)}function v(e,t,n){return g(e,t*12,n)}function y(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=u.Z.bind(null,e));let t=u.X(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),u.Z(r,n||NaN)}function b(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=u.Z.bind(null,e));let t=u.X(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),u.Z(r,n||NaN)}function x(e,t){let n=u.X(e)-+u.X(t);return n<0?-1:n>0?1:n}function S(e){return u.Z(e,Date.now())}function C(e,t,n){let[r,i]=u.G(n?.in,e,t);return+u.W(r)==+u.W(i)}function w(e,t,n){let[r,i]=u.G(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function T(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function E(e,t){return u.X(e)-+u.X(t)}function D(e,t){let n=u.X(e,t?.in);return n.setHours(23,59,59,999),n}function O(e,t){let n=u.X(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function k(e,t){let n=u.X(e,t?.in);return+D(n,t)==+O(n,t)}function A(e,t,n){let[r,i,a]=u.G(n?.in,e,e,t),o=x(i,a),s=Math.abs(w(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=x(i,a)===-o;k(r)&&s===1&&x(r,a)===1&&(c=!1);let l=o*(s-+c);return l===0?0:l}function j(e,t,n){let r=E(e,t)/1e3;return T(n?.roundingMethod)(r)}function M(e,t){let[n,r]=u.G(e,t.start,t.end);return{start:n,end:r}}function N(e,t){let{start:n,end:r}=M(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(u.Z(n,o)),o.setMonth(o.getMonth()+s);return i?c.reverse():c}function ee(e,t){let n=u.X(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function P(e,t){let n=u.X(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function F(e,t){let{start:n,end:r}=M(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(u.Z(n,o)),o.setFullYear(o.getFullYear()+s);return i?c.reverse():c}function I(e,t){let n=u.Y(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=u.X(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function L(e,t){return I(e,{...t,weekStartsOn:1})}function te(e,t,n){let r=u.Y(),i=n?.locale??r.locale??u.I,a=x(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=u.G(n?.in,...a>0?[t,e]:[e,t]),l=j(c,s),d=(u.K(c)-u.K(s))/1e3,f=Math.round((l-d)/60),p;if(f<2)return n?.includeSeconds?l<5?i.formatDistance(`lessThanXSeconds`,5,o):l<10?i.formatDistance(`lessThanXSeconds`,10,o):l<20?i.formatDistance(`lessThanXSeconds`,20,o):l<40?i.formatDistance(`halfAMinute`,0,o):l<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):f===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,f,o);if(f<45)return i.formatDistance(`xMinutes`,f,o);if(f<90)return i.formatDistance(`aboutXHours`,1,o);if(f<1440){let e=Math.round(f/60);return i.formatDistance(`aboutXHours`,e,o)}else if(f<2520)return i.formatDistance(`xDays`,1,o);else if(f<43200){let e=Math.round(f/u.Q);return i.formatDistance(`xDays`,e,o)}else if(f<43200*2)return p=Math.round(f/u.$),i.formatDistance(`aboutXMonths`,p,o);if(p=A(c,s),p<12){let e=Math.round(f/u.$);return i.formatDistance(`xMonths`,e,o)}else{let e=p%12,t=Math.trunc(p/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function ne(e,t){return te(e,S(e),t)}function re(e,t){let n=u.X(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=u.Z(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function ie(e,t){return u.X(e,t?.in).getMonth()}function ae(e,t){return u.X(e,t?.in).getFullYear()}function oe(e,t){return+u.X(e)>+u.X(t)}function se(e,t){return+u.X(e)<+u.X(t)}function ce(e,t,n){let[r,i]=u.G(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function le(e,t,n){let[r,i]=u.G(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function ue(e,t,n){let r=u.X(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=u.Z(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=re(o);return r.setMonth(t,Math.min(a,s)),r}function de(e,t,n){let r=u.X(e,n?.in);return isNaN(+r)?u.Z(n?.in||e,NaN):(r.setFullYear(t),r)}var fe={lessThanXSeconds:{standalone:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`},withPreposition:{one:`weniger als 1 Sekunde`,other:`weniger als {{count}} Sekunden`}},xSeconds:{standalone:{one:`1 Sekunde`,other:`{{count}} Sekunden`},withPreposition:{one:`1 Sekunde`,other:`{{count}} Sekunden`}},halfAMinute:{standalone:`eine halbe Minute`,withPreposition:`einer halben Minute`},lessThanXMinutes:{standalone:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`},withPreposition:{one:`weniger als 1 Minute`,other:`weniger als {{count}} Minuten`}},xMinutes:{standalone:{one:`1 Minute`,other:`{{count}} Minuten`},withPreposition:{one:`1 Minute`,other:`{{count}} Minuten`}},aboutXHours:{standalone:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`},withPreposition:{one:`etwa 1 Stunde`,other:`etwa {{count}} Stunden`}},xHours:{standalone:{one:`1 Stunde`,other:`{{count}} Stunden`},withPreposition:{one:`1 Stunde`,other:`{{count}} Stunden`}},xDays:{standalone:{one:`1 Tag`,other:`{{count}} Tage`},withPreposition:{one:`1 Tag`,other:`{{count}} Tagen`}},aboutXWeeks:{standalone:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`},withPreposition:{one:`etwa 1 Woche`,other:`etwa {{count}} Wochen`}},xWeeks:{standalone:{one:`1 Woche`,other:`{{count}} Wochen`},withPreposition:{one:`1 Woche`,other:`{{count}} Wochen`}},aboutXMonths:{standalone:{one:`etwa 1 Monat`,other:`etwa {{count}} Monate`},withPreposition:{one:`etwa 1 Monat`,other:`etwa {{count}} Monaten`}},xMonths:{standalone:{one:`1 Monat`,other:`{{count}} Monate`},withPreposition:{one:`1 Monat`,other:`{{count}} Monaten`}},aboutXYears:{standalone:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahre`},withPreposition:{one:`etwa 1 Jahr`,other:`etwa {{count}} Jahren`}},xYears:{standalone:{one:`1 Jahr`,other:`{{count}} Jahre`},withPreposition:{one:`1 Jahr`,other:`{{count}} Jahren`}},overXYears:{standalone:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahre`},withPreposition:{one:`mehr als 1 Jahr`,other:`mehr als {{count}} Jahren`}},almostXYears:{standalone:{one:`fast 1 Jahr`,other:`fast {{count}} Jahre`},withPreposition:{one:`fast 1 Jahr`,other:`fast {{count}} Jahren`}}},pe=(e,t,n)=>{let r,i=n?.addSuffix?fe[e].withPreposition:fe[e].standalone;return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:`vor `+r:r},me={date:u.B({formats:{full:`EEEE, do MMMM y`,long:`do MMMM y`,medium:`do MMM y`,short:`dd.MM.y`},defaultWidth:`full`}),time:u.B({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:u.B({formats:{full:`{{date}} 'um' {{time}}`,long:`{{date}} 'um' {{time}}`,medium:`{{date}} {{time}}`,short:`{{date}} {{time}}`},defaultWidth:`full`})},he={lastWeek:`'letzten' eeee 'um' p`,yesterday:`'gestern um' p`,today:`'heute um' p`,tomorrow:`'morgen um' p`,nextWeek:`eeee 'um' p`,other:`P`},ge=(e,t,n,r)=>he[e],_e={narrow:[`v.Chr.`,`n.Chr.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`vor Christus`,`nach Christus`]},ve={narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1. Quartal`,`2. Quartal`,`3. Quartal`,`4. Quartal`]},ye={narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mär`,`Apr`,`Mai`,`Jun`,`Jul`,`Aug`,`Sep`,`Okt`,`Nov`,`Dez`],wide:[`Januar`,`Februar`,`März`,`April`,`Mai`,`Juni`,`Juli`,`August`,`September`,`Oktober`,`November`,`Dezember`]},be={narrow:ye.narrow,abbreviated:[`Jan.`,`Feb.`,`März`,`Apr.`,`Mai`,`Juni`,`Juli`,`Aug.`,`Sep.`,`Okt.`,`Nov.`,`Dez.`],wide:ye.wide},xe={code:`de`,formatDistance:pe,formatLong:me,formatRelative:ge,localize:{ordinalNumber:e=>Number(e)+`.`,era:u.z({values:_e,defaultWidth:`wide`}),quarter:u.z({values:ve,defaultWidth:`wide`,argumentCallback:e=>e-1}),month:u.z({values:ye,formattingValues:be,defaultWidth:`wide`}),day:u.z({values:{narrow:[`S`,`M`,`D`,`M`,`D`,`F`,`S`],short:[`So`,`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`],abbreviated:[`So.`,`Mo.`,`Di.`,`Mi.`,`Do.`,`Fr.`,`Sa.`],wide:[`Sonntag`,`Montag`,`Dienstag`,`Mittwoch`,`Donnerstag`,`Freitag`,`Samstag`]},defaultWidth:`wide`}),dayPeriod:u.z({values:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachm.`,evening:`Abend`,night:`Nacht`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`Morgen`,afternoon:`Nachmittag`,evening:`Abend`,night:`Nacht`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`vm.`,pm:`nm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachm.`,evening:`abends`,night:`nachts`},abbreviated:{am:`vorm.`,pm:`nachm.`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`},wide:{am:`vormittags`,pm:`nachmittags`,midnight:`Mitternacht`,noon:`Mittag`,morning:`morgens`,afternoon:`nachmittags`,evening:`abends`,night:`nachts`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:u.L({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:u.R({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:`any`}),quarter:u.R({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:u.R({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:u.R({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:u.R({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:`wide`,parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}},Se={lessThanXSeconds:{one:`minder dan een seconde`,other:`minder dan {{count}} seconden`},xSeconds:{one:`1 seconde`,other:`{{count}} seconden`},halfAMinute:`een halve minuut`,lessThanXMinutes:{one:`minder dan een minuut`,other:`minder dan {{count}} minuten`},xMinutes:{one:`een minuut`,other:`{{count}} minuten`},aboutXHours:{one:`ongeveer 1 uur`,other:`ongeveer {{count}} uur`},xHours:{one:`1 uur`,other:`{{count}} uur`},xDays:{one:`1 dag`,other:`{{count}} dagen`},aboutXWeeks:{one:`ongeveer 1 week`,other:`ongeveer {{count}} weken`},xWeeks:{one:`1 week`,other:`{{count}} weken`},aboutXMonths:{one:`ongeveer 1 maand`,other:`ongeveer {{count}} maanden`},xMonths:{one:`1 maand`,other:`{{count}} maanden`},aboutXYears:{one:`ongeveer 1 jaar`,other:`ongeveer {{count}} jaar`},xYears:{one:`1 jaar`,other:`{{count}} jaar`},overXYears:{one:`meer dan 1 jaar`,other:`meer dan {{count}} jaar`},almostXYears:{one:`bijna 1 jaar`,other:`bijna {{count}} jaar`}},Ce=(e,t,n)=>{let r,i=Se[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,String(t)),n?.addSuffix?n.comparison&&n.comparison>0?`over `+r:r+` geleden`:r},we={date:u.B({formats:{full:`EEEE d MMMM y`,long:`d MMMM y`,medium:`d MMM y`,short:`dd-MM-y`},defaultWidth:`full`}),time:u.B({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:u.B({formats:{full:`{{date}} 'om' {{time}}`,long:`{{date}} 'om' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Te={lastWeek:`'afgelopen' eeee 'om' p`,yesterday:`'gisteren om' p`,today:`'vandaag om' p`,tomorrow:`'morgen om' p`,nextWeek:`eeee 'om' p`,other:`P`},Ee={code:`nl`,formatDistance:Ce,formatLong:we,formatRelative:(e,t,n,r)=>Te[e],localize:{ordinalNumber:(e,t)=>Number(e)+`e`,era:u.z({values:{narrow:[`v.C.`,`n.C.`],abbreviated:[`v.Chr.`,`n.Chr.`],wide:[`voor Christus`,`na Christus`]},defaultWidth:`wide`}),quarter:u.z({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`K1`,`K2`,`K3`,`K4`],wide:[`1e kwartaal`,`2e kwartaal`,`3e kwartaal`,`4e kwartaal`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:u.z({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`jan.`,`feb.`,`mrt.`,`apr.`,`mei`,`jun.`,`jul.`,`aug.`,`sep.`,`okt.`,`nov.`,`dec.`],wide:[`januari`,`februari`,`maart`,`april`,`mei`,`juni`,`juli`,`augustus`,`september`,`oktober`,`november`,`december`]},defaultWidth:`wide`}),day:u.z({values:{narrow:[`Z`,`M`,`D`,`W`,`D`,`V`,`Z`],short:[`zo`,`ma`,`di`,`wo`,`do`,`vr`,`za`],abbreviated:[`zon`,`maa`,`din`,`woe`,`don`,`vri`,`zat`],wide:[`zondag`,`maandag`,`dinsdag`,`woensdag`,`donderdag`,`vrijdag`,`zaterdag`]},defaultWidth:`wide`}),dayPeriod:u.z({values:{narrow:{am:`AM`,pm:`PM`,midnight:`middernacht`,noon:`het middaguur`,morning:`'s ochtends`,afternoon:`'s middags`,evening:`'s avonds`,night:`'s nachts`},abbreviated:{am:`AM`,pm:`PM`,midnight:`middernacht`,noon:`het middaguur`,morning:`'s ochtends`,afternoon:`'s middags`,evening:`'s avonds`,night:`'s nachts`},wide:{am:`AM`,pm:`PM`,midnight:`middernacht`,noon:`het middaguur`,morning:`'s ochtends`,afternoon:`'s middags`,evening:`'s avonds`,night:`'s nachts`}},defaultWidth:`wide`})},match:{ordinalNumber:u.L({matchPattern:/^(\d+)e?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:u.R({matchPatterns:{narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?Chr\.?)/,wide:/^((voor|na) Christus)/},defaultMatchWidth:`wide`,parsePatterns:{any:[/^v/,/^n/]},defaultParseWidth:`any`}),quarter:u.R({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234]e kwartaal/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:u.R({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^jan/i,/^feb/i,/^m(r|a)/i,/^apr/i,/^mei/i,/^jun/i,/^jul/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i]},defaultParseWidth:`any`}),day:u.R({matchPatterns:{narrow:/^[zmdwv]/i,short:/^(zo|ma|di|wo|do|vr|za)/i,abbreviated:/^(zon|maa|din|woe|don|vri|zat)/i,wide:/^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^z/i,/^m/i,/^d/i,/^w/i,/^d/i,/^v/i,/^z/i],any:[/^zo/i,/^ma/i,/^di/i,/^wo/i,/^do/i,/^vr/i,/^za/i]},defaultParseWidth:`any`}),dayPeriod:u.R({matchPatterns:{any:/^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^am/i,pm:/^pm/i,midnight:/^middernacht/i,noon:/^het middaguur/i,morning:/ochtend/i,afternoon:/middag/i,evening:/avond/i,night:/nacht/i}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:4}};function De(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=De(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Oe(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=De(e))&&(r&&(r+=` `),r+=t);return r}var ke=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ae=Oe,je=(e,t)=>n=>{if(t?.variants==null)return Ae(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ke(t)||ke(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ae(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Me=Object.defineProperty,Ne=(e,t)=>Me(e,`name`,{value:t,configurable:!0});function Pe(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ne(Pe,`setRef`);function Fe(...e){return t=>{let n=!1,r=e.map(e=>{let r=Pe(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Pe(e[t],null)}}}}Ne(Fe,`composeRefs`);function Ie(...e){return f.useCallback(Fe(...e),e)}Ne(Ie,`useComposedRefs`);var Le=Object.defineProperty,Re=(e,t)=>Le(e,`name`,{value:t,configurable:!0}),ze=Re(((e,t)=>{let n={...t};for(let r in t){let i=e[r],a=t[r];if(/^on[A-Z]/.test(r))if(i&&a){let e=typeof i==`function`,t=typeof a==`function`;n[r]=(...n)=>{let r=t?a(...n):void 0;return e&&i(...n),r}}else i&&(n[r]=i);else r===`style`?n[r]={...typeof i==`object`?i:null,...typeof a==`object`?a:null}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Be(a,i))}return{...e,...n}}),`mergeProps`);function Be(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Re(Be,`concatAriaDescribedby`);var Ve=f.createContext(ze);Ve.displayName=`SlotContext`;function He(e){let t=f.forwardRef((t,n)=>{let r=f.useContext(Ve),{children:i,mergeProps:a=r,...o}=t,s=null,c=!1,l=[];Ye(i)&&typeof Ze==`function`&&(i=Ze(i._payload)),f.Children.forEach(i,e=>{if(qe(e)){c=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ye(n)&&typeof Ze==`function`&&(n=Ze(n._payload)),s=eee(t,n),l.push(s?.props?.children)}else l.push(e)}),s?s=f.cloneElement(s,void 0,l):!c&&f.Children.count(i)===1&&f.isValidElement(i)&&(s=i);let u=s?Ke(s):void 0,d=Ie(n,u);if(!s){if(i||i===0)throw Error(c?nee(e):tee(e));return i}let p=a(o,s.props??{});return s.type!==f.Fragment&&(p.ref=n?d:u),f.cloneElement(s,p)});return t.displayName=`${e}.Slot`,t}Re(He,`createSlot`);var Ue=He(`Slot`),We=Symbol.for(`radix.slottable`);function Ge(e){let t=Re(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=We,t}Re(Ge,`createSlottable`);var eee=Re((e,t)=>{if(`child`in e.props){let t=e.props.child;return f.isValidElement(t)?f.cloneElement(t,void 0,e.props.children(t.props.children)):null}return f.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Ke(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Re(Ke,`getElementRef`);function qe(e){return f.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===We}Re(qe,`isSlottable`);var Je=Symbol.for(`react.lazy`);function Ye(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Je&&`_payload`in e&&Xe(e._payload)}Re(Ye,`isLazyComponent`);function Xe(e){return typeof e==`object`&&!!e&&`then`in e}Re(Xe,`isPromiseLike`);var tee=Re(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),nee=Re(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ze=f.use,ree=Object.defineProperty,iee=(e,t)=>ree(e,`name`,{value:t,configurable:!0}),Qe=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=He(`Primitive.${t}`),r=f.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,m.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function $e(e,t){e&&p.flushSync(()=>e.dispatchEvent(t))}iee($e,`dispatchDiscreteCustomEvent`);var et=Object.defineProperty,tt=(e,t)=>et(e,`name`,{value:t,configurable:!0}),nt=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),rt=f.forwardRef(tt(function(e,t){return(0,m.jsx)(Qe.span,{...e,ref:t,style:{...nt,...e.style}})},`VisuallyHidden`)),it=Object.defineProperty,at=(e,t)=>it(e,`name`,{value:t,configurable:!0});function ot(e,t){let n=f.createContext(t);n.displayName=e+`Context`;let r=at(e=>{let{children:t,...r}=e,i=f.useMemo(()=>r,Object.values(r));return(0,m.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=f.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return at(i,`useContext`),[r,i]}at(ot,`createContext`);function st(e,t=[]){let n=[];function r(t,r){let i=f.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=at(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=f.useMemo(()=>o,Object.values(o));return(0,m.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=f.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return at(s,`useContext`),[o,s]}at(r,`createContext`);let i=at(()=>{let t=n.map(e=>f.createContext(e));return at(function(n){let r=n?.[e]||t;return f.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ct(i,...t)]}at(st,`createContextScope`);function ct(...e){let t=e[0];if(e.length===1)return t;let n=at(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return at(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}at(ct,`composeContextScopes`);var lt=Object.defineProperty,ut=(e,t)=>lt(e,`name`,{value:t,configurable:!0});function dt(e){let t=e+`CollectionProvider`,[n,r]=st(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=ut(e=>{let{scope:t,children:n}=e,r=f.useRef(null),a=f.useRef(new Map).current;return(0,m.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=He(s),l=f.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,m.jsx)(c,{ref:Ie(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,p=He(u),h=f.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=f.useRef(null),s=Ie(t,o),c=a(u,n);return f.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,m.jsx)(p,{[d]:``,ref:s,children:r})});h.displayName=u;function g(t){let n=a(e+`CollectionConsumer`,t);return f.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return ut(g,`useCollection`),[{Provider:o,Slot:l,ItemSlot:h},g,r]}ut(dt,`createCollection`);var ft=new WeakMap,pt=class e extends Map{static{ut(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ft.set(this,!0)}set(e,t){return ft.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=gt(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t===void 0?!1:this.delete(t)}at(e){let t=mt(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=mt(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return mt(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function mt(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=ht(e,t);return n===-1?void 0:e[n]}ut(mt,`at`);function ht(e,t){let n=e.length,r=gt(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ut(ht,`toSafeIndex`);function gt(e){return e!==e||e===0?0:Math.trunc(e)}ut(gt,`toSafeInteger`);function _t(e){let t=e+`CollectionProvider`,[n,r]=st(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new pt,setItemMap:ut(()=>void 0,`setItemMap`)}),o=ut(({state:e,...t})=>e?(0,m.jsx)(c,{...t,state:e}):(0,m.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=ut(e=>{let t=_();return(0,m.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=ut(e=>{let{scope:t,children:n,state:r}=e,a=f.useRef(null),[o,s]=f.useState(null),c=Ie(a,s),[l,u]=r;return f.useEffect(()=>{if(!o)return;let e=xt(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,m.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=He(l),d=f.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,m.jsx)(u,{ref:Ie(t,a(l,n).collectionRef),children:r})});d.displayName=l;let p=e+`CollectionItemSlot`,h=He(p),g=f.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=f.useRef(null),[s,c]=f.useState(null),l=Ie(t,o,c),{setItemMap:u}=a(p,n),d=f.useRef(i);vt(d.current,i)||(d.current=i);let g=d.current;return f.useEffect(()=>{let e=g;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(bt):(t.set(s,{...e,element:s}),t.toSorted(bt)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new pt(e)))}},[s,g,u]),(0,m.jsx)(h,{"data-radix-collection-item":``,ref:l,children:r})});g.displayName=p;function _(){return f.useState(new pt)}ut(_,`useInitCollection`);function v(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return ut(v,`useCollection`),[{Provider:o,Slot:d,ItemSlot:g},{createCollectionScope:r,useCollection:v,useInitCollection:_}]}ut(_t,`createCollection`);function vt(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ut(vt,`shallowEqual`);function yt(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ut(yt,`isElementPreceding`);function bt(e,t){return!e[1].element||!t[1].element?0:yt(e[1].element,t[1].element)?-1:1}ut(bt,`sortByDocumentPosition`);function xt(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ut(xt,`getChildListObserver`);var St=Object.defineProperty,Ct=(e,t)=>St(e,`name`,{value:t,configurable:!0}),wt=!!(typeof window<`u`&&window.document&&window.document.createElement);function R(e,t,{checkForDefaultPrevented:n=!0}={}){return Ct(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Ct(R,`composeEventHandlers`);function Tt(e){if(!wt)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Ct(Tt,`getOwnerWindow`);function Et(e){if(!wt)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Ct(Et,`getOwnerDocument`);function Dt(e,t=!1){let{activeElement:n}=Et(e);if(!n?.nodeName)return null;if(Ot(n)&&n.contentDocument)return Dt(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Et(n).getElementById(e);if(t)return t}}return n}Ct(Dt,`getActiveElement`);function Ot(e){return e.tagName===`IFRAME`}Ct(Ot,`isFrame`);var kt=globalThis?.document?f.useLayoutEffect:()=>{},aee=Object.defineProperty,At=(e,t)=>aee(e,`name`,{value:t,configurable:!0}),jt=f.useEffectEvent,Mt=f.useInsertionEffect;function Nt(e){if(typeof jt==`function`)return jt(e);let t=f.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Mt==`function`?Mt(()=>{t.current=e}):kt(()=>{t.current=e}),f.useMemo(()=>((...e)=>t.current?.(...e)),[])}At(Nt,`useEffectEvent`);var Pt=Object.defineProperty,Ft=(e,t)=>Pt(e,`name`,{value:t,configurable:!0}),It=f.useInsertionEffect||kt;function Lt({prop:e,defaultProp:t,onChange:n=Ft(()=>{},`onChange`),caller:r}){let[i,a,o]=Rt({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,f.useCallback(t=>{if(s){let n=zt(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Ft(Lt,`useControllableState`);function Rt({defaultProp:e,onChange:t}){let[n,r]=f.useState(e),i=f.useRef(n),a=f.useRef(t);return It(()=>{a.current=t},[t]),f.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Ft(Rt,`useUncontrolledState`);function zt(e){return typeof e==`function`}Ft(zt,`isFunction`);var Bt=Symbol(`RADIX:SYNC_STATE`);function oee(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Nt(o),u=[{...n,state:a}];r&&u.push(r);let[d,p]=f.useReducer((t,n)=>{if(n.type===Bt)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),m=d.state,h=f.useRef(m);f.useEffect(()=>{h.current!==m&&(h.current=m,c||l(m))},[m,h,c]);let g=f.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return f.useEffect(()=>{c&&!Object.is(i,d.state)&&p({type:Bt,state:i})},[i,d.state,c]),[g,p]}Ft(oee,`useControllableStateReducer`);var see=Object.defineProperty,Vt=(e,t)=>see(e,`name`,{value:t,configurable:!0});function Ht(e,t){return f.useReducer((e,n)=>t[e][n]??e,e)}Vt(Ht,`useStateMachine`);var Ut=Vt(e=>{let{present:t,children:n}=e,r=Wt(t),i=typeof n==`function`?n({present:r.isPresent}):f.Children.only(n),a=Kt(r.ref,Jt(i));return typeof n==`function`||r.isPresent?f.cloneElement(i,{ref:a}):null},`Presence`);function Wt(e){let[t,n]=f.useState(),r=f.useRef(null),i=f.useRef(e),a=f.useRef(`none`),o=f.useRef(void 0),[s,c]=Ht(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return f.useEffect(()=>{s===`mounted`?(a.current=o.current??qt(r.current),o.current=void 0):a.current=`none`},[s]),kt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=qt(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),kt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Vt(a=>{let o=qt(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Vt(e=>{e.target===t&&(a.current=qt(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:f.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=qt(t)}else r.current=null;n(e)},[])}}Vt(Wt,`usePresence`);function Gt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Vt(Gt,`setRef`);function Kt(...e){let t=f.useRef(e);return t.current=e,f.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Gt(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Gt(n[e],null)}}},[])}Vt(Kt,`useStableComposedRefs`);function qt(e){return e?.animationName||`none`}Vt(qt,`getAnimationName`);function Jt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Vt(Jt,`getElementRef`);var Yt=Object.defineProperty,Xt=(e,t)=>Yt(e,`name`,{value:t,configurable:!0}),Zt=f.useId||(()=>void 0),Qt=0;function $t(e){let[t,n]=f.useState(Zt());return kt(()=>{e||n(e=>e??String(Qt++))},[e]),e||(t?`radix-${t}`:``)}Xt($t,`useId`);var en=Object.defineProperty,tn=(e,t)=>en(e,`name`,{value:t,configurable:!0}),nn=`Collapsible`,[rn,cee]=st(nn),[an,on]=rn(nn),sn=f.forwardRef(tn(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Lt({prop:r,defaultProp:i??!1,onChange:o,caller:nn});return(0,m.jsx)(an,{scope:n,disabled:a,contentId:$t(),open:c,onOpenToggle:f.useCallback(()=>l(e=>!e),[l]),children:(0,m.jsx)(Qe.div,{"data-state":pn(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),cn=`CollapsibleTrigger`,ln=f.forwardRef(tn(function(e,t){let{__scopeCollapsible:n,...r}=e,i=on(cn,n);return(0,m.jsx)(Qe.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":pn(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:R(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),un=`CollapsibleContent`,dn=f.forwardRef(tn(function(e,t){let{forceMount:n,...r}=e,i=on(un,e.__scopeCollapsible);return(0,m.jsx)(Ut,{present:n||i.open,children:({present:e})=>(0,m.jsx)(fn,{...r,ref:t,present:e})})},`CollapsibleContent`)),fn=f.forwardRef(tn(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=on(un,n),[s,c]=f.useState(r),l=f.useRef(null),u=Ie(t,l),d=f.useRef(0),p=d.current,h=f.useRef(0),g=h.current,_=o.open||s,v=f.useRef(_),y=f.useRef(void 0);return f.useEffect(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),kt(()=>{let e=l.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),c(r)}},[o.open,r]),(0,m.jsx)(Qe.div,{"data-state":pn(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!_,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:_&&i})},`CollapsibleContentImpl`));function pn(e){return e?`open`:`closed`}tn(pn,`getState`);var mn=Object.defineProperty,hn=(e,t)=>mn(e,`name`,{value:t,configurable:!0}),gn=f.createContext(void 0);function _n(e){let t=f.useContext(gn);return e||t||`ltr`}hn(_n,`useDirection`);var vn=Object.defineProperty,yn=(e,t)=>vn(e,`name`,{value:t,configurable:!0});function bn(e){let t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>((...e)=>t.current?.(...e)),[])}yn(bn,`useCallbackRef`);var xn=Object.defineProperty,Sn=(e,t)=>xn(e,`name`,{value:t,configurable:!0}),Cn=`dismissableLayer.update`,lee=`dismissableLayer.pointerDownOutside`,uee=`dismissableLayer.focusOutside`,wn,Tn=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),En=f.forwardRef(Sn(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=f.useContext(Tn),[d,p]=f.useState(null),h=d?.ownerDocument??globalThis?.document,[,g]=f.useState({}),_=Ie(t,p),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y?v.indexOf(y):-1,x=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=f.useRef(!1),T=On(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:h,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:f.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return C&&!t},[u.branches,C])}),E=kn(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},h),D=d?x===v.length-1:!1,O=bn(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return f.useEffect(()=>{if(D)return h.addEventListener(`keydown`,O,{capture:!0}),()=>h.removeEventListener(`keydown`,O,{capture:!0})},[h,D,O]),f.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wn=h.body.style.pointerEvents,h.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),An(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=wn))}},[d,h,n,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),An())},[d,u]),f.useEffect(()=>{let e=Sn(()=>g({}),`handleUpdate`);return document.addEventListener(Cn,e),()=>document.removeEventListener(Cn,e)},[]),(0,m.jsx)(Qe.div,{...l,ref:_,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:R(e.onFocusCapture,E.onFocusCapture),onBlurCapture:R(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`));function Dn(){let e=f.useContext(Tn),[t,n]=f.useState(null);return f.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Sn(Dn,`useDismissableLayerSurface`);var dee=Sn(()=>!0,`IS_TRUE`);function On(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=dee}=t,s=bn(e),c=f.useRef(!1),l=f.useRef(!1),u=f.useRef(new Map),d=f.useRef(()=>{});return f.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Sn(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Sn(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Sn(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Sn(p,`handleInteractionBubble`);let m=Sn(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||jn(lee,s,p,{discrete:!0})};if(Sn(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Sn(()=>c.current=!0,`onPointerDownCapture`)}}Sn(On,`usePointerDownOutside`);function kn(e,t=globalThis?.document){let n=bn(e),r=f.useRef(!1);return f.useEffect(()=>{let e=Sn(e=>{e.target&&!r.current&&jn(uee,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Sn(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Sn(()=>r.current=!1,`onBlurCapture`)}}Sn(kn,`useFocusOutside`);function An(){let e=new CustomEvent(Cn);document.dispatchEvent(e)}Sn(An,`dispatchUpdate`);function jn(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?$e(i,a):i.dispatchEvent(a)}Sn(jn,`handleAndDispatchCustomEvent`);var fee=Object.defineProperty,Mn=(e,t)=>fee(e,`name`,{value:t,configurable:!0}),Nn=`focusScope.autoFocusOnMount`,Pn=`focusScope.autoFocusOnUnmount`,Fn={bubbles:!1,cancelable:!0},In=f.forwardRef(Mn(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=f.useState(null),l=bn(i),u=bn(a),d=f.useRef(null),p=Ie(t,c),h=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let e=function(e){if(h.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Un(d.current,{select:!0})},t=function(e){if(h.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Un(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Un(s)};Mn(e,`handleFocusIn`),Mn(t,`handleFocusOut`),Mn(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,h.paused]),f.useEffect(()=>{if(s){Wn.add(h);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Nn,Fn);s.addEventListener(Nn,l),s.dispatchEvent(t),t.defaultPrevented||(Ln(qn(zn(s)),{select:!0}),document.activeElement===e&&Un(s))}return()=>{s.removeEventListener(Nn,l),setTimeout(()=>{let t=new CustomEvent(Pn,Fn);s.addEventListener(Pn,u),s.dispatchEvent(t),t.defaultPrevented||Un(e??document.body,{select:!0}),s.removeEventListener(Pn,u),Wn.remove(h)},0)}}},[s,l,u,h]);let g=f.useCallback(e=>{if(!n&&!r||h.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Rn(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Un(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Un(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,h.paused]);return(0,m.jsx)(Qe.div,{tabIndex:-1,...o,ref:p,onKeyDown:g})},`FocusScope`));function Ln(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Un(r,{select:t}),document.activeElement!==n)return}Mn(Ln,`focusFirst`);function Rn(e){let t=zn(e);return[Bn(t,e),Bn(t.reverse(),e)]}Mn(Rn,`getTabbableEdges`);function zn(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Mn(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Mn(zn,`getTabbableCandidates`);function Bn(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Vn(r,{upTo:t})))return r}Mn(Bn,`findVisible`);function Vn(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Mn(Vn,`isHidden`);function Hn(e){return e instanceof HTMLInputElement&&`select`in e}Mn(Hn,`isSelectableInput`);function Un(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Hn(e)&&t&&e.select()}}Mn(Un,`focus`);var Wn=Gn();function Gn(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Kn(e,t),e.unshift(t)},remove(t){e=Kn(e,t),e[0]?.resume()}}}Mn(Gn,`createFocusScopesStack`);function Kn(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Mn(Kn,`arrayRemove`);function qn(e){return e.filter(e=>e.tagName!==`A`)}Mn(qn,`removeLinks`);var Jn=Object.defineProperty,Yn=f.forwardRef(((e,t)=>Jn(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=f.useState(!1);kt(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?p.createPortal((0,m.jsx)(Qe.div,{...r,ref:t}),o):null},`Portal`)),Xn=Object.defineProperty,Zn=(e,t)=>Xn(e,`name`,{value:t,configurable:!0}),Qn=0,$n=null;function er(e){return tr(),e.children}Zn(er,`FocusGuards`);function tr(){f.useEffect(()=>{$n||={start:nr(),end:nr()};let{start:e,end:t}=$n;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Qn++,()=>{Qn===1&&($n?.start.remove(),$n?.end.remove(),$n=null),Qn=Math.max(0,Qn-1)}},[])}Zn(tr,`useFocusGuards`);function nr(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Zn(nr,`createFocusGuard`);var rr=function(){return rr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rr.apply(this,arguments)};function ir(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ar(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function pee(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var or=`right-scroll-bar-position`,sr=`width-before-scroll-bar`,mee=`with-scroll-bars-hidden`,hee=`--removed-body-scroll-bar-size`;function cr(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function gee(e,t){var n=(0,d.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var _ee=typeof window<`u`?d.useLayoutEffect:d.useEffect,lr=new WeakMap;function ur(e,t){var n=gee(t||null,function(t){return e.forEach(function(e){return cr(e,t)})});return _ee(function(){var t=lr.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||cr(e,null)}),i.forEach(function(e){r.has(e)||cr(e,a)})}lr.set(n,e)},[e]),n}function dr(e){return e}function fr(e,t){t===void 0&&(t=dr);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function pr(e){e===void 0&&(e={});var t=fr(null);return t.options=rr({async:!0,ssr:!1},e),t}var mr=function(e){var t=e.sideCar,n=ir(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return d.createElement(r,rr({},n))};mr.isSideCarExport=!0;function hr(e,t){return e.useMedium(t),mr}var gr=pr(),_r=function(){},vr=d.forwardRef(function(e,t){var n=d.useRef(null),r=d.useState({onScrollCapture:_r,onWheelCapture:_r,onTouchMoveCapture:_r}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=ir(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ur([n,t]),w=rr(rr({},x),i);return d.createElement(d.Fragment,null,u&&d.createElement(S,{sideCar:gr,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?d.cloneElement(d.Children.only(s),rr(rr({},w),{ref:C})):d.createElement(y,rr({},w,{className:c,ref:C}),s))});vr.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vr.classNames={fullWidth:sr,zeroRight:or};var yr,br=function(){if(yr)return yr;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function xr(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=br();return t&&e.setAttribute(`nonce`,t),e}function Sr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Cr(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var wr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xr())&&(Sr(t,n),Cr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Tr=function(){var e=wr();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Er=function(){var e=Tr();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Dr={left:0,top:0,right:0,gap:0},Or=function(e){return parseInt(e||``,10)||0},kr=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Or(n),Or(r),Or(i)]},Ar=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Dr;var t=kr(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},jr=Er(),Mr=`data-scroll-locked`,Nr=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
-
.${mee} {
|
|
3
|
-
overflow: hidden ${r};
|
|
4
|
-
padding-right: ${s}px ${r};
|
|
5
|
-
}
|
|
6
|
-
body[${Mr}] {
|
|
7
|
-
overflow: hidden ${r};
|
|
8
|
-
overscroll-behavior: contain;
|
|
9
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
-
padding-left: ${i}px;
|
|
11
|
-
padding-top: ${a}px;
|
|
12
|
-
padding-right: ${o}px;
|
|
13
|
-
margin-left:0;
|
|
14
|
-
margin-top:0;
|
|
15
|
-
margin-right: ${s}px ${r};
|
|
16
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.${or} {
|
|
20
|
-
right: ${s}px ${r};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${sr} {
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${or} .${or} {
|
|
28
|
-
right: 0 ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${sr} .${sr} {
|
|
32
|
-
margin-right: 0 ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[${Mr}] {
|
|
36
|
-
${hee}: ${s}px;
|
|
37
|
-
}
|
|
38
|
-
`},Pr=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Fr=function(){d.useEffect(function(){return document.body.setAttribute(Mr,(Pr()+1).toString()),function(){var e=Pr()-1;e<=0?document.body.removeAttribute(Mr):document.body.setAttribute(Mr,e.toString())}},[])},Ir=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Fr();var a=d.useMemo(function(){return Ar(i)},[i]);return d.createElement(jr,{styles:Nr(a,!t,i,n?``:`!important`)})},Lr=!1;if(typeof window<`u`)try{var Rr=Object.defineProperty({},`passive`,{get:function(){return Lr=!0,!0}});window.addEventListener(`test`,Rr,Rr),window.removeEventListener(`test`,Rr,Rr)}catch{Lr=!1}var zr=Lr?{passive:!1}:!1,Br=function(e){return e.tagName===`TEXTAREA`},Vr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Br(e)&&n[t]===`visible`)},Hr=function(e){return Vr(e,`overflowY`)},Ur=function(e){return Vr(e,`overflowX`)},Wr=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),qr(e,r)){var i=Jr(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Gr=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Kr=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},qr=function(e,t){return e===`v`?Hr(t):Ur(t)},Jr=function(e,t){return e===`v`?Gr(t):Kr(t)},Yr=function(e,t){return e===`h`&&t===`rtl`?-1:1},Xr=function(e,t,n,r,i){var a=Yr(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Jr(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&qr(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Zr=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qr=function(e){return[e.deltaX,e.deltaY]},$r=function(e){return e&&`current`in e?e.current:e},vee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yee=function(e){return`
|
|
39
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},bee=0,ei=[];function xee(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),i=d.useState(bee++)[0],a=d.useState(Er)[0],o=d.useRef(e);d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=pee([e.lockRef.current],(e.shards||[]).map($r),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=d.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Zr(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Wr(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Wr(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Xr(h,t,e,h===`h`?s:c,!0)},[]),c=d.useCallback(function(e){var n=e;if(!(!ei.length||ei[ei.length-1]!==a)){var r=`deltaY`in n?Qr(n):Zr(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&vee(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map($r).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=d.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:See(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=d.useCallback(function(e){n.current=Zr(e),r.current=void 0},[]),f=d.useCallback(function(t){l(t.type,Qr(t),t.target,s(t,e.lockRef.current))},[]),p=d.useCallback(function(t){l(t.type,Zr(t),t.target,s(t,e.lockRef.current))},[]);d.useEffect(function(){return ei.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,zr),document.addEventListener(`touchmove`,c,zr),document.addEventListener(`touchstart`,u,zr),function(){ei=ei.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,zr),document.removeEventListener(`touchmove`,c,zr),document.removeEventListener(`touchstart`,u,zr)}},[]);var m=e.removeScrollBar,h=e.inert;return d.createElement(d.Fragment,null,h?d.createElement(a,{styles:yee(i)}):null,m?d.createElement(Ir,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function See(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Cee=hr(gr,xee),ti=d.forwardRef(function(e,t){return d.createElement(vr,rr({},e,{ref:t,sideCar:Cee}))});ti.classNames=vr.classNames;var wee=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ni=new WeakMap,ri=new WeakMap,ii={},ai=0,oi=function(e){return e&&(e.host||oi(e.parentNode))},Tee=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=oi(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Eee=function(e,t,n,r){var i=Tee(t,Array.isArray(e)?e:[e]);ii[n]||(ii[n]=new WeakMap);var a=ii[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(ni.get(e)||0)+1,l=(a.get(e)||0)+1;ni.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ri.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ai++,function(){o.forEach(function(e){var t=ni.get(e)-1,i=a.get(e)-1;ni.set(e,t),a.set(e,i),t||(ri.has(e)||e.removeAttribute(r),ri.delete(e)),i||e.removeAttribute(n)}),ai--,ai||(ni=new WeakMap,ni=new WeakMap,ri=new WeakMap,ii={})}},si=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||wee(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Eee(r,i,n,`aria-hidden`)):function(){return null}},Dee=Object.defineProperty,ci=(e,t)=>Dee(e,`name`,{value:t,configurable:!0}),li=`Dialog`,[ui,di]=st(li),[Oee,fi]=ui(li),pi=ci(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=f.useRef(null),c=f.useRef(null),[l,u]=Lt({prop:r,defaultProp:i??!1,onChange:a,caller:li}),[d,p]=f.useState(0),[h,g]=f.useState(0);return(0,m.jsx)(Oee,{scope:t,triggerRef:s,contentRef:c,contentId:$t(),titleId:$t(),descriptionId:$t(),titlePresent:d>0,descriptionPresent:h>0,setTitleCount:p,setDescriptionCount:g,open:l,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),kee=`DialogTrigger`,mi=f.forwardRef(ci(function(e,t){let{__scopeDialog:n,...r}=e,i=fi(kee,n),a=Ie(t,i.triggerRef);return(0,m.jsx)(Qe.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Ni(i.open),...r,ref:a,onClick:R(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),hi=`DialogPortal`,[gi,_i]=ui(hi,{forceMount:void 0}),vi=ci(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=fi(hi,t);return(0,m.jsx)(gi,{scope:t,forceMount:n,children:f.Children.map(r,e=>(0,m.jsx)(Ut,{present:n||a.open,children:(0,m.jsx)(Yn,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),yi=`DialogOverlay`,bi=f.forwardRef(ci(function(e,t){let n=_i(yi,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fi(yi,e.__scopeDialog);return a.modal?(0,m.jsx)(Ut,{present:r||a.open,children:(0,m.jsx)(Si,{...i,ref:t})}):null},`DialogOverlay`)),xi=He(`DialogOverlay.RemoveScroll`),Si=f.forwardRef(ci(function(e,t){let{__scopeDialog:n,...r}=e,i=fi(yi,n),a=Ie(t,Dn());return(0,m.jsx)(ti,{as:xi,allowPinchZoom:!0,shards:[i.contentRef],children:(0,m.jsx)(Qe.div,{"data-state":Ni(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Ci=`DialogContent`,wi=f.forwardRef(ci(function(e,t){let n=_i(Ci,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fi(Ci,e.__scopeDialog);return(0,m.jsx)(Ut,{present:r||a.open,children:a.modal?(0,m.jsx)(Ti,{...i,ref:t}):(0,m.jsx)(Ei,{...i,ref:t})})},`DialogContent`)),Ti=f.forwardRef(ci(function(e,t){let n=fi(Ci,e.__scopeDialog),r=f.useRef(null),i=Ie(t,n.contentRef,r);return f.useEffect(()=>{let e=r.current;if(e)return si(e)},[]),(0,m.jsx)(Di,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:R(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:R(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ei=f.forwardRef(ci(function(e,t){let n=fi(Ci,e.__scopeDialog),r=f.useRef(!1),i=f.useRef(!1);return(0,m.jsx)(Di,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Di=f.forwardRef(ci(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,...s}=e,c=fi(Ci,n);return tr(),(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(In,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,m.jsx)(En,{role:`dialog`,id:c.contentId,"aria-labelledby":c.titlePresent?c.titleId:void 0,"aria-describedby":c.descriptionPresent?Mi(o,c.descriptionId):o,"data-state":Ni(c.open),...s,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},`DialogContentImpl`)),Oi=f.forwardRef(ci(function(e,t){let{__scopeDialog:n,...r}=e,i=fi(`DialogTitle`,n),{setTitleCount:a}=i;return kt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,m.jsx)(Qe.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),ki=f.forwardRef(ci(function(e,t){let{__scopeDialog:n,...r}=e,i=fi(`DialogDescription`,n),{setDescriptionCount:a}=i;return kt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,m.jsx)(Qe.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Ai=`DialogClose`,ji=f.forwardRef(ci(function(e,t){let{__scopeDialog:n,...r}=e,i=fi(Ai,n);return(0,m.jsx)(Qe.button,{type:`button`,...r,ref:t,onClick:R(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Mi(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}ci(Mi,`concatAriaDescribedby`);function Ni(e){return e?`open`:`closed`}ci(Ni,`getState`);var Pi=Object.defineProperty,Fi=(e,t)=>Pi(e,`name`,{value:t,configurable:!0}),[Ii,Aee]=st(`AlertDialog`,[di]),Li=di(),Ri=Fi(e=>{let{__scopeAlertDialog:t,...n}=e,r=Li(t);return(0,m.jsx)(pi,{...r,...n,modal:!0})},`AlertDialog`);f.forwardRef(Fi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Li(n);return(0,m.jsx)(mi,{...i,...r,ref:t})},`AlertDialogTrigger`));var zi=Fi(e=>{let{__scopeAlertDialog:t,...n}=e,r=Li(t);return(0,m.jsx)(vi,{...r,...n})},`AlertDialogPortal`),Bi=f.forwardRef(Fi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Li(n);return(0,m.jsx)(bi,{...i,...r,ref:t})},`AlertDialogOverlay`)),[Vi,Hi]=Ii(`AlertDialogContent`),Ui=f.forwardRef(Fi(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=Li(n),o=Ie(t,f.useRef(null)),s=f.useRef(null);return(0,m.jsx)(Vi,{scope:n,cancelRef:s,children:(0,m.jsx)(wi,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:R(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Wi=f.forwardRef(Fi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Li(n);return(0,m.jsx)(Oi,{...i,...r,ref:t})},`AlertDialogTitle`)),Gi=f.forwardRef(Fi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Li(n);return(0,m.jsx)(ki,{...i,...r,ref:t})},`AlertDialogDescription`)),Ki=f.forwardRef(Fi(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Li(n);return(0,m.jsx)(ji,{...i,...r,ref:t})},`AlertDialogAction`)),qi=`AlertDialogCancel`,Ji=f.forwardRef(Fi(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Hi(qi,n),a=Li(n),o=Ie(t,i);return(0,m.jsx)(ji,{...a,...r,ref:o})},`AlertDialogCancel`)),Yi=Object.defineProperty,Xi=(e,t)=>Yi(e,`name`,{value:t,configurable:!0});function Zi(e){let[t,n]=f.useState(void 0);return kt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}Xi(Zi,`useSize`);var Qi=Object.defineProperty,$i=(e,t)=>Qi(e,`name`,{value:t,configurable:!0}),ea=`Checkbox`,[ta,jee]=st(ea),[na,ra]=ta(ea);function ia(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[p,h]=Lt({prop:n,defaultProp:i??!1,onChange:c,caller:ea}),[g,_]=f.useState(null),[v,y]=f.useState(null),b=f.useRef(!1),[x,S]=f.useReducer(e=>e+1,0),C=g?!!o||!!g.closest(`form`):!0,w={checked:p,disabled:a,setChecked:h,control:g,setControl:_,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:l,defaultChecked:pa(i)?!1:i,isFormControl:C,bubbleInput:v,setBubbleInput:y};return(0,m.jsx)(na,{scope:t,...w,children:fa(d)?d(w):r})}$i(ia,`CheckboxProvider`);var aa=`CheckboxTrigger`,oa=f.forwardRef($i(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:p,onUserInteraction:h,isFormControl:g,bubbleInput:_}=ra(aa,e),v=Ie(i,u),y=f.useRef(c);return f.useEffect(()=>{let e=a?.form;if(e){let t=$i(()=>d(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,m.jsx)(Qe.button,{type:`button`,role:`checkbox`,"aria-checked":pa(c)?`mixed`:c,"aria-required":l,"data-state":ma(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:v,onKeyDown:R(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:R(n,e=>{h(),d(e=>pa(e)?!0:!e),_&&g&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})},`CheckboxTrigger`)),sa=f.forwardRef($i(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,m.jsx)(ia,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(oa,{...d,ref:t,__scopeCheckbox:n}),e&&(0,m.jsx)(da,{__scopeCheckbox:n})]})})},`Checkbox`)),ca=`CheckboxIndicator`,la=f.forwardRef($i(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=ra(ca,n);return(0,m.jsx)(Ut,{present:r||pa(a.checked)||a.checked===!0,children:(0,m.jsx)(Qe.span,{"data-state":ma(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),ua=`CheckboxBubbleInput`,da=f.forwardRef($i(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:p,form:h,bubbleInput:g,setBubbleInput:_}=ra(ua,e),v=Ie(r,_),y=Zi(i),b=f.useRef(!1),x=f.useRef(s),S=f.useRef(o);f.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==S.current;S.current=o;let i=x.current!==s;x.current=s;let c=!(r&&a.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=pa(s),n.call(e,pa(s)?!1:s),e.dispatchEvent(t),b.current=!1}},[g,s,a,o]);let C=f.useRef(pa(s)?!1:s);return(0,m.jsx)(Qe.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??C.current,required:l,disabled:u,name:d,value:p,form:h,...n,tabIndex:-1,ref:v,onClick:R(t,e=>{b.current&&e.stopPropagation()}),style:{...n.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function fa(e){return typeof e==`function`}$i(fa,`isFunction`);function pa(e){return e===`indeterminate`}$i(pa,`isIndeterminate`);function ma(e){return pa(e)?`indeterminate`:e?`checked`:`unchecked`}$i(ma,`getState`);var ha=[`top`,`right`,`bottom`,`left`],ga=Math.min,_a=Math.max,va=Math.round,ya=Math.floor,ba=e=>({x:e,y:e}),xa={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Sa(e,t,n){return _a(e,ga(t,n))}function Ca(e,t){return typeof e==`function`?e(t):e}function wa(e){return e.split(`-`)[0]}function Ta(e){return e.split(`-`)[1]}function Ea(e){return e===`x`?`y`:`x`}function Da(e){return e===`y`?`height`:`width`}function Oa(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ka(e){return Ea(Oa(e))}function Aa(e,t,n){n===void 0&&(n=!1);let r=Ta(e),i=ka(e),a=Da(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=za(o)),[o,za(o)]}function ja(e){let t=za(e);return[Ma(e),t,Ma(t)]}function Ma(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Na=[`left`,`right`],Pa=[`right`,`left`],Fa=[`top`,`bottom`],Ia=[`bottom`,`top`];function La(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Pa:Na:t?Na:Pa;case`left`:case`right`:return t?Fa:Ia;default:return[]}}function Ra(e,t,n,r){let i=Ta(e),a=La(wa(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ma)))),a}function za(e){let t=wa(e);return xa[t]+e.slice(t.length)}function Ba(e){return{top:0,right:0,bottom:0,left:0,...e}}function Va(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ba(e)}function Ha(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}}function Ua(e,t,n){let{reference:r,floating:i}=e,a=Oa(t),o=ka(t),s=Da(o),c=wa(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(Ta(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 Wa(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}=Ca(t,e),p=Va(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ha(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=Ha(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}}var Ga=50,Ka=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Wa},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ua(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<Ga&&(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}=Ua(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},qa=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}=Ca(e,t)||{};if(l==null)return{};let d=Va(u),f={x:n,y:r},p=ka(i),m=Da(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=ga(d[_],T),D=ga(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Sa(O,A,k),M=!c.arrow&&Ta(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Ja=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}=Ca(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=wa(r),_=Oa(o),v=wa(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[za(o)]:ja(o)),x=p!==`none`;!d&&x&&b.push(...Ra(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=Aa(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`&&_!==Oa(t))||T.every(e=>Oa(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=Oa(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{}}}};function Ya(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xa(e){return ha.some(t=>e[t]>=0)}var Za=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ca(e,t);switch(i){case`referenceHidden`:{let e=Ya(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Xa(e)}}}case`escaped`:{let e=Ya(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Xa(e)}}}default:return{}}}}},Qa=new Set([`left`,`top`]);async function $a(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=wa(n),s=Ta(n),c=Oa(n)===`y`,l=Qa.has(o)?-1:1,u=a&&c?-1:1,d=Ca(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 eo=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 $a(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}}}}},to=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}=Ca(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Oa(wa(i)),p=Ea(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=Sa(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=Sa(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}}}}}},no=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}=Ca(e,t),u={x:n,y:r},d=Oa(i),f=Ea(d),p=u[f],m=u[d],h=Ca(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=Qa.has(wa(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}}}},ro=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}=Ca(e,t),u=await o.detectOverflow(t,l),d=wa(i),f=Ta(i),p=Oa(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=ga(h-u[g],v),x=ga(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=_a(u.left,0),t=_a(u.right,0),n=_a(u.top,0),r=_a(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:_a(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:_a(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 io(){return typeof window<`u`}function ao(e){return co(e)?(e.nodeName||``).toLowerCase():`#document`}function oo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function so(e){return((co(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function co(e){return io()?e instanceof Node||e instanceof oo(e).Node:!1}function lo(e){return io()?e instanceof Element||e instanceof oo(e).Element:!1}function uo(e){return io()?e instanceof HTMLElement||e instanceof oo(e).HTMLElement:!1}function fo(e){return!io()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof oo(e).ShadowRoot}function po(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=bo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Mee(e){return/^(table|td|th)$/.test(ao(e))}function mo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Nee=/transform|translate|scale|rotate|perspective|filter/,Pee=/paint|layout|strict|content/,ho=e=>!!e&&e!==`none`,go;function _o(e){let t=lo(e)?bo(e):e;return ho(t.transform)||ho(t.translate)||ho(t.scale)||ho(t.rotate)||ho(t.perspective)||!vo()&&(ho(t.backdropFilter)||ho(t.filter))||Nee.test(t.willChange||``)||Pee.test(t.contain||``)}function Fee(e){let t=So(e);for(;uo(t)&&!yo(t);){if(_o(t))return t;if(mo(t))return null;t=So(t)}return null}function vo(){return go??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),go}function yo(e){return/^(html|body|#document)$/.test(ao(e))}function bo(e){return oo(e).getComputedStyle(e)}function xo(e){return lo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function So(e){if(ao(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||fo(e)&&e.host||so(e);return fo(t)?t.host:t}function Co(e){let t=So(e);return yo(t)?e.ownerDocument?e.ownerDocument.body:e.body:uo(t)&&po(t)?t:Co(t)}function wo(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Co(e),i=r===e.ownerDocument?.body,a=oo(r);if(i){let e=To(a);return t.concat(a,a.visualViewport||[],po(r)?r:[],e&&n?wo(e):[])}else return t.concat(r,wo(r,[],n))}function To(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Eo(e){let t=bo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=uo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=va(n)!==a||va(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Do(e){return lo(e)?e:e.contextElement}function Oo(e){let t=Do(e);if(!uo(t))return ba(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Eo(t),o=(a?va(n.width):n.width)/r,s=(a?va(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Iee=ba(0);function ko(e){let t=oo(e);return!vo()||!t.visualViewport?Iee:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Lee(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==oo(e)?!1:t}function Ao(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Do(e),o=ba(1);t&&(r?lo(r)&&(o=Oo(r)):o=Oo(e));let s=Lee(a,n,r)?ko(a):ba(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=oo(a),t=r&&lo(r)?oo(r):r,n=e,i=To(n);for(;i&&r&&t!==n;){let e=Oo(i),t=i.getBoundingClientRect(),r=bo(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=oo(i),i=To(n)}}return Ha({width:u,height:d,x:c,y:l})}function jo(e,t){let n=xo(e).scrollLeft;return t?t.left+n:Ao(so(e)).left+n}function Mo(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-jo(e,n),y:n.top+t.scrollTop}}function Ree(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=so(r),s=t?mo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=ba(1),u=ba(0),d=uo(r);if((d||!d&&!a)&&((ao(r)!==`body`||po(o))&&(c=xo(r)),d)){let e=Ao(r);l=Oo(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Mo(o,c):ba(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 No(e){return Array.from(e.getClientRects())}function zee(e){let t=so(e),n=xo(e),r=e.ownerDocument.body,i=_a(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=_a(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+jo(e),s=-n.scrollTop;return bo(r).direction===`rtl`&&(o+=_a(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Po=25;function Bee(e,t){let n=oo(e),r=so(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=vo();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=jo(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<=Po&&(a-=o)}else l<=Po&&(a+=l);return{width:a,height:o,x:s,y:c}}function Fo(e,t){let n=Ao(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=uo(e)?Oo(e):ba(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Io(e,t,n){let r;if(t===`viewport`)r=Bee(e,n);else if(t===`document`)r=zee(so(e));else if(lo(t))r=Fo(t,n);else{let n=ko(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ha(r)}function Lo(e,t){let n=So(e);return n===t||!lo(n)||yo(n)?!1:bo(n).position===`fixed`||Lo(n,t)}function Ro(e,t){let n=t.get(e);if(n)return n;let r=wo(e,[],!1).filter(e=>lo(e)&&ao(e)!==`body`),i=null,a=bo(e).position===`fixed`,o=a?So(e):e;for(;lo(o)&&!yo(o);){let t=bo(o),n=_o(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||po(o)&&!n&&Lo(e,o))?r=r.filter(e=>e!==o):i=t,o=So(o)}return t.set(e,r),r}function zo(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?mo(t)?[]:Ro(t,this._c):[].concat(n),r],o=Io(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=Io(t,a[e],i);s=_a(n.top,s),c=ga(n.right,c),l=ga(n.bottom,l),u=_a(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Bo(e){let{width:t,height:n}=Eo(e);return{width:t,height:n}}function Vo(e,t,n){let r=uo(t),i=so(t),a=n===`fixed`,o=Ao(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=ba(0);function l(){c.x=jo(i)}if(r||!r&&!a)if((ao(t)!==`body`||po(i))&&(s=xo(t)),r){let e=Ao(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?Mo(i,s):ba(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 Ho(e){return bo(e).position===`static`}function Uo(e,t){if(!uo(e)||bo(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return so(e)===n&&(n=n.ownerDocument.body),n}function Wo(e,t){let n=oo(e);if(mo(e))return n;if(!uo(e)){let t=So(e);for(;t&&!yo(t);){if(lo(t)&&!Ho(t))return t;t=So(t)}return n}let r=Uo(e,t);for(;r&&Mee(r)&&Ho(r);)r=Uo(r,t);return r&&yo(r)&&Ho(r)&&!_o(r)?n:r||Fee(e)||n}var Vee=async function(e){let t=this.getOffsetParent||Wo,n=this.getDimensions,r=await n(e.floating);return{reference:Vo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hee(e){return bo(e).direction===`rtl`}var Uee={convertOffsetParentRelativeRectToViewportRelativeRect:Ree,getDocumentElement:so,getClippingRect:zo,getOffsetParent:Wo,getElementRects:Vee,getClientRects:No,getDimensions:Bo,getScale:Oo,isElement:lo,isRTL:Hee};function Go(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wee(e,t){let n=null,r,i=so(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=ya(d),h=ya(i.clientWidth-(u+f)),g=ya(i.clientHeight-(d+p)),_=ya(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:_a(0,ga(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&&!Go(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 Gee(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=Do(e),u=i||a?[...l?wo(l):[],...t?wo(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Wee(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?Ao(e):null;c&&g();function g(){let t=Ao(e);h&&!Go(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 Kee=eo,qee=to,Jee=Ja,Ko=ro,qo=Za,Jo=qa,Yo=no,Xo=(e,t,n)=>{let r=new Map,i={platform:Uee,...n},a={...i.platform,_c:r};return Ka(e,t,{...i,platform:a})},Zo=typeof document<`u`?f.useLayoutEffect:function(){};function Qo(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(!Qo(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)&&!Qo(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function $o(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function es(e,t){let n=$o(e);return Math.round(t*n)/n}function ts(e){let t=f.useRef(e);return Zo(()=>{t.current=e}),t}function ns(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]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=f.useState(r);Qo(m,r)||h(r);let[g,_]=f.useState(null),[v,y]=f.useState(null),b=f.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=f.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=f.useRef(null),T=f.useRef(null),E=f.useRef(u),D=c!=null,O=ts(c),k=ts(i),A=ts(l),j=f.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Xo(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Qo(E.current,t)&&(E.current=t,p.flushSync(()=>{d(t)}))})},[m,t,n,k,A]);Zo(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=f.useRef(!1);Zo(()=>(M.current=!0,()=>{M.current=!1}),[]),Zo(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=f.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),ee=f.useMemo(()=>({reference:S,floating:C}),[S,C]),P=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!ee.floating)return e;let t=es(ee.floating,u.x),r=es(ee.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...$o(ee.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ee.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:j,refs:N,elements:ee,floatingStyles:P}),[u,j,N,ee,P])}var rs=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?{}:Jo({element:r.current,padding:i}).fn(n):r?Jo({element:r,padding:i}).fn(n):{}}}},is=(e,t)=>{let n=Kee(e);return{name:n.name,fn:n.fn,options:[e,t]}},as=(e,t)=>{let n=qee(e);return{name:n.name,fn:n.fn,options:[e,t]}},os=(e,t)=>({fn:Yo(e).fn,options:[e,t]}),ss=(e,t)=>{let n=Jee(e);return{name:n.name,fn:n.fn,options:[e,t]}},cs=(e,t)=>{let n=Ko(e);return{name:n.name,fn:n.fn,options:[e,t]}},ls=(e,t)=>{let n=qo(e);return{name:n.name,fn:n.fn,options:[e,t]}},us=(e,t)=>{let n=rs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ds=Object.defineProperty,fs=f.forwardRef(((e,t)=>ds(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,m.jsx)(Qe.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,m.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),ps=Object.defineProperty,ms=(e,t)=>ps(e,`name`,{value:t,configurable:!0}),hs=`Popper`,[gs,_s]=st(hs),[vs,ys]=gs(hs),bs=ms(e=>{let{__scopePopper:t,children:n}=e,[r,i]=f.useState(null),[a,o]=f.useState(void 0);return(0,m.jsx)(vs,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),xs=`PopperAnchor`,Ss=f.forwardRef(ms(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=ys(xs,n),o=f.useRef(null),s=a.onAnchorChange,c=Ie(t,f.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=f.useRef(null);f.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Ms(a.placementState),d=u?.[0],p=u?.[1];return r?null:(0,m.jsx)(Qe.div,{"data-radix-popper-side":d,"data-radix-popper-align":p,...i,ref:c})},`PopperAnchor`)),Cs=`PopperContent`,[ws,Ts]=gs(Cs),Es=f.forwardRef(ms(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=ys(Cs,n),[y,b]=f.useState(null),x=Ie(t,b),[S,C]=f.useState(null),w=Zi(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],A=k.length>0,j={padding:O,boundary:k.filter(As),altBoundary:A},{refs:M,floatingStyles:N,placement:ee,isPositioned:P,middlewareData:F}=ns({strategy:`fixed`,placement:D,whileElementsMounted:ms((...e)=>Gee(...e,{animationFrame:h===`always`}),`whileElementsMounted`),elements:{reference:v.anchor},middleware:[is({mainAxis:i+E,alignmentAxis:o}),c&&as({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?os():void 0,...j}),c&&ss({...j}),cs({...j,apply:ms(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&us({element:S,padding:s}),js({arrowWidth:T,arrowHeight:E}),p&&ls({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),I=v.setPlacementState;kt(()=>(I(ee),()=>{I(void 0)}),[ee,I]);let[L,te]=Ms(ee),ne=bn(g);kt(()=>{P&&ne?.()},[P,ne]);let re=F.arrow?.x,ie=F.arrow?.y,ae=F.arrow?.centerOffset!==0,[oe,se]=f.useState();return kt(()=>{y&&se(window.getComputedStyle(y).zIndex)},[y]),(0,m.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:P?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,m.jsx)(ws,{scope:n,placedSide:L,placedAlign:te,onArrowChange:C,arrowX:re,arrowY:ie,shouldHideArrow:ae,children:(0,m.jsx)(Qe.div,{"data-side":L,"data-align":te,..._,ref:x,style:{..._.style,animation:P?_.style?.animation:`none`}})})})},`PopperContent`)),Ds=`PopperArrow`,Os={top:`bottom`,right:`left`,bottom:`top`,left:`right`},ks=f.forwardRef(ms(function(e,t){let{__scopePopper:n,...r}=e,i=Ts(Ds,n),a=Os[i.placedSide];return(0,m.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,m.jsx)(fs,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function As(e){return e!==null}ms(As,`isNotNull`);var js=ms(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Ms(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Ms(e){let[t,n=`center`]=e.split(`-`);return[t,n]}ms(Ms,`getSideAndAlignFromPlacement`);var Ns=Object.defineProperty,Ps=(e,t)=>Ns(e,`name`,{value:t,configurable:!0}),Fs=!1;function Is(){let[e,t]=f.useState(Fs);return f.useEffect(()=>{Fs||(Fs=!0,t(!0))},[]),e}Ps(Is,`useIsHydrated`);var Ls=f.useSyncExternalStore;function Rs(){return()=>{}}Ps(Rs,`subscribe`);function zs(){return Ls(Rs,()=>!0,()=>!1)}Ps(zs,`useIsHydratedModern`);var Bs=typeof Ls==`function`?zs:Is,Vs=Object.defineProperty,Hs=(e,t)=>Vs(e,`name`,{value:t,configurable:!0}),Us=`rovingFocusGroup.onEntryFocus`,Ws={bubbles:!1,cancelable:!0},Gs=`RovingFocusGroup`,[Ks,qs,Js]=dt(Gs),[Ys,Xs]=st(Gs,[Js]),[Zs,Qs]=Ys(Gs),$s=f.forwardRef(Hs(function(e,t){return(0,m.jsx)(Ks.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,m.jsx)(Ks.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,m.jsx)(ec,{...e,ref:t})})})},`RovingFocusGroup`)),ec=f.forwardRef(Hs(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=f.useRef(null),h=Ie(t,p),g=_n(a),[_,v]=Lt({prop:o,defaultProp:s??null,onChange:c,caller:Gs}),[y,b]=f.useState(!1),x=bn(l),S=qs(n),C=f.useRef(!1),[w,T]=f.useState(0);return f.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(Us,x),()=>e.removeEventListener(Us,x)},[x]),(0,m.jsx)(Zs,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:f.useCallback(e=>v(e),[v]),onItemShiftTab:f.useCallback(()=>b(!0),[]),onFocusableItemAdd:f.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:f.useCallback(()=>T(e=>e-1),[]),children:(0,m.jsx)(Qe.div,{tabIndex:y||w===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:`none`,...e.style},onMouseDown:R(e.onMouseDown,()=>{C.current=!0}),onFocus:R(e.onFocus,e=>{let t=!C.current;if(e.target===e.currentTarget&&t&&!y){let t=new CustomEvent(Us,Ws);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=S().filter(e=>e.focusable);ac([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),u)}}C.current=!1}),onBlur:R(e.onBlur,()=>b(!1))})})},`RovingFocusGroupImpl`)),tc=`RovingFocusGroupItem`,nc=f.forwardRef(Hs(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=$t(),l=a||c,u=Qs(tc,n),d=u.currentTabStopId===l,p=qs(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=u,v=Bs();return kt(()=>{if(!(!v||!r))return h(),()=>g()},[v,r,h,g]),f.useEffect(()=>{if(!(v||!r))return h(),()=>g()},[v,r,h,g]),(0,m.jsx)(Ks.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,m.jsx)(Qe.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:R(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:R(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:R(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ic(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?oc(n,r+1):n.slice(r+1)}setTimeout(()=>ac(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:_!=null}):o})})},`RovingFocusGroupItem`)),Yee={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function rc(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Hs(rc,`getDirectionAwareKey`);function ic(e,t,n){let r=rc(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Yee[r]}Hs(ic,`getFocusIntent`);function ac(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Hs(ac,`focusFirst`);function oc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Hs(oc,`wrapArray`);var Xee=Object.defineProperty,sc=(e,t)=>Xee(e,`name`,{value:t,configurable:!0}),cc=[`Enter`,` `],Zee=[`ArrowDown`,`PageUp`,`Home`],lc=[`ArrowUp`,`PageDown`,`End`],Qee=[...Zee,...lc],$ee={ltr:[...cc,`ArrowRight`],rtl:[...cc,`ArrowLeft`]},ete={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},uc=`Menu`,[dc,tte,nte]=dt(uc),[fc,pc]=st(uc,[nte,_s,Xs]),mc=_s(),hc=Xs(),[gc,_c]=fc(uc),[rte,vc]=fc(uc),yc=sc(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=mc(t),[c,l]=f.useState(null),u=f.useRef(!1),d=bn(a),p=_n(i);return f.useEffect(()=>{let e=sc(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=sc(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),f.useEffect(()=>{if(!n)return;let e=sc(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,m.jsx)(bs,{...s,children:(0,m.jsx)(gc,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,m.jsx)(rte,{scope:t,onClose:f.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})},`Menu`),bc=f.forwardRef(sc(function(e,t){let{__scopeMenu:n,...r}=e,i=mc(n);return(0,m.jsx)(Ss,{...i,...r,ref:t})},`MenuAnchor`)),xc=`MenuPortal`,[ite,Sc]=fc(xc,{forceMount:void 0}),Cc=sc(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=_c(xc,t);return(0,m.jsx)(ite,{scope:t,forceMount:n,children:(0,m.jsx)(Ut,{present:n||a.open,children:(0,m.jsx)(Yn,{asChild:!0,container:i,children:r})})})},`MenuPortal`),wc=`MenuContent`,[ate,Tc]=fc(wc),Ec=f.forwardRef(sc(function(e,t){let n=Sc(wc,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=_c(wc,e.__scopeMenu),o=vc(wc,e.__scopeMenu);return(0,m.jsx)(dc.Provider,{scope:e.__scopeMenu,children:(0,m.jsx)(Ut,{present:r||a.open,children:(0,m.jsx)(dc.Slot,{scope:e.__scopeMenu,children:o.modal?(0,m.jsx)(Dc,{...i,ref:t}):(0,m.jsx)(Oc,{...i,ref:t})})})})},`MenuContent`)),Dc=f.forwardRef(sc(function(e,t){let n=_c(wc,e.__scopeMenu),r=f.useRef(null),i=Ie(t,r);return f.useEffect(()=>{let e=r.current;if(e)return si(e)},[]),(0,m.jsx)(Ac,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:R(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Oc=f.forwardRef(sc(function(e,t){let n=_c(wc,e.__scopeMenu);return(0,m.jsx)(Ac,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),kc=He(`MenuContent.ScrollLock`),Ac=f.forwardRef(sc(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,..._}=e,v=_c(wc,n),y=vc(wc,n),b=mc(n),x=hc(n),S=tte(n),[C,w]=f.useState(null),T=f.useRef(null),E=Ie(t,T,v.onContentChange),D=f.useRef(0),O=f.useRef(``),k=f.useRef(0),A=f.useRef(null),j=f.useRef(`right`),M=f.useRef(0),N=g?ti:f.Fragment,ee=g?{as:kc,allowPinchZoom:!0}:void 0,P=sc(e=>{let t=O.current+e,n=S().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=sl(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;sc((function e(t){O.current=t,window.clearTimeout(D.current),t!==``&&(D.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);f.useEffect(()=>()=>window.clearTimeout(D.current),[]),tr();let F=f.useCallback(e=>j.current===A.current?.side&&ll(e,A.current?.area),[]);return(0,m.jsx)(ate,{scope:n,searchRef:O,onItemEnter:f.useCallback(e=>{F(e)&&e.preventDefault()},[F]),onItemLeave:f.useCallback(e=>{F(e)||(T.current?.focus(),w(null))},[F]),onTriggerLeave:f.useCallback(e=>{F(e)&&e.preventDefault()},[F]),pointerGraceTimerRef:k,onPointerGraceIntentChange:f.useCallback(e=>{A.current=e},[]),children:(0,m.jsx)(N,{...ee,children:(0,m.jsx)(In,{asChild:!0,trapped:i,onMountAutoFocus:R(a,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,m.jsx)(En,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:(0,m.jsx)($s,{asChild:!0,...x,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:C,onCurrentTabStopIdChange:w,onEntryFocus:R(c,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,m.jsx)(Es,{role:`menu`,"aria-orientation":`vertical`,"data-state":nl(v.open),"data-radix-menu-content":``,dir:y.dir,...b,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:R(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&P(e.key));let i=T.current;if(e.target!==i||!Qee.includes(e.key))return;e.preventDefault();let a=S().filter(e=>!e.disabled).map(e=>e.ref.current);lc.includes(e.key)&&a.reverse(),al(a)}),onBlur:R(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current=``)}),onPointerMove:R(e.onPointerMove,ul(e=>{let t=e.target,n=M.current!==e.clientX;e.currentTarget.contains(t)&&n&&(j.current=e.clientX>M.current?`right`:`left`,M.current=e.clientX)}))})})})})})})},`MenuContentImpl`)),jc=f.forwardRef(sc(function(e,t){let{__scopeMenu:n,...r}=e;return(0,m.jsx)(Qe.div,{role:`group`,...r,ref:t})},`MenuGroup`)),Mc=f.forwardRef(sc(function(e,t){let{__scopeMenu:n,...r}=e;return(0,m.jsx)(Qe.div,{...r,ref:t})},`MenuLabel`)),Nc=`MenuItem`,Pc=`menu.itemSelect`,Fc=f.forwardRef(sc(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=f.useRef(null),o=vc(Nc,e.__scopeMenu),s=Tc(Nc,e.__scopeMenu),c=Ie(t,a),l=f.useRef(!1),u=sc(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Pc,{bubbles:!0,cancelable:!0});e.addEventListener(Pc,e=>r?.(e),{once:!0}),$e(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,m.jsx)(Ic,{...i,ref:c,disabled:n,onClick:R(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:R(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:R(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||cc.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Ic=f.forwardRef(sc(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Tc(Nc,n),s=hc(n),c=f.useRef(null),l=Ie(t,c),[u,d]=f.useState(!1),[p,h]=f.useState(``);return f.useEffect(()=>{let e=c.current;e&&h((e.textContent??``).trim())},[a.children]),(0,m.jsx)(dc.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,m.jsx)(nc,{asChild:!0,...s,focusable:!r,children:(0,m.jsx)(Qe.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:R(e.onPointerMove,ul(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:R(e.onPointerLeave,ul(e=>o.onItemLeave(e))),onFocus:R(e.onFocus,()=>d(!0)),onBlur:R(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),Lc=f.forwardRef(sc(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,m.jsx)(Wc,{scope:e.__scopeMenu,checked:n,children:(0,m.jsx)(Fc,{role:`menuitemcheckbox`,"aria-checked":rl(n)?`mixed`:n,...i,ref:t,"data-state":il(n),onSelect:R(i.onSelect,()=>r?.(rl(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[Rc,zc]=fc(`MenuRadioGroup`,{value:void 0,onValueChange:sc(()=>{},`onValueChange`)}),Bc=f.forwardRef(sc(function(e,t){let{value:n,onValueChange:r,...i}=e,a=bn(r);return(0,m.jsx)(Rc,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,m.jsx)(jc,{...i,ref:t})})},`MenuRadioGroup`)),Vc=`MenuRadioItem`,Hc=f.forwardRef(sc(function(e,t){let{value:n,...r}=e,i=zc(Vc,e.__scopeMenu),a=n===i.value;return(0,m.jsx)(Wc,{scope:e.__scopeMenu,checked:a,children:(0,m.jsx)(Fc,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":il(a),onSelect:R(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Uc=`MenuItemIndicator`,[Wc,Gc]=fc(Uc,{checked:!1}),Kc=f.forwardRef(sc(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=Gc(Uc,n);return(0,m.jsx)(Ut,{present:r||rl(a.checked)||a.checked===!0,children:(0,m.jsx)(Qe.span,{...i,ref:t,"data-state":il(a.checked)})})},`MenuItemIndicator`)),qc=f.forwardRef(sc(function(e,t){let{__scopeMenu:n,...r}=e;return(0,m.jsx)(Qe.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),Jc=`MenuSub`,[Yc,Xc]=fc(Jc),Zc=sc(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=_c(Jc,t),o=mc(t),[s,c]=f.useState(null),[l,u]=f.useState(null),d=bn(i);return f.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,m.jsx)(bs,{...o,children:(0,m.jsx)(gc,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,m.jsx)(Yc,{scope:t,contentId:$t(),triggerId:$t(),trigger:s,onTriggerChange:c,children:n})})})},`MenuSub`),Qc=`MenuSubTrigger`,$c=f.forwardRef(sc(function(e,t){let n=_c(Qc,e.__scopeMenu),r=vc(Qc,e.__scopeMenu),i=Xc(Qc,e.__scopeMenu),a=Tc(Qc,e.__scopeMenu),o=f.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=f.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);f.useEffect(()=>u,[u]),f.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=Ie(t,i.onTriggerChange);return(0,m.jsx)(bc,{asChild:!0,...l,children:(0,m.jsx)(Ic,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":nl(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:R(e.onPointerMove,ul(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:R(e.onPointerLeave,ul(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:R(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||$ee[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),el=`MenuSubContent`,tl=f.forwardRef(sc(function(e,t){let n=Sc(wc,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=_c(wc,e.__scopeMenu),s=vc(wc,e.__scopeMenu),c=Xc(el,e.__scopeMenu),l=f.useRef(null),u=Ie(t,l);return(0,m.jsx)(dc.Provider,{scope:e.__scopeMenu,children:(0,m.jsx)(Ut,{present:r||o.open,children:(0,m.jsx)(dc.Slot,{scope:e.__scopeMenu,children:(0,m.jsx)(Ac,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:R(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:R(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:R(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ete[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function nl(e){return e?`open`:`closed`}sc(nl,`getOpenState`);function rl(e){return e===`indeterminate`}sc(rl,`isIndeterminate`);function il(e){return rl(e)?`indeterminate`:e?`checked`:`unchecked`}sc(il,`getCheckedState`);function al(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}sc(al,`focusFirst`);function ol(e,t){return e.map((n,r)=>e[(t+r)%e.length])}sc(ol,`wrapArray`);function sl(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ol(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}sc(sl,`getNextMatch`);function cl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}sc(cl,`isPointInPolygon`);function ll(e,t){return t?cl({x:e.clientX,y:e.clientY},t):!1}sc(ll,`isPointerInGraceArea`);function ul(e){return t=>t.pointerType===`mouse`?e(t):void 0}sc(ul,`whenMouse`);var dl=Object.defineProperty,fl=(e,t)=>dl(e,`name`,{value:t,configurable:!0}),pl=`ContextMenu`,[ml,ote]=st(pl,[pc]),hl=pc(),[gl,_l]=ml(pl),vl=fl(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:a,modal:o=!0}=e,s=f.useRef(!1),[c,l]=Lt({prop:i,defaultProp:!1,onChange:r,caller:pl}),u=hl(t);return(0,m.jsx)(gl,{scope:t,open:c,onOpenChange:l,modal:o,hasInteractedRef:s,children:(0,m.jsx)(yc,{...u,dir:a,open:c,onOpenChange:l,modal:o,children:n})})},`ContextMenu`),yl=`ContextMenuTrigger`,bl=f.forwardRef(fl(function(e,t){let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=_l(yl,n),o=hl(n),[s,c]=f.useState({x:0,y:0}),l=f.useMemo(()=>({current:{getBoundingClientRect:fl(()=>DOMRect.fromRect({width:0,height:0,...s}),`getBoundingClientRect`)}}),[s]),u=f.useRef(0),d=f.useCallback(()=>window.clearTimeout(u.current),[]),p=fl(e=>{a.hasInteractedRef.current=!0,c({x:e.clientX,y:e.clientY}),a.onOpenChange(!0)},`handleOpen`);return f.useEffect(()=>d,[d]),f.useEffect(()=>void(r&&d()),[r,d]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(bc,{...o,virtualRef:l}),(0,m.jsx)(Qe.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:R(e.onContextMenu,e=>{d(),p(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:R(e.onPointerDown,Ml(e=>{d(),a.open&&a.onOpenChange(!1),u.current=window.setTimeout(()=>p(e),700)})),onPointerMove:r?e.onPointerMove:R(e.onPointerMove,Ml(d)),onPointerCancel:r?e.onPointerCancel:R(e.onPointerCancel,Ml(d)),onPointerUp:r?e.onPointerUp:R(e.onPointerUp,Ml(d))})]})},`ContextMenuTrigger`)),xl=fl(e=>{let{__scopeContextMenu:t,...n}=e,r=hl(t);return(0,m.jsx)(Cc,{...r,...n})},`ContextMenuPortal`),Sl=`ContextMenuContent`,Cl=f.forwardRef(fl(function(e,t){let{__scopeContextMenu:n,...r}=e,i=_l(Sl,n),a=hl(n),o=f.useRef(!1);return(0,m.jsx)(Ec,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`ContextMenuContent`)),wl=f.forwardRef(fl(function(e,t){let{__scopeContextMenu:n,...r}=e,i=hl(n);return(0,m.jsx)(jc,{...i,...r,ref:t})},`ContextMenuGroup`)),Tl=f.forwardRef(fl(function(e,t){let{__scopeContextMenu:n,...r}=e,i=hl(n);return(0,m.jsx)(Mc,{...i,...r,ref:t})},`ContextMenuLabel`)),El=f.forwardRef(fl(function(e,t){let{__scopeContextMenu:n,...r}=e,i=hl(n);return(0,m.jsx)(Fc,{...i,...r,ref:t})},`ContextMenuItem`)),Dl=f.forwardRef(fl(function(e,t){let{__scopeContextMenu:n,...r}=e,i=hl(n);return(0,m.jsx)(qc,{...i,...r,ref:t})},`ContextMenuSeparator`)),Ol=`ContextMenuSub`,kl=fl(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=hl(t),[s,c]=Lt({prop:i,defaultProp:a??!1,onChange:r,caller:Ol});return(0,m.jsx)(Zc,{...o,open:s,onOpenChange:c,children:n})},`ContextMenuSub`),Al=f.forwardRef(fl(function(e,t){let{__scopeContextMenu:n,...r}=e,i=hl(n);return(0,m.jsx)($c,{...i,...r,ref:t})},`ContextMenuSubTrigger`)),jl=f.forwardRef(fl(function(e,t){let{__scopeContextMenu:n,...r}=e,i=hl(n);return(0,m.jsx)(tl,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`ContextMenuSubContent`));function Ml(e){return t=>t.pointerType===`mouse`?void 0:e(t)}fl(Ml,`whenTouchOrPen`);var Nl=Object.defineProperty,Pl=(e,t)=>Nl(e,`name`,{value:t,configurable:!0}),Fl=`DropdownMenu`,[Il,ste]=st(Fl,[pc]),Ll=pc(),[Rl,zl]=Il(Fl),Bl=Pl(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Ll(t),l=f.useRef(null),[u,d]=Lt({prop:i,defaultProp:a??!1,onChange:o,caller:Fl});return(0,m.jsx)(Rl,{scope:t,triggerId:$t(),triggerRef:l,contentId:$t(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,m.jsx)(yc,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Vl=`DropdownMenuTrigger`,Hl=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=zl(Vl,n),o=Ll(n),s=Ie(t,a.triggerRef);return(0,m.jsx)(bc,{asChild:!0,...o,children:(0,m.jsx)(Qe.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:R(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:R(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Ul=Pl(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Ll(t);return(0,m.jsx)(Cc,{...r,...n})},`DropdownMenuPortal`),Wl=`DropdownMenuContent`,Gl=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=zl(Wl,n),a=Ll(n),o=f.useRef(!1);return(0,m.jsx)(Ec,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:R(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:R(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Kl=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)(jc,{...i,...r,ref:t})},`DropdownMenuGroup`)),ql=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)(Mc,{...i,...r,ref:t})},`DropdownMenuLabel`)),Jl=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)(Fc,{...i,...r,ref:t})},`DropdownMenuItem`)),Yl=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)(Lc,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),Xl=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)(Bc,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),Zl=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)(Hc,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),Ql=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)(Kc,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),$l=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)(qc,{...i,...r,ref:t})},`DropdownMenuSeparator`)),eu=Pl(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Ll(t),[s,c]=Lt({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,m.jsx)(Zc,{...o,open:s,onOpenChange:c,children:n})},`DropdownMenuSub`),tu=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)($c,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),nu=f.forwardRef(Pl(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ll(n);return(0,m.jsx)(tl,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),ru=Object.defineProperty,iu=f.forwardRef(((e,t)=>ru(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,m.jsx)(Qe.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),au=Object.defineProperty,ou=(e,t)=>au(e,`name`,{value:t,configurable:!0});function su(e){let t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}ou(su,`usePrevious`);var cu=Object.defineProperty,lu=(e,t)=>cu(e,`name`,{value:t,configurable:!0});function uu(e,[t,n]){return Math.min(n,Math.max(t,e))}lu(uu,`clamp`);var du=Object.defineProperty,fu=(e,t)=>du(e,`name`,{value:t,configurable:!0}),pu=`Popover`,[mu,cte]=st(pu,[_s]),hu=_s(),[gu,_u]=mu(pu),vu=fu(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=hu(t),c=f.useRef(null),[l,u]=f.useState(!1),[d,p]=f.useState(0),[h,g]=f.useState(0),[_,v]=Lt({prop:r,defaultProp:i??!1,onChange:a,caller:pu});return(0,m.jsx)(bs,{...s,children:(0,m.jsx)(gu,{scope:t,contentId:$t(),titleId:$t(),descriptionId:$t(),titlePresent:d>0,descriptionPresent:h>0,setTitleCount:p,setDescriptionCount:g,triggerRef:c,open:_,onOpenChange:v,onOpenToggle:f.useCallback(()=>v(e=>!e),[v]),hasCustomAnchor:l,onCustomAnchorAdd:f.useCallback(()=>u(!0),[]),onCustomAnchorRemove:f.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),yu=`PopoverAnchor`,bu=f.forwardRef(fu(function(e,t){let{__scopePopover:n,...r}=e,i=_u(yu,n),a=hu(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return f.useEffect(()=>(o(),()=>s()),[o,s]),(0,m.jsx)(Ss,{...a,...r,ref:t})},`PopoverAnchor`)),xu=`PopoverTrigger`,Su=f.forwardRef(fu(function(e,t){let{__scopePopover:n,...r}=e,i=_u(xu,n),a=hu(n),o=Ie(t,i.triggerRef),s=(0,m.jsx)(Qe.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Nu(i.open),...r,ref:o,onClick:R(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,m.jsx)(Ss,{asChild:!0,...a,children:s})},`PopoverTrigger`)),Cu=`PopoverPortal`,[wu,Tu]=mu(Cu,{forceMount:void 0}),Eu=fu(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=_u(Cu,t);return(0,m.jsx)(wu,{scope:t,forceMount:n,children:(0,m.jsx)(Ut,{present:n||a.open,children:(0,m.jsx)(Yn,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Du=`PopoverContent`,Ou=f.forwardRef(fu(function(e,t){let n=Tu(Du,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=_u(Du,e.__scopePopover);return(0,m.jsx)(Ut,{present:r||a.open,children:a.modal?(0,m.jsx)(Au,{...i,ref:t}):(0,m.jsx)(ju,{...i,ref:t})})},`PopoverContent`)),ku=He(`PopoverContent.RemoveScroll`),Au=f.forwardRef(fu(function(e,t){let n=_u(Du,e.__scopePopover),r=f.useRef(null),i=Ie(t,r),a=f.useRef(!1);return f.useEffect(()=>{let e=r.current;if(e)return si(e)},[]),(0,m.jsx)(ti,{as:ku,allowPinchZoom:!0,children:(0,m.jsx)(Mu,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:R(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:R(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),ju=f.forwardRef(fu(function(e,t){let n=_u(Du,e.__scopePopover),r=f.useRef(!1),i=f.useRef(!1);return(0,m.jsx)(Mu,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Mu=f.forwardRef(fu(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,...f}=e,p=_u(Du,n),h=hu(n);return tr(),(0,m.jsx)(In,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,m.jsx)(En,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,m.jsx)(Es,{"data-state":Nu(p.open),role:`dialog`,id:p.contentId,"aria-labelledby":p.titlePresent?p.titleId:void 0,"aria-describedby":p.descriptionPresent?Pu(d,p.descriptionId):d,...h,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function Nu(e){return e?`open`:`closed`}fu(Nu,`getState`);function Pu(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}fu(Pu,`concatAriaDescribedby`);var Fu=Object.defineProperty,Iu=(e,t)=>Fu(e,`name`,{value:t,configurable:!0}),Lu=`Progress`,Ru=100,[zu,lte]=st(Lu),[Bu,Vu]=zu(Lu),Hu=f.forwardRef(Iu(function(e,t){let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=Gu,...o}=e;(i||i===0)&&!Ju(i)&&console.error(Xu(`${i}`,`Progress`));let s=Ju(i)?i:Ru;r!==null&&!Yu(r,s)&&console.error(Zu(`${r}`,`Progress`));let c=Yu(r,s)?r:null,l=qu(c)?a(c,s):void 0;return(0,m.jsx)(Bu,{scope:n,value:c,max:s,children:(0,m.jsx)(Qe.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":qu(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":Ku(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})},`Progress`)),Uu=`ProgressIndicator`,Wu=f.forwardRef(Iu(function(e,t){let{__scopeProgress:n,...r}=e,i=Vu(Uu,n);return(0,m.jsx)(Qe.div,{"data-state":Ku(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})},`ProgressIndicator`));function Gu(e,t){return`${Math.round(e/t*100)}%`}Iu(Gu,`defaultGetValueLabel`);function Ku(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}Iu(Ku,`getProgressState`);function qu(e){return typeof e==`number`}Iu(qu,`isNumber`);function Ju(e){return qu(e)&&!isNaN(e)&&e>0}Iu(Ju,`isValidMaxNumber`);function Yu(e,t){return qu(e)&&!isNaN(e)&&e<=t&&e>=0}Iu(Yu,`isValidValueNumber`);function Xu(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ru}\`.`}Iu(Xu,`getInvalidMaxError`);function Zu(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
42
|
-
- a positive number
|
|
43
|
-
- less than the value passed to \`max\` (or ${Ru} if no \`max\` prop is set)
|
|
44
|
-
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
45
|
-
|
|
46
|
-
Defaulting to \`null\`.`}Iu(Zu,`getInvalidValueError`);var Qu=Object.defineProperty,$u=(e,t)=>Qu(e,`name`,{value:t,configurable:!0}),ed=`Radio`,[td,nd]=st(ed),[rd,id]=td(ed);function ad(e){let{__scopeRadio:t,checked:n=!1,children:r,disabled:i,form:a,name:o,onCheck:s,required:c,value:l=`on`,internal_do_not_use_render:u}=e,[d,p]=f.useState(null),[h,g]=f.useState(null),_=f.useRef(!1),[v,y]=f.useReducer(e=>e+1,0),b={checked:n,disabled:i,required:c,name:o,form:a,value:l,control:d,setControl:p,hasConsumerStoppedPropagationRef:_,userInteractionCount:v,onUserInteraction:y,isFormControl:d?!!a||!!d.closest(`form`):!0,bubbleInput:h,setBubbleInput:g,onCheck:$u(()=>s?.(),`onCheck`)};return(0,m.jsx)(rd,{scope:t,...b,children:fd(u)?u(b):r})}$u(ad,`RadioProvider`);var od=`RadioTrigger`,sd=f.forwardRef($u(function({__scopeRadio:e,onClick:t,...n},r){let{checked:i,disabled:a,value:o,setControl:s,onCheck:c,hasConsumerStoppedPropagationRef:l,onUserInteraction:u,isFormControl:d,bubbleInput:f}=id(od,e),p=Ie(r,s);return(0,m.jsx)(Qe.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":pd(i),"data-disabled":a?``:void 0,disabled:a,value:o,...n,ref:p,onClick:R(t,e=>{i||(u(),c()),f&&d&&(l.current=e.isPropagationStopped(),l.current||e.stopPropagation())})})},`RadioTrigger`)),cd=`RadioIndicator`,ld=f.forwardRef($u(function(e,t){let{__scopeRadio:n,forceMount:r,...i}=e,a=id(cd,n);return(0,m.jsx)(Ut,{present:r||a.checked,children:(0,m.jsx)(Qe.span,{"data-state":pd(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})},`RadioIndicator`)),ud=`RadioBubbleInput`,dd=f.forwardRef($u(function({__scopeRadio:e,onClick:t,...n},r){let{control:i,checked:a,required:o,disabled:s,name:c,value:l,form:u,bubbleInput:d,setBubbleInput:p,hasConsumerStoppedPropagationRef:h,userInteractionCount:g}=id(ud,e),_=Ie(r,p),v=Zi(i),y=f.useRef(!1),b=f.useRef(a),x=f.useRef(g);f.useEffect(()=>{let e=d;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=g!==x.current;x.current=g;let i=b.current!==a;b.current=a;let o=!(r&&h.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:o});n.call(e,a),e.dispatchEvent(t),y.current=!1}},[d,a,h,g]);let S=f.useRef(a);return(0,m.jsx)(Qe.input,{type:`radio`,"aria-hidden":!0,defaultChecked:S.current,required:o,disabled:s,name:c,value:l,form:u,...n,tabIndex:-1,ref:_,onClick:R(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function fd(e){return typeof e==`function`}$u(fd,`isFunction`);function pd(e){return e?`checked`:`unchecked`}$u(pd,`getState`);var md=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],hd=`RadioGroup`,[gd,ute]=st(hd,[Xs,nd]),_d=Xs(),vd=nd(),[yd,bd]=gd(hd),xd=f.forwardRef($u(function(e,t){let{__scopeRadioGroup:n,name:r,form:i,defaultValue:a,value:o,required:s=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:p,...h}=e,g=_d(n),_=_n(u),[v,y]=Lt({prop:o,defaultProp:a??null,onChange:p,caller:hd}),[b,x]=f.useState(null),S=Ie(t,x),C=f.useRef(v);return f.useEffect(()=>{let e=i?b?.ownerDocument.getElementById(i):b?.closest(`form`);if(e instanceof HTMLFormElement){let t=$u(()=>y(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[b,i,y]),(0,m.jsx)(yd,{scope:n,name:r,form:i,required:s,disabled:c,value:v,onValueChange:y,children:(0,m.jsx)($s,{asChild:!0,...g,orientation:l,dir:_,loop:d,children:(0,m.jsx)(Qe.div,{role:`radiogroup`,"aria-required":s,"aria-orientation":l,"data-disabled":c?``:void 0,dir:_,...h,ref:S})})})},`RadioGroup`)),Sd=`RadioGroupItemProvider`,Cd=`RadioGroupItemTrigger`;function wd(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:i,internal_do_not_use_render:a}=e,o=bd(Sd,t),s=vd(t),c=o.disabled||r;return(0,m.jsx)(ad,{...s,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:a,children:i})}$u(wd,`RadioGroupItemProvider`);var Td=f.forwardRef($u(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=_d(n),a=vd(n),{checked:o,disabled:s}=id(Cd,a.__scopeRadio),c=f.useRef(null),l=Ie(t,c),u=f.useRef(!1);return f.useEffect(()=>{let e=$u(e=>{md.includes(e.key)&&(u.current=!0)},`handleKeyDown`),t=$u(()=>u.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,m.jsx)(nc,{asChild:!0,...i,focusable:!s,active:o,children:(0,m.jsx)(sd,{...a,...r,ref:l,onKeyDown:R(r.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:R(r.onFocus,()=>{u.current&&c.current?.click()})})})},`RadioGroupItemTrigger`)),Ed=f.forwardRef($u(function(e,t){let{__scopeRadioGroup:n,value:r,disabled:i,...a}=e;return(0,m.jsx)(wd,{__scopeRadioGroup:n,value:r,disabled:i,internal_do_not_use_render:({isFormControl:e})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Td,{...a,ref:t,__scopeRadioGroup:n}),e&&(0,m.jsx)(Dd,{__scopeRadioGroup:n})]})})},`RadioGroupItem`)),Dd=f.forwardRef($u(function(e,t){let{__scopeRadioGroup:n,...r}=e;return(0,m.jsx)(dd,{...vd(n),...r,ref:t})},`RadioGroupItemBubbleInput`)),Od=f.forwardRef($u(function(e,t){let{__scopeRadioGroup:n,...r}=e;return(0,m.jsx)(ld,{...vd(n),...r,ref:t})},`RadioGroupIndicator`)),kd=Object.defineProperty,Ad=(e,t)=>kd(e,`name`,{value:t,configurable:!0});function jd(e,t){return f.useReducer((e,n)=>t[e][n]??e,e)}Ad(jd,`useStateMachine`);var Md=`ScrollArea`,[Nd,dte]=st(Md),[Pd,Fd]=Nd(Md),Id=f.forwardRef(Ad(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=f.useState(null),[l,u]=f.useState(null),[d,p]=f.useState(null),[h,g]=f.useState(null),[_,v]=f.useState(null),[y,b]=f.useState(0),[x,S]=f.useState(0),[C,w]=f.useState(!1),[T,E]=f.useState(!1),D=Ie(t,c),O=_n(i);return(0,m.jsx)(Pd,{scope:n,type:r,dir:O,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:C,onScrollbarXEnabledChange:w,scrollbarY:_,onScrollbarYChange:v,scrollbarYEnabled:T,onScrollbarYEnabledChange:E,onCornerWidthChange:b,onCornerHeightChange:S,children:(0,m.jsx)(Qe.div,{dir:O,...o,ref:D,style:{position:`relative`,"--radix-scroll-area-corner-width":y+`px`,"--radix-scroll-area-corner-height":x+`px`,...e.style}})})},`ScrollArea`)),Ld=`ScrollAreaViewport`,Rd=f.forwardRef(Ad(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Fd(Ld,n),s=Ie(t,f.useRef(null),o.onViewportChange);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(zd,{nonce:i}),(0,m.jsx)(Qe.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,m.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),zd=f.memo(Ad(function({nonce:e}){return(0,m.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),Bd=`ScrollAreaScrollbar`,Vd=f.forwardRef(Ad(function(e,t){let{forceMount:n,...r}=e,i=Fd(Bd,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return f.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,m.jsx)(Hd,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,m.jsx)(Ud,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,m.jsx)(Wd,{...r,ref:t,forceMount:n}):i.type===`always`?(0,m.jsx)(Gd,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),Hd=f.forwardRef(Ad(function(e,t){let{forceMount:n,...r}=e,i=Fd(Bd,e.__scopeScrollArea),[a,o]=f.useState(!1);return f.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=Ad(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=Ad(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,m.jsx)(Ut,{present:n||a,children:(0,m.jsx)(Wd,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),Ud=f.forwardRef(Ad(function(e,t){let{forceMount:n,...r}=e,i=Fd(Bd,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=cf(()=>c(`SCROLL_END`),100),[s,c]=jd(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return f.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),f.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=Ad(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,m.jsx)(Ut,{present:n||s!==`hidden`,children:(0,m.jsx)(Gd,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:R(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:R(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),Wd=f.forwardRef(Ad(function(e,t){let n=Fd(Bd,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=f.useState(!1),s=e.orientation===`horizontal`,c=cf(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return lf(n.viewport,c),lf(n.content,c),(0,m.jsx)(Ut,{present:r||a,children:(0,m.jsx)(Gd,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),Gd=f.forwardRef(Ad(function(e,t){let{orientation:n=`vertical`,...r}=e,i=Fd(Bd,e.__scopeScrollArea),a=f.useRef(null),o=f.useRef(0),[s,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=tf(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:Ad(e=>a.current=e,`onThumbChange`),onThumbPointerUp:Ad(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:Ad(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return rf(e,o.current,s,t)}return Ad(d,`getScrollPosition`),n===`horizontal`?(0,m.jsx)(Kd,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=af(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,m.jsx)(qd,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=af(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),Kd=f.forwardRef(Ad(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Fd(Bd,e.__scopeScrollArea),[o,s]=f.useState(),c=f.useRef(null),l=Ie(t,c,a.onScrollbarXChange);return f.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,m.jsx)(Xd,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":nf(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),sf(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:ef(o.paddingLeft),paddingEnd:ef(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),qd=f.forwardRef(Ad(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=Fd(Bd,e.__scopeScrollArea),[o,s]=f.useState(),c=f.useRef(null),l=Ie(t,c,a.onScrollbarYChange);return f.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,m.jsx)(Xd,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":nf(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),sf(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:ef(o.paddingTop),paddingEnd:ef(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[Jd,Yd]=Nd(Bd),Xd=f.forwardRef(Ad(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...p}=e,h=Fd(Bd,n),[g,_]=f.useState(null),v=Ie(t,_),y=f.useRef(null),b=f.useRef(``),x=h.viewport,S=r.content-r.viewport,C=bn(u),w=bn(c),T=cf(d,10);function E(e){y.current&&l({x:e.clientX-y.current.left,y:e.clientY-y.current.top})}return Ad(E,`handleDragScroll`),f.useEffect(()=>{let e=Ad(e=>{let t=e.target;g?.contains(t)&&C(e,S)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[x,g,S,C]),f.useEffect(w,[r,w]),lf(g,T),lf(h.content,T),(0,m.jsx)(Jd,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:bn(a),onThumbPointerUp:bn(o),onThumbPositionChange:w,onThumbPointerDown:bn(s),children:(0,m.jsx)(Qe.div,{...p,ref:v,style:{position:`absolute`,...p.style},onPointerDown:R(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,h.viewport&&(h.viewport.style.scrollBehavior=`auto`),E(e))}),onPointerMove:R(e.onPointerMove,E),onPointerUp:R(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=``),y.current=null})})})},`ScrollAreaScrollbarImpl`)),Zd=`ScrollAreaThumb`,Qd=f.forwardRef(Ad(function(e,t){let{forceMount:n,...r}=e,i=Yd(Zd,e.__scopeScrollArea);return(0,m.jsx)(Ut,{present:n||i.hasThumb,children:(0,m.jsx)(fte,{ref:t,...r})})},`ScrollAreaThumb`)),fte=f.forwardRef(Ad(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=Fd(Zd,n),o=Yd(Zd,n),{onThumbPositionChange:s}=o,c=Ie(t,o.onThumbChange),l=f.useRef(void 0),u=cf(()=>{l.current&&=(l.current(),void 0)},100);return f.useEffect(()=>{let e=a.viewport;if(e){let t=Ad(()=>{u(),l.current||(l.current=hte(e,s),s())},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,m.jsx)(Qe.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:R(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:R(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),$d=`ScrollAreaCorner`,pte=f.forwardRef(Ad(function(e,t){let n=Fd($d,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,m.jsx)(mte,{...e,ref:t}):null},`ScrollAreaCorner`)),mte=f.forwardRef(Ad(function(e,t){let{__scopeScrollArea:n,...r}=e,i=Fd($d,n),[a,o]=f.useState(0),[s,c]=f.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return lf(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),lf(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),f.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,m.jsx)(Qe.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function ef(e){return e?parseInt(e,10):0}Ad(ef,`toInt`);function tf(e,t){let n=e/t;return isNaN(n)?0:n}Ad(tf,`getThumbRatio`);function nf(e){let t=tf(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}Ad(nf,`getThumbSize`);function rf(e,t,n,r=`ltr`){let i=nf(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return of([c,l],d)(e)}Ad(rf,`getScrollPositionFromPointer`);function af(e,t,n=`ltr`){let r=nf(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=uu(e,n===`ltr`?[0,o]:[o*-1,0]);return of([0,o],[0,s])(c)}Ad(af,`getThumbOffsetFromScroll`);function of(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Ad(of,`linearScale`);function sf(e,t){return e>0&&e<t}Ad(sf,`isScrollingWithinScrollbarBounds`);var hte=Ad((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return Ad((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function cf(e,t){let n=bn(e),r=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),f.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}Ad(cf,`useDebounceCallback`);function lf(e,t){let n=bn(t);kt(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}Ad(lf,`useResizeObserver`);var gte=Object.defineProperty,uf=(e,t)=>gte(e,`name`,{value:t,configurable:!0}),_te=[` `,`Enter`,`ArrowUp`,`ArrowDown`],vte=[` `,`Enter`],df=`Select`,[ff,pf,yte]=dt(df),[mf,bte]=st(df,[yte,_s]),hf=_s(),[xte,gf]=mf(df),[Ste,Cte]=mf(df);function _f(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:p,required:h,form:g,internal_do_not_use_render:_}=e,v=hf(t),[y,b]=f.useState(null),[x,S]=f.useState(null),[C,w]=f.useState(!1),T=_n(l),[E,D]=Lt({prop:r,defaultProp:i??!1,onChange:a,caller:df}),[O,k]=Lt({prop:o,defaultProp:s,onChange:c,caller:df}),A=f.useRef(null),j=f.useRef(O);f.useEffect(()=>{let e=g?y?.ownerDocument.getElementById(g):y?.form;if(e instanceof HTMLFormElement){let t=uf(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[g,y,k]);let M=y?!!g||!!y.closest(`form`):!0,[N,ee]=f.useState(new Set),P=$t(),F=Array.from(N).map(e=>e.props.value).join(`;`),I=f.useCallback(e=>{ee(t=>new Set(t).add(e))},[]),L=f.useCallback(e=>{ee(t=>{let n=new Set(t);return n.delete(e),n})},[]),te={required:h,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:P,value:O,onValueChange:k,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:p,name:u,autoComplete:d,form:g,nativeOptions:N,nativeSelectKey:F,isFormControl:M};return(0,m.jsx)(bs,{...v,children:(0,m.jsx)(xte,{scope:t,...te,children:(0,m.jsx)(ff.Provider,{scope:t,children:(0,m.jsx)(Ste,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:L,children:jf(_)?_(te):n})})})})}uf(_f,`SelectProvider`);var wte=uf(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,m.jsx)(_f,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,m.jsxs)(m.Fragment,{children:[n,e?(0,m.jsx)(Zte,{__scopeSelect:t}):null]})})},`Select`),Tte=`SelectTrigger`,Ete=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=hf(n),o=gf(Tte,n),s=o.disabled||r,c=Ie(t,o.onTriggerChange),l=pf(n),u=f.useRef(`touch`),[d,p,h]=Nf(e=>{let t=l().filter(e=>!e.disabled),n=Pf(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=uf(e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,m.jsx)(Ss,{asChild:!0,...a,children:(0,m.jsx)(Qe.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Mf(o.value)?``:void 0,...i,ref:c,onClick:R(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&g(e)}),onPointerDown:R(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:R(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&_te.includes(e.key)&&(g(),e.preventDefault())})})})},`SelectTrigger`)),Dte=`SelectValue`,Ote=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=gf(Dte,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Ie(t,c.onValueNodeChange);kt(()=>{l(u)},[l,u]);let p=Mf(c.value);return(0,m.jsx)(Qe.span,{...s,asChild:p?!1:s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,m.jsx)(f.Fragment,{children:p?o:a},p?`placeholder`:`value`)})},`SelectValue`)),kte=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,m.jsx)(Qe.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[Ate,jte]=mf(`SelectPortal`,{forceMount:void 0}),Mte=uf(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,m.jsx)(Ate,{scope:e.__scopeSelect,forceMount:n,children:(0,m.jsx)(Yn,{asChild:!0,...r})})},`SelectPortal`),vf=`SelectContent`,Nte=f.forwardRef(uf(function(e,t){let n=jte(vf,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=gf(vf,e.__scopeSelect),[o,s]=f.useState();return kt(()=>{s(new DocumentFragment)},[]),(0,m.jsx)(Ut,{present:r||a.open,children:({present:e})=>e?(0,m.jsx)(Ite,{...i,ref:t}):(0,m.jsx)(Pte,{...i,fragment:o})})},`SelectContent`)),Pte=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?p.createPortal((0,m.jsx)(bf,{scope:n,children:(0,m.jsx)(ff.Slot,{scope:n,children:(0,m.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),yf=10,[bf,xf]=mf(vf),Fte=He(`SelectContent.RemoveScroll`),Ite=f.forwardRef(uf(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...y}=e,b=gf(vf,n),[x,S]=f.useState(null),[C,w]=f.useState(null),T=Ie(t,S),[E,D]=f.useState(null),[O,k]=f.useState(null),A=pf(n),[j,M]=f.useState(!1),N=f.useRef(!1);f.useEffect(()=>{if(x)return si(x)},[x]),tr();let ee=f.useCallback(e=>{let[t,...n]=A().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[A,C]),P=f.useCallback(()=>ee([E,x]),[ee,E,x]);f.useEffect(()=>{j&&P()},[j,P]);let{onOpenChange:F,triggerPointerDownPosRef:I}=b;f.useEffect(()=>{if(x){let e={x:0,y:0},t=uf(t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},`handlePointerMove`),n=uf(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(x)||F(!1),document.removeEventListener(`pointermove`,t),I.current=null},`handlePointerUp`);return I.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,F,I]),f.useEffect(()=>{let e=uf(()=>F(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[F]);let[L,te]=Nf(e=>{let t=A().filter(e=>!e.disabled),n=Pf(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=f.useCallback((e,t,n)=>{let r=!N.current&&!n;(b.value!==void 0&&b.value===t||r)&&(D(e),r&&(N.current=!0))},[b.value]),re=f.useCallback(()=>x?.focus(),[x]),ie=f.useCallback((e,t,n)=>{let r=!N.current&&!n;(b.value!==void 0&&b.value===t||r)&&k(e)},[b.value]),ae=r===`popper`?Sf:Lte,oe=ae===Sf?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,m.jsx)(bf,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:ne,selectedItem:E,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:P,selectedItemText:O,position:r,isPositioned:j,searchRef:L,children:(0,m.jsx)(ti,{as:Fte,allowPinchZoom:!0,children:(0,m.jsx)(In,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:R(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,m.jsx)(En,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,m.jsx)(ae,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...oe,onPlaced:()=>M(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,...y.style},onKeyDown:R(y.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=A().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ee(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Lte=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=gf(vf,n),o=xf(vf,n),[s,c]=f.useState(null),[l,u]=f.useState(null),d=Ie(t,u),p=pf(n),h=f.useRef(!1),g=f.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,x=f.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&_&&v&&y){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-yf,d=uu(a,[yf,Math.max(yf,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-yf,d=uu(a,[yf,Math.max(yf,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=p(),c=window.innerHeight-yf*2,u=_.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+m+u+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-yf,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+m+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${yf}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[p,a.trigger,a.valueNode,s,l,_,v,y,a.dir,r]);kt(()=>x(),[x]);let[S,C]=f.useState();return kt(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]),(0,m.jsx)(Rte,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:f.useCallback(e=>{e&&g.current===!0&&(x(),b?.(),g.current=!1)},[x,b]),children:(0,m.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,m.jsx)(Qe.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),Sf=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=yf,...a}=e,o=hf(n);return(0,m.jsx)(Es,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Rte,Cf]=mf(vf,{}),wf=`SelectViewport`,zte=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=xf(wf,n),o=Cf(wf,n),s=Ie(t,a.onViewportChange),c=f.useRef(0);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,m.jsx)(ff.Slot,{scope:n,children:(0,m.jsx)(Qe.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:R(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-yf*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Bte,Vte]=mf(`SelectGroup`),Hte=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,...r}=e,i=$t();return(0,m.jsx)(Bte,{scope:n,id:i,children:(0,m.jsx)(Qe.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})},`SelectGroup`)),Tf=`SelectItem`,[Ute,Ef]=mf(Tf),Wte=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=gf(Tf,n),c=xf(Tf,n),l=s.value===r,[u,d]=f.useState(a??``),[p,h]=f.useState(!1),g=Ie(t,bn(e=>c.itemRefCallback?.(e,r,i))),_=$t(),v=f.useRef(`touch`),y=uf(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,m.jsx)(Ute,{scope:n,value:r,disabled:i,textId:_,isSelected:l,onItemTextChange:f.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,m.jsx)(ff.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,m.jsx)(Qe.div,{role:`option`,"aria-labelledby":_,"data-highlighted":p?``:void 0,"aria-selected":l&&p,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:R(o.onFocus,()=>h(!0)),onBlur:R(o.onBlur,()=>h(!1)),onClick:R(o.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:R(o.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:R(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:R(o.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:R(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(vte.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Df=`SelectItemText`,Gte=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=gf(Df,n),s=xf(Df,n),c=Ef(Df,n),l=Cte(Df,n),[u,d]=f.useState(null),h=bn(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),g=Ie(t,d,c.onItemTextChange,h),_=u?.textContent,v=f.useMemo(()=>(0,m.jsx)(`option`,{value:c.value,disabled:c.disabled,children:_},c.value),[c.disabled,c.value,_]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=l;return kt(()=>(y(v),()=>b(v)),[y,b,v]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Qe.span,{id:c.textId,...a,ref:g}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Mf(o.value)?p.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Kte=`SelectItemIndicator`,qte=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,...r}=e;return Ef(Kte,n).isSelected?(0,m.jsx)(Qe.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Of=`SelectScrollUpButton`,Jte=f.forwardRef(uf(function(e,t){let n=xf(Of,e.__scopeSelect),r=Cf(Of,e.__scopeSelect),[i,a]=f.useState(!1),o=Ie(t,r.onScrollButtonChange);return kt(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)};uf(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,m.jsx)(Af,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),kf=`SelectScrollDownButton`,Yte=f.forwardRef(uf(function(e,t){let n=xf(kf,e.__scopeSelect),r=Cf(kf,e.__scopeSelect),[i,a]=f.useState(!1),o=Ie(t,r.onScrollButtonChange);return kt(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)};uf(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,m.jsx)(Af,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Af=f.forwardRef(uf(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=xf(`SelectScrollButton`,n),o=f.useRef(null),s=pf(n),c=f.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),kt(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,m.jsx)(Qe.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:R(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:R(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:R(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Xte=`SelectBubbleInput`,Zte=f.forwardRef(uf(function({__scopeSelect:e,...t},n){let r=gf(Xte,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:p}=r,h=f.useRef(null),g=Ie(n,h),_=i??``,v=su(_),y=Array.from(d).some(e=>(e.props.value??``)===``);return f.useEffect(()=>{let e=h.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(v!==_&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,_),e.dispatchEvent(t)}},[v,_]),(0,m.jsxs)(Qe.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...nt,...t.style},ref:g,defaultValue:_,children:[Mf(i)&&!y?(0,m.jsx)(`option`,{value:``}):null,Array.from(d)]},p)},`SelectBubbleInput`));function jf(e){return typeof e==`function`}uf(jf,`isFunction`);function Mf(e){return e===``||e===void 0}uf(Mf,`shouldShowPlaceholder`);function Nf(e){let t=bn(e),n=f.useRef(``),r=f.useRef(0),i=f.useCallback(e=>{let i=n.current+e;t(i),uf((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=f.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}uf(Nf,`useTypeaheadSearch`);function Pf(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ff(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}uf(Pf,`findNextItem`);function Ff(e,t){return e.map((n,r)=>e[(t+r)%e.length])}uf(Ff,`wrapArray`);var Qte=Object.defineProperty,If=(e,t)=>Qte(e,`name`,{value:t,configurable:!0}),Lf=`horizontal`,$te=[`horizontal`,`vertical`],ene=f.forwardRef(If(function(e,t){let{decorative:n,orientation:r=Lf,...i}=e,a=Rf(r)?r:Lf,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,m.jsx)(Qe.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function Rf(e){return $te.includes(e)}If(Rf,`isValidOrientation`);var tne=Object.defineProperty,zf=(e,t)=>tne(e,`name`,{value:t,configurable:!0}),Bf=[`PageUp`,`PageDown`],Vf=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Hf={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Uf=`Slider`,[Wf,nne,rne]=dt(Uf),[Gf,ine]=st(Uf,[rne]),[ane,Kf]=Gf(Uf),one=f.forwardRef(zf(function(e,t){let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,preserveThumbOrder:l=!1,defaultValue:u=[r],value:d,onValueChange:p=zf(()=>{},`onValueChange`),onValueCommit:h=zf(()=>{},`onValueCommit`),inverted:g=!1,form:_,...v}=e,y=f.useRef(new Set),b=f.useRef(0),x=f.useRef(!1),S=o===`horizontal`?sne:cne,[C,w]=f.useState(null),T=Ie(t,w),[E=[],D]=Lt({prop:d,defaultProp:u,onChange:zf(e=>{[...y.current][b.current]?.focus({preventScroll:!0,focusVisible:x.current}),x.current=!1,p(e)},`onChange`)}),O=f.useRef(E),k=f.useRef(E);f.useEffect(()=>{let e=_?C?.ownerDocument.getElementById(_):C?.closest(`form`);if(e instanceof HTMLFormElement){let t=zf(()=>D(k.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[C,_,D]);function A(e){N(e,ip(E,e))}zf(A,`handleSlideStart`);function j(e){N(e,b.current)}zf(j,`handleSlideMove`);function M(){String(E)!==String(O.current)&&h(E)}zf(M,`handleSlideEnd`);function N(e,t,{commit:n}={commit:!1}){let o=lp(a),s=uu(up(Math.round((e-r)/a)*a+r,o),[r,i]);D((e=[])=>{let o=c*a,u=l?uu(s,[e[t-1]===void 0?r:e[t-1]+o,e[t+1]===void 0?i:e[t+1]-o]):s,d=tp(e,u,t);if(sp(d,o)){b.current=l?t:d.indexOf(u);let r=String(d)!==String(e);return r&&n&&h(d),r?d:e}else return e})}return zf(N,`updateValues`),(0,m.jsx)(ane,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:b,thumbs:y.current,values:E,orientation:o,form:_,children:(0,m.jsx)(Wf.Provider,{scope:e.__scopeSlider,children:(0,m.jsx)(Wf.Slot,{scope:e.__scopeSlider,children:(0,m.jsx)(S,{"aria-disabled":s,"data-disabled":s?``:void 0,...v,ref:T,onPointerDown:R(v.onPointerDown,()=>{s||(O.current=E,x.current=!1)}),min:r,max:i,inverted:g,onSlideStart:s?void 0:A,onSlideMove:s?void 0:j,onSlideEnd:s?void 0:M,onHomeKeyDown:()=>{s||(x.current=!0,N(r,0,{commit:!0}))},onEndKeyDown:()=>{s||(x.current=!0,N(i,E.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!s){x.current=!0;let n=Bf.includes(e.key)||e.shiftKey&&Vf.includes(e.key)?10:1,i=b.current,o=E[i];N(dp(o,{min:r,step:a,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[qf,Jf]=Gf(Uf,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),sne=f.forwardRef(zf(function(e,t){let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,p]=f.useState(null),h=Ie(t,p),g=f.useRef(void 0),_=_n(i),v=_===`ltr`,y=v&&!a||!v&&a;function b(e){let t=g.current||d.getBoundingClientRect(),i=cp([0,t.width],y?[n,r]:[r,n]);return g.current=t,i(e-t.left)}return zf(b,`getValueFromPointer`),(0,m.jsx)(qf,{scope:e.__scopeSlider,startEdge:y?`left`:`right`,endEdge:y?`right`:`left`,direction:y?1:-1,size:`width`,children:(0,m.jsx)(Yf,{dir:_,"data-orientation":`horizontal`,...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=b(e.clientX);o?.(t)},onSlideMove:e=>{let t=b(e.clientX);s?.(t)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:e=>{let t=Hf[y?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),cne=f.forwardRef(zf(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=f.useRef(null),d=Ie(t,u),p=f.useRef(void 0),h=!i;function g(e){let t=p.current||u.current.getBoundingClientRect(),i=cp([0,t.height],h?[r,n]:[n,r]);return p.current=t,i(e-t.top)}return zf(g,`getValueFromPointer`),(0,m.jsx)(qf,{scope:e.__scopeSlider,startEdge:h?`bottom`:`top`,endEdge:h?`top`:`bottom`,size:`height`,direction:h?1:-1,children:(0,m.jsx)(Yf,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=g(e.clientY);a?.(t)},onSlideMove:e=>{let t=g(e.clientY);o?.(t)},onSlideEnd:()=>{p.current=void 0,s?.()},onStepKeyDown:e=>{let t=Hf[h?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),Yf=f.forwardRef(zf(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Kf(Uf,n);return(0,m.jsx)(Qe.span,{...l,ref:t,onKeyDown:R(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Bf.concat(Vf).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:R(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:R(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:R(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),lne=`SliderTrack`,une=f.forwardRef(zf(function(e,t){let{__scopeSlider:n,...r}=e,i=Kf(lne,n);return(0,m.jsx)(Qe.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),Xf=`SliderRange`,dne=f.forwardRef(zf(function(e,t){let{__scopeSlider:n,...r}=e,i=Kf(Xf,n),a=Jf(Xf,n),o=Ie(t,f.useRef(null)),s=i.values.length,c=i.values.map(e=>np(e,i.min,i.max)),l=s>1?Math.min(...c):0,u=100-Math.max(...c);return(0,m.jsx)(Qe.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:u+`%`}})},`SliderRange`)),[fne,Zf]=Gf(`SliderThumb`),pne=`SliderThumbProvider`;function Qf(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=Kf(pne,t),o=nne(t),[s,c]=f.useState(null),l=f.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=Zi(s),d=s?!!a.form||!!s.closest(`form`):!0,p=a.values[l],h=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),g=p===void 0?0:np(p,a.min,a.max);f.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let _={value:p,name:h,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:g,size:u};return(0,m.jsx)(fne,{scope:t,..._,children:fp(i)?i(_):r})}zf(Qf,`SliderThumbProvider`);var $f=`SliderThumbTrigger`,mne=f.forwardRef(zf(function(e,t){let{__scopeSlider:n,...r}=e,i=Kf($f,n),a=Jf($f,n),{index:o,value:s,percent:c,size:l,onThumbChange:u}=Zf($f,n),d=Ie(t,u),f=rp(o,i.values.length),p=l?.[a.size],h=p?ap(p,c,a.direction):0;return(0,m.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[a.startEdge]:`calc(${c}% + ${h}px)`},children:(0,m.jsx)(Wf.ItemSlot,{scope:n,children:(0,m.jsx)(Qe.span,{role:`slider`,"aria-label":e[`aria-label`]||f,"aria-valuemin":i.min,"aria-valuenow":s,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:d,style:s===void 0?{display:`none`}:e.style,onFocus:R(e.onFocus,()=>{i.valueIndexToChangeRef.current=o})})})})},`SliderThumbTrigger`)),hne=f.forwardRef(zf(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,m.jsx)(Qf,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(mne,{...i,ref:t,__scopeSlider:n}),r?(0,m.jsx)(ep,{__scopeSlider:n},e):null]})})},`SliderThumb`)),gne=`SliderBubbleInput`,ep=f.forwardRef(zf(function({__scopeSlider:e,...t},n){let{value:r,name:i,form:a}=Zf(gne,e),o=f.useRef(null),s=Ie(o,n),c=su(r);return f.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(c!==r&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[c,r]),(0,m.jsx)(Qe.input,{style:{display:`none`},name:i,form:a,...t,ref:s,defaultValue:r})},`SliderBubbleInput`));function tp(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}zf(tp,`getNextSortedValues`);function np(e,t,n){return uu(100/(n-t)*(e-t),[0,100])}zf(np,`convertValueToPercentage`);function rp(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}zf(rp,`getLabel`);function ip(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}zf(ip,`getClosestValueIndex`);function ap(e,t,n){let r=e/2;return(r-cp([0,50],[0,r])(t)*n)*n}zf(ap,`getThumbInBoundsOffset`);function op(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}zf(op,`getStepsBetweenValues`);function sp(e,t){if(t>0){let n=op(e);return Math.min(...n)>=t}return!0}zf(sp,`hasMinStepsBetweenValues`);function cp(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}zf(cp,`linearScale`);function lp(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}zf(lp,`getDecimalCount`);function up(e,t){let n=10**t;return Math.round(e*n)/n}zf(up,`roundValue`);function dp(e,{min:t,step:n,direction:r,multiplier:i}){let a=lp(n),o=(e-t)/n,s=Math.round(o),c=up(s*n+t,a)===up(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),up(l*n+t,a)}zf(dp,`getNextStepValue`);function fp(e){return typeof e==`function`}zf(fp,`isFunction`);var pp=Object.defineProperty,mp=(e,t)=>pp(e,`name`,{value:t,configurable:!0}),hp=`Switch`,[gp,_ne]=st(hp),[_p,vp]=gp(hp);function yp(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[p,h]=Lt({prop:n,defaultProp:i??!1,onChange:c,caller:hp}),[g,_]=f.useState(null),[v,y]=f.useState(null),b=f.useRef(!1),[x,S]=f.useReducer(e=>e+1,0),C={checked:p,setChecked:h,disabled:a,control:g,setControl:_,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:b,userInteractionCount:x,onUserInteraction:S,required:l,defaultChecked:i,isFormControl:g?!!o||!!g.closest(`form`):!0,bubbleInput:v,setBubbleInput:y};return(0,m.jsx)(_p,{scope:t,...C,children:Dp(d)?d(C):r})}mp(yp,`SwitchProvider`);var bp=`SwitchTrigger`,xp=f.forwardRef(mp(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:p,onUserInteraction:h,isFormControl:g,bubbleInput:_}=vp(bp,e),v=Ie(r,u),y=f.useRef(c);return f.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=mp(()=>d(y.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,m.jsx)(Qe.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":Op(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:v,onClick:R(t,e=>{h(),d(e=>!e),_&&g&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})},`SwitchTrigger`)),Sp=f.forwardRef(mp(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,m.jsx)(yp,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(xp,{...d,ref:t,__scopeSwitch:n}),e&&(0,m.jsx)(Ep,{__scopeSwitch:n})]})})},`Switch`)),Cp=`SwitchThumb`,wp=f.forwardRef(mp(function(e,t){let{__scopeSwitch:n,...r}=e,i=vp(Cp,n);return(0,m.jsx)(Qe.span,{"data-state":Op(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),Tp=`SwitchBubbleInput`,Ep=f.forwardRef(mp(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:p,form:h,bubbleInput:g,setBubbleInput:_}=vp(Tp,e),v=Ie(r,_),y=Zi(i),b=f.useRef(!1),x=f.useRef(s),S=f.useRef(o);f.useEffect(()=>{let e=g;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==S.current;S.current=o;let i=x.current!==s;x.current=s;let c=!(r&&a.current);if(i&&n){b.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),b.current=!1}},[g,s,a,o]);let C=f.useRef(s);return(0,m.jsx)(Qe.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??C.current,required:l,disabled:u,name:d,value:p,form:h,...n,tabIndex:-1,ref:v,onClick:R(t,e=>{b.current&&e.stopPropagation()}),style:{...n.style,...y,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function Dp(e){return typeof e==`function`}mp(Dp,`isFunction`);function Op(e){return e?`checked`:`unchecked`}mp(Op,`getState`);var kp=Object.defineProperty,Ap=(e,t)=>kp(e,`name`,{value:t,configurable:!0}),jp=`Tabs`,[Mp,vne]=st(jp,[Xs]),Np=Xs(),[Pp,Fp]=Mp(jp),Ip=f.forwardRef(Ap(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=_n(s),[d,f]=Lt({prop:r,onChange:i,defaultProp:a??``,caller:jp});return(0,m.jsx)(Pp,{scope:n,baseId:$t(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,m.jsx)(Qe.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Lp=`TabsList`,Rp=f.forwardRef(Ap(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Fp(Lp,n),o=Np(n);return(0,m.jsx)($s,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,m.jsx)(Qe.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),zp=`TabsTrigger`,Bp=f.forwardRef(Ap(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Fp(zp,n),s=Np(n),c=Up(o.baseId,r),l=Wp(o.baseId,r),u=r===o.value;return(0,m.jsx)(nc,{asChild:!0,...s,focusable:!i,active:u,children:(0,m.jsx)(Qe.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:R(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:R(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:R(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Vp=`TabsContent`,Hp=f.forwardRef(Ap(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Fp(Vp,n),c=Up(s.baseId,r),l=Wp(s.baseId,r),u=r===s.value,d=f.useRef(u);return f.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,m.jsx)(Ut,{present:i||u,children:({present:n})=>(0,m.jsx)(Qe.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Up(e,t){return`${e}-trigger-${t}`}Ap(Up,`makeTriggerId`);function Wp(e,t){return`${e}-content-${t}`}Ap(Wp,`makeContentId`);var Gp=Object.defineProperty,Kp=(e,t)=>Gp(e,`name`,{value:t,configurable:!0}),qp=`Toggle`,Jp=f.forwardRef(Kp(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=Lt({prop:n,onChange:i,defaultProp:r??!1,caller:qp});return(0,m.jsx)(Qe.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:R(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Yp=Object.defineProperty,Xp=(e,t)=>Yp(e,`name`,{value:t,configurable:!0}),Zp=`ToggleGroup`,[Qp,yne]=st(Zp,[Xs]),$p=Xs(),em=f.forwardRef(Xp(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,m.jsx)(rm,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,m.jsx)(im,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Zp}\``)},`ToggleGroup`)),[tm,nm]=Qp(Zp),rm=f.forwardRef(Xp(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Xp(()=>{},`onValueChange`),...a}=e,[o,s]=Lt({prop:n,defaultProp:r??``,onChange:i,caller:Zp});return(0,m.jsx)(tm,{scope:e.__scopeToggleGroup,type:`single`,value:f.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:f.useCallback(()=>s(``),[s]),children:(0,m.jsx)(sm,{...a,ref:t})})},`ToggleGroupImplSingle`)),im=f.forwardRef(Xp(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Xp(()=>{},`onValueChange`),...a}=e,[o,s]=Lt({prop:n,defaultProp:r??[],onChange:i,caller:Zp}),c=f.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=f.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,m.jsx)(tm,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,m.jsx)(sm,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[am,om]=Qp(Zp),sm=f.forwardRef(Xp(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=$p(n),u=_n(o),d={dir:u,...c};return(0,m.jsx)(am,{scope:n,rovingFocus:i,disabled:r,children:i?(0,m.jsx)($s,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,m.jsx)(Qe.div,{...d,ref:t})}):(0,m.jsx)(Qe.div,{...d,ref:t})})},`ToggleGroupImpl`)),cm=`ToggleGroupItem`,lm=f.forwardRef(Xp(function(e,t){let n=nm(cm,e.__scopeToggleGroup),r=om(cm,e.__scopeToggleGroup),i=$p(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=f.useRef(null);return r.rovingFocus?(0,m.jsx)(nc,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,m.jsx)(um,{...s,ref:t})}):(0,m.jsx)(um,{...s,ref:t})},`ToggleGroupItem`)),um=f.forwardRef(Xp(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=nm(cm,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,m.jsx)(Jp,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),dm=Object.defineProperty,fm=(e,t)=>dm(e,`name`,{value:t,configurable:!0}),[pm,bne]=st(`Tooltip`,[_s]),mm=_s(),hm=`TooltipProvider`,gm=700,_m=`tooltip.open`,[vm,ym]=pm(hm),bm=fm(e=>{let{__scopeTooltip:t,delayDuration:n=gm,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=f.useRef(!0),s=f.useRef(!1),c=f.useRef(0);return f.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,m.jsx)(vm,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:f.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:f.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:f.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),xm=`Tooltip`,[Sm,Cm]=pm(xm),wm=fm(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=ym(xm,e.__scopeTooltip),l=mm(t),[u,d]=f.useState(null),[p,h]=f.useState(void 0),g=$t(),_=f.useRef(0),v=o??c.disableHoverableContent,y=s??c.delayDuration,b=f.useRef(!1),[x,S]=Lt({prop:r,defaultProp:i??!1,onChange:fm(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(_m))):c.onClose(),a?.(e)},`onChange`),caller:xm}),C=f.useMemo(()=>x?b.current?`delayed-open`:`instant-open`:`closed`,[x]),w=f.useCallback(()=>{window.clearTimeout(_.current),_.current=0,b.current=!1,S(!0)},[S]),T=f.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S(!1)},[S]),E=f.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{b.current=!0,S(!0),_.current=0},y)},[y,S]);f.useEffect(()=>()=>{_.current&&=(window.clearTimeout(_.current),0)},[]);let D=p??g;return(0,m.jsx)(bs,{...l,children:(0,m.jsx)(Sm,{scope:t,contentId:D,setContentId:h,open:x,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayedRef.current?E():w()},[c.isOpenDelayedRef,E,w]),onTriggerLeave:f.useCallback(()=>{v?T():(window.clearTimeout(_.current),_.current=0)},[T,v]),onOpen:w,onClose:T,disableHoverableContent:v,children:n})})},`Tooltip`),Tm=`TooltipTrigger`,Em=f.forwardRef(fm(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Cm(Tm,n),o=ym(Tm,n),s=mm(n),c=Ie(t,f.useRef(null),a.onTriggerChange),l=f.useRef(!1),u=f.useRef(!1),d=f.useCallback(()=>l.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,m.jsx)(Ss,{asChild:!0,...s,children:(0,m.jsx)(Qe.button,{"aria-describedby":a.open?Um(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:R(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:R(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:R(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:R(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:R(e.onBlur,a.onClose),onClick:R(e.onClick,a.onClose)})})},`TooltipTrigger`)),Dm=`TooltipPortal`,[Om,km]=pm(Dm,{forceMount:void 0}),Am=fm(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Cm(Dm,t);return(0,m.jsx)(Om,{scope:t,forceMount:n,children:(0,m.jsx)(Ut,{present:n||a.open,children:(0,m.jsx)(Yn,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),jm=`TooltipContent`,Mm=f.forwardRef(fm(function(e,t){let n=km(jm,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Cm(jm,e.__scopeTooltip);return(0,m.jsx)(Ut,{present:r||o.open,children:o.disableHoverableContent?(0,m.jsx)(Fm,{side:i,...a,ref:t}):(0,m.jsx)(Nm,{side:i,...a,ref:t})})},`TooltipContent`)),Nm=f.forwardRef(fm(function(e,t){let n=Cm(jm,e.__scopeTooltip),r=ym(jm,e.__scopeTooltip),i=f.useRef(null),a=Ie(t,i),[o,s]=f.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,p=f.useCallback(()=>{s(null),d(!1)},[d]),h=f.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Rm(r,Lm(r,n.getBoundingClientRect())),a=zm(t.getBoundingClientRect());s(Vm([...i,...a])),d(!0)},[d]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(c&&u){let e=fm(e=>h(e,u),`handleTriggerLeave`),t=fm(e=>h(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,h,p]),f.useEffect(()=>{if(o){let e=fm(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Bm(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,m.jsx)(Fm,{...e,ref:a})},`TooltipContentHoverable`)),Pm=Ge(`TooltipContent`),Fm=f.forwardRef(fm(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Cm(jm,n),u=mm(n),{onClose:d}=l;f.useEffect(()=>(document.addEventListener(_m,d),()=>document.removeEventListener(_m,d)),[d]),f.useEffect(()=>{if(l.trigger){let e=fm(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:p}=l;return kt(()=>(p(a),()=>{p(void 0)}),[a,p]),(0,m.jsx)(En,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,m.jsxs)(Es,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,m.jsx)(Pm,{children:r}),i?(0,m.jsx)(rt,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Im=f.forwardRef(fm(function(e,t){let{__scopeTooltip:n,...r}=e,i=mm(n);return(0,m.jsx)(ks,{...i,...r,ref:t})},`TooltipArrow`));function Lm(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}fm(Lm,`getExitSideFromRect`);function Rm(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}fm(Rm,`getPaddedExitPoints`);function zm(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}fm(zm,`getPointsFromRect`);function Bm(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}fm(Bm,`isPointInPolygon`);function Vm(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Hm(t)}fm(Vm,`getHull`);function Hm(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}fm(Hm,`getHullPresorted`);function Um(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}fm(Um,`concatAriaDescribedby`);var Wm=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Gm=(e,t)=>({classGroupId:e,validator:t}),Km=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qm=`-`,Jm=[],Ym=`arbitrary..`,Xm=e=>{let t=$m(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Qm(e);let n=e.split(qm);return Zm(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Wm(i,t):t:i||Jm}return n[e]||Jm}}},Zm=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Zm(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(qm):e.slice(t).join(qm),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Qm=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Ym+r:void 0})(),$m=e=>{let{theme:t,classGroups:n}=e;return eh(n,t)},eh=(e,t)=>{let n=Km();for(let r in e){let i=e[r];th(i,n,r,t)}return n},th=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];nh(i,t,n,r)}},nh=(e,t,n,r)=>{if(typeof e==`string`){rh(e,t,n);return}if(typeof e==`function`){ih(e,t,n,r);return}ah(e,t,n,r)},rh=(e,t,n)=>{let r=e===``?t:oh(t,e);r.classGroupId=n},ih=(e,t,n,r)=>{if(sh(e)){th(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Gm(n,e))},ah=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];th(o,oh(t,a),n,r)}},oh=(e,t)=>{let n=e,r=t.split(qm),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Km(),n.nextPart.set(t,i)),n=i}return n},sh=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ch=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},lh=`!`,uh=`:`,dh=[],fh=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ph=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===uh){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(lh)?(c=s.slice(0,-1),l=!0):s.startsWith(lh)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return fh(t,l,c,u)};if(t){let e=t+uh,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):fh(dh,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},mh=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},hh=e=>({cache:ch(e.cacheSize),parseClassName:ph(e),sortModifiers:mh(e),...Xm(e)}),gh=/\s+/,_h=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(gh),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+lh:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},vh=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=yh(n))&&(i&&(i+=` `),i+=r);return i},yh=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=yh(e[r]))&&(n&&(n+=` `),n+=t);return n},bh=(e,...t)=>{let n,r,i,a,o=o=>(n=hh(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=_h(e,n);return i(e,a),a};return a=o,(...e)=>a(vh(...e))},xh=[],Sh=e=>{let t=t=>t[e]||xh;return t.isThemeGetter=!0,t},Ch=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Th=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Eh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Dh=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Oh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ah=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jh=e=>Th.test(e),Mh=e=>!!e&&!Number.isNaN(Number(e)),Nh=e=>!!e&&Number.isInteger(Number(e)),Ph=e=>e.endsWith(`%`)&&Mh(e.slice(0,-1)),Fh=e=>Eh.test(e),Ih=()=>!0,Lh=e=>Dh.test(e)&&!Oh.test(e),Rh=()=>!1,zh=e=>kh.test(e),Bh=e=>Ah.test(e),Vh=e=>!Uh(e)&&!Zh(e),Hh=e=>ag(e,lg,Rh),Uh=e=>Ch.test(e),Wh=e=>ag(e,ug,Lh),Gh=e=>ag(e,dg,Mh),Kh=e=>ag(e,pg,Ih),qh=e=>ag(e,fg,Rh),Jh=e=>ag(e,sg,Rh),Yh=e=>ag(e,cg,Bh),Xh=e=>ag(e,mg,zh),Zh=e=>wh.test(e),Qh=e=>og(e,ug),$h=e=>og(e,fg),eg=e=>og(e,sg),tg=e=>og(e,lg),ng=e=>og(e,cg),rg=e=>og(e,mg,!0),ig=e=>og(e,pg,!0),ag=(e,t,n)=>{let r=Ch.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},og=(e,t,n=!1)=>{let r=wh.exec(e);return r?r[1]?t(r[1]):n:!1},sg=e=>e===`position`||e===`percentage`,cg=e=>e===`image`||e===`url`,lg=e=>e===`length`||e===`size`||e===`bg-size`,ug=e=>e===`length`,dg=e=>e===`number`,fg=e=>e===`family-name`,pg=e=>e===`number`||e===`weight`,mg=e=>e===`shadow`,hg=bh(()=>{let e=Sh(`color`),t=Sh(`font`),n=Sh(`text`),r=Sh(`font-weight`),i=Sh(`tracking`),a=Sh(`leading`),o=Sh(`breakpoint`),s=Sh(`container`),c=Sh(`spacing`),l=Sh(`radius`),u=Sh(`shadow`),d=Sh(`inset-shadow`),f=Sh(`text-shadow`),p=Sh(`drop-shadow`),m=Sh(`blur`),h=Sh(`perspective`),g=Sh(`aspect`),_=Sh(`ease`),v=Sh(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Zh,Uh],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Zh,Uh,c],T=()=>[jh,`full`,`auto`,...w()],E=()=>[Nh,`none`,`subgrid`,Zh,Uh],D=()=>[`auto`,{span:[`full`,Nh,Zh,Uh]},Nh,Zh,Uh],O=()=>[Nh,`auto`,Zh,Uh],k=()=>[`auto`,`min`,`max`,`fr`,Zh,Uh],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[jh,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ee=()=>[jh,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],P=()=>[jh,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],F=()=>[e,Zh,Uh],I=()=>[...b(),eg,Jh,{position:[Zh,Uh]}],L=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,tg,Hh,{size:[Zh,Uh]}],ne=()=>[Ph,Qh,Wh],re=()=>[``,`none`,`full`,l,Zh,Uh],ie=()=>[``,Mh,Qh,Wh],ae=()=>[`solid`,`dashed`,`dotted`,`double`],oe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],se=()=>[Mh,Ph,eg,Jh],ce=()=>[``,`none`,m,Zh,Uh],le=()=>[`none`,Mh,Zh,Uh],ue=()=>[`none`,Mh,Zh,Uh],de=()=>[Mh,Zh,Uh],fe=()=>[jh,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Fh],breakpoint:[Fh],color:[Ih],container:[Fh],"drop-shadow":[Fh],ease:[`in`,`out`,`in-out`],font:[Vh],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Fh],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Fh],shadow:[Fh],spacing:[`px`,Mh],text:[Fh],"text-shadow":[Fh],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,jh,Uh,Zh,g]}],container:[`container`],columns:[{columns:[Mh,Uh,Zh,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Nh,`auto`,Zh,Uh]}],basis:[{basis:[jh,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Mh,jh,`auto`,`initial`,`none`,Uh]}],grow:[{grow:[``,Mh,Zh,Uh]}],shrink:[{shrink:[``,Mh,Zh,Uh]}],order:[{order:[Nh,`first`,`last`,`none`,Zh,Uh]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...ee()]}],"min-inline-size":[{"min-inline":[`auto`,...ee()]}],"max-inline-size":[{"max-inline":[`none`,...ee()]}],"block-size":[{block:[`auto`,...P()]}],"min-block-size":[{"min-block":[`auto`,...P()]}],"max-block-size":[{"max-block":[`none`,...P()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Qh,Wh]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ig,Kh]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ph,Uh]}],"font-family":[{font:[$h,qh,t]}],"font-features":[{"font-features":[Uh]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Zh,Uh]}],"line-clamp":[{"line-clamp":[Mh,`none`,Zh,Gh]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,Zh,Uh]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Zh,Uh]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ae(),`wavy`]}],"text-decoration-thickness":[{decoration:[Mh,`from-font`,`auto`,Zh,Wh]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[Mh,`auto`,Zh,Uh]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Zh,Uh]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Zh,Uh]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:L()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Nh,Zh,Uh],radial:[``,Zh,Uh],conic:[Nh,Zh,Uh]},ng,Yh]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ae(),`hidden`,`none`]}],"divide-style":[{divide:[...ae(),`hidden`,`none`]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ae(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Mh,Zh,Uh]}],"outline-w":[{outline:[``,Mh,Qh,Wh]}],"outline-color":[{outline:F()}],shadow:[{shadow:[``,`none`,u,rg,Xh]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":[`none`,d,rg,Xh]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:ie()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[Mh,Wh]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":[`none`,f,rg,Xh]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[Mh,Zh,Uh]}],"mix-blend":[{"mix-blend":[...oe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Mh]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[Zh,Uh]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Mh]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:L()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Zh,Uh]}],filter:[{filter:[``,`none`,Zh,Uh]}],blur:[{blur:ce()}],brightness:[{brightness:[Mh,Zh,Uh]}],contrast:[{contrast:[Mh,Zh,Uh]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,rg,Xh]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:[``,Mh,Zh,Uh]}],"hue-rotate":[{"hue-rotate":[Mh,Zh,Uh]}],invert:[{invert:[``,Mh,Zh,Uh]}],saturate:[{saturate:[Mh,Zh,Uh]}],sepia:[{sepia:[``,Mh,Zh,Uh]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Zh,Uh]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Mh,Zh,Uh]}],"backdrop-contrast":[{"backdrop-contrast":[Mh,Zh,Uh]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Mh,Zh,Uh]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Mh,Zh,Uh]}],"backdrop-invert":[{"backdrop-invert":[``,Mh,Zh,Uh]}],"backdrop-opacity":[{"backdrop-opacity":[Mh,Zh,Uh]}],"backdrop-saturate":[{"backdrop-saturate":[Mh,Zh,Uh]}],"backdrop-sepia":[{"backdrop-sepia":[``,Mh,Zh,Uh]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Zh,Uh]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Mh,`initial`,Zh,Uh]}],ease:[{ease:[`linear`,`initial`,_,Zh,Uh]}],delay:[{delay:[Mh,Zh,Uh]}],animate:[{animate:[`none`,v,Zh,Uh]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Zh,Uh]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[Zh,Uh,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":[`translate-none`],accent:[{accent:F()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Zh,Uh]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Zh,Uh]}],fill:[{fill:[`none`,...F()]}],"stroke-w":[{stroke:[Mh,Qh,Wh,Gh]}],stroke:[{stroke:[`none`,...F()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function z(...e){return hg(Oe(e))}var gg=je(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 active:scale-[0.97] transition-transform duration-150`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function B({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,m.jsx)(r?Ue:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:z(gg({variant:t,size:n,className:e})),...i})}function _g({...e}){return(0,m.jsx)(Ri,{"data-slot":`alert-dialog`,...e})}function vg({...e}){return(0,m.jsx)(zi,{"data-slot":`alert-dialog-portal`,...e})}function yg({className:e,...t}){return(0,m.jsx)(Bi,{"data-slot":`alert-dialog-overlay`,className:z(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function bg({className:e,size:t=`default`,...n}){return(0,m.jsxs)(vg,{children:[(0,m.jsx)(yg,{}),(0,m.jsx)(Ui,{"data-slot":`alert-dialog-content`,"data-size":t,className:z(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function xg({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:z(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Sg({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:z(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Cg({className:e,...t}){return(0,m.jsx)(Wi,{"data-slot":`alert-dialog-title`,className:z(`text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function wg({className:e,...t}){return(0,m.jsx)(Gi,{"data-slot":`alert-dialog-description`,className:z(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function Tg({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,m.jsx)(B,{variant:t,size:n,asChild:!0,children:(0,m.jsx)(Ki,{"data-slot":`alert-dialog-action`,className:z(e),...r})})}function Eg({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,m.jsx)(B,{variant:t,size:n,asChild:!0,children:(0,m.jsx)(Ji,{"data-slot":`alert-dialog-cancel`,className:z(e),...r})})}function Dg({className:e,type:t,...n}){return(0,m.jsx)(`input`,{type:t,"data-slot":`input`,className:z(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function Og({className:e,...t}){return(0,m.jsx)(iu,{"data-slot":`label`,className:z(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var kg=e=>{let[t,n]=(0,d.useState)(``),r=e.requireConfirmationInput,i=r?.confirmTerm??``,a=!r||t===i,o=(r?.label??`Type {{confirmTerm}} to confirm`).split(`{{confirmTerm}}`);return(0,m.jsx)(_g,{open:e.isOpen,onOpenChange:t=>{t||(n(``),e.onCancel())},children:(0,m.jsxs)(bg,{children:[(0,m.jsxs)(xg,{children:[(0,m.jsx)(Cg,{children:e.title}),(0,m.jsx)(wg,{children:e.description})]}),r&&(0,m.jsxs)(`div`,{className:`grid gap-2`,children:[(0,m.jsx)(Og,{htmlFor:`confirm-type-input`,children:o.map((e,t)=>t<o.length-1?(0,m.jsxs)(`span`,{children:[e,(0,m.jsx)(`span`,{className:`font-bold`,children:i})]},t):(0,m.jsx)(`span`,{children:e},t))}),(0,m.jsx)(Dg,{id:`confirm-type-input`,value:t,onChange:e=>n(e.target.value),onKeyDown:t=>{t.key===`Enter`&&a&&(t.preventDefault(),n(``),e.onConfirm())},placeholder:i,autoComplete:`off`}),r.hint&&(0,m.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:r.hint})]}),(0,m.jsxs)(Sg,{children:[(0,m.jsx)(Eg,{className:`active:scale-[0.97] transition-transform duration-150`,onClick:t=>{t.preventDefault(),n(``),e.onCancel()},children:e.cancelButtonText}),(0,m.jsx)(Tg,{variant:e.variant,className:`active:scale-[0.97] transition-transform duration-150`,disabled:!a,onClick:t=>{t.preventDefault(),n(``),e.onConfirm()},children:e.confirmButtonText})]})]})})},Ag=(0,d.createContext)(void 0),jg=({children:e})=>{let[t,n]=(0,d.useState)({}),[r,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(null),s=(0,d.useCallback)(e=>(o(e=>(e&&e(!1),null)),n(e),i(!0),new Promise(e=>{o(()=>e)})),[]);return(0,m.jsxs)(Ag.Provider,{value:{confirm:s},children:[e,(0,m.jsx)(kg,{isOpen:r,title:t.title||`Confirm Action`,description:t.description||`Are you sure you want to proceed?`,confirmButtonText:t.confirmButtonText||`Confirm`,cancelButtonText:t.cancelButtonText||`Cancel`,variant:t.variant||`default`,requireConfirmationInput:t.requireConfirmationInput,onConfirm:()=>{a&&a(!0),i(!1),o(null)},onCancel:()=>{a&&a(!1),i(!1),o(null)}})]})},Mg=()=>{let e=(0,d.useContext)(Ag);if(!e)throw Error(`useConfirm must be used within a ConfirmDialogProvider`);return e.confirm},Ng={en:{empty:{noVisibleItems:`This survey does not currently render any player-visible items.`},navigation:{previousButtonLabel:`Previous`,nextButtonLabel:`Next`,submitButtonLabel:`Submit`,pageIndicator:`Page {current} of {total}`},contentAvailability:{noContentForLocale:`No content available for the selected language: {locale}.`,noTitleForLocale:`No title available for the selected language: {locale}.`}}},Pg=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Fg=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]=Pg(r)?Fg(r):r;return t},Ig=(e,t)=>{let n=Fg(e);for(let[e,r]of Object.entries(t)){let t=n[e];if(Pg(t)&&Pg(r)){n[e]=Ig(t,r);continue}n[e]=Pg(r)?Fg(r):r}return n},Lg=e=>e.trim().replaceAll(`_`,`-`).toLowerCase(),Rg=(e,...t)=>{let n={};for(let r of[e,...t])if(r)for(let[e,t]of Object.entries(r)){let r=Lg(e);if(!r)continue;let i=n[r];n[r]=i?Ig(i,t):Fg(t)}return n},zg=(e,t)=>{let n=Lg(t)||Lg(`en`),r=Lg(e)||n;return Array.from(new Set([r,r.split(`-`)[0],n,n.split(`-`)[0]]))},Bg=(e,t)=>{if(!e)return;let n=e;for(let e of t.split(`.`)){if(!Pg(n)||!(e in n))return;n=n[e]}return typeof n==`string`?n:void 0},Vg=(e,t)=>t?e.replace(/\{([a-zA-Z0-9_]+)\}/g,(e,n)=>{let r=t[n];return r==null?`{${n}}`:String(r)}):e,Hg=({fallbackLocale:e,locale:t,localizations:n,onMissing:r})=>(i,a)=>{for(let r of zg(t,e)){let e=Bg(n[r],i);if(e!==void 0)return Vg(e,a)}return r?.(i,t),i},Ug=(e,t)=>{let n=t?.trim();return n?(t,r)=>e(`${n}.${t}`,r):e},Wg=(...e)=>Rg(Ng,...e),Gg=(...e)=>Rg({},...e),Kg=(e,t)=>Hg({fallbackLocale:`en`,locale:e,localizations:t,onMissing:(e,t)=>console.log(`[SurveyPlayer] Missing localization for key "${e}" in language "${t}".`)}),qg=(e,t)=>Ug(e,t),Jg=(0,d.createContext)(null),Yg=({survey:e,locale:t,surveyEngine:n,surveyPlayerRegistry:r,translate:i,children:a,onRunExternalHandler:o,onResponseChanged:s})=>{let c={survey:e,locale:t,surveyEngine:n,surveyPlayerRegistry:r,runExternalHandler:o,onResponseChanged:s,translate:i};return(0,m.jsx)(Jg.Provider,{value:c,children:(0,m.jsx)(jg,{children:a})})},Xg=({survey:e,locale:t,surveyEngine:n,surveyPlayerRegistry:r,localizations:i,children:a,onRunExternalHandler:o,onResponseChanged:s})=>{let c=(0,d.useMemo)(()=>Wg(r?.localizations,i),[i,r?.localizations]);return(0,m.jsx)(Yg,{locale:t,onResponseChanged:s,onRunExternalHandler:o,survey:e,surveyEngine:n,surveyPlayerRegistry:r,translate:(0,d.useMemo)(()=>Kg(t,c),[t,c]),children:a})},Zg=()=>{let e=(0,d.useContext)(Jg);if(!e)throw Error(`useSurvey must be used within SurveyProvider`);return e},Qg=e=>{let{translate:t}=Zg();return(0,d.useMemo)(()=>qg(t,e),[e,t])},$g=(0,d.createContext)(null),e_=(0,d.createContext)(null),t_=({children:e,renderedItemInfos:t})=>{let{survey:n,surveyEngine:r,onResponseChanged:i}=Zg(),a=t.id,[o,s]=(0,d.useState)(r.getResponseItem(a)?.response),c=(0,d.useMemo)(()=>n.surveyItems.get(a),[n,a]),l=(0,d.useMemo)(()=>n.getItemTranslations(a),[n,a]),u=(0,d.useCallback)(e=>{r.setResponse(a,e),s(r.getResponseItem(a)?.response),i?.()},[a,i,r]),f=(0,d.useMemo)(()=>({item:c,renderedItemInfos:t,itemTranslations:l,headerId:`${a}-header`}),[c,a,l,t]),p=(0,d.useMemo)(()=>({currentResponse:o,setResponse:u}),[o,u]);return(0,m.jsx)($g.Provider,{value:f,children:(0,m.jsx)(e_.Provider,{value:p,children:(0,m.jsx)(`div`,{className:`@container`,children:e})})})},n_=()=>{let e=(0,d.useContext)($g);if(!e)throw Error(`useSurveyItemStaticCtx must be used within a SurveyItemContextProvider`);return e},r_=()=>{let e=(0,d.useContext)(e_);if(!e)throw Error(`useSurveyItemResponseCtx must be used within a SurveyItemContextProvider`);return e},i_={blank:`blank`,incomplete:`incomplete`,ready:`ready`},a_={special:{en:`Special Items`},display:{en:`Display`},form:{en:`Forms`},question:{en:`Questions`},structure:{en:`Structure`}};function o_(e,t=`en`){return e[t]??e.en??Object.values(e)[0]??``}function s_(e,t,n=`en`){let r=t[e];return r?o_(r,n):e}var c_=e=>e===void 0?`undefined`:typeof e!=`object`||!e?JSON.stringify(e)??`undefined`:Array.isArray(e)?`[${e.map(e=>c_(e)).join(`,`)}]`:`{${Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${JSON.stringify(e)}:${c_(t)}`).join(`,`)}}`,l_=e=>{let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)},u_=e=>l_(c_(e));Object.freeze({status:`aborted`});function V(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var d_=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},f_=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},p_={};function m_(e){return e&&Object.assign(p_,e),p_}function h_(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function g_(e,t){return typeof t==`bigint`?t.toString():t}function __(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function v_(e){return e==null}function y_(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function b_(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var x_=Symbol(`evaluating`);function S_(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==x_)return r===void 0&&(r=x_,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function C_(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function w_(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function T_(e){return JSON.stringify(e)}function E_(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var D_=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function O_(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var k_=__(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function A_(e){if(O_(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(O_(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function j_(e){return A_(e)?{...e}:Array.isArray(e)?[...e]:e}var M_=new Set([`string`,`number`,`symbol`]);function N_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function P_(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function F_(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function I_(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var L_={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function R_(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return P_(e,w_(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return C_(this,`shape`,e),e},checks:[]}))}function z_(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return P_(e,w_(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return C_(this,`shape`,r),r},checks:[]}))}function B_(e,t){if(!A_(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return P_(e,w_(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return C_(this,`shape`,n),n}}))}function V_(e,t){if(!A_(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return P_(e,w_(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return C_(this,`shape`,n),n}}))}function H_(e,t){return P_(e,w_(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return C_(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function U_(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return P_(t,w_(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return C_(this,`shape`,i),i},checks:[]}))}function W_(e,t,n){return P_(t,w_(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return C_(this,`shape`,i),i}}))}function G_(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function K_(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function q_(e){return typeof e==`string`?e:e?.message}function J_(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=q_(e.inst?._zod.def?.error?.(e))??q_(t?.error?.(e))??q_(n.customError?.(e))??q_(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Y_(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function X_(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Z_=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,g_,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Q_=V(`$ZodError`,Z_),$_=V(`$ZodError`,Z_,{Parent:Error});function ev(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function tv(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var nv=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new d_;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>J_(e,a,m_())));throw D_(t,i?.callee),t}return o.value},rv=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>J_(e,a,m_())));throw D_(t,i?.callee),t}return o.value},iv=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new d_;return a.issues.length?{success:!1,error:new(e??Q_)(a.issues.map(e=>J_(e,i,m_())))}:{success:!0,data:a.value}},av=iv($_),ov=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>J_(e,i,m_())))}:{success:!0,data:a.value}},sv=ov($_),cv=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return nv(e)(t,n,i)},lv=e=>(t,n,r)=>nv(e)(t,n,r),uv=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return rv(e)(t,n,i)},dv=e=>async(t,n,r)=>rv(e)(t,n,r),fv=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return iv(e)(t,n,i)},pv=e=>(t,n,r)=>iv(e)(t,n,r),mv=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return ov(e)(t,n,i)},hv=e=>async(t,n,r)=>ov(e)(t,n,r),gv=/^[cC][^\s-]{8,}$/,_v=/^[0-9a-z]+$/,vv=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,yv=/^[0-9a-vA-V]{20}$/,bv=/^[A-Za-z0-9]{27}$/,xv=/^[a-zA-Z0-9_-]{21}$/,Sv=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Cv=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,wv=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Tv=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ev=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Dv(){return new RegExp(Ev,`u`)}var Ov=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,kv=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Av=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,jv=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mv=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Nv=/^[A-Za-z0-9_-]*$/,Pv=/^\+[1-9]\d{6,14}$/,Fv=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Iv=RegExp(`^${Fv}$`);function Lv(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Rv(e){return RegExp(`^${Lv(e)}$`)}function zv(e){let t=Lv({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Fv}T(?:${r})$`)}var Bv=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Vv=/^-?\d+$/,Hv=/^-?\d+(?:\.\d+)?$/,Uv=/^(?:true|false)$/i,Wv=/^null$/i,Gv=/^[^A-Z]*$/,Kv=/^[^a-z]*$/,qv=V(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Jv={number:`number`,bigint:`bigint`,object:`date`},Yv=V(`$ZodCheckLessThan`,(e,t)=>{qv.init(e,t);let n=Jv[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xv=V(`$ZodCheckGreaterThan`,(e,t)=>{qv.init(e,t);let n=Jv[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zv=V(`$ZodCheckMultipleOf`,(e,t)=>{qv.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):b_(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Qv=V(`$ZodCheckNumberFormat`,(e,t)=>{qv.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=L_[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Vv)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),$v=V(`$ZodCheckMaxLength`,(e,t)=>{var n;qv.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!v_(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Y_(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ey=V(`$ZodCheckMinLength`,(e,t)=>{var n;qv.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!v_(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Y_(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ty=V(`$ZodCheckLengthEquals`,(e,t)=>{var n;qv.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!v_(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Y_(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ny=V(`$ZodCheckStringFormat`,(e,t)=>{var n,r;qv.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ry=V(`$ZodCheckRegex`,(e,t)=>{ny.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),iy=V(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Gv,ny.init(e,t)}),ay=V(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Kv,ny.init(e,t)}),oy=V(`$ZodCheckIncludes`,(e,t)=>{qv.init(e,t);let n=N_(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),sy=V(`$ZodCheckStartsWith`,(e,t)=>{qv.init(e,t);let n=RegExp(`^${N_(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),cy=V(`$ZodCheckEndsWith`,(e,t)=>{qv.init(e,t);let n=RegExp(`.*${N_(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ly=V(`$ZodCheckOverwrite`,(e,t)=>{qv.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),uy=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
47
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
48
|
-
`))}},dy={major:4,minor:3,patch:6},fy=V(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=dy;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=G_(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new d_;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=G_(e,t))});else{if(e.issues.length===t)continue;r||=G_(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(G_(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new d_;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new d_;return o.then(e=>t(e,r,a))}return t(o,r,a)}}S_(e,`~standard`,()=>({validate:t=>{try{let n=av(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return sv(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),py=V(`$ZodString`,(e,t)=>{fy.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Bv(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),my=V(`$ZodStringFormat`,(e,t)=>{ny.init(e,t),py.init(e,t)}),hy=V(`$ZodGUID`,(e,t)=>{t.pattern??=Cv,my.init(e,t)}),gy=V(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=wv(e)}else t.pattern??=wv();my.init(e,t)}),_y=V(`$ZodEmail`,(e,t)=>{t.pattern??=Tv,my.init(e,t)}),vy=V(`$ZodURL`,(e,t)=>{my.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),yy=V(`$ZodEmoji`,(e,t)=>{t.pattern??=Dv(),my.init(e,t)}),by=V(`$ZodNanoID`,(e,t)=>{t.pattern??=xv,my.init(e,t)}),xy=V(`$ZodCUID`,(e,t)=>{t.pattern??=gv,my.init(e,t)}),Sy=V(`$ZodCUID2`,(e,t)=>{t.pattern??=_v,my.init(e,t)}),Cy=V(`$ZodULID`,(e,t)=>{t.pattern??=vv,my.init(e,t)}),wy=V(`$ZodXID`,(e,t)=>{t.pattern??=yv,my.init(e,t)}),Ty=V(`$ZodKSUID`,(e,t)=>{t.pattern??=bv,my.init(e,t)}),Ey=V(`$ZodISODateTime`,(e,t)=>{t.pattern??=zv(t),my.init(e,t)}),Dy=V(`$ZodISODate`,(e,t)=>{t.pattern??=Iv,my.init(e,t)}),Oy=V(`$ZodISOTime`,(e,t)=>{t.pattern??=Rv(t),my.init(e,t)}),ky=V(`$ZodISODuration`,(e,t)=>{t.pattern??=Sv,my.init(e,t)}),Ay=V(`$ZodIPv4`,(e,t)=>{t.pattern??=Ov,my.init(e,t),e._zod.bag.format=`ipv4`}),jy=V(`$ZodIPv6`,(e,t)=>{t.pattern??=kv,my.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),My=V(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Av,my.init(e,t)}),Ny=V(`$ZodCIDRv6`,(e,t)=>{t.pattern??=jv,my.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Py(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Fy=V(`$ZodBase64`,(e,t)=>{t.pattern??=Mv,my.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Py(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Iy(e){if(!Nv.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Py(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Ly=V(`$ZodBase64URL`,(e,t)=>{t.pattern??=Nv,my.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Iy(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ry=V(`$ZodE164`,(e,t)=>{t.pattern??=Pv,my.init(e,t)});function zy(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var By=V(`$ZodJWT`,(e,t)=>{my.init(e,t),e._zod.check=n=>{zy(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Vy=V(`$ZodNumber`,(e,t)=>{fy.init(e,t),e._zod.pattern=e._zod.bag.pattern??Hv,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Hy=V(`$ZodNumberFormat`,(e,t)=>{Qv.init(e,t),Vy.init(e,t)}),Uy=V(`$ZodBoolean`,(e,t)=>{fy.init(e,t),e._zod.pattern=Uv,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Wy=V(`$ZodNull`,(e,t)=>{fy.init(e,t),e._zod.pattern=Wv,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Gy=V(`$ZodAny`,(e,t)=>{fy.init(e,t),e._zod.parse=e=>e}),Ky=V(`$ZodUnknown`,(e,t)=>{fy.init(e,t),e._zod.parse=e=>e}),qy=V(`$ZodNever`,(e,t)=>{fy.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Jy(e,t,n){e.issues.length&&t.issues.push(...K_(n,e.issues)),t.value[n]=e.value}var Yy=V(`$ZodArray`,(e,t)=>{fy.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Jy(t,n,e))):Jy(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Xy(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...K_(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Zy(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=I_(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Qy(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Xy(e,n,i,t,u))):Xy(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var $y=V(`$ZodObject`,(e,t)=>{if(fy.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=__(()=>Zy(t));S_(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=O_,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Xy(n,t,e,s,r))):Xy(i,t,e,s,r)}return i?Qy(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),eb=V(`$ZodObjectJIT`,(e,t)=>{$y.init(e,t);let n=e._zod.parse,r=__(()=>Zy(t)),i=e=>{let t=new uy([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=T_(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=T_(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
|
|
49
|
-
if (${n}.issues.length) {
|
|
50
|
-
if (${o} in input) {
|
|
51
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
52
|
-
...iss,
|
|
53
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
54
|
-
})));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (${n}.value === undefined) {
|
|
59
|
-
if (${o} in input) {
|
|
60
|
-
newResult[${o}] = undefined;
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
newResult[${o}] = ${n}.value;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
`):t.write(`
|
|
67
|
-
if (${n}.issues.length) {
|
|
68
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
69
|
-
...iss,
|
|
70
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
71
|
-
})));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (${n}.value === undefined) {
|
|
75
|
-
if (${o} in input) {
|
|
76
|
-
newResult[${o}] = undefined;
|
|
77
|
-
}
|
|
78
|
-
} else {
|
|
79
|
-
newResult[${o}] = ${n}.value;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=O_,s=!p_.jitless,c=s&&k_.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Qy([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function tb(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!G_(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>J_(e,r,m_())))}),t)}var nb=V(`$ZodUnion`,(e,t)=>{fy.init(e,t),S_(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),S_(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),S_(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),S_(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>y_(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>tb(t,i,e,a)):tb(s,i,e,a)}}),rb=V(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,nb.init(e,t);let n=e._zod.parse;S_(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=__(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!O_(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),ib=V(`$ZodIntersection`,(e,t)=>{fy.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>ob(e,t,n)):ob(e,i,a)}});function ab(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(A_(e)&&A_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ab(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ab(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ob(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),G_(e))return e;let o=ab(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var sb=V(`$ZodRecord`,(e,t)=>{fy.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!A_(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...K_(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...K_(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Hv.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>J_(e,r,m_())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...K_(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...K_(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),cb=V(`$ZodEnum`,(e,t)=>{fy.init(e,t);let n=h_(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>M_.has(typeof e)).map(e=>typeof e==`string`?N_(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),lb=V(`$ZodLiteral`,(e,t)=>{if(fy.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?N_(e):e?N_(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),ub=V(`$ZodTransform`,(e,t)=>{fy.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new f_(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new d_;return n.value=i,n}});function db(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var fb=V(`$ZodOptional`,(e,t)=>{fy.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,S_(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),S_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${y_(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>db(t,e.value)):db(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),pb=V(`$ZodExactOptional`,(e,t)=>{fb.init(e,t),S_(e._zod,`values`,()=>t.innerType._zod.values),S_(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),mb=V(`$ZodNullable`,(e,t)=>{fy.init(e,t),S_(e._zod,`optin`,()=>t.innerType._zod.optin),S_(e._zod,`optout`,()=>t.innerType._zod.optout),S_(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${y_(e.source)}|null)$`):void 0}),S_(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),hb=V(`$ZodDefault`,(e,t)=>{fy.init(e,t),e._zod.optin=`optional`,S_(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>gb(e,t)):gb(r,t)}});function gb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var _b=V(`$ZodPrefault`,(e,t)=>{fy.init(e,t),e._zod.optin=`optional`,S_(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),vb=V(`$ZodNonOptional`,(e,t)=>{fy.init(e,t),S_(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>yb(t,e)):yb(i,e)}});function yb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var bb=V(`$ZodCatch`,(e,t)=>{fy.init(e,t),S_(e._zod,`optin`,()=>t.innerType._zod.optin),S_(e._zod,`optout`,()=>t.innerType._zod.optout),S_(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>J_(e,n,m_()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>J_(e,n,m_()))},input:e.value}),e.issues=[]),e)}}),xb=V(`$ZodPipe`,(e,t)=>{fy.init(e,t),S_(e._zod,`values`,()=>t.in._zod.values),S_(e._zod,`optin`,()=>t.in._zod.optin),S_(e._zod,`optout`,()=>t.out._zod.optout),S_(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Sb(e,t.in,n)):Sb(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Sb(e,t.out,n)):Sb(r,t.out,n)}});function Sb(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Cb=V(`$ZodReadonly`,(e,t)=>{fy.init(e,t),S_(e._zod,`propValues`,()=>t.innerType._zod.propValues),S_(e._zod,`values`,()=>t.innerType._zod.values),S_(e._zod,`optin`,()=>t.innerType?._zod?.optin),S_(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(wb):wb(r)}});function wb(e){return e.value=Object.freeze(e.value),e}var Tb=V(`$ZodLazy`,(e,t)=>{fy.init(e,t),S_(e._zod,`innerType`,()=>t.getter()),S_(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),S_(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),S_(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),S_(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Eb=V(`$ZodCustom`,(e,t)=>{qv.init(e,t),fy.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Db(t,n,r,e));Db(i,n,r,e)}});function Db(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(X_(e))}}var Ob,kb=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ab(){return new kb}(Ob=globalThis).__zod_globalRegistry??(Ob.__zod_globalRegistry=Ab());var jb=globalThis.__zod_globalRegistry;function Mb(e,t){return new e({type:`string`,...F_(t)})}function Nb(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...F_(t)})}function Pb(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...F_(t)})}function Fb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...F_(t)})}function Ib(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...F_(t)})}function Lb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...F_(t)})}function Rb(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...F_(t)})}function zb(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...F_(t)})}function Bb(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...F_(t)})}function Vb(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...F_(t)})}function Hb(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...F_(t)})}function Ub(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...F_(t)})}function Wb(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...F_(t)})}function Gb(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...F_(t)})}function xne(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...F_(t)})}function Sne(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...F_(t)})}function Cne(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...F_(t)})}function wne(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...F_(t)})}function Tne(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...F_(t)})}function Ene(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...F_(t)})}function Dne(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...F_(t)})}function One(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...F_(t)})}function kne(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...F_(t)})}function Ane(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...F_(t)})}function jne(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...F_(t)})}function Mne(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...F_(t)})}function Nne(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...F_(t)})}function Pne(e,t){return new e({type:`number`,checks:[],...F_(t)})}function Fne(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...F_(t)})}function Ine(e,t){return new e({type:`boolean`,...F_(t)})}function Lne(e,t){return new e({type:`null`,...F_(t)})}function Rne(e){return new e({type:`any`})}function zne(e){return new e({type:`unknown`})}function Bne(e,t){return new e({type:`never`,...F_(t)})}function Kb(e,t){return new Yv({check:`less_than`,...F_(t),value:e,inclusive:!1})}function qb(e,t){return new Yv({check:`less_than`,...F_(t),value:e,inclusive:!0})}function Jb(e,t){return new Xv({check:`greater_than`,...F_(t),value:e,inclusive:!1})}function Yb(e,t){return new Xv({check:`greater_than`,...F_(t),value:e,inclusive:!0})}function Xb(e,t){return new Zv({check:`multiple_of`,...F_(t),value:e})}function Zb(e,t){return new $v({check:`max_length`,...F_(t),maximum:e})}function Qb(e,t){return new ey({check:`min_length`,...F_(t),minimum:e})}function $b(e,t){return new ty({check:`length_equals`,...F_(t),length:e})}function Vne(e,t){return new ry({check:`string_format`,format:`regex`,...F_(t),pattern:e})}function Hne(e){return new iy({check:`string_format`,format:`lowercase`,...F_(e)})}function Une(e){return new ay({check:`string_format`,format:`uppercase`,...F_(e)})}function Wne(e,t){return new oy({check:`string_format`,format:`includes`,...F_(t),includes:e})}function Gne(e,t){return new sy({check:`string_format`,format:`starts_with`,...F_(t),prefix:e})}function Kne(e,t){return new cy({check:`string_format`,format:`ends_with`,...F_(t),suffix:e})}function ex(e){return new ly({check:`overwrite`,tx:e})}function qne(e){return ex(t=>t.normalize(e))}function Jne(){return ex(e=>e.trim())}function Yne(){return ex(e=>e.toLowerCase())}function Xne(){return ex(e=>e.toUpperCase())}function Zne(){return ex(e=>E_(e))}function Qne(e,t,n){return new e({type:`array`,element:t,...F_(n)})}function $ne(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...F_(n)})}function ere(e){let t=tre(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(X_(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(X_(r))}},e(n.value,n)));return t}function tre(e,t){let n=new qv({check:`custom`,...F_(t)});return n._zod.check=e,n}function tx(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??jb,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function nx(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,nx(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&ax(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function rx(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
83
|
-
|
|
84
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ix(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:ox(t,`input`,e.processors),output:ox(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ax(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return ax(r.element,n);if(r.type===`set`)return ax(r.valueType,n);if(r.type===`lazy`)return ax(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return ax(r.innerType,n);if(r.type===`intersection`)return ax(r.left,n)||ax(r.right,n);if(r.type===`record`||r.type===`map`)return ax(r.keyType,n)||ax(r.valueType,n);if(r.type===`pipe`)return ax(r.in,n)||ax(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ax(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ax(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ax(e,n))return!0;return!!(r.rest&&ax(r.rest,n))}return!1}var nre=(e,t={})=>n=>{let r=tx({...n,processors:t});return nx(e,r),rx(r,e),ix(r,e)},ox=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=tx({...i??{},target:a,io:t,processors:n});return nx(e,o),rx(o,e),ix(o,e)},rre={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ire=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=rre[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},are=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},ore=(e,t,n,r)=>{n.type=`boolean`},sre=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},cre=(e,t,n,r)=>{n.not={}},lre=(e,t,n,r)=>{let i=e._zod.def,a=h_(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},ure=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},dre=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},fre=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},pre=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=nx(a.element,t,{...r,path:[...r.path,`items`]})},mre=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=nx(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=nx(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},hre=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>nx(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},gre=(e,t,n,r)=>{let i=e._zod.def,a=nx(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=nx(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},_re=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=nx(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=nx(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=nx(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},vre=(e,t,n,r)=>{let i=e._zod.def,a=nx(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},yre=(e,t,n,r)=>{let i=e._zod.def;nx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bre=(e,t,n,r)=>{let i=e._zod.def;nx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},xre=(e,t,n,r)=>{let i=e._zod.def;nx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Sre=(e,t,n,r)=>{let i=e._zod.def;nx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Cre=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;nx(a,t,r);let o=t.seen.get(e);o.ref=a},wre=(e,t,n,r)=>{let i=e._zod.def;nx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},sx=(e,t,n,r)=>{let i=e._zod.def;nx(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Tre=(e,t,n,r)=>{let i=e._zod.innerType;nx(i,t,r);let a=t.seen.get(e);a.ref=i},Ere=V(`ZodISODateTime`,(e,t)=>{Ey.init(e,t),fx.init(e,t)});function Dre(e){return Ane(Ere,e)}var Ore=V(`ZodISODate`,(e,t)=>{Dy.init(e,t),fx.init(e,t)});function kre(e){return jne(Ore,e)}var Are=V(`ZodISOTime`,(e,t)=>{Oy.init(e,t),fx.init(e,t)});function jre(e){return Mne(Are,e)}var Mre=V(`ZodISODuration`,(e,t)=>{ky.init(e,t),fx.init(e,t)});function Nre(e){return Nne(Mre,e)}var cx=(e,t)=>{Q_.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>tv(e,t)},flatten:{value:t=>ev(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,g_,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,g_,2)}},isEmpty:{get(){return e.issues.length===0}}})};V(`ZodError`,cx);var lx=V(`ZodError`,cx,{Parent:Error}),Pre=nv(lx),Fre=rv(lx),Ire=iv(lx),Lre=ov(lx),Rre=cv(lx),zre=lv(lx),Bre=uv(lx),Vre=dv(lx),Hre=fv(lx),Ure=pv(lx),Wre=mv(lx),Gre=hv(lx),ux=V(`ZodType`,(e,t)=>(fy.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ox(e,`input`),output:ox(e,`output`)}}),e.toJSONSchema=nre(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(w_(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>P_(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Pre(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ire(e,t,n),e.parseAsync=async(t,n)=>Fre(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Lre(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Rre(e,t,n),e.decode=(t,n)=>zre(e,t,n),e.encodeAsync=async(t,n)=>Bre(e,t,n),e.decodeAsync=async(t,n)=>Vre(e,t,n),e.safeEncode=(t,n)=>Hre(e,t,n),e.safeDecode=(t,n)=>Ure(e,t,n),e.safeEncodeAsync=async(t,n)=>Wre(e,t,n),e.safeDecodeAsync=async(t,n)=>Gre(e,t,n),e.refine=(t,n)=>e.check(Hie(t,n)),e.superRefine=t=>e.check(Uie(t)),e.overwrite=t=>e.check(ex(t)),e.optional=()=>kx(e),e.exactOptional=()=>Oie(e),e.nullable=()=>Ax(e),e.nullish=()=>kx(Ax(e)),e.nonoptional=t=>Pie(e,t),e.array=()=>U(e),e.or=t=>Cx([e,t]),e.and=t=>xie(e,t),e.transform=t=>Mx(e,Eie(t)),e.default=t=>jie(e,t),e.prefault=t=>Nie(e,t),e.catch=t=>Iie(e,t),e.pipe=t=>Mx(e,t),e.readonly=()=>zie(e),e.describe=t=>{let n=e.clone();return jb.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return jb.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return jb.get(e);let n=e.clone();return jb.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),dx=V(`_ZodString`,(e,t)=>{py.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ire(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Vne(...t)),e.includes=(...t)=>e.check(Wne(...t)),e.startsWith=(...t)=>e.check(Gne(...t)),e.endsWith=(...t)=>e.check(Kne(...t)),e.min=(...t)=>e.check(Qb(...t)),e.max=(...t)=>e.check(Zb(...t)),e.length=(...t)=>e.check($b(...t)),e.nonempty=(...t)=>e.check(Qb(1,...t)),e.lowercase=t=>e.check(Hne(t)),e.uppercase=t=>e.check(Une(t)),e.trim=()=>e.check(Jne()),e.normalize=(...t)=>e.check(qne(...t)),e.toLowerCase=()=>e.check(Yne()),e.toUpperCase=()=>e.check(Xne()),e.slugify=()=>e.check(Zne())}),Kre=V(`ZodString`,(e,t)=>{py.init(e,t),dx.init(e,t),e.email=t=>e.check(Nb(qre,t)),e.url=t=>e.check(zb(Jre,t)),e.jwt=t=>e.check(kne(lie,t)),e.emoji=t=>e.check(Bb(Yre,t)),e.guid=t=>e.check(Pb(px,t)),e.uuid=t=>e.check(Fb(mx,t)),e.uuidv4=t=>e.check(Ib(mx,t)),e.uuidv6=t=>e.check(Lb(mx,t)),e.uuidv7=t=>e.check(Rb(mx,t)),e.nanoid=t=>e.check(Vb(Xre,t)),e.guid=t=>e.check(Pb(px,t)),e.cuid=t=>e.check(Hb(Zre,t)),e.cuid2=t=>e.check(Ub(Qre,t)),e.ulid=t=>e.check(Wb($re,t)),e.base64=t=>e.check(Ene(oie,t)),e.base64url=t=>e.check(Dne(sie,t)),e.xid=t=>e.check(Gb(eie,t)),e.ksuid=t=>e.check(xne(tie,t)),e.ipv4=t=>e.check(Sne(nie,t)),e.ipv6=t=>e.check(Cne(rie,t)),e.cidrv4=t=>e.check(wne(iie,t)),e.cidrv6=t=>e.check(Tne(aie,t)),e.e164=t=>e.check(One(cie,t)),e.datetime=t=>e.check(Dre(t)),e.date=t=>e.check(kre(t)),e.time=t=>e.check(jre(t)),e.duration=t=>e.check(Nre(t))});function H(e){return Mb(Kre,e)}var fx=V(`ZodStringFormat`,(e,t)=>{my.init(e,t),dx.init(e,t)}),qre=V(`ZodEmail`,(e,t)=>{_y.init(e,t),fx.init(e,t)}),px=V(`ZodGUID`,(e,t)=>{hy.init(e,t),fx.init(e,t)}),mx=V(`ZodUUID`,(e,t)=>{gy.init(e,t),fx.init(e,t)}),Jre=V(`ZodURL`,(e,t)=>{vy.init(e,t),fx.init(e,t)}),Yre=V(`ZodEmoji`,(e,t)=>{yy.init(e,t),fx.init(e,t)}),Xre=V(`ZodNanoID`,(e,t)=>{by.init(e,t),fx.init(e,t)}),Zre=V(`ZodCUID`,(e,t)=>{xy.init(e,t),fx.init(e,t)}),Qre=V(`ZodCUID2`,(e,t)=>{Sy.init(e,t),fx.init(e,t)}),$re=V(`ZodULID`,(e,t)=>{Cy.init(e,t),fx.init(e,t)}),eie=V(`ZodXID`,(e,t)=>{wy.init(e,t),fx.init(e,t)}),tie=V(`ZodKSUID`,(e,t)=>{Ty.init(e,t),fx.init(e,t)}),nie=V(`ZodIPv4`,(e,t)=>{Ay.init(e,t),fx.init(e,t)}),rie=V(`ZodIPv6`,(e,t)=>{jy.init(e,t),fx.init(e,t)}),iie=V(`ZodCIDRv4`,(e,t)=>{My.init(e,t),fx.init(e,t)}),aie=V(`ZodCIDRv6`,(e,t)=>{Ny.init(e,t),fx.init(e,t)}),oie=V(`ZodBase64`,(e,t)=>{Fy.init(e,t),fx.init(e,t)}),sie=V(`ZodBase64URL`,(e,t)=>{Ly.init(e,t),fx.init(e,t)}),cie=V(`ZodE164`,(e,t)=>{Ry.init(e,t),fx.init(e,t)}),lie=V(`ZodJWT`,(e,t)=>{By.init(e,t),fx.init(e,t)}),hx=V(`ZodNumber`,(e,t)=>{Vy.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>are(e,t,n,r),e.gt=(t,n)=>e.check(Jb(t,n)),e.gte=(t,n)=>e.check(Yb(t,n)),e.min=(t,n)=>e.check(Yb(t,n)),e.lt=(t,n)=>e.check(Kb(t,n)),e.lte=(t,n)=>e.check(qb(t,n)),e.max=(t,n)=>e.check(qb(t,n)),e.int=t=>e.check(_x(t)),e.safe=t=>e.check(_x(t)),e.positive=t=>e.check(Jb(0,t)),e.nonnegative=t=>e.check(Yb(0,t)),e.negative=t=>e.check(Kb(0,t)),e.nonpositive=t=>e.check(qb(0,t)),e.multipleOf=(t,n)=>e.check(Xb(t,n)),e.step=(t,n)=>e.check(Xb(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function gx(e){return Pne(hx,e)}var uie=V(`ZodNumberFormat`,(e,t)=>{Hy.init(e,t),hx.init(e,t)});function _x(e){return Fne(uie,e)}var die=V(`ZodBoolean`,(e,t)=>{Uy.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ore(e,t,n,r)});function vx(e){return Ine(die,e)}var fie=V(`ZodNull`,(e,t)=>{Wy.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sre(e,t,n,r)});function yx(e){return Lne(fie,e)}var pie=V(`ZodAny`,(e,t)=>{Gy.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function bx(){return Rne(pie)}var mie=V(`ZodUnknown`,(e,t)=>{Ky.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function xx(){return zne(mie)}var hie=V(`ZodNever`,(e,t)=>{qy.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cre(e,t,n,r)});function gie(e){return Bne(hie,e)}var _ie=V(`ZodArray`,(e,t)=>{Yy.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pre(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Qb(t,n)),e.nonempty=t=>e.check(Qb(1,t)),e.max=(t,n)=>e.check(Zb(t,n)),e.length=(t,n)=>e.check($b(t,n)),e.unwrap=()=>e.element});function U(e,t){return Qne(_ie,e,t)}var vie=V(`ZodObject`,(e,t)=>{eb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mre(e,t,n,r),S_(e,`shape`,()=>t.shape),e.keyof=()=>Dx(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xx()}),e.loose=()=>e.clone({...e._zod.def,catchall:xx()}),e.strict=()=>e.clone({...e._zod.def,catchall:gie()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>B_(e,t),e.safeExtend=t=>V_(e,t),e.merge=t=>H_(e,t),e.pick=t=>R_(e,t),e.omit=t=>z_(e,t),e.partial=(...t)=>U_(Ox,e,t[0]),e.required=(...t)=>W_(jx,e,t[0])});function W(e,t){return new vie({type:`object`,shape:e??{},...F_(t)})}var Sx=V(`ZodUnion`,(e,t)=>{nb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hre(e,t,n,r),e.options=t.options});function Cx(e,t){return new Sx({type:`union`,options:e,...F_(t)})}var yie=V(`ZodDiscriminatedUnion`,(e,t)=>{Sx.init(e,t),rb.init(e,t)});function wx(e,t,n){return new yie({type:`union`,options:t,discriminator:e,...F_(n)})}var bie=V(`ZodIntersection`,(e,t)=>{ib.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gre(e,t,n,r)});function xie(e,t){return new bie({type:`intersection`,left:e,right:t})}var Sie=V(`ZodRecord`,(e,t)=>{sb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_re(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Tx(e,t,n){return new Sie({type:`record`,keyType:e,valueType:t,...F_(n)})}var Ex=V(`ZodEnum`,(e,t)=>{cb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lre(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ex({...t,checks:[],...F_(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ex({...t,checks:[],...F_(r),entries:i})}});function Dx(e,t){return new Ex({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...F_(t)})}function Cie(e,t){return new Ex({type:`enum`,entries:e,...F_(t)})}var wie=V(`ZodLiteral`,(e,t)=>{lb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ure(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function G(e,t){return new wie({type:`literal`,values:Array.isArray(e)?e:[e],...F_(t)})}var Tie=V(`ZodTransform`,(e,t)=>{ub.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fre(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new f_(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(X_(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(X_(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Eie(e){return new Tie({type:`transform`,transform:e})}var Ox=V(`ZodOptional`,(e,t)=>{fb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kx(e){return new Ox({type:`optional`,innerType:e})}var Die=V(`ZodExactOptional`,(e,t)=>{pb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sx(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oie(e){return new Die({type:`optional`,innerType:e})}var kie=V(`ZodNullable`,(e,t)=>{mb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vre(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ax(e){return new kie({type:`nullable`,innerType:e})}var Aie=V(`ZodDefault`,(e,t)=>{hb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bre(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jie(e,t){return new Aie({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():j_(t)}})}var Mie=V(`ZodPrefault`,(e,t)=>{_b.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xre(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nie(e,t){return new Mie({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():j_(t)}})}var jx=V(`ZodNonOptional`,(e,t)=>{vb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yre(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Pie(e,t){return new jx({type:`nonoptional`,innerType:e,...F_(t)})}var Fie=V(`ZodCatch`,(e,t)=>{bb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sre(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Iie(e,t){return new Fie({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Lie=V(`ZodPipe`,(e,t)=>{xb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cre(e,t,n,r),e.in=t.in,e.out=t.out});function Mx(e,t){return new Lie({type:`pipe`,in:e,out:t})}var Rie=V(`ZodReadonly`,(e,t)=>{Cb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wre(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zie(e){return new Rie({type:`readonly`,innerType:e})}var Bie=V(`ZodLazy`,(e,t)=>{Tb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tre(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Nx(e){return new Bie({type:`lazy`,getter:e})}var Vie=V(`ZodCustom`,(e,t)=>{Eb.init(e,t),ux.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dre(e,t,n,r)});function Hie(e,t={}){return $ne(Vie,e,t)}function Uie(e){return ere(e)}var Px=W({code:Dx([`attachment_unavailable`,`authorization_failed`,`model_unavailable`,`rate_limited`,`request_failed`]),detail:H().optional()}),Wie=`case-survey-assistant-error:`,Gie=e=>{if(typeof e==`object`&&e&&`code`in e){let t=Px.safeParse({code:e.code,detail:`detail`in e&&typeof e.detail==`string`?e.detail:`message`in e&&typeof e.message==`string`?e.message:void 0});if(t.success)return t.data}let t=e instanceof Error?e.message:typeof e==`string`?e:typeof e==`object`&&e&&`message`in e?String(e.message):``;if(t.startsWith(Wie))try{let e=Px.safeParse(JSON.parse(t.slice(28)));if(e.success)return e.data}catch{}return{code:`request_failed`,...t.trim()?{detail:t.trim()}:{}}},Fx=Nx(()=>Cx([H(),gx(),vx(),yx(),U(Fx),Tx(H(),Fx)])),Ix=Tx(H(),Fx),Lx=W({weight:Dx([`strong`,`normal`]).optional(),italic:Dx([`italic`,`normal`]).optional(),underline:Dx([`underline`,`none`]).optional(),color:Dx([`primary`,`accent`,`default`]).optional()}),Rx=W({type:G(`text`),text:H().max(2e4),style:Lx.optional(),attrs:Ix.optional()}),zx=W({type:G(`template`),key:H().min(1).max(240),style:Lx.optional(),attrs:Ix.optional()}),Bx=W({type:G(`lineBreak`),attrs:Ix.optional()}),Kie=wx(`type`,[Rx,zx,Bx]),Vx=wx(`type`,[Rx,zx,W({type:G(`link`),href:H().min(1).max(2e3),target:H().max(120).nullable().optional(),rel:H().max(240).nullable().optional(),title:H().max(1e3).nullable().optional(),attrs:Ix.optional(),children:U(Kie).max(200)}),Bx,W({type:G(`inlineExtension`),name:H().min(1).max(120),attrs:Ix.optional()})]),Hx=Dx([`left`,`center`,`right`,`justify`]),Ux=W({type:G(`paragraph`),children:U(Vx).max(500),alignment:Hx.optional(),attrs:Ix.optional()}),qie=W({type:G(`heading`),level:Cx([G(1),G(2)]),children:U(Vx).max(500),alignment:Hx.optional(),attrs:Ix.optional()}),Jie=W({type:G(`listItem`),children:U(Ux).max(100),attrs:Ix.optional()}),Yie=W({type:G(`bulletList`),items:U(Jie).max(100),attrs:Ix.optional()}),Wx=Cx([W({unit:G(`px`),value:gx().finite().nonnegative()}),W({unit:G(`%`),value:gx().finite().nonnegative()})]),Xie=wx(`type`,[W({type:G(`asset`),assetId:H().min(1).max(240)}),W({type:G(`external`),url:H().min(1).max(2e3)})]),Zie=wx(`type`,[Ux,qie,Yie,W({type:G(`image`),source:Xie,alt:H().max(2e3).optional(),caption:U(Ux).max(20).optional(),size:W({width:Wx.optional(),height:Wx.optional(),maxWidth:Wx.optional(),maxHeight:Wx.optional()}).optional(),alignment:Hx.optional(),attrs:Ix.optional()}),W({type:G(`infoBox`),tone:Dx([`info`,`warning`]).optional(),title:U(Vx).max(100).optional(),collapsible:vx().optional(),defaultOpen:vx().optional(),children:U(Ux).max(100),attrs:Ix.optional()}),W({type:G(`separator`),attrs:Ix.optional()}),W({type:G(`blockExtension`),name:H().min(1).max(120),attrs:Ix.optional()})]),Gx=wx(`type`,[W({type:G(`md`),content:H().max(2e4)}),W({type:G(`plain`),content:H().max(2e4)}),W({type:G(`richText`),version:G(1),doc:W({type:G(`doc`),blocks:U(Zie).max(200)})})]),Kx=H().min(1).max(120).optional().describe(`Optional client/model supplied id for correlating validation issues.`),qx=H().min(1).max(240).describe(`Survey item id, key, or fullKey.`),Jx=H().min(1).max(120).describe(`New item key. It must be unique among siblings.`),Yx=W({locale:H().min(1).max(40),contentKey:H().min(1).max(240).describe(`Item translation content key, for example "label" or "content".`),plainText:H().max(2e4).optional().describe(`Simple text content to persist for the translation key.`),content:Gx.optional().describe(`Structured survey content to persist for the translation key. Use { "type": "richText", "version": 1, "doc": ... } for formatted text.`)}).refine(e=>e.plainText!==void 0||e.content!==void 0,{message:`Provide either plainText or content for a translation.`}),Qie=W({id:H().min(1).max(120).optional().describe(`Optional stable option id. If omitted, the validator derives a unique id.`),key:H().min(1).max(120).optional().describe(`Optional coding key. If omitted, the validator derives a unique key.`),label:H().min(1).max(1e3).describe(`Respondent-visible option label as a plain string. Do not pass a translation object here; add-choice-option creates the matching translation in its locale.`)}),Xx=W({id:H().min(1).max(120).optional(),key:Jx,itemType:H().min(1).max(120),metadata:Tx(H(),H()).optional(),config:xx().optional().describe(`Optional item-type config. For choiceItem, provide response options as config.options, for example [{ "label": "Fuji" }, { "label": "Gala" }]. Use config.maxSelection: 1 for single choice, null for unlimited multiple choice / select-all-that-apply, or a number greater than 1 for capped multiple choice. The validator converts option labels into options.<optionId>.label translations.`),validations:Tx(H(),bx()).optional(),displayConditions:bx().optional(),disabledConditions:bx().optional(),prefills:U(bx()).optional()}).passthrough(),Zx=H().max(500).describe(`JSON Pointer path into the survey document, for example "/surveyItems/1/config/options/0/key" or "/translations/en/itemTranslations/<itemId>/title".`),Qx=wx(`op`,[W({op:G(`add`),path:Zx,value:Fx}),W({op:G(`replace`),path:Zx,value:Fx}),W({op:G(`test`),path:Zx,value:Fx}),W({op:G(`remove`),path:Zx}),W({op:G(`move`),from:Zx,path:Zx}),W({op:G(`copy`),from:Zx,path:Zx})]),$x=W({id:Kx,kind:G(`create-item`),target:W({parentItemId:H().max(240).describe(`Parent group item id, key, or fullKey where the new item should be inserted. Use the root group id/key for top-level items.`),index:gx().int().min(0).optional()}),item:Xx,translations:U(Yx).optional().describe(`Top-level item translations for visible content, for example [{ "locale": "en", "contentKey": "title", "plainText": "Question text" }]. For formatted content, use the "content" field with a richText object. Put translations beside target and item, not inside item. Form select/dropdown option labels must be translations at fields.<fieldId>.options.<optionId>.label.`)}),eS=W({id:Kx,kind:G(`update-item-key`),itemId:qx,key:Jx}),tS=W({id:Kx,kind:G(`update-item-label`),itemId:qx,itemLabel:H().max(200)}),nS=W({id:Kx,kind:G(`update-item-color`),itemId:qx,color:Dx([`#404040`,`#b91c1c`,`#c2410c`,`#a16207`,`#4d7c0f`,`#047857`,`#0369a1`,`#4338ca`,`#7e22ce`,`#86198f`,`#be123c`]).describe(`One of the Survey Editor's supported item-color swatches.`)}),rS=W({id:Kx,kind:G(`update-item-translation`),itemId:qx,locale:H().min(1).max(40),contentKey:H().min(1).max(240).describe(`Item translation content key, for example "label".`),plainText:H().max(2e4).optional().describe(`Simple text content to persist for the translation key.`),content:Gx.optional().describe(`Structured survey content to persist for the translation key. Use { "type": "richText", "version": 1, "doc": ... } for formatted text.`)}).refine(e=>e.plainText!==void 0||e.content!==void 0,{message:`Provide either plainText or content for update-item-translation.`}),iS=Cx([W({unit:G(`px`),value:gx().finite().nonnegative()}),W({unit:G(`%`),value:gx().finite().nonnegative().max(100)})]),aS=wx(`type`,[W({type:G(`asset`),assetId:H().min(1).max(240)}),W({type:G(`external`),url:H().min(1).max(2e3)})]),oS=W({id:Kx,kind:G(`update-placed-image`),itemId:qx,locale:H().min(1).max(40),contentKey:H().min(1).max(240),imageIndex:gx().int().nonnegative().describe(`Zero-based index among image blocks in the selected rich-text content value.`),expectedAssetId:H().min(1).max(240).optional(),changes:W({source:aS.optional(),alt:H().max(2e3).nullable().optional(),caption:H().max(2e4).nullable().optional(),width:iS.nullable().optional(),height:iS.nullable().optional(),maxWidth:iS.nullable().optional(),maxHeight:iS.nullable().optional(),alignment:Dx([`left`,`center`,`right`]).nullable().optional()}).refine(e=>Object.values(e).some(e=>e!==void 0),{message:`Provide at least one placed-image property to change.`})}),sS=W({id:Kx,kind:G(`patch-item-config`),itemId:qx,patches:U(Qx).min(1).max(100).describe(`JSON Patch operations relative to this item's config root, for example [{ "op": "replace", "path": "/max", "value": 7 }]. Inspect the item first and do not include /surveyItems/<index>/config in these paths.`)}),cS=W({itemId:qx,optionId:H().min(1).max(240).optional().describe(`Choice option id when targeting an inline embedded form.`)}),lS=U(Yx).max(100).optional().describe(`Translations written atomically with this form structure change. Content keys are relative to the form; embedded-form prefixes are added automatically.`),uS=W({id:H().min(1).max(120),layout:W({base:gx().int().min(1).max(12),xs:gx().int().min(1).max(12),sm:gx().int().min(1).max(12),md:gx().int().min(1).max(12),xl:gx().int().min(1).max(12)}).optional(),fields:U(xx()).optional(),hasDisplayCondition:vx().optional()}).passthrough(),$ie=W({id:H().min(1).max(120),key:H().min(1).max(120),type:Dx([`input`,`textarea`,`number`,`datepicker`,`switch`,`select`,`slider`]),controller:Tx(H(),xx()),required:vx().optional(),validations:U(Tx(H(),xx())).optional()}).passthrough(),eae=W({id:Kx,kind:G(`upsert-form-field-group`),target:cS,index:gx().int().min(0).optional(),group:uS,translations:lS}),tae=W({id:Kx,kind:G(`remove-form-field-group`),target:cS,groupId:H().min(1).max(240)}),nae=W({id:Kx,kind:G(`reorder-form-field-groups`),target:cS,groupIds:U(H().min(1).max(240)).min(1).max(100)}),rae=W({id:Kx,kind:G(`upsert-form-field`),target:cS,groupId:H().min(1).max(240),index:gx().int().min(0).optional(),field:$ie,translations:lS}),iae=W({id:Kx,kind:G(`remove-form-field`),target:cS,fieldId:H().min(1).max(240)}),dS=W({id:Kx,kind:G(`move-form-field`),target:cS,fieldId:H().min(1).max(240),targetGroupId:H().min(1).max(240),index:gx().int().min(0).optional()}),fS=W({id:Kx,kind:G(`set-embedded-form`),itemId:qx,optionId:H().min(1).max(240),form:W({id:H().min(1).max(120),fieldGroups:U(uS).max(100)}).passthrough(),translations:lS}),pS=W({id:Kx,kind:G(`remove-embedded-form`),itemId:qx,optionId:H().min(1).max(240)}),mS=W({id:Kx,kind:G(`add-choice-option`),itemId:qx,locale:H().min(1).max(40).optional(),index:gx().int().min(0).optional(),option:Qie}),hS=W({id:Kx,kind:G(`update-choice-option-label`),itemId:qx,optionId:H().min(1).max(240).describe(`Existing choice option id, key, or current visible label.`),locale:H().min(1).max(40).optional(),label:H().min(1).max(1e3).describe(`New respondent-visible option label.`)}),gS=W({id:Kx,kind:G(`remove-choice-option`),itemId:qx,optionId:H().min(1).max(240).describe(`Existing choice option id, key, or current visible label.`)}),_S=W({id:Kx,kind:G(`reorder-choice-options`),itemId:qx,optionIds:U(H().min(1).max(240)).min(1).max(100).describe(`Complete desired order of existing choice options. Entries can be option ids, keys, or current visible labels.`)}),vS=W({id:Kx,kind:G(`remove-item`),itemId:qx,includeChildren:vx().optional().describe(`Must be true when removing a group item that has children.`)}),yS=W({id:Kx,kind:G(`move-item`),itemId:qx,target:W({parentItemId:qx,index:gx().int().min(0).optional()})}),bS=W({id:Kx,kind:G(`reorder-items`),parentItemId:qx,itemIds:U(qx).min(1).max(200)}),xS=W({id:Kx,kind:G(`update-survey-metadata`),values:Tx(H().min(1).max(240),H().max(2e4).nullable())}),SS=W({id:Kx,kind:G(`update-survey-pagination`),value:W({large:gx().int().min(1).max(1e3),small:gx().int().min(1).max(1e3)}).nullable()}),CS=W({id:Kx,kind:G(`update-survey-translation`),locale:H().min(1).max(40),surface:Dx([`surveyCardContent`,`navigationContent`,`validationMessages`]),contentKey:H().min(1).max(240),plainText:H().max(2e4).optional(),content:Gx.optional()}).refine(e=>e.plainText!==void 0||e.content!==void 0,{message:`Provide either plainText or content for update-survey-translation.`}),wS=W({id:Kx,kind:G(`remove-survey-locale`),locale:H().min(1).max(40)}),TS=W({name:H().max(500).optional(),filename:H().max(500).optional(),alt:H().max(2e3).optional(),width:gx().int().positive().optional(),height:gx().int().positive().optional()}),ES=W({kind:G(`image`),source:W({type:G(`embedded`),mediaType:H().regex(/^image\//),encoding:G(`base64`),data:H().min(1).max(8e6)}),metadata:TS.optional()}),DS=W({id:Kx,kind:G(`set-image-asset`),assetId:H().min(1).max(240),asset:ES}),OS=W({id:Kx,kind:G(`update-image-asset-metadata`),assetId:H().min(1).max(240),metadata:W({name:H().max(500).nullable().optional(),filename:H().max(500).nullable().optional(),alt:H().max(2e3).nullable().optional(),width:gx().int().positive().nullable().optional(),height:gx().int().positive().nullable().optional()})}),kS=W({id:Kx,kind:G(`remove-image-asset`),assetId:H().min(1).max(240)}),AS=W({id:Kx,kind:G(`survey-json-patch`),patches:U(Qx).min(1).max(100).describe(`Batch of JSON Patch operations applied to the survey document. Use this for raw survey edits such as reordering group items, editing item config, survey metadata, template values, translations/locales, or maxItemsPerPage.`)}),jS=e=>e,MS=wx(`kind`,[jS($x),jS(eS),jS(tS),jS(nS),jS(rS),jS(oS),jS(sS),jS(eae),jS(tae),jS(nae),jS(rae),jS(iae),jS(dS),jS(fS),jS(pS),jS(mS),jS(hS),jS(gS),jS(_S),jS(vS),jS(yS),jS(bS),jS(xS),jS(SS),jS(CS),jS(wS),jS(DS),jS(OS),jS(kS),jS(AS)]),NS=W({severity:Dx([`error`,`warning`]),code:H(),message:H(),operationIndex:gx().int().nonnegative().optional(),operationId:H().optional(),itemId:H().optional()}),PS=W({valid:vx(),issues:U(NS),warnings:U(NS),normalizedOperations:U(MS)}),FS=`create-item.update-item-key.update-item-label.update-item-color.update-item-translation.update-placed-image.patch-item-config.upsert-form-field-group.remove-form-field-group.reorder-form-field-groups.upsert-form-field.remove-form-field.move-form-field.set-embedded-form.remove-embedded-form.add-choice-option.update-choice-option-label.remove-choice-option.reorder-choice-options.remove-item.move-item.reorder-items.update-survey-metadata.update-survey-pagination.update-survey-translation.remove-survey-locale.set-image-asset.update-image-asset-metadata.remove-image-asset.survey-json-patch`.split(`.`),IS=Dx([`deterministic`,`interactive-only`,`unsupported`]),LS=W({key:H().min(1),role:Dx([`primary`,`secondary`,`option`,`field`,`validation`]),format:Dx([`plain`,`rich`]),requiredOnCreate:vx().optional(),pattern:vx().optional(),aliases:U(H().min(1)).optional()}),RS=W({key:H().min(1),valueType:H().min(1)}),zS=W({configSummary:H().min(1).max(1e3).optional()}),BS=W({itemType:H().min(1),capabilityVersion:H().min(1),displayName:H().min(1),description:H().optional(),defaultItemKeyPrefix:H().min(1).optional(),create:IS,supportedOperations:U(Dx(FS)),contentSurfaces:U(LS),responseSlots:U(RS).optional(),referenceTopics:U(H().min(1)).optional(),authoring:zS.optional()}),VS=W({digest:H().min(1),itemTypes:U(BS)}),HS=G(1),US=W({sessionId:H().nullable(),revision:gx().int().nonnegative(),historyIndex:gx().int(),contentHash:H().min(1),capabilityDigest:H().min(1)}),WS=W({view:Dx([`item-editor`,`preview-mode`,`translation-mode`,`asset-manager`]),selectedItemId:H().optional(),selectedLocale:H().min(1),focusItemId:H().optional(),recentItemIds:U(H()).max(10).optional(),activeSurface:H().max(120).optional(),openPanels:U(H().max(120)).max(12).optional(),highlights:U(W({kind:H().min(1).max(80),itemId:H().optional(),componentId:H().optional(),label:H().max(240).optional(),details:H().max(1e3).optional()})).max(12).optional(),history:W({currentIndex:gx().int(),totalEntries:gx().int().nonnegative(),canUndo:vx(),canRedo:vx(),recent:U(W({index:gx().int().nonnegative(),kind:Dx([`survey-snapshot`,`asset-change`]),label:H(),source:Dx([`user`,`system`,`assistant`]).optional(),timestamp:gx().nonnegative(),isCurrent:vx()})).max(12)}).optional()}),GS=W({id:H().min(1),key:H().min(1),itemType:H().min(1)}).passthrough(),KS=Tx(H(),W({itemTranslations:Tx(H(),Tx(H(),Gx)).optional()}).passthrough());W({protocolVersion:HS,version:US,survey:W({$schema:H().min(1),surveyItems:U(GS).min(1),translations:KS.optional()}).passthrough(),ui:WS,capabilities:VS,createdAt:H().min(1)});var qS=W({id:H().min(1).max(240),title:H().min(1).max(160),titleMode:Dx([`automatic`,`manual`]),createdAt:H().datetime(),updatedAt:H().datetime()});W({threads:U(qS)}),W({thread:qS,messages:U(xx())}),W({title:H().trim().min(1).max(160).optional()}),Cx([W({mode:G(`automatic`),title:H().trim().min(1).max(160).optional()}),W({mode:G(`manual`).optional(),title:H().trim().min(1).max(160)})]);var JS=Dx([`user`,`background`]),YS=W({text:H().min(1)}),XS=Dx([`survey-pattern`,`compact`,`preferred`,`fair`]),ZS=YS.extend({category:XS,rationale:H().optional()}),QS=W({itemId:H().min(1),draftKey:H(),currentKey:H(),siblingKeys:U(H()),maxSuggestions:gx().int().positive().optional()}),$S=W({suggestions:U(ZS)}),eC=W({itemId:H().min(1),draftLabel:H(),itemType:H().min(1),locale:H().min(1).optional(),maxSuggestions:gx().int().positive().optional()}),tC=W({suggestions:U(YS)}),nC=W({id:H().min(1),text:H(),kind:H().min(1)}),rC=W({sourceLocale:H().min(1),targetLocales:U(H().min(1)).min(1),entries:U(nC).min(1)}),iC=W({translations:Tx(H(),Tx(H(),H()))}),aC=W({id:H().min(1),key:H(),fullKey:H(),itemType:H().min(1),itemLabel:H().optional(),visibleText:U(W({locale:H().min(1),contentKey:H().min(1),text:H()})),visibleTextTruncated:vx()}),oC=Dx([`sibling`,`same-type`,`survey`]),sC={context:W({document:W({revision:gx().int().nonnegative(),contentHash:H().min(1),capabilityDigest:H().min(1)}),survey:W({key:H().optional(),locales:U(H()),itemCount:gx().int().nonnegative(),selectedLocale:H().min(1)}),focus:W({item:aC,parent:aC.optional(),ancestorPath:U(aC),siblingKeys:U(H()),siblingItems:U(aC),siblingItemCount:gx().int().nonnegative(),siblingItemsTruncated:vx(),relatedItems:U(aC),relatedItemCount:gx().int().nonnegative(),relatedItemsTruncated:vx()}).optional(),naming:W({keyExamples:U(W({itemId:H().min(1),itemType:H().min(1),key:H(),relationship:oC})),keyExampleCount:gx().int().nonnegative(),keyExamplesTruncated:vx(),labelExamples:U(W({itemId:H().min(1),itemType:H().min(1),key:H(),label:H(),relationship:oC})),labelExampleCount:gx().int().nonnegative(),labelExamplesTruncated:vx()}).optional(),translation:W({examples:U(W({itemId:H().min(1),contentKey:H().min(1),values:Tx(H(),H())})),exampleCount:gx().int().nonnegative(),examplesTruncated:vx()}).optional()}),mode:JS.optional(),modelId:H().trim().min(1).max(240).optional()};wx(`taskId`,[W({...sC,taskId:G(`suggest-item-key`),input:QS}),W({...sC,taskId:G(`suggest-item-label`),input:eC}),W({...sC,taskId:G(`translate-content`),input:rC})]);var cC=W({id:H().trim().min(1).max(240),label:H().trim().min(1).max(240)});W({defaultModelId:H().trim().min(1).max(240),models:U(cC).min(1)}).refine(({defaultModelId:e,models:t})=>t.some(t=>t.id===e),`The default model must be present in the model catalog.`),W({protocolVersion:HS.default(1),id:H().min(1),turnId:H().min(1),status:Dx([`validated`,`rejected`]),summary:H().min(1).max(500),operations:U(MS),supersedesChangeIds:U(H().min(1)).max(100).optional(),precondition:US.optional(),validation:PS,createdAt:H().min(1)}),W({protocolVersion:HS,turnId:H().min(1),status:Dx([`completed`,`failed`,`aborted`]),executableChangeSetIds:U(H().min(1)),blockedChangeSetIds:U(H().min(1)).max(100).optional(),createdAt:H().min(1)}).superRefine((e,t)=>{e.status!==`completed`&&e.executableChangeSetIds.length>0&&t.addIssue({code:`custom`,message:`Failed or aborted turns cannot authorize executable change sets.`,path:[`executableChangeSetIds`]}),new Set(e.executableChangeSetIds).size!==e.executableChangeSetIds.length&&t.addIssue({code:`custom`,message:`Executable change-set ids must be unique.`,path:[`executableChangeSetIds`]});let n=e.blockedChangeSetIds??[];new Set(n).size!==n.length&&t.addIssue({code:`custom`,message:`Blocked change-set ids must be unique.`,path:[`blockedChangeSetIds`]}),n.length>0&&e.executableChangeSetIds.length>0&&t.addIssue({code:`custom`,message:`A blocked turn cannot authorize executable change sets.`,path:[`executableChangeSetIds`]})}),Dx([`auto`,`review`,`deny`]);var lC=Dx([`applied`,`rejected`,`stale`,`failed`]);W({results:U(W({status:lC,changeId:H(),summary:H(),message:H(),appliedOperations:gx().int().nonnegative(),issues:U(NS).optional()}))}),W({protocolVersion:HS,turnId:H().min(1),changeSetId:H().min(1),beforeVersion:US,afterVersion:US.optional(),status:lC,operationCount:gx().int().nonnegative(),commit:W({id:H().min(1).optional(),index:gx().int().optional()}).optional(),issues:U(NS).optional(),createdAt:H().min(1)});var uC=e=>{let t=new Map;for(let n of e){let e=BS.parse(n.manifest),r=e.itemType;if(t.has(r))throw Error(`Duplicate survey assistant capability for item type "${r}".`);if(e.create===`deterministic`&&!e.supportedOperations.includes(`create-item`))throw Error(`Deterministically creatable item type "${r}" must support "create-item".`);let i=new Set(e.referenceTopics??[]);for(let e of n.references??[])if(!i.has(e.topic))throw Error(`Capability reference "${e.topic}" for item type "${r}" is missing from manifest.referenceTopics.`);t.set(r,n)}let n={itemTypes:Array.from(t.values()).map(e=>e.manifest).sort((e,t)=>e.itemType.localeCompare(t.itemType))};return{manifest:{...n,digest:u_(n)},byItemType:t}},dC=e=>e.itemTypes.filter(e=>e.create===`deterministic`).map(e=>e.itemType),aae=({displayName:e,itemType:t})=>({manifest:{itemType:t,capabilityVersion:`unsupported-v1`,displayName:e,create:`unsupported`,supportedOperations:[],contentSurfaces:[]}}),fC=class extends Error{code=`survey-assistant-capability-mismatch`;constructor(e=`Survey assistant capabilities changed; start a fresh turn and retry.`){super(e),this.name=`SurveyAssistantCapabilityMismatchError`}},oae=({manifest:e,trustedCapabilities:t,versionDigest:n})=>{let{digest:r,...i}=e;if(r!==u_(i)||n!==r)throw new fC;if(t&&t.manifest.digest!==r)throw new fC(`The editor and server use different survey assistant capabilities; refresh and retry.`)},pC=e=>typeof e==`object`&&!!e&&!Array.isArray(e),mC=e=>typeof e==`string`&&e.trim().length>0?e.trim():void 0,hC=e=>Array.isArray(e)?e:[],gC=e=>hC((pC(e.config)?e.config:void 0)?.items).filter(e=>typeof e==`string`),sae=e=>{switch(e.type){case`number`:case`slider`:return u.gt.number;case`datepicker`:return u.gt.date;case`switch`:return u.gt.boolean;default:return u.gt.string}},_C=(e,t,n,r)=>{e[`${t}...${u.ht.get}...${n}`]=r,e[`${t}...${u.ht.isDefined}...${n}`]=u.gt.boolean},vC=({config:e,itemId:t,lookup:n,slotPrefix:r})=>{if(pC(e))for(let i of hC(e.fieldGroups).filter(pC))for(let e of hC(i.fields).filter(pC)){let i=mC(e.key);i&&_C(n,t,r?`${r}.${i}`:i,sae(e))}},cae=(e,t)=>{let n={};for(let r of e.surveyItems){let e=t?.byItemType.get(r.itemType)?.deriveResponseSlots;if(e){for(let[t,i]of Object.entries(e(r)))_C(n,r.id,t,i);continue}if(r.itemType===`choiceItem`){let e=pC(r.config)?r.config:{},t=mC(e.id)??r.id;_C(n,r.id,t,e.maxSelection===1?u.gt.reference:u.gt.referenceArray);for(let t of hC(e.options).filter(pC)){let e=mC(t.id);e&&t.embeddedForm&&vC({config:t.embeddedForm,itemId:r.id,lookup:n,slotPrefix:`embedded.${e}`})}}else r.itemType===`formItem`&&vC({config:r.config,itemId:r.id,lookup:n})}return n},lae=(e,t,n)=>{let r=e.survey.surveyItems,i=new Map(r.map(e=>[e.id,e])),a=new Map;for(let e of r)for(let t of gC(e))i.has(t)&&!a.has(t)&&a.set(t,e.id);let o=new Map,s=(e,t=new Set)=>{let n=o.get(e);if(n)return n;let r=i.get(e);if(!r)return e;if(t.has(e))return r.key;let c=a.get(e);if(!c)return r.key;t.add(e);let l=`${s(c,t)}.${r.key}`;return t.delete(e),o.set(e,l),l},c=[],l=new Set,d=(e,t)=>{if(l.has(e))return;let n=i.get(e);if(n){l.add(e),c.push({itemId:e,parentId:a.get(e),depth:t,itemType:n.itemType,key:n.key,fullKey:s(e),itemLabel:n.metadata?.itemLabel,childCount:gC(n).length});for(let e of gC(n))d(e,t+1)}},f=r.find(e=>pC(e.config)&&e.config.isRoot===!0);f&&d(f.id,0);for(let e of[...r].sort((e,t)=>e.id.localeCompare(t.id)))l.has(e.id)||d(e.id,0);let p=c.map(e=>({itemId:e.itemId,itemType:e.itemType,key:e.key,fullKey:e.fullKey,itemLabel:e.itemLabel,path:e.fullKey.split(`.`)})),m=new u.pt(e.survey.translations),h=(e,t)=>{let n=i.get(e);--t.remaining;let o=m.getItemTranslations(e),c=(o?.locales??[]).flatMap(e=>Object.entries(o?.getAllForLocale(e)??{}).slice(0,8).map(([t,n])=>({locale:e,contentKey:t,text:u.xt(n).slice(0,120)})));return{itemId:e,itemType:n.itemType,itemKey:n.key,fullKey:s(e),itemLabel:n.metadata?.itemLabel,siblingKeys:r.filter(t=>t.id!==e&&a.get(t.id)===a.get(e)).map(e=>e.key),translations:c,descendants:gC(n).filter(e=>i.has(e)&&t.remaining>0).map(e=>h(e,t))}},g=n??e.ui.focusItemId??e.ui.selectedItemId,_,v,y=!1;if(g&&i.has(g)){let e=[],t=g,n=new Set;for(;t&&!n.has(t);)n.add(t),e.unshift(t),t=a.get(t);let o=a.get(g);_={focusItemId:g,parentItemId:o,pathItemIds:e,siblingItemIds:r.filter(e=>e.id!==g&&a.get(e.id)===o).map(e=>e.id),childItemIds:gC(i.get(g))};let s={remaining:120};v=h(g,s),y=s.remaining===0}let b=cae(e.survey,t),x=[e.ui.selectedLocale,...Object.keys(e.survey.translations??{}).filter(t=>t!==e.ui.selectedLocale)].filter((e,t,n)=>e.length>0&&n.indexOf(e)===t);return{inspection:{surveyKey:f?.key,locales:x,itemCount:r.length,outline:c,focus:_,focusItem:v,keyIndex:p,responseSlots:Object.keys(b),focusItemTreeTruncated:y},responseSlotTypes:b}},uae=(e,t,n)=>{oae({manifest:e.capabilities,trustedCapabilities:t,versionDigest:e.version.capabilityDigest});let{inspection:r,responseSlotTypes:i}=lae(e,t,n?.focusItemId);return{document:e,version:e.version,survey:e.survey,ui:e.ui,capabilities:e.capabilities,responseSlotTypes:i,inspection:r,trustedCapabilities:t}};W({itemId:H(),itemType:H(),key:H(),fullKey:H(),itemLabel:H().optional(),parentId:H().optional(),depth:gx().int().nonnegative().optional(),childCount:gx().int().nonnegative().optional(),path:U(H()).optional(),siblingKeys:U(H()).optional()}),W({locale:H(),contentKey:H(),text:H()});var dae=W({id:H(),key:H().optional(),labelContentKey:H(),hasDisplayCondition:vx().optional(),embeddedFormItemId:H().optional(),embeddedFormFieldGroupCount:gx().int().nonnegative().optional(),embeddedFormTranslationPrefix:H().optional(),embeddedFormResponseSlotPrefix:H().optional()}),fae=W({id:H(),value:H().optional(),labelContentKey:H()}),pae=W({base:gx().int().positive(),xs:gx().int().positive(),sm:gx().int().positive(),md:gx().int().positive(),xl:gx().int().positive()}),mae=W({id:H(),key:H(),type:H(),responseSlotId:H(),labelContentKey:H(),descriptionContentKey:H(),errorContentKey:H(),placeholderContentKey:H().optional(),unitContentKey:H().optional(),checkedLabelContentKey:H().optional(),uncheckedLabelContentKey:H().optional(),required:vx().optional(),controllerType:H().optional(),validationTypes:U(H()).optional(),validationMessageContentKeys:U(H()).optional(),selectOptions:U(fae).optional()}),hae=W({id:H(),titleContentKey:H(),descriptionContentKey:H(),hasDisplayCondition:vx().optional(),layout:pae,fieldCount:gx().int().nonnegative(),fields:U(mae)});W({kind:Dx([`choice`,`form`,`generic`]),summary:U(H()),mainResponseSlotId:H().optional(),choiceOptions:U(dae).optional(),formFieldGroups:U(hae).optional()});var yC=Nx(()=>Cx([H(),gx(),vx(),yx(),U(yC),Tx(H(),yC)])),bC=W({type:Dx([u.gt.string,u.gt.duration,u.gt.reference,u.gt.number,u.gt.boolean,u.gt.date,u.gt.stringArray,u.gt.durationArray,u.gt.referenceArray,u.gt.numberArray,u.gt.dateArray]),value:yC.optional(),unit:H().optional(),precision:H().optional()}).passthrough(),xC=Nx(()=>wx(`type`,[W({type:G(u.it.Const),value:bC.optional(),editorConfig:Tx(H(),yC).optional()}),W({type:G(u.it.ResponseVariable),variableRef:H().min(1),editorConfig:Tx(H(),yC).optional()}),W({type:G(u.it.ContextVariable),contextType:Dx([`locale`,`participantFlag`,`customValue`,`customExpression`]),key:xC.optional(),arguments:U(xC.optional()).optional(),asType:Dx([u.gt.string,u.gt.duration,u.gt.reference,u.gt.number,u.gt.boolean,u.gt.date,u.gt.stringArray,u.gt.durationArray,u.gt.referenceArray,u.gt.numberArray,u.gt.dateArray]).optional(),editorConfig:Tx(H(),yC).optional()}),W({type:G(u.it.Function),functionName:Cie(u.ot),arguments:U(xC.optional()),editorConfig:Tx(H(),yC).optional()})])),SC=wx(`type`,[W({type:G(`itemResponse`)}),W({type:G(`field`),fieldId:H().min(1).max(240)}),W({type:G(`embeddedField`),optionId:H().min(1).max(240),fieldId:H().min(1).max(240)})]),gae=wx(`type`,[W({type:G(`static`),value:bC}),W({type:G(`expression`),expression:xC}),W({type:G(`templateValue`),key:H().min(1).max(240)}),W({type:G(`previousResponse`),ref:W({surveyKey:H().min(1).max(240).optional(),itemId:H().min(1).max(240),target:SC.optional()}),ifUnsupported:G(`skip`).optional()})]),_ae=W({id:H().min(1).max(240),target:SC,when:xC.optional(),apply:G(`ifEmpty`).optional(),source:gae}),vae=Dx([u.gt.string,u.gt.duration,u.gt.reference,u.gt.number,u.gt.boolean,u.gt.date,u.gt.stringArray,u.gt.durationArray,u.gt.referenceArray,u.gt.numberArray,u.gt.dateArray]),yae=W({type:Dx([`default`,`date2string`]),returnType:vae,expression:xC.optional(),dateFormat:H().min(1).max(120).optional()});wx(`kind`,[W({kind:G(`set-item-display-condition`),itemId:H().min(1).max(240),expression:xC}),W({kind:G(`clear-item-display-condition`),itemId:H().min(1).max(240)}),W({kind:G(`set-component-display-condition`),itemId:H().min(1).max(240),componentId:H().min(1).max(240),expression:xC}),W({kind:G(`clear-component-display-condition`),itemId:H().min(1).max(240),componentId:H().min(1).max(240)}),W({kind:G(`set-component-disabled-condition`),itemId:H().min(1).max(240),componentId:H().min(1).max(240),expression:xC}),W({kind:G(`clear-component-disabled-condition`),itemId:H().min(1).max(240),componentId:H().min(1).max(240)}),W({kind:G(`set-validation-expression`),itemId:H().min(1).max(240),validationKey:H().min(1).max(240),expression:xC}),W({kind:G(`clear-validation-expression`),itemId:H().min(1).max(240),validationKey:H().min(1).max(240)}),W({kind:G(`set-prefill`),itemId:H().min(1).max(240),prefill:_ae}),W({kind:G(`clear-prefill`),itemId:H().min(1).max(240),prefillId:H().min(1).max(240)}),W({kind:G(`set-template-value`),templateKey:H().min(1).max(240),templateValue:yae}),W({kind:G(`clear-template-value`),templateKey:H().min(1).max(240)})]);var bae=48,xae=80,CC=24,wC=600,TC=40,EC=60,Sae=e=>typeof e==`object`&&!!e&&!Array.isArray(e),DC=e=>{if(!Sae(e.metadata))return;let t=e.metadata.itemLabel;return typeof t==`string`&&t.trim().length>0?t.trim():void 0},OC=(e,t,n)=>{if(t<0||n<1)return[];let r=Math.min(e.length,n+1),i=t-Math.floor(n/2),a=Math.min(Math.max(0,i),e.length-r);return e.slice(a,a+r).filter((e,n)=>a+n!==t)},kC=(e,t)=>{let{inspection:n}=uae(e,void 0,{focusItemId:t.focusItemId}),r=new Map(e.survey.surveyItems.map(e=>[e.id,e])),i=new Map(n.outline.flatMap(e=>e.parentId?[[e.itemId,e.parentId]]:[])),a=new Map;for(let e of n.outline){if(!e.parentId)continue;let t=a.get(e.parentId)??[];t.push(e.itemId),a.set(e.parentId,t)}let o=new Map(n.keyIndex.map(e=>[e.itemId,e.fullKey])),s=t=>{let n=[],r=!1;for(let[i,a]of Object.entries(e.survey.translations??{})){let e=a.itemTranslations?.[t.id];if(e)for(let[t,a]of Object.entries(e)){let e=u.xt(a).trim();e&&(e.length>wC&&(r=!0),n.push({locale:i,contentKey:t,text:e.length>wC?`${e.slice(0,wC)}...`:e}))}}return{id:t.id,key:t.key,fullKey:o.get(t.id)??t.key,itemType:t.itemType,itemLabel:DC(t),visibleText:n.slice(0,CC),visibleTextTruncated:n.length>CC||r}},c=n.outline.find(e=>e.depth===0)?.itemId,l=c?r.get(c):void 0,d={document:{revision:e.version.revision,contentHash:e.version.contentHash,capabilityDigest:e.version.capabilityDigest},survey:{key:l?.key,locales:n.locales,itemCount:n.itemCount,selectedLocale:e.ui.selectedLocale}},f=t.focusItemId?r.get(t.focusItemId):void 0;if(f){let e=i.get(f.id),t=e?r.get(e):void 0,n=[],o=new Set,c=e;for(;c&&!o.has(c);){o.add(c);let e=r.get(c);if(!e)break;n.unshift(e),c=i.get(c)}let l=t?a.get(t.id)??[]:[],u=Math.max(0,l.length-1),p=OC(l,l.indexOf(f.id),xae).map(e=>r.get(e)).filter(e=>!!e),m=[],h=new Set,g=[...a.get(f.id)??[]];for(;g.length>0;){let e=g.shift(),t=e?r.get(e):void 0;!t||h.has(t.id)||(h.add(t.id),m.push(t),g.push(...a.get(t.id)??[]))}let _=m.slice(0,bae);d.focus={item:s(f),parent:t?s(t):void 0,ancestorPath:n.map(s),siblingKeys:p.map(e=>e.key),siblingItems:p.map(s),siblingItemCount:u,siblingItemsTruncated:u>p.length,relatedItems:_.map(s),relatedItemCount:m.length,relatedItemsTruncated:m.length>_.length}}if((t.purpose===`suggest-item-key`||t.purpose===`suggest-item-label`)&&f){let t=i.get(f.id),n=t?a.get(t)??[]:[],r=new Map(n.map((e,t)=>[e,t])),o=r.get(f.id),s=e.survey.surveyItems.filter(e=>e.id!==f.id).map((e,n)=>({item:e,index:n,siblingDistance:o!==void 0&&r.has(e.id)?Math.abs(r.get(e.id)-o):1/0,relationship:i.get(e.id)===t?`sibling`:e.itemType===f.itemType?`same-type`:`survey`})).sort((e,t)=>{let n={sibling:0,"same-type":1,survey:2};return n[e.relationship]-n[t.relationship]||e.siblingDistance-t.siblingDistance||e.index-t.index}),c=s.map(({item:e,relationship:t})=>({itemId:e.id,itemType:e.itemType,key:e.key,relationship:t})),l=s.flatMap(({item:e,relationship:t})=>{let n=DC(e);return n?[{itemId:e.id,itemType:e.itemType,key:e.key,label:n,relationship:t}]:[]});d.naming={keyExamples:c.slice(0,TC),keyExampleCount:c.length,keyExamplesTruncated:c.length>TC,labelExamples:l.slice(0,TC),labelExampleCount:l.length,labelExamplesTruncated:l.length>TC}}let p=t.sourceLocale;if(t.purpose===`translate-content`&&p){let n=[p,...t.targetLocales??[]],r=new Set((t.sourceTexts??[]).flatMap(e=>e.toLocaleLowerCase().split(/[^\p{L}\p{N}]+/u)).filter(e=>e.length>=3)),i=[];e.survey.surveyItems.forEach((t,a)=>{let o=new Set;for(let r of n){let n=e.survey.translations?.[r]?.itemTranslations?.[t.id];for(let e of Object.keys(n??{}))o.add(e)}for(let s of o){let o={};for(let r of n){let n=e.survey.translations?.[r]?.itemTranslations?.[t.id]?.[s];if(!n)continue;let i=u.xt(n).trim();i&&(o[r]=i.slice(0,wC))}let c=o[p];if(!c||Object.keys(o).length<2)continue;let l=c.toLocaleLowerCase(),d=[...r].reduce((e,t)=>e+ +!!l.includes(t),0);i.push({itemId:t.id,contentKey:s,values:o,score:d,order:a})}}),i.sort((e,t)=>t.score-e.score||e.order-t.order),d.translation={examples:i.slice(0,EC).map(({itemId:e,contentKey:t,values:n})=>({itemId:e,contentKey:t,values:n})),exampleCount:i.length,examplesTruncated:i.length>EC}}return d},AC=900*1e3,jC=64,MC=class{entries=new Map;ttlMs;maxEntries;now;constructor(e={}){this.ttlMs=Math.max(0,e.ttlMs??AC),this.maxEntries=Math.max(1,e.maxEntries??jC),this.now=e.now??Date.now}get(e){let t=this.entries.get(e);if(t){if(t.expiresAt<=this.now()){this.entries.delete(e);return}return this.entries.delete(e),this.entries.set(e,t),t.value}}set(e,t){for(this.entries.delete(e),this.entries.set(e,{expiresAt:this.now()+this.ttlMs,value:t});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}clear(){this.entries.clear()}},NC={Content:`content`,Label:`label`,Key:`key`,ItemType:`itemType`},PC=e=>{let t=e.survey.surveyItems.get(e.itemId);if(!t)return;let n=t.metadata?.itemLabel??``,r=e.searchTerm.toLowerCase(),i=[],a=e.survey.getItemKey(t.id);return t.type.toLowerCase().includes(r)&&i.push({matchType:NC.ItemType,matchText:t.type}),n.toLowerCase().includes(r)&&i.push({matchType:NC.Label,matchText:n}),a?.fullKey.toLowerCase().includes(r)&&i.push({matchType:NC.Key,matchText:a.fullKey}),i},FC=[u.lt.Group,u.lt.PageBreak],IC=e=>typeof e==`object`&&!!e&&!Array.isArray(e),LC=(e,t,n)=>{let r=e?.[t];if(!IC(r))return;let i=r;for(let e of n){if(!IC(i)||!(e in i))return;i=i[e]}return typeof i==`string`?i:void 0};function RC(e){let t={...a_};for(let[n,r]of Object.entries(e??{}))t[n]={...t[n],...r};return t}function zC(e,t){if(!e&&!t)return;let n={};for(let[t,r]of Object.entries(e??{}))n[t]={...r};for(let[e,r]of Object.entries(t??{}))n[e]={...n[e]??{},...r};return n}function BC(e){return e.map(e=>{let t=e.itemType?` [${e.itemType}]`:``;return`${e.code}${t}: ${e.message}`}).join(`
|
|
85
|
-
`)}function VC(e){if(e.errors.length!==0)throw Error(`Invalid item registry entries:\n${BC(e.errors)}`)}function HC(e,t){let n=[],r=[],i=t.requireBuiltInTypes??!0,a=t.requireRenderer??!1,o=new Set;for(let i of e){if(o.has(i.itemType)){n.push({code:`duplicate-item-type`,itemType:i.itemType,message:`Duplicate item registry entry for type: ${i.itemType}`});continue}o.add(i.itemType),!i.constructor&&i.itemType!==`root`&&!FC.includes(i.itemType)&&r.push({code:`missing-constructor`,itemType:i.itemType,message:`Entry has no constructor. This item type will not be deserializable from survey JSON.`}),t.mode===`editor`&&!i.infos&&n.push({code:`missing-editor-infos`,itemType:i.itemType,message:`ItemRegistryEntry "${i.itemType}" must have infos when used in editor.`}),t.mode===`player`&&a&&!i.renderComponent&&n.push({code:`missing-renderer`,itemType:i.itemType,message:`Entry is missing renderComponent while requireRenderer=true.`})}if(t.mode===`editor`&&i)for(let e of FC)o.has(e)||n.push({code:`missing-built-in-type`,itemType:e,message:`Missing registry entry for built-in type: ${e}`});return{errors:n,warnings:r}}function UC(e){VC(HC(e,{mode:`player`,requireBuiltInTypes:!1}));let t={};for(let n of e)n.constructor&&(t[n.itemType]=n.constructor);return u._t(t)}function WC(e,t={}){VC(HC(e,{mode:`player`,requireRenderer:t.requireRenderer??!1,requireBuiltInTypes:!1}));let n=UC(e),r=new Map;for(let t of e)t.renderComponent&&r.set(t.itemType,t.renderComponent);return{coreRegistry:n,getRenderer:e=>r.get(e),localizations:Gg(...e.map(e=>e.playerLocalizations))}}function GC(e,t){return t?e.map(e=>{if(!e.infos)return e;let n={...e.infos.labelByLocale},r={...e.infos.descriptionByLocale};for(let i of Object.keys(t)){let a=LC(t,i,[`registryLabels`,`items`,e.itemType,`label`]);a!==void 0&&(n[i]=a);let o=LC(t,i,[`registryLabels`,`items`,e.itemType,`description`]);o!==void 0&&(r[i]=o)}return{...e,infos:{...e.infos,labelByLocale:n,descriptionByLocale:r,categories:[...e.infos.categories]}}}):e}function KC(e){if(!e)return;let t={};for(let n of Object.keys(e)){let r=e[n],i=IC(r)&&IC(r.registryLabels)&&IC(r.registryLabels.categories)?r.registryLabels.categories:void 0;if(i)for(let[e,r]of Object.entries(i))typeof r==`string`&&(t[e]={...t[e]??{},[n]:r})}return Object.keys(t).length>0?t:void 0}function qC(e){if(!e.infos)throw Error(`ItemRegistryEntry "${e.itemType}" must have infos when used in editor.`);let t=e.includeDefaultSearchAdapter??!0,n=e.searchAdapters?[...e.searchAdapters]:[];return t&&n.push(PC),{itemType:e.itemType,infos:e.infos,assistantCapability:e.assistantCapability,defaultItemKeyPrefix:e.defaultItemKeyPrefix,editorComponent:e.editorComponent,renderComponent:e.renderComponent,previewComponent:e.previewComponent,getAuthoringState:e.getAuthoringState,capabilities:e.capabilities,expressions:e.expressions?[...e.expressions]:void 0,isRootOnly:e.isRootOnly,getInitialItem:e.getInitialItem,createItem:e.createItem,searchAdapters:n,includeDefaultSearchAdapter:t}}function JC(e,t={}){VC(HC(e,{mode:`editor`,requireBuiltInTypes:t.requireBuiltInTypes??!0}));let n=UC(e),r={};for(let t of e){if(r[t.itemType])throw Error(`Duplicate item registry entry for type: ${t.itemType}`);r[t.itemType]={...qC(t)}}if(t.requireBuiltInTypes??!0){for(let e of FC)if(!r[e])throw Error(`Missing registry entry for built-in type: ${e}`)}return{coreRegistry:n,definitions:r,assistantCapabilities:uC(Object.values(r).map(e=>{let t=e.assistantCapability??aae({itemType:e.itemType,displayName:o_(e.infos.labelByLocale,`en`)});if(t.manifest.itemType!==e.itemType)throw Error(`Survey assistant capability "${t.manifest.itemType}" does not match registry item type "${e.itemType}".`);return t})),playerLocalizations:Gg(...e.map(e=>e.playerLocalizations)),categoryLabels:RC(t.categoryLabels)}}function YC(e,t){return t instanceof u.st&&t.isRoot()?e.definitions.root:e.definitions[t.type]}function XC(e){let{createdAt:t,updatedAt:n}=e.editorMetadata;return!n||t===n?i_.blank:i_.incomplete}function ZC({item:e,definition:t,itemContent:n,locales:r,locale:i}){return t?.getAuthoringState?.({item:e,itemContent:n,locales:r,locale:i})??XC(e)}var QC=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),$C=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ew=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),tw=e=>{let t=ew(e);return t.charAt(0).toUpperCase()+t.slice(1)},nw={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},rw=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},iw=(0,f.createContext)({}),aw=()=>(0,f.useContext)(iw),ow=(0,f.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:p=`currentColor`,className:m=``}=aw()??{},h=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,f.createElement)(`svg`,{ref:c,...nw,width:t??l??nw.width,height:t??l??nw.height,stroke:e??p,strokeWidth:h,className:QC(`lucide`,m,i),...!a&&!rw(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,f.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),K=(e,t)=>{let n=(0,f.forwardRef)(({className:n,...r},i)=>(0,f.createElement)(ow,{ref:i,iconNode:t,className:QC(`lucide-${$C(tw(e))}`,`lucide-${e}`,n),...r}));return n.displayName=tw(e),n},sw=K(`arrow-left-right`,[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]),cw=K(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),lw=K(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),uw=K(`asterisk`,[[`path`,{d:`M12 6v12`,key:`1vza4d`}],[`path`,{d:`M17.196 9 6.804 15`,key:`1ah31z`}],[`path`,{d:`m6.804 9 10.392 6`,key:`1b6pxd`}]]),dw=K(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),fw=K(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),pw=K(`bring-to-front`,[[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`2`,key:`yj20xf`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2`,key:`1ltk23`}],[`path`,{d:`M14 20a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2`,key:`1q24h9`}]]),mw=K(`calendar-clock`,[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5`,key:`1osxxc`}],[`path`,{d:`M3 10h5`,key:`r794hk`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]),hw=K(`calendar-days`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 14h.01`,key:`6423bh`}],[`path`,{d:`M12 14h.01`,key:`1etili`}],[`path`,{d:`M16 14h.01`,key:`1gbofw`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M16 18h.01`,key:`kzsmim`}]]),gw=K(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),_w=K(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),vw=K(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),yw=K(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),bw=K(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),xw=K(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Sw=K(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Cw=K(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ww=K(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Tw=K(`circle-ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M17 12h.01`,key:`1m0b6t`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M7 12h.01`,key:`eqddd0`}]]),Ew=K(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Dw=K(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Ow=K(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),kw=K(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Aw=K(`clipboard-pen-line`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,key:`1oijnt`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-.5`,key:`1but9f`}],[`path`,{d:`M16 4h2a2 2 0 0 1 1.73 1`,key:`1p8n7l`}],[`path`,{d:`M8 18h1`,key:`13wk12`}],[`path`,{d:`M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`2t3380`}]]),jw=K(`clipboard-plus`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M9 14h6`,key:`159ibu`}],[`path`,{d:`M12 17v-6`,key:`1y8rbf`}]]),Mw=K(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Nw=K(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Pw=K(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Fw=K(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Iw=K(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Lw=K(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Rw=K(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),zw=K(`files`,[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),Bw=K(`focus`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]),Vw=K(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Hw=K(`folder-up`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}],[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`m9 13 3-3 3 3`,key:`1pxg3c`}]]),Uw=K(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ww=K(`form`,[[`path`,{d:`M4 14h6`,key:`77gv2w`}],[`path`,{d:`M4 2h10`,key:`a2b314`}],[`rect`,{x:`4`,y:`18`,width:`16`,height:`4`,rx:`1`,key:`sybzq6`}],[`rect`,{x:`4`,y:`6`,width:`16`,height:`4`,rx:`1`,key:`1osc9e`}]]),Gw=K(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Kw=K(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),qw=K(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Jw=K(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Yw=K(`heading`,[[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M6 20V4`,key:`1w1bmo`}],[`path`,{d:`M18 20V4`,key:`o2hl4u`}]]),Xw=K(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Zw=K(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Qw=K(`images`,[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]),$w=K(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),eT=K(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),tT=K(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),nT=K(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),rT=K(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),iT=K(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),aT=K(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),oT=K(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),sT=K(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),cT=K(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),lT=K(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),uT=K(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),dT=K(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),fT=K(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),pT=K(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),mT=K(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),hT=K(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),gT=K(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),_T=K(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),vT=K(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),yT=K(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),bT=K(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),xT=K(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ST=K(`remove-formatting`,[[`path`,{d:`M4 7V4h16v3`,key:`9msm58`}],[`path`,{d:`M5 20h6`,key:`1h6pxn`}],[`path`,{d:`M13 4 8 20`,key:`kqq6aj`}],[`path`,{d:`m15 15 5 5`,key:`me55sn`}],[`path`,{d:`m20 15-5 5`,key:`11p7ol`}]]),CT=K(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),wT=K(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),TT=K(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ET=K(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),DT=K(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),OT=K(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),kT=K(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),AT=K(`tablet`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]),jT=K(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),MT=K(`text-align-center`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]]),NT=K(`text-align-justify`,[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]]),PT=K(`text-align-end`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]]),FT=K(`text-align-start`,[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]]),IT=K(`text-cursor-input`,[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]),LT=K(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),RT=K(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),zT=K(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),BT=K(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),VT=K(`tv-minimal`,[[`path`,{d:`M7 21h10`,key:`1b0cd5`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}]]),HT=K(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),UT=K(`underline`,[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]),WT=K(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),GT=K(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);function KT({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,m.jsx)(ene,{"data-slot":`separator`,decorative:n,orientation:t,className:z(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}function qT({className:e,...t}){return(0,m.jsx)(`fieldset`,{"data-slot":`field-set`,className:z(`flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function JT({className:e,variant:t=`legend`,...n}){return(0,m.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:z(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,e),...n})}function YT({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`field-group`,className:z(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var XT=je(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function ZT({className:e,orientation:t=`vertical`,...n}){return(0,m.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:z(XT({orientation:t}),e),...n})}function QT({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`field-content`,className:z(`group/field-content flex flex-1 flex-col gap-0.5 leading-snug`,e),...t})}function $T({className:e,...t}){return(0,m.jsx)(Og,{"data-slot":`field-label`,className:z(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function eE({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`field-label`,className:z(`flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50`,e),...t})}function tE({className:e,...t}){return(0,m.jsx)(`p`,{"data-slot":`field-description`,className:z(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function nE({className:e,children:t,errors:n,...r}){let i=(0,d.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,m.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,m.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,m.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:z(`text-sm font-normal text-destructive`,e),...r,children:i}):null}function rE({className:e,size:t=`default`,...n}){return(0,m.jsx)(Sp,{"data-slot":`switch`,"data-size":t,className:z(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,m.jsx)(wp,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}function iE({...e}){return(0,m.jsx)(Bl,{"data-slot":`dropdown-menu`,...e})}function aE({...e}){return(0,m.jsx)(Hl,{"data-slot":`dropdown-menu-trigger`,...e})}function oE({className:e,align:t=`start`,sideOffset:n=4,...r}){return(0,m.jsx)(Ul,{children:(0,m.jsx)(Gl,{"data-slot":`dropdown-menu-content`,sideOffset:n,align:t,className:z(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function sE({...e}){return(0,m.jsx)(Kl,{"data-slot":`dropdown-menu-group`,...e})}function cE({className:e,inset:t,variant:n=`default`,...r}){return(0,m.jsx)(Jl,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:z(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function lE({className:e,children:t,checked:n,inset:r,...i}){return(0,m.jsxs)(Yl,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:z(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,m.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,m.jsx)(Ql,{children:(0,m.jsx)(_w,{})})}),t]})}function uE({...e}){return(0,m.jsx)(Xl,{"data-slot":`dropdown-menu-radio-group`,...e})}function dE({className:e,children:t,inset:n,...r}){return(0,m.jsxs)(Zl,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:z(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[(0,m.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,m.jsx)(Ql,{children:(0,m.jsx)(_w,{})})}),t]})}function fE({className:e,inset:t,...n}){return(0,m.jsx)(ql,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:z(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function pE({className:e,...t}){return(0,m.jsx)($l,{"data-slot":`dropdown-menu-separator`,className:z(`-mx-1 my-1 h-px bg-border`,e),...t})}function mE({...e}){return(0,m.jsx)(eu,{"data-slot":`dropdown-menu-sub`,...e})}function hE({className:e,inset:t,children:n,...r}){return(0,m.jsxs)(tu,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:z(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,m.jsx)(bw,{className:`ml-auto`})]})}function gE({className:e,...t}){return(0,m.jsx)(nu,{"data-slot":`dropdown-menu-sub-content`,className:z(`z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})}var _E=`survey-editor:clipboard-value-updated`,vE=()=>{typeof window>`u`||window.dispatchEvent(new Event(_E))},yE=()=>{let[e,t]=(0,d.useState)(null),[n,r]=(0,d.useState)(null),i=(0,d.useEffectEvent)(async()=>{try{t(await navigator.clipboard.readText())}catch{t(null)}r(new Date)});return(0,d.useEffect)(()=>{let e=window.setTimeout(()=>void i(),0);if(typeof window>`u`)return;let t=()=>{i()};return window.addEventListener(_E,t),()=>{window.clearTimeout(e),window.removeEventListener(_E,t)}},[]),[e,(0,d.useCallback)(()=>{vE()},[]),n]},bE=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},xE=(e=>e?bE(e):bE),SE=e=>e;function CE(e,t=SE){let n=f.default.useSyncExternalStore(e.subscribe,f.default.useCallback(()=>t(e.getState()),[e,t]),f.default.useCallback(()=>t(e.getInitialState()),[e,t]));return f.default.useDebugValue(n),n}var wE=(0,d.createContext)(null);function q(e){let t=(0,d.useContext)(wE);if(!t)throw Error(`useEditorStore must be used within an EditorStoreProvider`);return CE(t,e)}function TE(){let e=(0,d.useContext)(wE);if(!e)throw Error(`useEditorStoreApi must be used within an EditorStoreProvider`);return e}function Cae(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var wae=e=>{switch(e){case`success`:return Dae;case`info`:return kae;case`warning`:return Oae;case`error`:return Aae;default:return null}},Tae=Array(12).fill(0),Eae=({visible:e,className:t})=>f.default.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},f.default.createElement(`div`,{className:`sonner-spinner`},Tae.map((e,t)=>f.default.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Dae=f.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},f.default.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Oae=f.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},f.default.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),kae=f.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},f.default.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Aae=f.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},f.default.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),jae=f.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},f.default.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),f.default.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Mae=()=>{let[e,t]=f.default.useState(document.hidden);return f.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},EE=1,DE=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:EE++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],f.default.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Pae(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!f.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!f.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!f.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!f.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||EE++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Nae=(e,t)=>{let n=t?.id||EE++;return DE.addToast({title:e,...t,id:n}),n},Pae=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,OE=Object.assign(Nae,{success:DE.success,info:DE.info,warning:DE.warning,error:DE.error,custom:DE.custom,message:DE.message,promise:DE.promise,dismiss:DE.dismiss,loading:DE.loading},{getHistory:()=>DE.toasts,getToasts:()=>DE.getActiveToasts()});Cae(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function kE(e){return e.label!==void 0}var Fae=3,Iae=`24px`,Lae=`16px`,AE=4e3,Rae=356,zae=14,Bae=45,Vae=200;function jE(...e){return e.filter(Boolean).join(` `)}function Hae(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Uae=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:p,closeButton:m,style:h,cancelButtonStyle:g,actionButtonStyle:_,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=f.default.useState(null),[k,A]=f.default.useState(null),[j,M]=f.default.useState(!1),[N,ee]=f.default.useState(!1),[P,F]=f.default.useState(!1),[I,L]=f.default.useState(!1),[te,ne]=f.default.useState(!1),[re,ie]=f.default.useState(0),[ae,oe]=f.default.useState(0),se=f.default.useRef(n.duration||b||AE),ce=f.default.useRef(null),le=f.default.useRef(null),ue=c===0,de=c+1<=o,fe=n.type,pe=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,ge=f.default.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),_e=f.default.useMemo(()=>n.closeButton??m,[n.closeButton,m]),ve=f.default.useMemo(()=>n.duration||b||AE,[n.duration,b]),ye=f.default.useRef(0),be=f.default.useRef(0),xe=f.default.useRef(0),Se=f.default.useRef(null),[Ce,we]=x.split(`-`),Te=f.default.useMemo(()=>s.reduce((e,t,n)=>n>=ge?e:e+t.height,0),[s,ge]),Ee=Mae(),De=n.invert||t,Oe=fe===`loading`;be.current=f.default.useMemo(()=>ge*S+Te,[ge,Te]),f.default.useEffect(()=>{se.current=ve},[ve]),f.default.useEffect(()=>{M(!0)},[]),f.default.useEffect(()=>{let e=le.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),f.default.useLayoutEffect(()=>{if(!j)return;let e=le.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let ke=f.default.useCallback(()=>{ee(!0),ie(be.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Vae)},[n,d,a,be]);f.default.useEffect(()=>{if(n.promise&&fe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ee?(()=>{if(xe.current<ye.current){let e=new Date().getTime()-ye.current;se.current-=e}xe.current=new Date().getTime()})():se.current!==1/0&&(ye.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),ke()},se.current)),()=>clearTimeout(e)},[u,i,n,fe,Ee,ke]),f.default.useEffect(()=>{n.delete&&(ke(),n.onDismiss==null||n.onDismiss.call(n,n))},[ke,n.delete]);function Ae(){return T?.loading?f.default.createElement(`div`,{className:jE(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":fe===`loading`},T.loading):f.default.createElement(Eae,{className:jE(w?.loader,n?.classNames?.loader),visible:fe===`loading`})}let je=n.icon||T?.[fe]||wae(fe);return f.default.createElement(`li`,{tabIndex:0,ref:le,className:jE(v,me,w?.toast,n?.classNames?.toast,w?.default,w?.[fe],n?.classNames?.[fe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??p,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":te,"data-removed":N,"data-visible":de,"data-y-position":Ce,"data-x-position":we,"data-index":c,"data-front":ue,"data-swiping":P,"data-dismissible":pe,"data-type":fe,"data-invert":De,"data-swipe-out":I,"data-swipe-direction":k,"data-expanded":!!(u||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${N?re:be.current}px`,"--initial-height":C?`auto`:`${ae}px`,...h,...n.style},onDragEnd:()=>{F(!1),O(null),Se.current=null},onPointerDown:e=>{e.button!==2&&(Oe||!pe||(ce.current=new Date,ie(be.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(F(!0),Se.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(I||!pe)return;Se.current=null;let e=Number(le.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(le.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ce.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=Bae||a>.11){ie(be.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),ke(),L(!0);return}else{var o,s;(o=le.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=le.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ne(!1),F(!1),O(null)},onPointerMove:t=>{var n,r;if(!Se.current||!pe||window.getSelection()?.toString().length>0)return;let i=t.clientY-Se.current.y,a=t.clientX-Se.current.x,o=e.swipeDirections??Hae(x);!D&&(Math.abs(a)>1||Math.abs(i)>1)&&O(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(D===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ne(!0),(n=le.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=le.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},_e&&!n.jsx&&fe!==`loading`?f.default.createElement(`button`,{"aria-label":E,"data-disabled":Oe,"data-close-button":!0,onClick:Oe||!pe?()=>{}:()=>{ke(),n.onDismiss==null||n.onDismiss.call(n,n)},className:jE(w?.closeButton,n?.classNames?.closeButton)},T?.close??jae):null,(fe||n.icon||n.promise)&&n.icon!==null&&(T?.[fe]!==null||n.icon)?f.default.createElement(`div`,{"data-icon":``,className:jE(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Ae():null,n.type===`loading`?null:je):null,f.default.createElement(`div`,{"data-content":``,className:jE(w?.content,n?.classNames?.content)},f.default.createElement(`div`,{"data-title":``,className:jE(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?f.default.createElement(`div`,{"data-description":``,className:jE(y,he,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),f.default.isValidElement(n.cancel)?n.cancel:n.cancel&&kE(n.cancel)?f.default.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{kE(n.cancel)&&pe&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),ke())},className:jE(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,f.default.isValidElement(n.action)?n.action:n.action&&kE(n.action)?f.default.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||_,onClick:e=>{kE(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&ke())},className:jE(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function ME(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Wae(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Lae:Iae;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Gae=f.default.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:m,duration:h,style:g,visibleToasts:_=Fae,toastOptions:v,dir:y=ME(),gap:b=zae,icons:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=f.default.useState([]),T=f.default.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=f.default.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=f.default.useState([]),[k,A]=f.default.useState(!1),[j,M]=f.default.useState(!1),[N,ee]=f.default.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),P=f.default.useRef(null),F=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=f.default.useRef(null),L=f.default.useRef(!1),te=f.default.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||DE.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return f.default.useEffect(()=>DE.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{p.default.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[C]),f.default.useEffect(()=>{if(d!==`system`){ee(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?ee(`dark`):ee(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{ee(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{ee(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),f.default.useEffect(()=>{C.length<=1&&A(!1)},[C]),f.default.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=P.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===P.current||P.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),f.default.useEffect(()=>{if(P.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[P.current]),f.default.createElement(`section`,{ref:t,"aria-label":`${S} ${F}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?f.default.createElement(`ol`,{key:t,dir:y===`auto`?ME():y,tabIndex:-1,ref:P,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${Rae}px`,"--gap":`${b}px`,...g,...Wae(l,u)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>f.default.createElement(Uae,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:m,duration:v?.duration??h,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:r,visibleToasts:_,closeButton:v?.closeButton??s,interacting:j,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:te,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:b,expanded:k,swipeDirections:e.swipeDirections}))):null}))}),NE=(0,d.createContext)(void 0);function Kae({isOpen:e,title:t,description:n,buttonLabel:r,dismissButtonClassName:i,dismissButtonVariant:a,children:o,onDismiss:s}){return(0,m.jsx)(_g,{open:e,onOpenChange:e=>{e||s()},children:(0,m.jsxs)(bg,{children:[(0,m.jsxs)(xg,{children:[(0,m.jsx)(Cg,{children:t}),n?(0,m.jsx)(wg,{children:n}):null]}),o==null?null:(0,m.jsx)(`div`,{className:`py-2`,children:o}),(0,m.jsx)(Sg,{className:`justify-center sm:justify-center`,children:(0,m.jsx)(Eg,{className:z(`min-w-24 active:scale-[0.97] transition-transform duration-150`,i),variant:a??`default`,children:r})})]})})}var qae=({children:e})=>{let[t,n]=(0,d.useState)({}),[r,i]=(0,d.useState)(!1),a=(0,d.useRef)(null),o=(0,d.useCallback)(()=>{let e=a.current;e&&e(),a.current=null},[]),s=(0,d.useCallback)(()=>{o(),i(!1)},[o]),c=(0,d.useCallback)(e=>(o(),n(e),i(!0),new Promise(e=>{a.current=e})),[o]),l=(0,d.useMemo)(()=>Object.assign(c,{dismiss:s}),[c,s]);return(0,m.jsxs)(NE.Provider,{value:{alert:l},children:[e,(0,m.jsx)(Kae,{isOpen:r,title:t.title??`Notice`,description:t.description??``,buttonLabel:t.buttonLabel??`OK`,dismissButtonClassName:t.dismissButtonClassName,dismissButtonVariant:t.dismissButtonVariant,onDismiss:s,children:t.children})]})},Jae=()=>{let e=(0,d.useContext)(NE);if(!e)throw Error(`useAlert must be used within an AlertDialogProvider`);return e.alert},Yae=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},Xae=f.createContext(void 0),Zae={setTheme:e=>{},themes:[]},Qae=()=>f.useContext(Xae)??Zae;f.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return f.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Yae.toString()})(${u})`}})});var $ae=({...e})=>{let{theme:t=`system`}=Qae();return(0,m.jsx)(Gae,{theme:t,className:`toaster group`,icons:{success:(0,m.jsx)(ww,{className:`size-4`}),info:(0,m.jsx)($w,{className:`size-4`}),warning:(0,m.jsx)(BT,{className:`size-4`}),error:(0,m.jsx)(dT,{className:`size-4`}),loading:(0,m.jsx)(oT,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},toastOptions:{classNames:{toast:`cn-toast`}},...e})};function eoe({delayDuration:e=0,...t}){return(0,m.jsx)(bm,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function PE({...e}){return(0,m.jsx)(wm,{"data-slot":`tooltip`,...e})}function FE({...e}){return(0,m.jsx)(Em,{"data-slot":`tooltip-trigger`,...e})}function IE({className:e,sideOffset:t=0,children:n,...r}){return(0,m.jsx)(Am,{children:(0,m.jsxs)(Mm,{"data-slot":`tooltip-content`,sideOffset:t,className:z(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,m.jsx)(Im,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var toe=`en`,LE={common:{actions:{back:`Back`,cancel:`Cancel`,close:`Close`,copy:`Copy`,delete:`Delete`,generate:`Generate`,more:`More`,open:`Open`,save:`Save`,search:`Search`}},history:{updateItemKey:`Update item key`,updateItemLabel:`Update item label`,updateItemContent:`Update item content`,updateItemResponseConfig:`Update response config`,updateGroupSettings:`Update group settings`,updateSurveyAsset:`Update survey asset`,removeSurveyAsset:`Remove survey asset`,moveItem:`Move item`,pasteItem:`Paste item`,updateItemEditorColor:`Update item editor color`,addItem:`Add item: {itemLabel}`},routes:{editor:{noSaveHandler:`No save handler provided by host application.`,undoTriggered:`Undo functionality triggered (Ctrl/Cmd + Z)`,noMoreUndo:`No more actions to undo`,redoTriggered:`Redo functionality triggered (Ctrl/Cmd + Shift + Z)`,noMoreRedo:`No more actions to redo`,assistantLock:{title:`Assistant is updating the survey.`,editingDescription:`Editing is temporarily paused. Preview and navigation remain available.`,previewDescription:`Preview remains interactive and may refresh when changes are applied.`,openPreview:`Open preview`,compactStatus:`Assistant working · Editing paused`}},footer:{help:`Help`,assets:`Assets ({count})`,unusedAssetsWarning:`Unused assets: {count}`},historyStack:{lastModified:`Last modified:`,recentChangesTitle:`Recent changes`,recentChangesDescription:`Click a state to roll back to that point`},itemEditor:{loading:`Loading...`,editor:`Survey editor`,outline:{title:`Outline`,rootContextMenuTarget:`Survey outline background`,addToSurvey:`Add item to survey`,addToGroup:`Add item to {group}`,addItem:`Add item`,before:`Before`,after:`After`,intoGroup:`Into the group`,focus:`Focus`,openInEditor:`Open in editor`,copySurveyAsGroup:`Copy survey as group`,copyItemReference:`Copy item reference`,copyItemKey:`Copy item key`,copyItemFullKey:`Copy full key`,copyItemId:`Copy ID`,itemReferenceCopied:`Item reference copied to clipboard`,itemReferenceCopyFailed:`Failed to copy item reference to clipboard`,openParentGroup:`Open parent group`,pasteItem:`Paste item`,emptyDescription:`Your survey outline will appear here. Use it to navigate and organize your questionnaire.`,emptyPanelControlsHint:`Use the workspace controls to resize or hide this panel.`,expandGroup:`Expand {group}`,collapseGroup:`Collapse {group}`,openItem:`Open {item}`,dragItem:`Move {item}`,moveFailed:`The item could not be moved.`,noItems:`No items`}},translationMode:{backToItemEditor:`Back to item editor`,title:`Translation editor`,comingSoon:`Translations mode coming soon`},previewMode:{backToItemEditor:`Back to item editor`,title:`Preview`,loading:`Loading survey preview...`,fullscreenDescription:`Authoring preview of the current unsaved survey.`,controlsLabel:`Survey preview controls`,switchToEditor:`Open in editor`,layoutLabel:`Preview layout`,singlePage:`Single page`,paginated:`Paginated`,viewportLabel:`Preview width`,viewport:{mobile:`Mobile`,tablet:`Tablet`,desktop:`Desktop`,wide:`Wide screen`},previewSettings:`Preview settings`,displayLabel:`Display`,showKeys:`Show item keys`,showFullKeys:`Show full item keys`,showMetadata:`Show item metadata`,showConditions:`Show condition indicators`,showPageIndicator:`Show page indicator`,locateFocusedItem:`Locate focused item`,noFocusedItem:`No preview item is focused`,focusItem:`Set focus to {item}`,setFocus:`Set focus`,resetSurvey:`Reset survey responses`,startSimulator:`Start respondent simulator`,enterFullscreen:`Enter fullscreen preview`,exitFullscreen:`Exit fullscreen preview`,hasConditions:`This item has display or disabled conditions`,openInEditor:`Open {item} in editor`,addItemHere:`Add item`,pageBreak:`Page break`,pageIndicator:`Page {current} of {total}`,itemCountOne:`{count} item`,itemCount:`{count} items`,pageNavigation:`Preview page navigation`,previousPage:`Previous page`,nextPage:`Next page`,emptyTitle:`Your survey starts here`,emptyDescription:`Start with your first question, then build the survey experience step by step.`,gettingStartedTitle:`Choose a starting point`,browseAllItems:`Browse all item types`,emptyReassurance:`You can edit everything later.`},assetManager:{backToItemEditor:`Back to item editor`,title:`Image assets`,description:`Upload images and reuse them anywhere in your survey.`}},workspace:{layoutControls:`Workspace layout controls`,toggleLeftPanel:`Toggle left panel`,toggleRightPanel:`Toggle right panel`,showPanel:`Show {panel}`,hidePanel:`Hide {panel}`,resizePanel:`Resize {panel}`,resetLayout:`Reset workspace layout`,assistant:{title:`Assistant`}},toolbar:{actions:{editor:`Editor`,openEditor:`Open editor`,preview:`Preview`,openPreview:`Open survey preview`,simulator:`Simulator`,startSimulator:`Start simulator`},languagePicker:{languages:`Languages:`,editLanguages:`Edit languages`},searchTrigger:{search:`Search`,searchSurveyItems:`Search survey items`},search:{title:`Search Survey Items`,placeholder:`Search survey items...`,key:`Key:`,content:`Content:`,label:`Label:`,itemType:`Item Type:`,noItemsFound:`No items found for "{searchTerm}"`,startTyping:`Start typing to search survey items...`,navigate:`to navigate`,select:`to select`},breadcrumbs:{selectSibling:`Select sibling`,addNewSibling:`Add new sibling`,surveySettings:`Survey settings`}},aiInput:{getSuggestions:`Get AI suggestions`,gettingSuggestions:`Getting AI suggestions...`,suggestions:`AI suggestions`,noSuggestions:`No suggestions found`,yourInput:`Your input`,ai:`AI`,navigate:`navigate`,select:`select`,close:`close`},itemEditorCard:{goToParentItem:`Go to parent item`,itemKeyUpdated:`Item key updated.`,itemKeyUpdateFailed:`Failed to update item key.`,itemLabelUpdated:`Item label updated.`,preview:`Go to preview`,conditionsDescription:`Visibility and branching rules for this item.`,prefillRules:`Prefill rules`,prefillRulesDescription:`Map existing survey data into this item automatically.`,exportSettings:`Export settings`,exportSettingsDescription:`Control how this item is represented in exports.`,comingSoon:`Coming soon`,comingSoonDescription:`This configuration area is planned but not available yet.`,expressions:{noneTitle:`No expressions`,noneDescription:`There are no assistant-authored rules in this area yet.`,categoryForTarget:`{target} · {category}`,categories:{display:`Visible if`,disabled:`Disabled if`,validation:`Valid if`,"prefill-condition":`Prefill if`,"prefill-value":`Prefill value`},allConditions:`All conditions`,viewFull:`View full rule`,dialogDescription:`A read-only, deterministic view of the expression used by the survey.`,conditionsDialogDescription:`All visibility, disabled, and validation expressions for this item.`,itemDialogDescription:`All display, disabled, validation, and prefill expressions for this item.`,readOnlyHint:`To change this rule, describe the change to the survey assistant.`}},tabTrigger:{switchToThisView:`Switch to this view`,then:`then`},itemSiblingNavigation:{goToNextSiblingItem:`Go to next sibling item`,nextSibling:`Next sibling`,goToPreviousSiblingItem:`Go to previous sibling item`,previousSibling:`Previous sibling`},copyItem:{copied:`Item copied to clipboard`,failed:`Failed to copy item`,failedToClipboard:`Failed to copy item to clipboard`},deleteItem:{removeReferencesTitle:`Remove references before deletion`,removeReferencesDescription:`This item is referenced in other parts of the survey. You need to remove all references before deleting it.`,ok:`Ok`,referencesFoundIn:`References found in:`,deleteSurveyItemTitle:`Delete survey item`,deleteSurveyItemDescription:`Are you sure you want to delete this survey item?`,deletedSuccessfully:`Item "{itemKey}" deleted successfully`,failed:`Failed to delete item`,unknownError:`Unknown error`},itemPreview:{noItemSelected:`No item selected`,noPreviewRenderer:`No preview renderer registered for {itemType}.`,blankTitle:`New {itemType} item`,blankDescription:`Open this item to start editing it.`,openToStart:`Start editing`,incompleteTitle:`This item is incomplete`,incompleteDescription:`Finish its content to see a participant-ready preview.`,openToComplete:`Open to complete`,openItem:`Open item`,previewIconAria:`{itemType} preview icon`,created:`Created`,modified:`Modified`},itemKeyEditor:{validation:{sameAsCurrent:`Key is the same as the current key`,duplicate:`Key already exists in the group, cannot use duplicate keys.`,dot:`Key cannot contain dots`,space:`Key cannot contain spaces`,empty:`Key cannot be empty`},keyLengthWarning:`This key is longer than {maxLength} characters. We recommend using a short key.`,noKey:`(no-key)`,editItemKey:`Edit item key`,title:`Key editor`,description:`Define the coding key for this item.`,keyLabel:`Key`,placeholder:`Enter new key`,surveyRootItem:`Survey root item`,parentFullKey:`Parent full key: {parentFullKey}`,suggestions:`Suggestions`,regenerate:`Regenerate`,generatingSuggestions:`Generating suggestions...`,noValidSuggestions:`No valid suggestions available. Try regenerate.`,suggestionCategories:{surveyPattern:`Pattern`,compact:`Compact`,preferred:`General`,fair:`FAIR`}},itemLabelEditor:{emptyLabel:`Add label...`,editItemLabel:`Edit item label`,placeholder:`Enter item label`},groupItems:{addNewItemToGroup:`Add a new item to the group:`,loadingGroupItem:`loading group item...`,itemPasted:`Item pasted from clipboard`,pasteFailed:`Failed to paste item from clipboard`,selectItemToCopy:`Select an item in the above list to copy`,pageBreak:`Page Break`,insert:`Insert:`,press:`Press`,or:`or`,toInsert:`to insert.`,items:`Items`,doubleClickHelp:`Double click on an item to open it, drag and drop to reorder.`,noItemsYet:`No items yet`,emptyDescription:`Add questions, sections, or other elements to your questionnaire`,addItem:`Add item`},addItemDialog:{entry:{structure:{title:`Organize`,description:`Add a new group container or insert a page break.`},blankItem:{title:`Available item types`,description:`Choose an available item type from the current editor registry.`},catalogue:{title:`Catalogue`,description:`Add an item from connected shared catalogues or use a custom catalogue.`},comingSoon:`Coming soon`,ariaLabel:`Add options`},structure:{ariaLabel:`Group and page break options`},blankItem:{gridLabel:`Available item types`,recent:`Recent`,searchPlaceholder:`Search available item types...`,noItemTypesFound:`No item types found.`,clipboardHeading:`Clipboard`,pasteFromClipboard:`Paste from clipboard`,pasteFromClipboardDescription:`Insert the item copied from the survey editor`},title:`What do you want to add?`,close:`Close add item dialog`,enterFullscreen:`Enter fullscreen`,exitFullscreen:`Exit fullscreen`,addingTo:`Adding to:`,itemCount:`({count} items)`,chooseHowToExpand:`Choose how you want to expand your questionnaire.`,footer:{entry:`Use arrow keys to select or Esc to cancel.`,structure:`Use arrow keys to select or Esc to cancel.`,"blank-item":`Search or type to filter. Use arrow keys to select or Esc to cancel.`,grid:`Use arrow keys to choose an item and Enter to add it. Esc closes this dialog.`,catalogue:`Catalogue support is coming soon.`},catalogueComingSoon:`Catalogue item import is coming soon.`,noValidGroupSelected:`No valid group selected.`,registryItemTypeUnavailable:`Item type "{itemType}" is not available in this editor registry.`,itemAdded:`Item added: {itemKey}`,itemAddFailed:`Failed to add item. Please try again.`},registryLabels:{categories:{special:`Special Items`,display:`Display`,form:`Forms`,question:`Questions`,structure:`Structure`},items:{root:{label:`Root`,description:`Survey root item.`},group:{label:`Group`,description:`A container for organizing survey items.`},pageBreak:{label:`Page break`,description:`Force items after this to appear on a new page.`},infoItem:{label:`Info`,description:`Display-only content: markdown, info, warnings, media (no responses).`},formItem:{label:`Form`,description:`Composable forms with groups and fields.`},choiceItem:{label:`Choice`,description:`Single or multiple choice groups; options may nest forms later.`}}},itemColor:{failedUpdate:`Failed to update item color.`,updated:`Item color updated.`,label:`Item color`,swatchTitle:`Color: {color}`},defaultEditors:{root:{items:`Items`,previewTodo:`todo: preview tab`,conditionsTodo:`todo: conditions tab`},group:{settingsTitle:`Group settings`,settingsDescription:`Item structure and ordering are managed in the outline.`,shuffleItemsLabel:`Randomize items`,shuffleItemsDescription:`Show this group’s items in a different order for each respondent.`,conditionsTitle:`Conditions`,conditionsDescription:`Choose when this group is shown to a respondent.`},pageBreak:{branching:`Branching`,title:`Branching logic`,description:`Use this tab to control when this page break should apply.`,todo:`todo: conditions tab`},groupPreview:{emptyTitle:`Empty Group`,emptyDescription:`No items in this group yet`,loading:`Loading preview...`,items:`Items`,itemNotFound:`Item not found`,itemPosition:`Item {index}`,unknownItemKey:`unknown`},pageBreakPreview:{nextPageDescription:`Next items render on a new page.`},questionPreview:{formPlaceholder:`Form item body will render here.`,choicePlaceholder:`Add options to preview this choice item.`,singleChoice:`Single choice`,multipleChoice:`Multiple choice`,choicePreviewMaxUnlimited:`Multiple choice (unlimited)`,choicePreviewMaxUpTo:`Up to {max} choices`,optionLabel:`Option {index}`},infoEditor:{contentPlaceholder:`Add content here, or type / for commands…`},infoPreview:{emptyContent:`No content yet.`},richTextToolbar:{bold:`Bold`,italic:`Italic`,underline:`Underline`,primaryColor:`Primary color`,accentColor:`Accent color`},questionHeader:{titlePlaceholder:`Add a question title...`,subtitlePlaceholder:`Add a subtitle...`,cardFooterPlaceholder:`Add card footer...`},questionBody:{topContentPlaceholder:`Add content before response...`,bottomContentPlaceholder:`Add content after response...`},formEditor:{responseConfig:`Response config`,addFieldGroup:`Add field group`,fieldGroupMenuButton:`Field group settings`,fieldGroupBranching:`Has branching logic`,fieldsLabel:`Fields`,addField:`Add field`,fieldRequired:`Required field`,fieldHasValidations:`Has validations`,fieldInvalid:`Field configuration is invalid`,openFieldEditor:`Open field editor`,editFieldKey:`Edit key…`,deleteField:`Delete field`,fieldDialogTitle:`Edit field`,fieldDialogDescription:`Configure the {fieldType} field, its wrapper content, and its validations.`,fieldKeyDialogTitle:`Edit field key`,fieldKeyDialogDescription:`Update the coding key stored for this field.`,fieldKeyLabel:`Field key`,fieldKeyPlaceholder:`e.g. RESP_01`,fieldKeyDescription:`Keep keys unique within this form item.`,fieldLabelLabel:`Field label`,fieldLabelPlaceholder:`Enter a field label`,fieldDescriptionLabel:`Help text`,fieldDescriptionPlaceholder:`Optional help text for this field`,fieldPlaceholderLabel:`Placeholder`,fieldPlaceholderPlaceholder:`Enter placeholder text`,fieldDatePlaceholder:`Select a date`,fieldDateModeLabel:`Date precision`,fieldDateModePlaceholder:`Choose what respondents can pick`,fieldDatePlaceholders:{year:`Select a year`,"year-month":`Select month and year`,"year-month-day":`Select a date`},fieldRowsLabel:`Rows`,fieldInputModeLabel:`Input mode`,fieldAutocompleteLabel:`Autocomplete`,fieldAutocompletePlaceholder:`e.g. email or organization`,fieldUnitLabel:`Unit`,fieldUnitPlaceholder:`e.g. years`,fieldDefaultValueLabel:`Default value`,fieldStepLabel:`Step`,fieldCheckedLabelLabel:`Checked label`,fieldCheckedLabelPlaceholder:`Shown when the switch is on`,fieldUncheckedLabelLabel:`Unchecked label`,fieldUncheckedLabelPlaceholder:`Shown when the switch is off`,fieldDefaultCheckedLabel:`Default on state`,fieldAllowClearLabel:`Allow clearing the selection`,fieldOptionsLabel:`Options`,fieldOptionsDescription:`Each select option needs a stored value. Labels can be filled in later.`,fieldAddOption:`Add option`,fieldOptionLabel:`Option {index} label`,fieldOptionValueLabel:`Option value`,fieldRemoveOption:`Remove option`,fieldReorderOption:`Reorder option`,fieldSelectPlaceholder:`Select an option`,fieldMinLabel:`Minimum`,fieldMaxLabel:`Maximum`,fieldShowValueLabel:`Show value`,fieldValidationSettingsTitle:`Validations`,fieldValidationSettingsDescription:`Add type-specific checks for the field value.`,fieldValidationValueLabel:`Validation value`,fieldValidationMessageLabel:`Validation message`,fieldValidationMessagePlaceholder:`Optional override shown when the rule fails`,fieldNoAdditionalValidations:`No additional validations are suggested for this field type.`,fieldRemoveValidation:`Remove validation`,fieldRendererSummaryTitle:`Renderer contract`,fieldRendererSummaryDescription:`The renderer can compose each field with these shadcn building blocks.`,fieldControllerSummaryLabel:`Controller`,fieldSuggestionsTitle:`Type suggestions`,fieldSuggestionsDescription:`Suggested config attributes and validations for this field type.`,fieldConfigSuggestionsLabel:`Suggested config`,fieldValidationSuggestionsLabel:`Suggested validations`,fieldIssuesTitle:`Config issues`,fieldIssuesDescription:`Resolve these issues before saving the field.`,fieldKeyRequired:`Enter a unique field key.`,fieldKeyDuplicate:`Field keys must be unique within a form item.`,fieldSelectOptionsRequired:`Select fields need at least one option.`,fieldSelectOptionIncomplete:`Each select option needs a stored key.`,fieldSelectOptionLabelMissing:`One or more options are missing a visible label.`,fieldSelectOptionDuplicate:`Option keys must be unique within the list.`,fieldSliderRangeInvalid:`Slider minimum must be lower than the maximum.`,fieldSliderStepInvalid:`Slider step must be greater than zero.`,fieldSliderDefaultInvalid:`Slider default value must stay within the configured range.`,fieldNumberStepInvalid:`Number step must be greater than zero.`,fieldDateRangeInvalid:`Earliest date must not be later than the latest date.`,fieldValidationInvalid:`One or more validations are missing a required value.`,fieldValidationDuplicate:`Each validation type can only be added once per field.`,dragHandle:`Reorder field`,sortDialogTitle:`Sort fields`,sortDialogDescription:`Drag fields to update the order in {groupTitle}. Changes are saved immediately.`,sortDialogUntitledGroup:`this field group`,sortDialogEmpty:`No fields yet`,sortDialogClose:`Ready`,groupHeaderDialogTitle:`Change group header`,groupHeaderDialogDescription:`Update the group title and description.`,groupHeaderTitleLabel:`Title`,groupHeaderTitlePlaceholder:`Optional group title`,groupHeaderDescriptionLabel:`Description`,groupHeaderDescriptionPlaceholder:`Optional group description`,layoutDialogTitle:`Field group layout`,layoutDialogDescription:`Set how many columns fields use at each width of the field group card (container queries in rem, not the whole screen). Changes apply when you save.`,layoutBreakpointCompact:`Below @xs — group card under 20rem wide`,layoutBreakpointAtXs:`@xs — group card ≥20rem (320px)`,layoutBreakpointAtSm:`@sm — group card ≥24rem (384px)`,layoutBreakpointAtMd:`@md — group card ≥28rem (448px)`,layoutBreakpointAtXl:`@xl — group card ≥36rem (576px)`,layoutDecreaseColumns:`Fewer columns`,layoutIncreaseColumns:`More columns`,fieldTypes:{input:`Input`,textarea:`Textarea`,number:`Number`,datepicker:`Date picker`,switch:`Switch`,select:`Select`,slider:`Slider`},fieldDateModes:{year:`Year only`,"year-month":`Year and month`,"year-month-day":`Year, month, and day`},fieldInputModes:{text:`Text`,email:`Email`,tel:`Telephone`,url:`URL`,password:`Password`},fieldGroupMenu:{changeTitle:`Change group header`,editBranching:`Edit branching logic`,editLayout:`Edit layout`,sortFields:`Sort fields`,deleteGroup:`Delete field group`}},infoBoxPopover:{typeLabel:`Type`,toneInfo:`Info`,toneWarning:`Warning`,titleLabel:`Title`,titlePlaceholder:`Title`,contentLabel:`Content`,contentPlaceholder:`Body text`,collapsibleBody:`Collapsible body`,openByDefault:`Open by default`,apply:`Apply`},imagePopover:{dialogTitle:`Edit image`,sourceDescription:`Pick a local survey asset or enter an external image URL.`,apply:`Apply`,tabLocalAsset:`Local asset`,tabExternalUrl:`External URL`,uploadAssetDialogTitle:`Upload local asset`,addLocalAsset:`Add local asset`,urlLabel:`Image URL`,alignmentLabel:`Alignment`,alignLeft:`Left`,alignCenter:`Center`,alignRight:`Right`,altLabel:`Alt text`,altPlaceholder:`Describe the image for accessibility`,widthLabel:`Width`,maxWidthLabel:`Max width`,dimensionPlaceholder:`e.g. 320`,unitPx:`px`,unitPercent:`%`,captionLabel:`Caption`,captionPlaceholder:`Optional caption shown below the image`,uploadFailed:`Could not add the image. Try again.`,uploading:`Uploading…`,deleteAssetConfirmTitle:`Delete this survey image?`,deleteAssetConfirmDescription:`This image is not used anywhere else in the survey. You can remove it from the survey's image library, or keep the file for reuse.`,deleteAssetConfirmPrimary:`Delete image`,deleteAssetKeepFile:`Keep file`},choiceEditor:{responseConfig:`Response config`,responseSettings:`Response settings`,responseSettingsDescription:`Control how respondents can select and see these options.`,maxSelectionLabel:`Max selection`,maxSelectionPlaceholder:`Select max selections`,maxSelectionDescription:`1 shows a single-choice control. Any higher number or unlimited shows checkboxes and limits how many options can be selected.`,maxSelectionUnlimited:`Unlimited`,maxSelectionCustomPlaceholder:`Custom`,shuffleOptionsLabel:`Shuffle items`,shuffleOptionsDescription:`Randomize the option order for each respondent.`,shuffleOptions:`Shuffled`,addResponseElement:`Add response element`,addOptionPlaceholder:`Add an option`,createOptionKeyPlaceholder:`opt_1`,createOptionKeyAriaLabel:`Option key`,createOptionLabelPlaceholder:`Add option label...`,createOptionLabelAriaLabel:`Option label`,createOptionCancel:`Cancel`,createOptionSubmit:`Submit`,createOptionKeyRequired:`Enter an option key.`,createOptionKeyDuplicate:`Option key must be unique.`,createOptionLabelRequired:`Enter an option label.`,invalidKeyDialogTitle:`Choose a valid option key`,invalidKeyDialogDescription:`{validationMessage} Keep editing to choose a key yourself, or use the next available key.`,invalidKeyDialogKeepEditing:`Keep editing`,invalidKeyDialogUseGenerated:`Use {key} and close`,optionLabelFallback:`Option {index}`,dragHandle:`Reorder option`,optionContext:{editLabel:`Edit label…`,editKey:`Edit key…`,editBranching:`Display condition…`,editEmbeddedForm:`Embedded form…`,duplicate:`Duplicate option`,delete:`Remove option`},editOptionDialogTitle:`Edit option`,advancedSettings:{title:`Advanced settings`,configured:`Configured`,configuredCount:`{count} configured`},optionIndicators:{displayCondition:`Has display condition`,embeddedForm:`Has embedded form`},embeddedFormDialog:{title:`Embedded form`,description:`Show follow-up fields beneath this option when a respondent selects it.`,helpLabel:`About embedded forms`}},assetManager:{uploadLabel:`Upload image assets`,uploadDescription:`Click to browse or drag and drop`,uploadAction:`Pick images`,uploadDrag:`or drag and drop`,uploadActive:`Drop images here`,nameLabel:`Custom name`,namePlaceholder:`Custom name (optional)`,externalPlaceholder:`https://example.com/image.png`,existingAssets:`Image assets`,empty:`No image assets yet.`,replaceAsset:`Replace`,removeAsset:`Remove asset`,usedByLabel:`Used in {count} items`,deleteBlocked:`This asset is in use and cannot be removed.`,unusedAssetWarning:`Unused asset. It can be removed safely.`,surveyRootItem:`Survey root item`,sourceEmbedded:`Embedded`,pickerAssets:`Choose existing asset`,pickerExternal:`Use external URL`,useExternal:`Use URL`,expandPreview:`View full image`,closePreview:`Close preview`,previewTitle:`Image preview`},placeholder:{structure:`Structure`,preview:`Preview`,conditions:`Conditions`,addContentBeforeResponse:`Add content before response`,addContentAfterResponse:`Add content after response`,structureTodo:`todo: structure editor`,previewTodo:`todo: preview`,conditionsTodo:`todo: conditions`}}},RE={common:{actions:{back:`Terug`,cancel:`Annuleren`,close:`Sluiten`,copy:`Kopiëren`,delete:`Verwijderen`,generate:`Genereren`,more:`Meer`,open:`Openen`,save:`Opslaan`,search:`Zoeken`}},history:{updateItemKey:`Itemcode bijwerken`,updateItemLabel:`Itemlabel bijwerken`,updateItemContent:`Iteminhoud bijwerken`,updateItemResponseConfig:`Antwoordconfiguratie bijwerken`,updateGroupSettings:`Groepsinstellingen bijwerken`,updateSurveyAsset:`Surveybestand bijwerken`,removeSurveyAsset:`Surveybestand verwijderen`,moveItem:`Item verplaatsen`,pasteItem:`Item plakken`,updateItemEditorColor:`Itemkleur bijwerken`,addItem:`Item toevoegen: {itemLabel}`},routes:{editor:{noSaveHandler:`Geen opslaghandler opgegeven door de hostapplicatie.`,undoTriggered:`Ongedaan maken geactiveerd (Ctrl/Cmd + Z)`,noMoreUndo:`Geen acties meer om ongedaan te maken`,redoTriggered:`Opnieuw uitvoeren geactiveerd (Ctrl/Cmd + Shift + Z)`,noMoreRedo:`Geen acties meer om opnieuw uit te voeren`,assistantLock:{title:`De assistent werkt de survey bij.`,editingDescription:`Bewerken is tijdelijk gepauzeerd. Voorbeeld en navigatie blijven beschikbaar.`,previewDescription:`Het voorbeeld blijft interactief en kan vernieuwen zodra wijzigingen worden toegepast.`,openPreview:`Voorbeeld openen`,compactStatus:`Assistent werkt · Bewerken gepauzeerd`}},footer:{help:`Help`,assets:`Bestanden ({count})`,unusedAssetsWarning:`Ongebruikte bestanden: {count}`},historyStack:{lastModified:`Laatst gewijzigd:`,recentChangesTitle:`Recente wijzigingen`,recentChangesDescription:`Klik op een status om terug te gaan naar dat punt`},itemEditor:{loading:`Laden...`,editor:`Survey-editor`,outline:{title:`Overzicht`,rootContextMenuTarget:`Achtergrond van surveyoverzicht`,addToSurvey:`Item aan survey toevoegen`,addToGroup:`Item aan {group} toevoegen`,addItem:`Item toevoegen`,before:`Ervoor`,after:`Erna`,intoGroup:`In de groep`,focus:`Focus`,openInEditor:`Openen in editor`,copySurveyAsGroup:`Enquête als groep kopiëren`,copyItemReference:`Itemreferentie kopiëren`,copyItemKey:`Itemcode kopiëren`,copyItemFullKey:`Volledige itemcode kopiëren`,copyItemId:`ID kopiëren`,itemReferenceCopied:`Itemreferentie naar klembord gekopieerd`,itemReferenceCopyFailed:`Itemreferentie kon niet naar klembord worden gekopieerd`,openParentGroup:`Bovenliggende groep openen`,pasteItem:`Item plakken`,emptyDescription:`Je surveyoverzicht verschijnt hier. Gebruik het om door je vragenlijst te navigeren en die te organiseren.`,emptyPanelControlsHint:`Gebruik de werkruimteknoppen om dit paneel te vergroten, verkleinen of te verbergen.`,expandGroup:`{group} uitvouwen`,collapseGroup:`{group} samenvouwen`,openItem:`{item} openen`,dragItem:`{item} verplaatsen`,moveFailed:`Het item kon niet worden verplaatst.`,noItems:`Geen items`}},translationMode:{backToItemEditor:`Terug naar itemeditor`,title:`Vertalingseditor`,comingSoon:`Vertaalmodus binnenkort beschikbaar`},previewMode:{backToItemEditor:`Terug naar itemeditor`,title:`Voorbeeld`,loading:`Surveyvoorbeeld laden...`,fullscreenDescription:`Auteursvoorbeeld van de huidige niet-opgeslagen survey.`,controlsLabel:`Bediening voor surveyvoorbeeld`,switchToEditor:`Openen in editor`,layoutLabel:`Voorbeeldindeling`,singlePage:`Eén pagina`,paginated:`Meerdere pagina's`,viewportLabel:`Voorbeeldbreedte`,viewport:{mobile:`Mobiel`,tablet:`Tablet`,desktop:`Desktop`,wide:`Breed scherm`},previewSettings:`Voorbeeldinstellingen`,displayLabel:`Weergave`,showKeys:`Itemcodes tonen`,showFullKeys:`Volledige itemcodes tonen`,showMetadata:`Itemmetadata tonen`,showConditions:`Voorwaarde-indicatoren tonen`,showPageIndicator:`Pagina-indicator tonen`,locateFocusedItem:`Geselecteerd item zoeken`,noFocusedItem:`Geen voorbeelditem geselecteerd`,focusItem:`Focus instellen op {item}`,setFocus:`Focus instellen`,resetSurvey:`Surveyantwoorden resetten`,startSimulator:`Respondentsimulator starten`,enterFullscreen:`Voorbeeld op volledig scherm`,exitFullscreen:`Volledig scherm afsluiten`,hasConditions:`Dit item heeft weergave- of uitschakelvoorwaarden`,openInEditor:`{item} openen in editor`,addItemHere:`Item toevoegen`,pageBreak:`Pagina-einde`,pageIndicator:`Pagina {current} van {total}`,itemCountOne:`{count} item`,itemCount:`{count} items`,pageNavigation:`Paginanavigatie voor voorbeeld`,previousPage:`Vorige pagina`,nextPage:`Volgende pagina`,emptyTitle:`Hier begint je survey`,emptyDescription:`Begin met je eerste vraag en bouw de surveyervaring stap voor stap op.`,gettingStartedTitle:`Kies een beginpunt`,browseAllItems:`Bekijk alle itemtypen`,emptyReassurance:`Je kunt alles later nog aanpassen.`},assetManager:{backToItemEditor:`Terug naar itemeditor`,title:`Afbeeldingsbestanden`,description:`Upload afbeeldingen en hergebruik ze overal in je survey.`}},workspace:{layoutControls:`Bediening voor werkruimte-indeling`,toggleLeftPanel:`Linkerpaneel in- of uitschakelen`,toggleRightPanel:`Rechterpaneel in- of uitschakelen`,showPanel:`{panel} tonen`,hidePanel:`{panel} verbergen`,resizePanel:`Formaat van {panel} wijzigen`,resetLayout:`Werkruimte-indeling herstellen`,assistant:{title:`Assistent`}},toolbar:{actions:{editor:`Editor`,openEditor:`Editor openen`,preview:`Voorbeeld`,openPreview:`Surveyvoorbeeld openen`,simulator:`Simulator`,startSimulator:`Simulator starten`},languagePicker:{languages:`Talen:`,editLanguages:`Talen bewerken`},searchTrigger:{search:`Zoeken`,searchSurveyItems:`Survey-items zoeken`},search:{title:`Survey-items zoeken`,placeholder:`Survey-items zoeken...`,key:`Code:`,content:`Inhoud:`,label:`Label:`,itemType:`Itemtype:`,noItemsFound:`Geen items gevonden voor "{searchTerm}"`,startTyping:`Begin met typen om survey-items te zoeken...`,navigate:`navigeren`,select:`selecteren`},breadcrumbs:{selectSibling:`Naastgelegen item selecteren`,addNewSibling:`Nieuw naastgelegen item toevoegen`,surveySettings:`Survey-instellingen`}},aiInput:{getSuggestions:`AI-suggesties ophalen`,gettingSuggestions:`AI-suggesties ophalen...`,suggestions:`AI-suggesties`,noSuggestions:`Geen suggesties gevonden`,yourInput:`Jouw invoer`,ai:`AI`,navigate:`navigeren`,select:`selecteren`,close:`sluiten`},itemEditorCard:{goToParentItem:`Ga naar bovenliggend item`,itemKeyUpdated:`Itemcode bijgewerkt.`,itemKeyUpdateFailed:`Bijwerken van itemcode is mislukt.`,itemLabelUpdated:`Itemlabel bijgewerkt.`,preview:`Ga naar voorbeeld`,conditionsDescription:`Zichtbaarheids- en routeringsregels voor dit item.`,prefillRules:`Voorinvulregels`,prefillRulesDescription:`Koppel bestaande surveydata automatisch aan dit item.`,exportSettings:`Exportinstellingen`,exportSettingsDescription:`Bepaal hoe dit item in exports wordt weergegeven.`,comingSoon:`Binnenkort beschikbaar`,comingSoonDescription:`Dit configuratiegebied is gepland maar nog niet beschikbaar.`,expressions:{noneTitle:`Geen expressies`,noneDescription:`Er zijn nog geen door de assistent gemaakte regels in dit onderdeel.`,categoryForTarget:`{target} · {category}`,categories:{display:`Zichtbaar als`,disabled:`Uitgeschakeld als`,validation:`Geldig als`,"prefill-condition":`Voorinvullen als`,"prefill-value":`Voorinvulwaarde`},allConditions:`Alle voorwaarden`,viewFull:`Volledige regel bekijken`,dialogDescription:`Een alleen-lezen, deterministische weergave van de expressie die de survey gebruikt.`,conditionsDialogDescription:`Alle zichtbaarheids-, uitschakel- en validatie-expressies voor dit item.`,itemDialogDescription:`Alle weergave-, uitschakel-, validatie- en voorinvulexpressies voor dit item.`,readOnlyHint:`Beschrijf de gewenste wijziging aan de survey-assistent om deze regel aan te passen.`}},tabTrigger:{switchToThisView:`Naar deze weergave schakelen`,then:`dan`},itemSiblingNavigation:{goToNextSiblingItem:`Ga naar volgend naastgelegen item`,nextSibling:`Volgend item`,goToPreviousSiblingItem:`Ga naar vorig naastgelegen item`,previousSibling:`Vorig item`},copyItem:{copied:`Item gekopieerd naar klembord`,failed:`Item kopiëren is mislukt`,failedToClipboard:`Item naar klembord kopiëren is mislukt`},deleteItem:{removeReferencesTitle:`Verwijder verwijzingen voor verwijderen`,removeReferencesDescription:`Dit item wordt elders in de survey gebruikt. Verwijder alle verwijzingen voordat je het item verwijdert.`,ok:`Ok`,referencesFoundIn:`Verwijzingen gevonden in:`,deleteSurveyItemTitle:`Survey-item verwijderen`,deleteSurveyItemDescription:`Weet je zeker dat je dit survey-item wilt verwijderen?`,deletedSuccessfully:`Item "{itemKey}" succesvol verwijderd`,failed:`Item verwijderen is mislukt`,unknownError:`Onbekende fout`},itemPreview:{noItemSelected:`Geen item geselecteerd`,noPreviewRenderer:`Geen voorbeeldrenderer geregistreerd voor {itemType}.`,blankTitle:`Nieuw {itemType}-item`,blankDescription:`Open dit item om het te bewerken.`,openToStart:`Beginnen met bewerken`,incompleteTitle:`Dit item is onvolledig`,incompleteDescription:`Voltooi de inhoud om een voorbeeld voor deelnemers te zien.`,openToComplete:`Openen om te voltooien`,openItem:`Item openen`,previewIconAria:`Voorbeeldicoon voor {itemType}`,created:`Aangemaakt`,modified:`Gewijzigd`},itemKeyEditor:{validation:{sameAsCurrent:`Code is hetzelfde als de huidige code`,duplicate:`Code bestaat al in de groep, dubbele codes zijn niet toegestaan.`,dot:`Code mag geen punten bevatten`,space:`Code mag geen spaties bevatten`,empty:`Code mag niet leeg zijn`},keyLengthWarning:`Deze code is langer dan {maxLength} tekens. We raden aan een korte code te gebruiken.`,noKey:`(geen-code)`,editItemKey:`Itemcode bewerken`,title:`Code-editor`,description:`Definieer de codeersleutel voor dit item.`,keyLabel:`Code`,placeholder:`Nieuwe code invoeren`,surveyRootItem:`Survey-rootitem`,parentFullKey:`Volledige code bovenliggend item: {parentFullKey}`,suggestions:`Suggesties`,regenerate:`Opnieuw genereren`,generatingSuggestions:`Suggesties genereren...`,noValidSuggestions:`Geen geldige suggesties beschikbaar. Probeer opnieuw te genereren.`,suggestionCategories:{surveyPattern:`Patroon`,compact:`Compact`,preferred:`Algemeen`,fair:`FAIR`}},itemLabelEditor:{emptyLabel:`Label toevoegen...`,editItemLabel:`Itemlabel bewerken`,placeholder:`Itemlabel invoeren`},groupItems:{addNewItemToGroup:`Voeg een nieuw item toe aan de groep:`,loadingGroupItem:`groepsitem laden...`,itemPasted:`Item geplakt vanaf klembord`,pasteFailed:`Item plakken vanaf klembord is mislukt`,selectItemToCopy:`Selecteer een item in de bovenstaande lijst om te kopiëren`,pageBreak:`Pagina-einde`,insert:`Invoegen:`,press:`Druk op`,or:`of`,toInsert:`om in te voegen.`,items:`Items`,doubleClickHelp:`Dubbelklik op een item om het te openen, sleep om de volgorde te wijzigen.`,noItemsYet:`Nog geen items`,emptyDescription:`Voeg vragen, secties of andere elementen toe aan je vragenlijst`,addItem:`Item toevoegen`},addItemDialog:{entry:{structure:{title:`Organiseren`,description:`Voeg een nieuwe groep toe of voeg een pagina-einde in.`},blankItem:{title:`Beschikbare itemtypen`,description:`Kies een beschikbaar itemtype uit het huidige editorregister.`},catalogue:{title:`Catalogus`,description:`Voeg een item toe uit gekoppelde gedeelde catalogi of gebruik een aangepaste catalogus.`},comingSoon:`Binnenkort beschikbaar`,ariaLabel:`Toevoegopties`},structure:{ariaLabel:`Groeps- en pagina-eindeopties`},blankItem:{gridLabel:`Beschikbare itemtypen`,recent:`Recent`,searchPlaceholder:`Beschikbare itemtypen zoeken...`,noItemTypesFound:`Geen itemtypen gevonden.`,clipboardHeading:`Klembord`,pasteFromClipboard:`Plakken vanaf klembord`,pasteFromClipboardDescription:`Voeg het item in dat uit de survey-editor is gekopieerd`},title:`Wat wil je toevoegen?`,close:`Dialoogvenster Item toevoegen sluiten`,enterFullscreen:`Volledig scherm openen`,exitFullscreen:`Volledig scherm afsluiten`,addingTo:`Toevoegen aan:`,itemCount:`({count} items)`,chooseHowToExpand:`Kies hoe je je vragenlijst wilt uitbreiden.`,footer:{entry:`Gebruik pijltjestoetsen om te selecteren of Esc om te annuleren.`,structure:`Gebruik pijltjestoetsen om te selecteren of Esc om te annuleren.`,"blank-item":`Zoek of typ om te filteren. Gebruik pijltjestoetsen om te selecteren of Esc om te annuleren.`,grid:`Gebruik de pijltjestoetsen om een item te kiezen en Enter om het toe te voegen. Esc sluit dit dialoogvenster.`,catalogue:`Catalogusondersteuning komt binnenkort.`},catalogueComingSoon:`Importeren van catalogusitems komt binnenkort.`,noValidGroupSelected:`Geen geldige groep geselecteerd.`,registryItemTypeUnavailable:`Itemtype "{itemType}" is niet beschikbaar in dit editorregister.`,itemAdded:`Item toegevoegd: {itemKey}`,itemAddFailed:`Item toevoegen is mislukt. Probeer het opnieuw.`},registryLabels:{categories:{special:`Speciale items`,display:`Weergave`,form:`Formulieren`,question:`Vragen`,structure:`Structuur`},items:{root:{label:`Root`,description:`Survey-rootitem.`},group:{label:`Groep`,description:`Een container om survey-items te organiseren.`},pageBreak:{label:`Pagina-einde`,description:`Dwing items hierna om op een nieuwe pagina te verschijnen.`},infoItem:{label:`Info`,description:`Alleen-weergave-inhoud: markdown, info, waarschuwingen, media (geen antwoorden).`},formItem:{label:`Formulier`,description:`Samenstelbare formulieren met groepen en velden.`},choiceItem:{label:`Keuze`,description:`Keuzegroepen met een configureerbaar maximaal aantal selecties; opties kunnen later formulieren bevatten.`}}},itemColor:{failedUpdate:`Itemkleur bijwerken is mislukt.`,updated:`Itemkleur bijgewerkt.`,label:`Itemkleur`,swatchTitle:`Kleur: {color}`},defaultEditors:{root:{items:`Items`,previewTodo:`todo: voorbeeldtab`,conditionsTodo:`todo: voorwaardentab`},group:{settingsTitle:`Groepsinstellingen`,settingsDescription:`De structuur en volgorde van items beheer je in de outline.`,shuffleItemsLabel:`Items willekeurig ordenen`,shuffleItemsDescription:`Toon de items in deze groep in een andere volgorde voor elke respondent.`,conditionsTitle:`Voorwaarden`,conditionsDescription:`Bepaal wanneer deze groep aan een respondent wordt getoond.`},pageBreak:{branching:`Routering`,title:`Routeringslogica`,description:`Gebruik dit tabblad om te bepalen wanneer dit pagina-einde geldt.`,todo:`todo: voorwaardentab`},groupPreview:{emptyTitle:`Lege groep`,emptyDescription:`Nog geen items in deze groep`,loading:`Voorbeeld laden...`,items:`Items`,itemNotFound:`Item niet gevonden`,itemPosition:`Item {index}`,unknownItemKey:`onbekend`},pageBreakPreview:{nextPageDescription:`Volgende items worden op een nieuwe pagina weergegeven.`},questionPreview:{formPlaceholder:`Formulierinhoud wordt hier weergegeven.`,choicePlaceholder:`Voeg opties toe om dit keuze-item te bekijken.`,singleChoice:`Enkele keuze`,multipleChoice:`Meerdere keuzes`,choicePreviewMaxUnlimited:`Meerdere keuzes (onbeperkt)`,choicePreviewMaxUpTo:`Tot {max} keuzes`,optionLabel:`Optie {index}`},infoEditor:{contentPlaceholder:`Voeg hier inhoud toe, of typ / voor commando's...`},infoPreview:{emptyContent:`Nog geen inhoud.`},richTextToolbar:{bold:`Vet`,italic:`Cursief`,underline:`Onderstrepen`,primaryColor:`Primaire kleur`,accentColor:`Accentkleur`},questionHeader:{titlePlaceholder:`Voeg een vraagtitel toe...`,subtitlePlaceholder:`Voeg een subtitel toe...`,cardFooterPlaceholder:`Voeg kaartvoet toe...`},questionBody:{topContentPlaceholder:`Voeg inhoud toe voor het antwoord...`,bottomContentPlaceholder:`Voeg inhoud toe na het antwoord...`},formEditor:{responseConfig:`Antwoordconfiguratie`,addFieldGroup:`Veldgroep toevoegen`,fieldGroupMenuButton:`Veldgroepinstellingen`,fieldGroupBranching:`Heeft routeringslogica`,fieldsLabel:`Velden`,addField:`Veld toevoegen`,fieldRequired:`Verplicht veld`,fieldHasValidations:`Heeft validaties`,fieldInvalid:`Veldconfiguratie is ongeldig`,openFieldEditor:`Veldeditor openen`,editFieldKey:`Code bewerken...`,deleteField:`Veld verwijderen`,fieldDialogTitle:`Veld bewerken`,fieldDialogDescription:`Configureer het veld {fieldType}, de wrapper-inhoud en de validaties.`,fieldKeyDialogTitle:`Veldcode bewerken`,fieldKeyDialogDescription:`Werk de code bij die voor dit veld wordt opgeslagen.`,fieldKeyLabel:`Veldcode`,fieldKeyPlaceholder:`bijv. RESP_01`,fieldKeyDescription:`Houd codes uniek binnen dit formulieritem.`,fieldLabelLabel:`Veldlabel`,fieldLabelPlaceholder:`Voer een veldlabel in`,fieldDescriptionLabel:`Helptekst`,fieldDescriptionPlaceholder:`Optionele helptekst voor dit veld`,fieldPlaceholderLabel:`Placeholder`,fieldPlaceholderPlaceholder:`Voer placeholdertekst in`,fieldDatePlaceholder:`Selecteer een datum`,fieldDateModeLabel:`Datumnauwkeurigheid`,fieldDateModePlaceholder:`Kies wat respondenten kunnen selecteren`,fieldDatePlaceholders:{year:`Selecteer een jaar`,"year-month":`Selecteer maand en jaar`,"year-month-day":`Selecteer een datum`},fieldRowsLabel:`Rijen`,fieldInputModeLabel:`Invoermodus`,fieldAutocompleteLabel:`Automatisch aanvullen`,fieldAutocompletePlaceholder:`bijv. email of organisatie`,fieldUnitLabel:`Eenheid`,fieldUnitPlaceholder:`bijv. jaren`,fieldDefaultValueLabel:`Standaardwaarde`,fieldStepLabel:`Stap`,fieldCheckedLabelLabel:`Label bij ingeschakeld`,fieldCheckedLabelPlaceholder:`Getoond wanneer de schakelaar aan staat`,fieldUncheckedLabelLabel:`Label bij uitgeschakeld`,fieldUncheckedLabelPlaceholder:`Getoond wanneer de schakelaar uit staat`,fieldDefaultCheckedLabel:`Standaard ingeschakeld`,fieldAllowClearLabel:`Selectie wissen toestaan`,fieldOptionsLabel:`Opties`,fieldOptionsDescription:`Elke selectoptie heeft een opgeslagen waarde nodig. Labels kunnen later worden ingevuld.`,fieldAddOption:`Optie toevoegen`,fieldOptionLabel:`Optie {index} label`,fieldOptionValueLabel:`Optiewaarde`,fieldRemoveOption:`Optie verwijderen`,fieldReorderOption:`Optie herschikken`,fieldSelectPlaceholder:`Selecteer een optie`,fieldMinLabel:`Minimum`,fieldMaxLabel:`Maximum`,fieldShowValueLabel:`Waarde tonen`,fieldValidationSettingsTitle:`Validaties`,fieldValidationSettingsDescription:`Voeg type-specifieke controles toe voor de veldwaarde.`,fieldValidationValueLabel:`Validatiewaarde`,fieldValidationMessageLabel:`Validatiebericht`,fieldValidationMessagePlaceholder:`Optionele override die wordt getoond wanneer de regel faalt`,fieldNoAdditionalValidations:`Voor dit veldtype worden geen extra validaties voorgesteld.`,fieldRemoveValidation:`Validatie verwijderen`,fieldRendererSummaryTitle:`Renderercontract`,fieldRendererSummaryDescription:`De renderer kan elk veld samenstellen met deze shadcn-bouwstenen.`,fieldControllerSummaryLabel:`Controller`,fieldSuggestionsTitle:`Typesuggesties`,fieldSuggestionsDescription:`Voorgestelde configuratie-attributen en validaties voor dit veldtype.`,fieldConfigSuggestionsLabel:`Voorgestelde configuratie`,fieldValidationSuggestionsLabel:`Voorgestelde validaties`,fieldIssuesTitle:`Configuratieproblemen`,fieldIssuesDescription:`Los deze problemen op voordat je het veld opslaat.`,fieldKeyRequired:`Voer een unieke veldcode in.`,fieldKeyDuplicate:`Veldcodes moeten uniek zijn binnen een formulieritem.`,fieldSelectOptionsRequired:`Selectvelden hebben minimaal een optie nodig.`,fieldSelectOptionIncomplete:`Elke selectoptie heeft een opgeslagen code nodig.`,fieldSelectOptionLabelMissing:`Bij een of meer opties ontbreekt een zichtbaar label.`,fieldSelectOptionDuplicate:`Optiecodes moeten uniek zijn in de lijst.`,fieldSliderRangeInvalid:`Het minimum van de slider moet lager zijn dan het maximum.`,fieldSliderStepInvalid:`De stap van de slider moet groter zijn dan nul.`,fieldSliderDefaultInvalid:`De standaardwaarde van de slider moet binnen het ingestelde bereik blijven.`,fieldNumberStepInvalid:`Getalstap moet groter zijn dan nul.`,fieldDateRangeInvalid:`De vroegste datum mag niet later zijn dan de laatste datum.`,fieldValidationInvalid:`Bij een of meer validaties ontbreekt een verplichte waarde.`,fieldValidationDuplicate:`Elk validatietype kan maar een keer per veld worden toegevoegd.`,dragHandle:`Veld herschikken`,sortDialogTitle:`Velden sorteren`,sortDialogDescription:`Sleep velden om de volgorde in {groupTitle} bij te werken. Wijzigingen worden direct opgeslagen.`,sortDialogUntitledGroup:`deze veldgroep`,sortDialogEmpty:`Nog geen velden`,sortDialogClose:`Klaar`,groupHeaderDialogTitle:`Groepskop wijzigen`,groupHeaderDialogDescription:`Werk de groepstitel en beschrijving bij.`,groupHeaderTitleLabel:`Titel`,groupHeaderTitlePlaceholder:`Optionele groepstitel`,groupHeaderDescriptionLabel:`Beschrijving`,groupHeaderDescriptionPlaceholder:`Optionele groepsbeschrijving`,layoutDialogTitle:`Veldgroeplayout`,layoutDialogDescription:`Stel in hoeveel kolommen velden gebruiken bij elke breedte van de veldgroepkaart (container queries in rem, niet het hele scherm). Wijzigingen gelden na opslaan.`,layoutBreakpointCompact:`Onder @xs - groepskaart smaller dan 20rem`,layoutBreakpointAtXs:`@xs - groepskaart >=20rem (320px)`,layoutBreakpointAtSm:`@sm - groepskaart >=24rem (384px)`,layoutBreakpointAtMd:`@md - groepskaart >=28rem (448px)`,layoutBreakpointAtXl:`@xl - groepskaart >=36rem (576px)`,layoutDecreaseColumns:`Minder kolommen`,layoutIncreaseColumns:`Meer kolommen`,fieldTypes:{input:`Invoer`,textarea:`Tekstvak`,number:`Getal`,datepicker:`Datumkiezer`,switch:`Schakelaar`,select:`Selectie`,slider:`Slider`},fieldDateModes:{year:`Alleen jaar`,"year-month":`Jaar en maand`,"year-month-day":`Jaar, maand en dag`},fieldInputModes:{text:`Tekst`,email:`E-mail`,tel:`Telefoon`,url:`URL`,password:`Wachtwoord`},fieldGroupMenu:{changeTitle:`Groepskop wijzigen`,editBranching:`Routeringslogica bewerken`,editLayout:`Layout bewerken`,sortFields:`Velden sorteren`,deleteGroup:`Veldgroep verwijderen`}},infoBoxPopover:{typeLabel:`Type`,toneInfo:`Info`,toneWarning:`Waarschuwing`,titleLabel:`Titel`,titlePlaceholder:`Titel`,contentLabel:`Inhoud`,contentPlaceholder:`Tekst`,collapsibleBody:`Inklapbare inhoud`,openByDefault:`Standaard geopend`,apply:`Toepassen`},imagePopover:{dialogTitle:`Afbeelding bewerken`,sourceDescription:`Kies een lokaal surveybestand of voer een externe afbeeldings-URL in.`,apply:`Toepassen`,tabLocalAsset:`Lokaal bestand`,tabExternalUrl:`Externe URL`,uploadAssetDialogTitle:`Lokaal bestand uploaden`,addLocalAsset:`Lokaal bestand toevoegen`,urlLabel:`Afbeeldings-URL`,alignmentLabel:`Uitlijning`,alignLeft:`Links`,alignCenter:`Midden`,alignRight:`Rechts`,altLabel:`Alt-tekst`,altPlaceholder:`Beschrijf de afbeelding voor toegankelijkheid`,widthLabel:`Breedte`,maxWidthLabel:`Max. breedte`,dimensionPlaceholder:`bijv. 320`,unitPx:`px`,unitPercent:`%`,captionLabel:`Bijschrift`,captionPlaceholder:`Optioneel bijschrift onder de afbeelding`,uploadFailed:`Afbeelding toevoegen is mislukt. Probeer het opnieuw.`,uploading:`Uploaden...`,deleteAssetConfirmTitle:`Deze surveyafbeelding verwijderen?`,deleteAssetConfirmDescription:`Deze afbeelding wordt nergens anders in de survey gebruikt. Je kunt deze verwijderen uit de afbeeldingsbibliotheek van de survey, of het bestand bewaren voor hergebruik.`,deleteAssetConfirmPrimary:`Afbeelding verwijderen`,deleteAssetKeepFile:`Bestand bewaren`},choiceEditor:{responseConfig:`Antwoordconfiguratie`,responseSettings:`Antwoordinstellingen`,responseSettingsDescription:`Bepaal hoe respondenten deze opties kunnen selecteren en zien.`,maxSelectionLabel:`Max. selectie`,maxSelectionPlaceholder:`Maximaal aantal selecties kiezen`,maxSelectionDescription:`1 toont een enkele-keuzeveld. Elk hoger getal of onbeperkt toont selectievakjes en beperkt hoeveel opties geselecteerd kunnen worden.`,maxSelectionUnlimited:`Onbeperkt`,maxSelectionCustomPlaceholder:`Aangepast`,shuffleOptionsLabel:`Items schudden`,shuffleOptionsDescription:`Randomiseer de optievolgorde voor elke respondent.`,shuffleOptions:`Geschud`,addResponseElement:`Antwoordelement toevoegen`,addOptionPlaceholder:`Optie toevoegen`,createOptionKeyPlaceholder:`opt_1`,createOptionKeyAriaLabel:`Optiecode`,createOptionLabelPlaceholder:`Optielabel toevoegen...`,createOptionLabelAriaLabel:`Optielabel`,createOptionCancel:`Annuleren`,createOptionSubmit:`Verzenden`,createOptionKeyRequired:`Voer een optiecode in.`,createOptionKeyDuplicate:`Optiecode moet uniek zijn.`,createOptionLabelRequired:`Voer een optielabel in.`,invalidKeyDialogTitle:`Kies een geldige optiecode`,invalidKeyDialogDescription:`{validationMessage} Blijf bewerken om zelf een code te kiezen, of gebruik de volgende beschikbare code.`,invalidKeyDialogKeepEditing:`Blijven bewerken`,invalidKeyDialogUseGenerated:`{key} gebruiken en sluiten`,optionLabelFallback:`Optie {index}`,dragHandle:`Optie herschikken`,optionContext:{editLabel:`Label bewerken...`,editKey:`Code bewerken...`,editBranching:`Weergavevoorwaarde...`,editEmbeddedForm:`Ingebed formulier...`,duplicate:`Optie dupliceren`,delete:`Optie verwijderen`},editOptionDialogTitle:`Optie bewerken`,advancedSettings:{title:`Geavanceerde instellingen`,configured:`Geconfigureerd`,configuredCount:`{count} geconfigureerd`},optionIndicators:{displayCondition:`Heeft weergavevoorwaarde`,embeddedForm:`Heeft ingebed formulier`},embeddedFormDialog:{title:`Ingebed formulier`,description:`Toon vervolgvelden onder deze optie wanneer een respondent deze selecteert.`,helpLabel:`Over ingebedde formulieren`}},assetManager:{uploadLabel:`Afbeeldingsbestanden uploaden`,uploadDescription:`Klik om te bladeren of sleep bestanden hierheen`,uploadAction:`Afbeeldingen kiezen`,uploadDrag:`of sleep hierheen`,uploadActive:`Zet afbeeldingen hier neer`,nameLabel:`Aangepaste naam`,namePlaceholder:`Aangepaste naam (optioneel)`,externalPlaceholder:`https://example.com/image.png`,existingAssets:`Afbeeldingsbestanden`,empty:`Nog geen afbeeldingsbestanden.`,replaceAsset:`Vervangen`,removeAsset:`Bestand verwijderen`,usedByLabel:`Gebruikt in {count} items`,deleteBlocked:`Dit bestand is in gebruik en kan niet worden verwijderd.`,unusedAssetWarning:`Ongebruikt bestand. Het kan veilig worden verwijderd.`,surveyRootItem:`Survey-rootitem`,sourceEmbedded:`Ingesloten`,pickerAssets:`Bestaand bestand kiezen`,pickerExternal:`Externe URL gebruiken`,useExternal:`URL gebruiken`,expandPreview:`Volledige afbeelding bekijken`,closePreview:`Voorbeeld sluiten`,previewTitle:`Afbeeldingsvoorbeeld`},placeholder:{structure:`Structuur`,preview:`Voorbeeld`,conditions:`Voorwaarden`,addContentBeforeResponse:`Inhoud toevoegen voor antwoord`,addContentAfterResponse:`Inhoud toevoegen na antwoord`,structureTodo:`todo: structuureditor`,previewTodo:`todo: voorbeeld`,conditionsTodo:`todo: voorwaarden`}}},zE={en:LE,nl:RE},BE=(...e)=>Rg(zE,...e),noe=(e,t)=>Hg({fallbackLocale:`en`,locale:e,localizations:t,onMissing:(e,t)=>console.log(`[SurveyEditor] Missing localization for key "${e}" in language "${t}".`)}),roe=(e,t)=>Ug(e,t),VE={de:xe,en:u.I,nl:Ee},HE=(...e)=>{let t={};for(let n of[VE,...e])if(n)for(let[e,r]of Object.entries(n)){let n=Lg(e);n&&(t[n]=r)}return t},UE=(e,t=VE)=>{let n=Lg(e),r=n.split(`-`)[0];return t[n]??t[r]??u.I},WE=(0,d.createContext)(void 0),ioe=({children:e,helpLink:t,aiProvider:n=null,fallbackLocale:r=`en`,language:i=`en`,localizations:a,dateLocales:o,workspace:s})=>{let c=r.trim()||`en`,l=i.trim()||`en`,u=(0,d.useMemo)(()=>noe(l,a),[a,l]),f={helpLink:t,aiProvider:n,fallbackLocale:c,language:l,localizations:a,dateLocales:o,dateLocale:(0,d.useMemo)(()=>UE(l,o),[o,l]),translate:u,workspace:s};return(0,m.jsx)(WE.Provider,{value:f,children:(0,m.jsxs)(eoe,{delayDuration:500,children:[(0,m.jsx)(qae,{children:(0,m.jsx)(jg,{children:e})}),(0,m.jsx)($ae,{})]})})},GE=()=>{let e=(0,d.useContext)(WE);if(e===void 0)throw Error(`useSurveyEditorConfig must be used within a SurveyEditorConfigProvider`);return e},KE=()=>GE().aiProvider,J=e=>{let{translate:t}=GE();return(0,d.useMemo)(()=>roe(t,e),[e,t])},qE=()=>GE().dateLocale,JE=({itemId:e})=>{let t=J(),n=q(e=>e.copyItem);return(0,m.jsxs)(cE,{onClick:()=>{try{let r=n(e);navigator.clipboard.writeText(JSON.stringify(r,null,2)).then(()=>{vE(),OE.success(t(`copyItem.copied`))}).catch(()=>{OE.error(t(`copyItem.failed`))})}catch(e){console.error(`Error copying item:`,e),OE.error(t(`copyItem.failed`))}},children:[(0,m.jsx)(Nw,{className:`size-4 mr-2`}),t(`common.actions.copy`)]})};function YE({className:e,orientation:t=`horizontal`,...n}){return(0,m.jsx)(Ip,{"data-slot":`tabs`,"data-orientation":t,className:z(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var aoe=je(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function XE({className:e,variant:t=`default`,...n}){return(0,m.jsx)(Rp,{"data-slot":`tabs-list`,"data-variant":t,className:z(aoe({variant:t}),e),...n})}function ZE({className:e,...t}){return(0,m.jsx)(Bp,{"data-slot":`tabs-trigger`,className:z(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function QE({className:e,...t}){return(0,m.jsx)(Hp,{"data-slot":`tabs-content`,className:z(`flex-1 text-sm outline-none`,e),...t})}var ooe=e=>{if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toLowerCase();return e.isContentEditable||t===`input`||t===`textarea`||t===`select`},$E=(e,{enabled:t=!0,ignoreEditableTargets:n=!0}={})=>{let r=(0,d.useEffectEvent)(e);(0,d.useEffect)(()=>{if(!t)return;let e=e=>{n&&ooe(e.target)||r(e)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t,n])};function eD(){return q(e=>e.editor)}function tD(){let e=q(e=>e.editor);return(0,d.useMemo)(()=>e?.survey??null,[e,q(e=>e.changeTick)])}function soe(e={view:`preview-mode`}){return xE((t,n)=>({location:e,history:[],assistantHighlights:{},adapter:null,setAdapter:e=>{let r=n();r._adapterUnsubscribe&&r._adapterUnsubscribe(),t({adapter:e}),t({location:e.getLocation(),assistantHighlights:{}}),t({_adapterUnsubscribe:e.subscribe(e=>{t({location:e,assistantHighlights:{}})})})},clearAdapter:()=>{let e=n();e._adapterUnsubscribe&&e._adapterUnsubscribe(),t({adapter:null,_adapterUnsubscribe:void 0})},navigate:(e,r=!1)=>{let{adapter:i,history:a}=n();if(i){i.navigateTo(e,{replace:r});return}t({location:e,history:r?a:[...a,e],assistantHighlights:{}})},setAssistantHighlight:(e,n)=>{t(t=>{let r={...t.assistantHighlights};return n?r[e]=n:delete r[e],{assistantHighlights:r}})}}))}var nD=(0,d.createContext)(null),coe=({children:e,adapter:t,initialLocation:n})=>{let[r]=(0,d.useState)(()=>soe(n));return(0,d.useEffect)(()=>(t?r.getState().setAdapter(t):r.getState().clearAdapter(),()=>{r.getState().clearAdapter()}),[r,t]),(0,m.jsx)(nD.Provider,{value:r,children:e})};function rD(e){let t=(0,d.useContext)(nD);if(!t)throw Error(`useSurveyEditorNavigationStore must be used within a SurveyEditorNavigationStoreProvider`);return CE(t,e)}function loe(){let e=(0,d.useContext)(nD);if(!e)throw Error(`useSurveyEditorNavigationStoreApi must be used within a SurveyEditorNavigationStoreProvider`);return e}var iD=e=>e.view!==`asset-manager`,uoe=e=>iD(e)?e.itemId:void 0,aD=(e,t)=>iD(e)?t?{...e,itemId:t}:{view:e.view}:t?{view:`item-editor`,itemId:t}:{view:`item-editor`},oD=()=>{let e=rD(e=>e.location),t=rD(e=>e.navigate),n=tD(),r=iD(e)?e.itemId:void 0,i=(0,d.useEffectEvent)((e,n)=>{t(e,n)});return(0,d.useEffect)(()=>{n&&r&&!n.surveyItems.get(r)&&i(aD(e),!0)},[e,n,r]),{selectedItemId:r,navigateToItem:n=>{n!==r&&t(aD(e,n))}}},sD=[`#404040`,`#b91c1c`,`#c2410c`,`#a16207`,`#4d7c0f`,`#047857`,`#0369a1`,`#4338ca`,`#7e22ce`,`#86198f`,`#be123c`],doe=e=>sD[new TextEncoder().encode(e).reduce((e,t)=>e+t,0)%sD.length],cD=e=>e.metadata?.editorItemColor||doe(e.id),lD=e=>e instanceof u.st&&e.isRoot()?`root`:e.type,uD={key:`unknown`,label:`Unknown`,description:`Item type not found in registry.`,icon:Ew},dD=(e,t)=>{if(!t)return uD;let n=YC(t,e);return n?{key:n.itemType,label:o_(n.infos.labelByLocale),description:o_(n.infos.descriptionByLocale),defaultItemClassName:n.infos.defaultItemClassName,icon:n.infos.icon}:{...uD,key:e.type,label:e.type}},fD=(e,t)=>{if(e===void 0||!t)return;let n=e===`root`?t.definitions.root:t.definitions[e];return n?{key:n.itemType,label:o_(n.infos.labelByLocale),description:o_(n.infos.descriptionByLocale),defaultItemClassName:n.infos.defaultItemClassName,icon:n.infos.icon}:{...uD,key:e,label:e}};function pD(e){let t=q(e=>e.editorItemRegistry);return(0,d.useMemo)(()=>fD(e,t),[e,t])}var mD=`survey-editor-authoring-lock-status`,foe=()=>{let e=J(`routes.editor.assistantLock`);return q(e=>e.userMutationsLocked)?(0,m.jsxs)(`div`,{id:mD,className:`flex h-8 max-w-[calc(100%-1.5rem)] items-center gap-1.5 rounded-full border border-blue-200 bg-blue-50/95 px-3 text-blue-950 shadow-md backdrop-blur-sm dark:border-blue-900 dark:bg-blue-950/90 dark:text-blue-100`,role:`status`,"aria-live":`polite`,children:[(0,m.jsx)(oT,{className:`size-3.5 shrink-0 animate-spin text-blue-600 dark:text-blue-300`}),(0,m.jsx)(`span`,{className:`truncate text-xs font-medium`,children:e(`compactStatus`)})]}):null},hD=({children:e,className:t})=>{let n=q(e=>e.userMutationsLocked);return(0,m.jsx)(`div`,{className:z(`h-full min-h-0 transition-opacity duration-200`,n&&`opacity-60`,t),inert:n?!0:void 0,"aria-disabled":n||void 0,"aria-describedby":n?mD:void 0,children:e})},gD=({label:e,onClick:t,className:n})=>(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":e,onClick:t,className:z(`h-[30px] shrink-0 gap-2 rounded-md px-2 text-xs font-medium`,`text-muted-foreground hover:text-foreground focus-visible:ring-inset`,n),children:[(0,m.jsx)(`span`,{children:e}),(0,m.jsx)(sw,{className:`size-3.5 text-muted-foreground`,"aria-hidden":!0})]})}),(0,m.jsx)(IE,{side:`bottom`,align:`start`,children:e})]});function _D(e={}){let{itemId:t,afterDeleteItemId:n}=e,r=J(`deleteItem`),{selectedItemId:i,navigateToItem:a}=oD(),o=Mg(),s=Jae(),c=tD(),l=q(e=>e.removeItem),u=t??i,f=(0,d.useCallback)(async()=>{if(!u)return;let e=c?.getReferenceUsages(u);if(e&&e.length>0){await s({title:r(`removeReferencesTitle`),description:r(`removeReferencesDescription`),buttonLabel:r(`ok`),children:(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground mb-1`,children:r(`referencesFoundIn`)}),(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map((e,t)=>(0,m.jsx)(`li`,{children:(0,m.jsxs)(B,{variant:`outline`,size:`sm`,className:`flex items-center gap-1 w-full`,onClick:()=>{a(e.itemId),s.dismiss()},children:[(0,m.jsx)(`span`,{className:`text-sm font-medium`,children:c?.getItemKey(e.itemId)?.fullKey??e.itemId}),(0,m.jsx)(`span`,{className:`text-[0.5rem] text-muted-foreground border border-muted-foreground rounded-md px-1 py-0.5`,children:e.usageType}),(0,m.jsx)(bw,{className:`ml-auto size-4 text-muted-foreground`})]})},e.itemId+t))})]})});return}if(await o({title:r(`deleteSurveyItemTitle`),description:r(`deleteSurveyItemDescription`),variant:`destructive`}))try{let e=c?.getParentItem(u),t=c?.surveyItems.get(u);l(u),a(n===void 0?e?.id??c?.rootItem?.id:n??void 0),OE.success(r(`deletedSuccessfully`,{itemKey:t?.key??u}))}catch(e){console.error(`Error deleting item:`,e),OE.error(r(`failed`),{description:e instanceof Error?e.message:r(`unknownError`)})}},[n,s,o,u,a,l,c,r]);return{itemId:u,canDelete:!!u,deleteItem:f}}var vD=({overrideItemId:e,afterDeleteItemId:t,disabled:n=!1})=>{let r=J(),{canDelete:i,deleteItem:a}=_D({itemId:e,afterDeleteItemId:t});return i?(0,m.jsxs)(cE,{disabled:n,onSelect:e=>{e.preventDefault(),!n&&a()},children:[(0,m.jsx)(zT,{className:`size-4 mr-2 text-destructive`}),r(`common.actions.delete`)]}):null};function yD({...e}){return(0,m.jsx)(vl,{"data-slot":`context-menu`,...e})}function bD({className:e,...t}){return(0,m.jsx)(bl,{"data-slot":`context-menu-trigger`,className:z(`select-none`,e),...t})}function xD({...e}){return(0,m.jsx)(wl,{"data-slot":`context-menu-group`,...e})}function SD({...e}){return(0,m.jsx)(kl,{"data-slot":`context-menu-sub`,...e})}function CD({className:e,...t}){return(0,m.jsx)(xl,{children:(0,m.jsx)(Cl,{"data-slot":`context-menu-content`,className:z(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})})}function wD({className:e,inset:t,variant:n=`default`,...r}){return(0,m.jsx)(El,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:z(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function TD({className:e,inset:t,children:n,...r}){return(0,m.jsxs)(Al,{"data-slot":`context-menu-sub-trigger`,"data-inset":t,className:z(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,m.jsx)(bw,{className:`ml-auto`})]})}function ED({className:e,...t}){return(0,m.jsx)(jl,{"data-slot":`context-menu-sub-content`,className:z(`z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})}function DD({className:e,inset:t,...n}){return(0,m.jsx)(Tl,{"data-slot":`context-menu-label`,"data-inset":t,className:z(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function OD({className:e,...t}){return(0,m.jsx)(Dl,{"data-slot":`context-menu-separator`,className:z(`-mx-1 my-1 h-px bg-border`,e),...t})}var kD=({currentColor:e,onColorChange:t})=>{let n=J(`itemColor`);return(0,m.jsx)(`div`,{className:`grid grid-cols-4 gap-2 p-2`,children:sD.map(r=>(0,m.jsx)(B,{variant:`ghost`,size:`sm`,className:z(`w-8 h-8 p-0 rounded-md border-2 hover:scale-110 transition-all`,e===r?`border-foreground ring-2 ring-foreground ring-offset-1`:`border-transparent hover:border-muted-foreground`),style:{backgroundColor:r},onClick:()=>t(r),title:n(`swatchTitle`,{color:r})},r))})},AD=e=>{let t=J(`history`),n=J(`itemColor`),r=q(e=>e.getItemDataCopy),i=q(e=>e.updateItem),a=q(e=>e.commitByUser),o=tD()?.surveyItems.get(e);return{currentColor:o&&cD(o)||`#404040`,onColorChange:o=>{let s=r(e);if(!s){OE.error(n(`failedUpdate`));return}s.metadata={...s.metadata,editorItemColor:o},i(e,s),a({label:t(`updateItemEditorColor`)}),OE.success(n(`updated`))}}},jD=({itemId:e})=>{let t=J(`itemColor`),{currentColor:n,onColorChange:r}=AD(e);return(0,m.jsxs)(mE,{children:[(0,m.jsxs)(hE,{children:[(0,m.jsx)(fT,{className:`mr-2 h-4 w-4`}),(0,m.jsx)(`span`,{className:`text-nowrap`,children:t(`label`)})]}),(0,m.jsx)(gE,{className:`border-border`,children:(0,m.jsx)(kD,{currentColor:n,onColorChange:r})})]})},MD=({itemId:e})=>{let t=J(`itemColor`),{currentColor:n,onColorChange:r}=AD(e);return(0,m.jsxs)(SD,{children:[(0,m.jsxs)(TD,{children:[(0,m.jsx)(fT,{className:`mr-2 h-4 w-4`}),(0,m.jsx)(`span`,{children:t(`label`)})]}),(0,m.jsx)(ED,{className:`border-border`,children:(0,m.jsx)(kD,{currentColor:n,onColorChange:r})})]})},ND=je(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function PD({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,m.jsx)(n?Ue:`span`,{"data-slot":`badge`,"data-variant":t,className:z(ND({variant:t}),e),...r})}function FD({className:e,...t}){return(0,m.jsx)(`kbd`,{"data-slot":`kbd`,className:z(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,e),...t})}function ID({className:e,...t}){return(0,m.jsx)(`kbd`,{"data-slot":`kbd-group`,className:z(`inline-flex items-center gap-1`,e),...t})}var LD=({value:e,label:t,icon:n,isActive:r,colorAccent:i,colorBorder:a,showShortcutNumber:o,shortcutNumber:s,hasIndicator:c,indicatorCount:l})=>{let u=J(`tabTrigger`),d={"--tab-accent":i,"--tab-accent-bg":`${i}10`,"--tab-accent-ring":`${i}30`,color:r?i:void 0};return(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsxs)(ZE,{value:e,className:z(`group/tab relative flex-none rounded-none border-0 px-3 py-2 text-sm font-medium shadow-none after:hidden focus-visible:outline-none focus-visible:ring-0`,r?`text-foreground`:`text-muted-foreground/80 hover:bg-primary/10 hover:text-foreground focus-visible:bg-primary/10 focus-visible:text-foreground focus-visible:shadow-[inset_0_0_0_1px_var(--tab-accent-ring)]`),style:d,children:[(0,m.jsx)(n,{className:`size-3`,style:{color:r?i:void 0}}),(0,m.jsx)(`span`,{children:t}),c&&typeof l==`number`&&(0,m.jsx)(PD,{variant:`outline`,className:`ms-1 rounded-full px-1.5 text-[11px]`,style:{borderColor:r?`${i}30`:a,color:r?i:void 0,backgroundColor:r?`${i}14`:`transparent`},children:l}),o&&(0,m.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-[3px] right-[3px] z-10 flex min-w-12 items-center justify-end rounded-[inherit] pl-6 pr-2`,children:[(0,m.jsx)(`div`,{className:`absolute inset-0 rounded-[inherit] bg-background/45 backdrop-blur-sm mask-[linear-gradient(to_right,transparent_0%,black_45%,black_100%)]`}),(0,m.jsx)(FD,{className:`relative z-10 h-5 min-w-5 rounded-[4px] border border-white/30 bg-background/80 px-1.5 text-[10px] text-foreground shadow-sm`,style:{borderColor:`${i}35`,color:i},children:s})]}),(0,m.jsx)(`div`,{className:z(`absolute bottom-0 left-3 right-3 h-[2px] rounded-full transition-opacity`,r?`opacity-100`:`opacity-0 group-focus-visible/tab:opacity-100`),style:{backgroundColor:i}})]})}),(0,m.jsx)(IE,{side:`bottom`,align:`center`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsx)(`span`,{children:u(`switchToThisView`)}),(0,m.jsxs)(ID,{children:[(0,m.jsx)(FD,{children:`V`}),(0,m.jsx)(`span`,{children:u(`then`)}),(0,m.jsx)(FD,{children:s})]})]})})]})},RD=({armKey:e,enabled:t=!0,maxIndex:n=9,timeoutMs:r=1800,onSelectIndex:i})=>{let[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(null),c=(0,d.useRef)(!1),l=()=>{c.current=!1,o(!1),s.current!==null&&(window.clearTimeout(s.current),s.current=null)},u=()=>{c.current=!0,o(!0),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{s.current=null,c.current=!1,o(!1)},r)};return $E(t=>{if(t.defaultPrevented)return;let r=t.metaKey||t.ctrlKey||t.altKey||t.shiftKey,a=t.key.toLowerCase();if(!c.current){!r&&a===e.toLowerCase()&&(t.preventDefault(),u());return}if(a===`escape`){t.preventDefault(),l();return}if(r)return;let o=Number.parseInt(a,10);l(),!(Number.isNaN(o)||o<1||o>n)&&(t.preventDefault(),i(o-1))},{enabled:t}),(0,d.useEffect)(()=>()=>{s.current!==null&&window.clearTimeout(s.current)},[]),{isArmed:a}};function zD({...e}){return(0,m.jsx)(vu,{"data-slot":`popover`,...e})}function BD({...e}){return(0,m.jsx)(Su,{"data-slot":`popover-trigger`,...e})}function VD({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,m.jsx)(Eu,{children:(0,m.jsx)(Ou,{"data-slot":`popover-content`,align:t,sideOffset:n,className:z(`z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r})})}function HD({...e}){return(0,m.jsx)(bu,{"data-slot":`popover-anchor`,...e})}function UD({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`popover-header`,className:z(`flex flex-col gap-0.5 text-sm`,e),...t})}function WD({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`popover-title`,className:z(`font-medium`,e),...t})}function GD({className:e,...t}){return(0,m.jsx)(`p`,{"data-slot":`popover-description`,className:z(`text-muted-foreground`,e),...t})}var KD=(e,t)=>e.key===t.key&&(t.modKey===void 0?!!e.metaKey==!!t.metaKey:!!(e.metaKey||e.ctrlKey)==!!t.modKey)&&(t.modKey===void 0?!!e.ctrlKey==!!t.ctrlKey:!0)&&!!e.shiftKey==!!t.shiftKey&&!!e.altKey==!!t.altKey,qD=(e,t,{enabled:n=!0,activeDurationMs:r=150,preventDefault:i=!0,ignoreEditableTargets:a=!0}={})=>{let[o,s]=(0,d.useState)(!1),c=(0,d.useRef)(null),l=()=>{let t=e.current;!n||!t||t.disabled||(c.current!==null&&window.clearTimeout(c.current),s(!0),c.current=window.setTimeout(()=>{c.current=null,e.current?.click(),s(!1)},r))};return $E(e=>{e.defaultPrevented||KD(e,t)&&(i&&e.preventDefault(),l())},{enabled:n,ignoreEditableTargets:a}),(0,d.useEffect)(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]),{isShortcutActive:o}},JD=[[`updated`,`alt`,`v2`,`draft`],[`next`,`clean`,`refined`,`candidate`],[`final`,`review`,`copy`,`latest`]],YD=e=>e.trim().replace(/[.\s-]+/g,`_`).replace(/[^A-Za-z0-9_]+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``),XD=e=>YD(e).toLocaleLowerCase(),ZD=32,QD=({source:e,seed:t,isValid:n})=>{let r=YD(e||`item`);if(r.length===0)return[];let i=JD[t%JD.length],a=[...i.slice(t%i.length),...i.slice(0,t%i.length)],o=[`${r}_${a[0]}`,`${r}_${a[1]}`,`${r}_${a[2]}`,`${r}_${a[3]}`,`${r}_v${t+2}`,`new_${r}`].map(YD);return Array.from(new Map(o.map(e=>[XD(e),e])).values()).filter(n).slice(0,6).map(e=>({text:e}))},$D=e=>{let t=J(`common.actions`),n=J(`itemKeyEditor`),r=KE(),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(e.currentItemKey?.itemKey??``),[c,l]=(0,d.useState)(!1),[u,f]=(0,d.useState)(0),[p,h]=(0,d.useState)([]),[g,_]=(0,d.useState)(!1),v=(0,d.useRef)(0),y=(0,d.useRef)(null),b=(0,d.useRef)(null),x=e.currentItemKey?.itemKey??``,{isShortcutActive:S}=qD(b,{key:`k`},{enabled:!0}),C=t=>t===x?n(`validation.sameAsCurrent`):e.siblingKeys.some(e=>e===t)?n(`validation.duplicate`):t.includes(`.`)?n(`validation.dot`):t.includes(` `)?n(`validation.space`):t.length===0?n(`validation.empty`):null,w=C(o),T=o.length>ZD?n(`keyLengthWarning`,{maxLength:ZD}):null,E=(e,t)=>{h(QD({source:e||x,seed:t,isValid:e=>C(e)===null}))},D=async(t,n)=>{let i=++v.current;y.current?.abort();let a=new AbortController;y.current=a,_(!0);try{let o=[];if(r?.suggestItemKey){let s=await r.suggestItemKey({itemId:e.itemId,draftKey:t,currentKey:x,siblingKeys:e.siblingKeys,maxSuggestions:6},{signal:a.signal,mode:`user`,cache:n>0?`refresh`:`default`});if(i!==v.current)return;o=Array.from(new Map(s.suggestions.map(e=>{let t=YD(e.text);return[XD(t),{...e,text:t}]})).values()).filter(e=>C(e.text)===null).slice(0,6)}if(o.length===0&&(o=QD({source:t||x,seed:n,isValid:e=>C(e)===null})),i!==v.current)return;h(o)}catch(e){if(e?.name===`AbortError`||i!==v.current)return;E(t,n)}finally{i===v.current&&_(!1),y.current===a&&(y.current=null)}},O=()=>{let t=o;if(t===x){a(!1);return}if(C(t)){l(!0);return}e.onChangeItemKey(t),a(!1)},k=()=>{s(x),a(!1)};return(0,m.jsxs)(zD,{open:i,onOpenChange:e=>{if(a(e),e){s(x),l(!1),f(0),D(x,0);return}v.current+=1,y.current?.abort(),y.current=null,_(!1)},children:[(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(BD,{asChild:!0,children:(0,m.jsx)(B,{ref:b,variant:`outline`,size:`sm`,className:z(`bg-transparent transition-[background-color,box-shadow,color,transform] duration-150`,S&&`bg-muted text-foreground ring-2 ring-ring/40 scale-[0.98]`),children:(0,m.jsx)(`span`,{className:`block truncate font-mono text-xs leading-none text-foreground`,children:x||n(`noKey`)})})})}),(0,m.jsx)(IE,{side:`bottom`,align:`start`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsx)(`span`,{children:n(`editItemKey`)}),(0,m.jsx)(FD,{children:`K`})]})})]}),(0,m.jsxs)(VD,{className:`w-[min(36rem,calc(100vw-1rem))] overflow-hidden rounded-xl border-border p-0 shadow-xl`,side:`bottom`,align:`start`,children:[(0,m.jsxs)(`div`,{className:`space-y-3 p-3 sm:p-4`,children:[(0,m.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-semibold tracking-tight`,children:n(`title`)}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`description`)})]}),(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(Og,{htmlFor:`keyInput`,className:`text-xs font-medium text-muted-foreground`,children:n(`keyLabel`)}),(0,m.jsx)(Dg,{id:`keyInput`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),O()):e.key===`Escape`&&(e.preventDefault(),k())},placeholder:n(`placeholder`),autoFocus:!0,"aria-describedby":T?`key-length-warning`:void 0,className:`h-8 rounded-lg border-border bg-muted/20 px-2.5 font-mono text-sm shadow-none`}),c&&w&&(0,m.jsx)(`p`,{className:`text-xs font-medium text-destructive`,children:w}),T?(0,m.jsxs)(`p`,{id:`key-length-warning`,role:`status`,"aria-live":`polite`,className:`flex items-start gap-1.5 text-xs font-medium text-amber-700 dark:text-amber-400`,children:[(0,m.jsx)(BT,{className:`mt-0.5 size-3.5 shrink-0`,"aria-hidden":`true`}),(0,m.jsx)(`span`,{children:T})]}):null,e.currentItemKey?.isRoot?(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`surveyRootItem`)}):(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`parentFullKey`,{parentFullKey:e.currentItemKey?.parentFullKey??``})})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,m.jsx)(`h4`,{className:`text-sm font-semibold`,children:n(`suggestions`)}),(0,m.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,className:`gap-1.5 text-xs`,disabled:g,onClick:()=>{let e=u+1;f(e),D(o,e)},children:[g?(0,m.jsx)(oT,{className:`size-3.5 animate-spin`}):(0,m.jsx)(xT,{className:`size-3.5`}),n(`regenerate`)]})]}),(0,m.jsx)(`div`,{className:`flex min-h-8 flex-wrap items-center gap-1.5`,children:g?(0,m.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 rounded-full border border-border bg-muted/30 px-2.5 py-1 text-xs text-muted-foreground`,children:[(0,m.jsx)(oT,{className:`size-3 animate-spin`}),n(`generatingSuggestions`)]}):p.length>0?p.map(e=>(0,m.jsxs)(`button`,{type:`button`,className:z(`rounded-full border border-border bg-background px-2.5 py-1 font-mono text-xs transition-colors`,`hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,o===e.text&&`border-primary/60 bg-primary/10 text-foreground`),onClick:()=>{s(e.text),l(!1)},children:[(0,m.jsx)(`span`,{children:e.text}),e.category&&(0,m.jsx)(`span`,{className:`ml-1.5 font-sans text-[10px] text-muted-foreground`,children:e.category===`survey-pattern`?n(`suggestionCategories.surveyPattern`):n(`suggestionCategories.${e.category}`)})]},`${e.category??`fallback`}-${e.text}`)):(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`noValidSuggestions`)})})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-2 border-t bg-muted/50 px-3 py-2 sm:px-4`,children:[(0,m.jsx)(B,{type:`button`,variant:`outline`,size:`sm`,onClick:k,children:t(`cancel`)}),(0,m.jsx)(B,{type:`button`,size:`sm`,onClick:O,disabled:w!==null,children:t(`save`)})]})]})]})},eO=3,tO=400,nO=3,rO=e=>{let t=J(`aiInput`),{value:n,onChange:r,placeholder:i,suggestionsAdapter:a=null}=e,[o,s]=(0,d.useState)([]),[c,l]=(0,d.useState)(!1),[u,f]=(0,d.useState)(!1),[p,h]=(0,d.useState)(0),g=(0,d.useRef)(null),_=(0,d.useRef)(null),v=(0,d.useRef)(void 0),y=(0,d.useRef)(0),b=(0,d.useRef)(null),x=(0,d.useRef)(!1),S=(0,d.useRef)(!1),C=a!==null,w=(0,d.useCallback)(()=>{v.current&&=(clearTimeout(v.current),void 0)},[]),T=(0,d.useCallback)(()=>{y.current+=1,b.current?.abort(),b.current=null},[]),E=(0,d.useCallback)(()=>{w(),T(),s([]),l(!1),f(!1),h(0)},[T,w]),D=(0,d.useCallback)(async(t,n)=>{if(!a){E();return}T();let r=y.current,i=new AbortController;b.current=i,f(!0);try{let o=n===`typing`?`background`:`user`,c=await a.onSuggest(t,n,{signal:i.signal,mode:o});if(r!==y.current)return;let u=e.maxSuggestions??a.maxSuggestions??nO,d=t.trim().length>0?[{id:`__input__`,text:t}]:[],f=new Set(d.map(e=>e.text.trim().toLocaleLowerCase())),p=c.filter(e=>{let t=e.text.trim().toLocaleLowerCase();return!t||f.has(t)?!1:(f.add(t),!0)}).slice(0,Math.max(0,u-d.length)),m=[...d,...p];s(m),l(m.length>0),h(0)}catch(e){if(e?.name===`AbortError`||r!==y.current)return;s([]),l(!1)}finally{r===y.current&&(f(!1),b.current=null)}},[T,E,e.maxSuggestions,a]);(0,d.useEffect)(()=>{_.current?.scrollIntoView({block:`nearest`,behavior:`smooth`})},[p]),(0,d.useEffect)(()=>{c&&g.current?.focus()},[c]),(0,d.useEffect)(()=>()=>{w(),T()},[T,w]),(0,d.useEffect)(()=>{if(!C){E();return}if(x.current){x.current=!1,E();return}if(!S.current)return;S.current=!1,w();let e=a?.minChars??eO,t=a?.debounceMs??tO;if(n.length>=e){v.current=setTimeout(()=>{D(n,`typing`)},t);return}E()},[C,w,E,D,a,n]);let O=e=>{x.current=!0,r(e.text),l(!1),g.current?.focus()};return(0,m.jsxs)(zD,{open:C?c:!1,onOpenChange:e=>l(C&&e),children:[(0,m.jsx)(HD,{asChild:!0,children:(0,m.jsxs)(`div`,{className:z(`relative w-full`,e.containerClassName),children:[(0,m.jsx)(Dg,{type:`text`,className:z(e.className,C?`pr-9`:``),value:n,onChange:e=>{S.current=!0,r(e.target.value)},onKeyDown:t=>{if(c&&o.length>0)switch(t.key){case`ArrowDown`:t.preventDefault(),h(e=>(e+1)%o.length);return;case`ArrowUp`:t.preventDefault(),h(e=>(e-1+o.length)%o.length);return;case`Enter`:case`Tab`:if(o[p]){t.preventDefault(),O(o[p]);return}break;case`Escape`:t.preventDefault(),t.stopPropagation(),l(!1);return;default:break}e.onKeyDown?.(t)},onBlur:t=>{t.relatedTarget?.dataset.aiPopoverInteractive!==`true`&&e.onBlur?.(t)},ref:g,id:e.id,autoComplete:e.autoComplete,autoFocus:e.autoFocus,disabled:e.disabled,placeholder:i}),C&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>{l(!0),D(n||``,`manual`)},disabled:u||e.disabled,"data-ai-popover-interactive":`true`,className:z(`absolute right-[2px] top-1/2 -translate-y-1/2 flex items-center justify-center p-0.5 rounded hover:bg-muted/50 hover:text-muted-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,e.aiButtonClassName),"aria-label":t(`getSuggestions`),children:u?(0,m.jsx)(oT,{className:`size-4 text-muted-foreground animate-spin`}):(0,m.jsx)(kT,{className:`size-4 text-muted-foreground/70`})})]})}),(0,m.jsx)(VD,{className:z(`w-(--radix-popover-trigger-width) min-w-0 p-0 border-border`,e.popoverContentClassName),align:`start`,side:`bottom`,sideOffset:4,onOpenAutoFocus:e=>e.preventDefault(),onCloseAutoFocus:e=>{e.preventDefault(),g.current?.focus()},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),l(!1),g.current?.focus()},children:(0,m.jsxs)(`div`,{className:`max-h-64 overflow-hidden flex flex-col`,children:[(0,m.jsx)(`div`,{className:`px-3 py-2 border-b border-border bg-muted/50 shrink-0`,children:(0,m.jsx)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:u?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(oT,{className:`size-3.5 animate-spin shrink-0`}),(0,m.jsx)(`span`,{children:t(`gettingSuggestions`)})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(kT,{className:`size-3.5 shrink-0`}),(0,m.jsx)(`span`,{children:t(`suggestions`)})]})})}),(0,m.jsx)(`div`,{className:`overflow-y-auto`,children:o.length===0&&!u?(0,m.jsx)(`div`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:t(`noSuggestions`)}):o.map((e,n)=>(0,m.jsxs)(`button`,{ref:n===p?_:void 0,type:`button`,"data-ai-popover-interactive":`true`,onClick:()=>O(e),onMouseEnter:()=>h(n),className:`w-full px-2.5 py-2 text-left transition-colors border-b border-border last:border-b-0 flex items-start justify-between gap-2
|
|
86
|
-
${n===p?`bg-accent text-accent-foreground`:`hover:bg-muted/50`}`,children:[(0,m.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,m.jsxs)(`p`,{className:`text-sm text-foreground wrap-break-word flex items-center gap-2`,children:[(0,m.jsx)(`span`,{children:e.text}),(e.id===`__input__`||e.label)&&(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`(`,e.id===`__input__`?t(`yourInput`):e.label,`)`]})]})}),n===p&&(0,m.jsx)(_w,{className:`size-4 text-muted-foreground shrink-0 mt-0.5`})]},e.id))}),(0,m.jsx)(`div`,{className:`px-3 py-2 border-t border-border bg-muted/30 shrink-0`,children:(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[(0,m.jsx)(`kbd`,{className:`px-1.5 py-0.5 text-[10px] font-mono bg-background border border-border rounded`,children:`↑`}),(0,m.jsx)(`kbd`,{className:`px-1.5 py-0.5 text-[10px] font-mono bg-background border border-border rounded ml-0.5`,children:`↓`}),(0,m.jsx)(`span`,{className:`mx-1`,children:t(`navigate`)}),(0,m.jsx)(`kbd`,{className:`px-1.5 py-0.5 text-[10px] font-mono bg-background border border-border rounded mx-1`,children:`Enter`}),(0,m.jsx)(`span`,{children:t(`select`)}),(0,m.jsx)(`kbd`,{className:`px-1.5 py-0.5 text-[10px] font-mono bg-background border border-border rounded mx-1`,children:`Esc`}),(0,m.jsx)(`span`,{children:t(`close`)})]})})]})})]})},iO=e=>{let t=J(`itemLabelEditor`),n=KE(),{language:r}=GE(),[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(e.itemLabel),c=(0,d.useRef)(e.itemLabel),l=(0,d.useRef)(null),u=(0,d.useRef)(!1),{isShortcutActive:f}=qD(l,{key:`l`},{enabled:!i});(0,d.useEffect)(()=>{!i&&u.current&&l.current&&l.current.focus(),u.current=i},[i]);let p=(0,d.useEffectEvent)(t=>{s(e.itemLabel),c.current=e.itemLabel,a(t)});(0,d.useEffect)(()=>{i&&e.itemLabel!==c.current&&p(!1)},[e.itemLabel,i]);let h=(0,d.useMemo)(()=>{let t=n?.suggestItemLabel;if(!t)return null;let i=e.maxSuggestions??3;return{minChars:3,debounceMs:400,maxSuggestions:i,onSuggest:async(n,a,o)=>(await t({itemId:e.itemId,draftLabel:n,itemType:e.itemType,locale:r,maxSuggestions:i},{signal:o?.signal,mode:o?.mode})).suggestions.map((e,t)=>({id:`item-label-suggestion-${t}-${e.text}`,text:e.text}))}},[n?.suggestItemLabel,r,e.itemId,e.itemType,e.maxSuggestions]),g=t=>{t!==e.itemLabel&&e.onChangeItemLabel(t)},_=()=>{e.itemLabel===c.current&&g(o)};if(!i){let n=e.itemLabel;return(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{ref:l,type:`button`,variant:`ghost`,size:`sm`,className:z(e.className,`hover:bg-primary/10 hover:underline text-muted-foreground`,f&&`bg-primary/5 text-foreground ring-2 ring-ring/40 scale-[0.98]`),onClick:()=>{s(e.itemLabel),c.current=e.itemLabel,a(!0)},children:(0,m.jsxs)(`span`,{className:`flex-1 min-w-0`,children:[n,n.length<1&&(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:t(`emptyLabel`)})]})})}),(0,m.jsx)(IE,{side:`bottom`,align:`start`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsx)(`span`,{children:t(`editItemLabel`)}),(0,m.jsx)(FD,{children:`L`})]})})]})}return(0,m.jsx)(rO,{value:o,onChange:s,id:`new-item-label`,containerClassName:z(`w-fit h-full`,e.className),autoComplete:`off`,autoFocus:!0,className:z(`min-w-64 w-fit max-h-7 rounded-md border-none bg-transparent px-2 text-xs font-medium shadow-none`,`focus:border-none focus:outline-none focus-visible:border-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/30`),aiButtonClassName:`rounded-sm p-1 hover:bg-muted/60 size-5`,popoverContentClassName:`z-[70]`,placeholder:t(`placeholder`),suggestionsAdapter:h,onBlur:()=>{a(!1),_()},onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),s(e.itemLabel),a(!1)),t.key===`Enter`&&(t.preventDefault(),_(),a(!1))}})};function aO({...e}){return(0,m.jsx)(pi,{"data-slot":`dialog`,...e})}function oO({...e}){return(0,m.jsx)(mi,{"data-slot":`dialog-trigger`,...e})}function sO({...e}){return(0,m.jsx)(vi,{"data-slot":`dialog-portal`,...e})}function cO({...e}){return(0,m.jsx)(ji,{"data-slot":`dialog-close`,...e})}function lO({className:e,...t}){return(0,m.jsx)(bi,{"data-slot":`dialog-overlay`,className:z(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,e),...t})}function uO({className:e,children:t,showCloseButton:n=!0,closeLabel:r=`Close`,dismissOnInteractOutside:i=!0,onInteractOutside:a,...o}){return(0,m.jsxs)(sO,{children:[(0,m.jsx)(lO,{}),(0,m.jsxs)(wi,{"data-slot":`dialog-content`,className:z(`bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,e),...o,onInteractOutside:e=>{a?.(e),i||e.preventDefault()},children:[t,n&&(0,m.jsx)(ji,{"data-slot":`dialog-close`,asChild:!0,children:(0,m.jsxs)(B,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,"aria-label":r,children:[(0,m.jsx)(GT,{}),(0,m.jsx)(`span`,{className:`sr-only`,children:r})]})})]})]})}function dO({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`dialog-header`,className:z(`gap-2 flex flex-col`,e),...t})}function fO({className:e,showCloseButton:t=!1,closeLabel:n=`Close`,children:r,...i}){return(0,m.jsxs)(`div`,{"data-slot":`dialog-footer`,className:z(`bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...i,children:[r,t&&(0,m.jsx)(ji,{asChild:!0,children:(0,m.jsx)(B,{variant:`outline`,children:n})})]})}function pO({className:e,...t}){return(0,m.jsx)(Oi,{"data-slot":`dialog-title`,className:z(`text-base leading-none font-medium`,e),...t})}function mO({className:e,...t}){return(0,m.jsx)(ki,{"data-slot":`dialog-description`,className:z(`text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3`,e),...t})}var hO=88;function gO(e){return JSON.stringify(e)}function _O(e){let t=new Date(e);return Number.isNaN(t.getTime())?`DATE ${e}`:`DATE ${gO(t.toISOString())}`}function vO(e,t){return`OPTION ${gO(t.resolveReferenceValue?.(e)??e)}`}function yO(e,t){return`[${e.map(t).join(`, `)}]`}function bO(e,t){if(!e)return`MISSING VALUE`;switch(e.type){case u.gt.string:return gO(e.value);case u.gt.reference:return vO(e.value,t);case u.gt.number:return String(e.value);case u.gt.boolean:return e.value?`TRUE`:`FALSE`;case u.gt.date:return _O(e.value);case u.gt.duration:return`DURATION ${e.value} ${e.unit}`;case u.gt.stringArray:return yO(e.value,gO);case u.gt.referenceArray:return yO(e.value,e=>vO(e,t));case u.gt.numberArray:return yO(e.value,String);case u.gt.dateArray:return yO(e.value,_O);case u.gt.durationArray:return yO(e.value,t=>`${t} ${e.unit}`)}}function xO(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[._-]+/g,` `).replace(/\s+/g,` `).trim().toUpperCase()}function SO(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[._-]+/g,` `).replace(/\s+/g,` `).trim().toLowerCase()}function CO(e,t){try{let n=new u.mt(e.variableRef),r=t.resolveItemKey?.(n.itemId)??n.itemId,i=!n.slotId||n.slotId===`response`;return n.name===u.ht.isDefined?i?`ANSWER EXISTS FOR ${gO(r)}`:`VALUE ${gO(SO(n.slotId))} EXISTS FOR ${gO(r)}`:i?`ANSWER TO ${gO(r)}`:`VALUE ${gO(SO(n.slotId))} FROM ${gO(r)}`}catch{return`ANSWER TO ${gO(e.variableRef)}`}}function wO(e,t){let n=e.key?` ${OO(e.key,t)}`:``,r=e.arguments?.filter(e=>!!e)??[],i=r.length?` (${r.map(e=>OO(e,t)).join(`, `)})`:``,a=e.asType?` AS ${xO(e.asType)}`:``;switch(e.contextType){case u.rt.Locale:return`SURVEY LOCALE${a}`;case u.rt.ParticipantFlag:return`PARTICIPANT FLAG${n}${i}${a}`;case u.rt.CustomValue:return`CUSTOM VALUE${n}${i}${a}`;case u.rt.CustomExpression:return`CUSTOM RULE${n}${i}${a}`;default:return`${xO(e.contextType)}${n}${i}${a}`}}var TO={[u.ot.eq]:`IS`,[u.ot.str_eq]:`IS`,[u.ot.date_eq]:`IS`,[u.ot.gt]:`IS GREATER THAN`,[u.ot.gte]:`IS AT LEAST`,[u.ot.lt]:`IS LESS THAN`,[u.ot.lte]:`IS AT MOST`,[u.ot.list_contains]:`CONTAINS`};function EO(e,t){return e.arguments[t]}function DO(e,t){let n=e.arguments.map(e=>e?OO(e,t):`MISSING VALUE`),r=TO[e.functionName];if(r&&n.length===2)return`${n[0]} ${r} ${n[1]}`;switch(e.functionName){case u.ot.and:return`ALL OF (${n.join(`, `)})`;case u.ot.or:return`ANY OF (${n.join(`, `)})`;case u.ot.not:return`NOT (${n[0]??`MISSING VALUE`})`;case u.ot.in_range:{let t=EO(e,3),r=(t instanceof u.et&&t.value?.type===u.gt.boolean?t.value.value:void 0)===!1?`IS STRICTLY BETWEEN`:`IS BETWEEN`;return`${n[0]??`MISSING VALUE`} ${r} ${n[1]??`MISSING VALUE`} AND ${n[2]??`MISSING VALUE`}`}case u.ot.sum:return`SUM OF (${n.join(`, `)})`;case u.ot.min:return`MINIMUM OF (${n.join(`, `)})`;case u.ot.max:return`MAXIMUM OF (${n.join(`, `)})`;default:return`${xO(e.functionName)} (${n.join(`, `)})`}}function OO(e,t){return e instanceof u.et?bO(e.value,t):e instanceof u.ut?CO(e,t):e instanceof u.nt?wO(e,t):e instanceof u.at?DO(e,t):`UNKNOWN EXPRESSION`}function kO(e){return e.map(e=>` ${e}`)}function AO(e,t){if(e instanceof u.at){if(e.functionName===u.ot.and||e.functionName===u.ot.or)return[e.functionName===u.ot.and?`ALL OF:`:`ANY OF:`,...e.arguments.flatMap(e=>kO(e?AO(e,t):[`MISSING VALUE`]))];if(e.functionName===u.ot.not){let n=e.arguments[0];return[`NOT:`,...kO(n?AO(n,t):[`MISSING VALUE`])]}let n=DO(e,t),r=t.maxInlineLength??hO;if(n.length>r&&e.arguments.length>1)return[`${xO(e.functionName)}:`,...e.arguments.flatMap(e=>kO(e?AO(e,t):[`MISSING VALUE`]))]}return[OO(e,t)]}function jO(e,t={}){return AO(e,t).join(`
|
|
87
|
-
`)}function MO(e){return Object.entries(e??{}).filter(e=>!!e[1]).sort(([e],[t])=>e.localeCompare(t))}function NO(e,t=`all`){let n=[];if(t!==`prefills`){e.displayConditions?.root&&n.push({id:`display-root`,category:`display`,expression:e.displayConditions.root});for(let[t,r]of MO(e.displayConditions?.components))n.push({id:`display-${t}`,category:`display`,target:t,expression:r});for(let[t,r]of MO(e.disabledConditions?.components))n.push({id:`disabled-${t}`,category:`disabled`,target:t,expression:r});for(let[t,r]of MO(e.validations))n.push({id:`validation-${t}`,category:`validation`,target:t,expression:r})}if(t!==`conditions`)for(let t of e.prefills??[])t.when&&n.push({id:`prefill-condition-${t.id}`,category:`prefill-condition`,target:t.id,expression:t.when}),t.source.type===`expression`&&n.push({id:`prefill-value-${t.id}`,category:`prefill-value`,target:t.id,expression:t.source.expression});return n}function PO(e,t=`all`){return NO(e,t).length}function FO(e,t,n=new Set){if(!(!e||typeof e!=`object`||n.has(e))){if(n.add(e),!Array.isArray(e)){let r=e;if(r.id===t){let e=[r.key,r.title,r.name].find(e=>typeof e==`string`&&e.trim().length>0);if(e)return e}for(let e of Object.values(r)){let r=FO(e,t,n);if(r)return r}return}for(let r of e){let e=FO(r,t,n);if(e)return e}}}function IO(e,t){let n=e?.getItemKey(t)?.fullKey;if(n)return n;for(let n of e?.surveyItems.values()??[]){let e=FO(n.config,t);if(e)return e}}var LO=/("(?:\\.|[^"\\])*"|\b(?:ALL OF|ANY OF|NOT|IS STRICTLY BETWEEN|IS GREATER THAN|IS LESS THAN|IS AT LEAST|IS AT MOST|IS BETWEEN|IS|AND|CONTAINS|ANSWER EXISTS FOR|ANSWER TO|VALUE|FROM|EXISTS FOR|OPTION|DATE|DURATION|SURVEY LOCALE|PARTICIPANT FLAG|CUSTOM VALUE|CUSTOM RULE|SUM OF|MINIMUM OF|MAXIMUM OF|TRUE|FALSE|MISSING VALUE|UNKNOWN EXPRESSION|AS)\b|-?\b\d+(?:\.\d+)?\b)/g;function RO(e){return e.startsWith(`"`)?`text-emerald-700 dark:text-emerald-300`:/^-?\d/.test(e)?`text-sky-700 dark:text-sky-300`:/^(TRUE|FALSE)$/.test(e)?`text-amber-700 dark:text-amber-300`:/^(ANSWER TO|ANSWER EXISTS FOR|VALUE|OPTION|SURVEY LOCALE|PARTICIPANT FLAG|CUSTOM VALUE|CUSTOM RULE)$/.test(e)?`text-violet-700 dark:text-violet-300`:`font-semibold text-foreground`}function zO({code:e}){return(0,m.jsx)(`code`,{children:e.split(LO).map((e,t)=>(0,m.jsx)(d.Fragment,{children:e?(0,m.jsx)(`span`,{className:RO(e),children:e}):null},`${t}-${e}`))})}function BO(e,t){return jO(e,{resolveItemKey:e=>t?.getItemKey(e)?.fullKey,resolveReferenceValue:e=>IO(t,e)})}function VO({open:e,onOpenChange:t,title:n,expression:r}){let i=J(`itemEditorCard.expressions`),a=J(`common.actions`),o=tD();return(0,m.jsx)(aO,{open:e,onOpenChange:t,children:(0,m.jsxs)(uO,{closeLabel:a(`close`),className:`gap-0 overflow-hidden sm:max-w-3xl`,onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,m.jsxs)(dO,{className:`border-b border-border px-6 py-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(fw,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),(0,m.jsx)(pO,{className:`font-mono text-sm tracking-tight`,children:n})]}),(0,m.jsx)(mO,{children:i(`dialogDescription`)})]}),(0,m.jsx)(`div`,{className:`max-h-[65svh] overflow-auto bg-muted/25 p-4 sm:p-6`,children:(0,m.jsx)(`pre`,{className:`min-w-max whitespace-pre-wrap font-mono text-xs leading-6 text-muted-foreground sm:text-sm`,children:(0,m.jsx)(zO,{code:BO(r,o)})})}),(0,m.jsx)(`p`,{className:`border-t border-border px-6 py-3 text-xs text-muted-foreground`,children:i(`readOnlyHint`)})]})})}function HO({expression:e,title:t,className:n}){let[r,i]=(0,d.useState)(!1);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{"data-expression-trigger":`true`,className:`inline-flex shrink-0`,onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-xs`,className:z(`size-7 text-muted-foreground`,n),"aria-label":t,onClick:()=>i(!0),children:(0,m.jsx)(Gw,{className:`size-4`,"aria-hidden":!0})})}),(0,m.jsx)(IE,{children:t})]})}),(0,m.jsx)(VO,{open:r,onOpenChange:i,title:t,expression:e})]})}function UO({item:e,title:t,className:n,scope:r=`all`}){let[i,a]=(0,d.useState)(!1),o=J(`itemEditorCard.expressions`),s=J(`common.actions`);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,variant:`outline`,size:`icon-xs`,className:n,"aria-label":t,onClick:()=>a(!0),children:(0,m.jsx)(Gw,{className:`size-3.5`,"aria-hidden":!0})})}),(0,m.jsx)(IE,{children:t})]}),(0,m.jsx)(aO,{open:i,onOpenChange:a,children:(0,m.jsxs)(uO,{closeLabel:s(`close`),className:`gap-0 overflow-hidden sm:max-w-3xl`,children:[(0,m.jsxs)(dO,{className:`border-b border-border px-6 py-4`,children:[(0,m.jsx)(pO,{children:t}),(0,m.jsx)(mO,{children:o(r===`conditions`?`conditionsDialogDescription`:`itemDialogDescription`)})]}),(0,m.jsx)(`div`,{className:`max-h-[70svh] overflow-y-auto p-4 sm:p-6`,children:(0,m.jsx)(GO,{item:e,scope:r})})]})})]})}function WO(e){switch(e){case`display`:case`disabled`:return Gw;case`validation`:return ET;case`prefill-condition`:case`prefill-value`:return WT}}function GO({item:e,scope:t=`all`,className:n,compact:r=!1}){let i=J(`itemEditorCard.expressions`),a=tD(),[o,s]=(0,d.useState)(),c=NO(e,t),l=e=>BO(e.expression,a),u=e=>{let t=i(`categories.${e.category}`).toLocaleUpperCase();return e.target?i(`categoryForTarget`,{category:t,target:e.category===`display`||e.category===`disabled`?IO(a,e.target)??e.target:e.target}):t};return c.length===0?(0,m.jsxs)(`div`,{className:z(`space-y-1`,n),children:[(0,m.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:i(`noneTitle`)}),(0,m.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:i(`noneDescription`)})]}):(0,m.jsxs)(`div`,{className:z(`space-y-2`,n),children:[c.map(e=>{let t=WO(e.category),n=l(e),a=n.split(`
|
|
88
|
-
`).length;return(0,m.jsxs)(`article`,{className:`min-w-0 rounded-lg border border-border/80 bg-background`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 border-b border-border/70 px-2.5 py-2`,children:[(0,m.jsx)(t,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,m.jsx)(`h4`,{className:`min-w-0 flex-1 truncate font-mono text-xs font-medium tracking-tight text-foreground`,children:u(e)})]}),(0,m.jsx)(`pre`,{className:z(`overflow-hidden whitespace-pre-wrap break-words px-2.5 py-2 font-mono text-[11px] leading-5 text-muted-foreground`,r&&(a>3||n.length>150)&&`max-h-[4.75rem]`),children:(0,m.jsx)(zO,{code:n})}),(0,m.jsx)(`div`,{className:`flex justify-end border-t border-border/60 px-1.5 py-1`,children:(0,m.jsxs)(B,{type:`button`,variant:`ghost`,size:`xs`,className:`h-7 gap-1.5 text-[11px] text-muted-foreground`,onClick:()=>s(e),children:[(0,m.jsx)(Iw,{className:`size-3`,"aria-hidden":!0}),i(`viewFull`)]})})]},e.id)}),o?(0,m.jsx)(VO,{open:!0,onOpenChange:e=>!e&&s(void 0),title:u(o),expression:o.expression}):null]})}var KO=({itemId:e})=>{let t=J(`itemSiblingNavigation`),n=tD(),{navigateToItem:r}=oD(),i=(0,d.useRef)(null),a=(0,d.useRef)(null),o=n?.getSiblings(e)??[],s=o.findIndex(t=>t.id===e),c=s>=0&&o.length>0,l=s>0?o[s-1]:void 0,u=s>=0&&s<o.length-1?o[s+1]:void 0,{isShortcutActive:f}=qD(i,{key:`ArrowDown`,metaKey:!0},{enabled:!!u}),{isShortcutActive:p}=qD(a,{key:`ArrowUp`,metaKey:!0},{enabled:!!l});return c?(0,m.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,m.jsxs)(`span`,{className:`min-w-11 text-center font-medium tabular-nums text-muted-foreground text-xs`,children:[s+1,` / `,o.length]}),(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{ref:i,type:`button`,variant:`ghost`,size:`icon-xs`,className:z(`text-muted-foreground hover:bg-primary/10 hover:text-foreground`,f&&`bg-primary/5 text-foreground ring-2 ring-ring/40 scale-[0.98]`),disabled:!u,"aria-label":t(`goToNextSiblingItem`),onClick:()=>{u&&r(u.id)},children:(0,m.jsx)(vw,{className:`size-4`})})}),(0,m.jsx)(IE,{side:`bottom`,align:`center`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsx)(`span`,{children:t(`nextSibling`)}),(0,m.jsxs)(ID,{children:[(0,m.jsx)(FD,{children:`Cmd`}),(0,m.jsx)(FD,{children:`↓`})]})]})})]}),(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{ref:a,type:`button`,variant:`ghost`,size:`icon-xs`,className:z(`text-muted-foreground hover:bg-primary/10 hover:text-foreground`,p&&`bg-primary/5 text-foreground ring-2 ring-ring/40 scale-[0.98]`),disabled:!l,"aria-label":t(`goToPreviousSiblingItem`),onClick:()=>{l&&r(l.id)},children:(0,m.jsx)(xw,{className:`size-4`})})}),(0,m.jsx)(IE,{side:`bottom`,align:`center`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsx)(`span`,{children:t(`previousSibling`)}),(0,m.jsxs)(ID,{children:[(0,m.jsx)(FD,{children:`Cmd`}),(0,m.jsx)(FD,{children:`↑`})]})]})})]})]}):null},qO=({typeInfos:e,color:t,iconClassName:n})=>(0,m.jsxs)(PE,{delayDuration:500,children:[(0,m.jsx)(FE,{children:(0,m.jsx)(`div`,{className:t?void 0:e.defaultItemClassName,style:{color:t},children:(0,m.jsx)(e.icon,{className:z(`size-5`,n)})})}),(0,m.jsx)(IE,{align:`start`,side:`bottom`,children:e.label})]}),JO=({itemId:e,menu:t})=>{let n=t.items.length>0||!t.hideDeleteItem;return(0,m.jsxs)(oE,{side:`bottom`,align:`end`,className:`border-border`,children:[(0,m.jsx)(jD,{itemId:e}),n?(0,m.jsx)(pE,{}):null,t.items,t.hideDeleteItem?null:(0,m.jsxs)(m.Fragment,{children:[t.items.length>0?(0,m.jsx)(pE,{}):null,(0,m.jsx)(vD,{})]})]})},YO=({navItems:e,activeMode:t,showShortcutNumbers:n,colors:r})=>e.length===0?null:(0,m.jsx)(`div`,{className:`shrink-0 border-b px-2`,style:{borderColor:r.border},children:(0,m.jsx)(`div`,{className:`overflow-x-auto`,children:(0,m.jsx)(XE,{variant:`line`,className:`h-auto min-w-full justify-start gap-0 rounded-none bg-transparent p-0`,children:e.map((e,i)=>{let a=i+1;return(0,m.jsx)(LD,{value:e.id,label:e.label,icon:e.icon,isActive:t===e.id,colorAccent:r.accent,colorBorder:r.border,showShortcutNumber:n&&a<=9,shortcutNumber:a,hasIndicator:e.hasIndicator,indicatorCount:e.indicatorCount},e.id)})})})}),XO=({sidePanelCards:e,colors:t,className:n,labels:r})=>e?.length?(0,m.jsx)(`aside`,{className:z(`flex min-h-0 w-full max-w-full flex-col overflow-x-auto overflow-y-hidden @2xl/editor-card:w-80 @2xl/editor-card:shrink-0 @2xl/editor-card:overflow-y-auto`,n),children:(0,m.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-3`,children:(0,m.jsx)(`div`,{className:`flex pb-3 min-w-0 flex-1 flex-row flex-nowrap items-stretch gap-3 @2xl/editor-card:w-full @2xl/editor-card:flex-col`,children:e?.map(e=>{let n=e.icon;return(0,m.jsxs)(`section`,{className:`w-fit max-w-full min-w-0 shrink-0 rounded-2xl border bg-card p-3 shadow-sm @2xl/editor-card:w-full`,style:{borderColor:t.border},children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-2`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`h3`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,m.jsx)(`span`,{style:{color:t.accent},children:(0,m.jsx)(n,{className:`size-3`})}),e.title]}),e.description?(0,m.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e.description}):null]}),e.headerAction?(0,m.jsx)(`div`,{className:`shrink-0`,children:e.headerAction}):null]}),(0,m.jsx)(`div`,{className:z(`mt-4 rounded-xl border p-2`,e.content?`border-border/80 bg-muted/20`:`border-dashed border-border/80 bg-muted/35`),children:e.content??(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:r.comingSoon}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r.comingSoonDescription})]})})]},e.id)})})})}):null,ZO=({children:e,sidePanelCards:t,colors:n,labels:r})=>(0,m.jsxs)(`div`,{className:z(`flex h-full min-h-0 w-full flex-col @2xl/editor-card:flex-row`,!!t?.length&&`min-h-0`),children:[(0,m.jsx)(`div`,{className:`order-2 min-h-0 min-w-0 flex-1 overflow-y-auto @2xl/editor-card:order-1`,children:e}),(0,m.jsx)(XO,{sidePanelCards:t,colors:n,className:`order-1 @2xl/editor-card:order-2`,labels:r})]}),QO=({surveyItem:e,menu:t,navItems:n=[],layoutVariant:r=`tabs`,sidePanelCards:i,children:a})=>{let o=J(`history`),s=J(`itemEditorCard`),c=r===`tabs`,[l,u]=(0,d.useState)(n[0]?.id??``),f=q(e=>e.getItemDataCopy),p=q(e=>e.updateItem),h=q(e=>e.commitByUser),{navigateToItem:g}=oD(),_=rD(e=>e.navigate),v=tD(),y=eD(),b=cD(e)??`#404040`,x={accent:b,background:`${b}08`,border:`${b}25`},S={itemKeyUpdated:s(`itemKeyUpdated`),itemKeyUpdateFailed:s(`itemKeyUpdateFailed`),itemLabelUpdated:s(`itemLabelUpdated`),preview:s(`preview`),comingSoon:s(`comingSoon`),comingSoonDescription:s(`comingSoonDescription`)},C=pD(lD(e)),w=v?.getParentItem(e.id),T=v?.rootItem?.id===e.id,E=(w?.items??[]).filter(t=>t!==e.id).map(e=>v?.getItemKey(e)?.itemKey).filter(e=>!!e),D=n.some(e=>e.id===l)?l:n[0]?.id??``,O=i?.map(t=>{let n=t.id===`conditions`||t.id===`prefill-rules`,r=t.id===`conditions`?`conditions`:`prefills`,i=t.content??(n?(0,m.jsx)(GO,{item:e,scope:r,compact:!0}):void 0),a=t.headerAction??(t.id===`conditions`&&PO(e,`conditions`)>0?(0,m.jsx)(UO,{item:e,title:s(`expressions.allConditions`),scope:`conditions`}):void 0);return{...t,content:i,headerAction:a}});$E(e=>{e.defaultPrevented||e.key!==`ArrowUp`||!e.metaKey||!e.shiftKey||e.ctrlKey||e.altKey||!w||(e.preventDefault(),g(w.id))},{enabled:!!w});let{isArmed:k}=RD({armKey:`v`,enabled:c&&n.length>1,maxIndex:Math.min(n.length,9),onSelectIndex:e=>{let t=n[e];t&&u(t.id)}});if(!y||!v)return null;let A=t=>{try{p(e.id,{key:t}),h({label:o(`updateItemKey`)}),OE.success(S.itemKeyUpdated)}catch(e){console.error(`Failed to update item key:`,e);let t=e instanceof Error?e.message:S.itemKeyUpdateFailed;OE.error(t)}},j=t=>{let n=f(e.id);n&&(n.metadata={...n.metadata,itemLabel:t},p(e.id,n),h({label:o(`updateItemLabel`)}),OE.success(S.itemLabelUpdated))},M=c?a:(0,m.jsx)(ZO,{sidePanelCards:O,colors:x,labels:S,children:a}),N=(0,m.jsxs)(`div`,{className:`@container/editor-card flex h-full w-full min-h-0 flex-col overflow-hidden bg-(--surface-bg-color)`,children:[(0,m.jsx)(`div`,{className:`shrink-0 border-b border-border`,style:{backgroundColor:x.background,borderColor:x.border},children:(0,m.jsxs)(`div`,{className:`flex min-h-9 w-full shrink-0 flex-wrap items-center gap-1.5 px-4 py-0.5`,children:[(0,m.jsx)(gD,{label:S.preview,onClick:()=>_({view:`preview-mode`,itemId:e.id})}),(0,m.jsx)(`div`,{className:`mx-1 h-4 w-px shrink-0 bg-border`,"aria-hidden":!0}),C?(0,m.jsx)(`div`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md text-white`,style:{backgroundColor:x.accent},children:(0,m.jsx)(qO,{typeInfos:C,color:`#ffffff`,iconClassName:`size-3.5`})}):null,(0,m.jsx)(hD,{className:`contents`,children:(0,m.jsx)($D,{itemId:e.id,currentItemKey:y.survey.getItemKey(e.id),siblingKeys:E,onChangeItemKey:A})}),T?null:(0,m.jsx)(`div`,{className:`order-last min-w-0 basis-full sm:order-0 sm:basis-auto sm:pt-0`,children:(0,m.jsx)(hD,{className:`contents`,children:(0,m.jsx)(iO,{itemId:e.id,itemType:e.type,maxSuggestions:5,className:`w-full justify-start text-left sm:w-auto`,itemLabel:e.metadata?.itemLabel??``,onChangeItemLabel:j})})}),(0,m.jsx)(`span`,{className:`flex-1`}),(0,m.jsx)(hD,{className:`contents`,children:(0,m.jsxs)(iE,{children:[(0,m.jsx)(aE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon`,className:`size-8 rounded-md text-foreground hover:bg-black/5 focus-visible:ring-ring/40`,children:(0,m.jsx)(Fw,{className:`size-4`})})}),(0,m.jsx)(JO,{itemId:e.id,menu:t})]})}),(0,m.jsx)(`div`,{className:`-me-3 hidden @lg/editor-card:block`,children:(0,m.jsx)(KO,{itemId:e.id})})]})}),c?(0,m.jsx)(YO,{navItems:n,activeMode:D,showShortcutNumbers:k,colors:x}):null,(0,m.jsx)(hD,{className:`min-h-0 flex-1`,children:M})]});return c?(0,m.jsx)(YE,{value:D,onValueChange:u,className:`h-full w-full`,children:N}):N},$O=e=>{let t=J(`defaultEditors.group`),n=J(`history`),r=q(e=>e.getItemDataCopy),i=q(e=>e.updateItem),a=q(e=>e.commitByUser),o=e.item instanceof u.st?e.item:null;return(0,m.jsx)(QO,{surveyItem:e.item,menu:{items:[(0,m.jsx)(JE,{itemId:e.item.id},`copy-item`)]},layoutVariant:`stacked`,children:(0,m.jsx)(`div`,{className:`h-full min-h-0 overflow-y-auto`,children:(0,m.jsxs)(`div`,{className:`mx-auto flex w-full max-w-3xl flex-col gap-6 p-4`,children:[(0,m.jsxs)(`section`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`settingsTitle`)}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`settingsDescription`)})]}),(0,m.jsxs)(ZT,{orientation:`horizontal`,className:`rounded-xl border border-border bg-muted/20 p-4`,children:[(0,m.jsxs)(QT,{children:[(0,m.jsx)(eE,{children:t(`shuffleItemsLabel`)}),(0,m.jsx)(tE,{children:t(`shuffleItemsDescription`)})]}),(0,m.jsx)(rE,{checked:o?.shuffleItems??!1,onCheckedChange:e=>{if(!o||o.shuffleItems===e)return;let t={...r(o.id).config,shuffleItems:e};i(o.id,{config:t}),a({label:n(`updateGroupSettings`)})},"aria-label":t(`shuffleItemsLabel`)})]})]}),(0,m.jsx)(KT,{}),(0,m.jsxs)(`section`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`conditionsTitle`)}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`conditionsDescription`)})]}),(0,m.jsx)(GO,{item:e.item,scope:`conditions`})]})]})})})},ek=e=>{let t=J(`defaultEditors.pageBreak`),n=PO(e.item,`conditions`),r=[{id:`branching`,label:t(`branching`),icon:Gw,hasIndicator:n>0,indicatorCount:n}];return(0,m.jsx)(QO,{surveyItem:e.item,menu:{items:[(0,m.jsx)(JE,{itemId:e.item.id},`copy-item`)]},navItems:r,children:(0,m.jsx)(QE,{value:`branching`,className:`h-full min-h-0 overflow-y-auto p-4`,children:(0,m.jsxs)(`div`,{className:`space-y-4 rounded-xl border border-border bg-muted/20 p-4`,children:[(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:t(`title`)}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`description`)})]}),(0,m.jsx)(GO,{item:e.item,scope:`conditions`})]})})})},tk=Symbol.for(`preact-signals`);function nk(){if(ck>1)ck--;else{var e,t=!1;for((function(){var e=fk;for(fk=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o})();sk!==void 0;){var n=sk;for(sk=void 0,lk++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&_k(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(lk=0,ck--,t)throw e}}function rk(e){if(ck>0)return e();dk=++uk,ck++;try{return e()}finally{nk()}}var ik=void 0;function ak(e){var t=ik;ik=void 0;try{return e()}finally{ik=t}}var ok,sk=void 0,ck=0,lk=0,uk=0,dk=0,fk=void 0,pk=0;function mk(e){if(ik!==void 0){var t=e.n;if(t===void 0||t.t!==ik)return t={i:0,S:e,p:ik.s,n:void 0,t:ik,e:void 0,x:void 0,r:t},ik.s!==void 0&&(ik.s.n=t),ik.s=t,e.n=t,32&ik.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=ik.s,t.n=void 0,ik.s.n=t,ik.s=t),t}}function hk(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}hk.prototype.brand=tk,hk.prototype.h=function(){return!0},hk.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?ak(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},hk.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&ak(function(){var e;(e=t.Z)==null||e.call(t)}))}},hk.prototype.subscribe=function(e){var t=this;return Ek(function(){var n=t.value,r=ik;ik=void 0;try{e(n)}finally{ik=r}},{name:`sub`})},hk.prototype.valueOf=function(){return this.value},hk.prototype.toString=function(){return this.value+``},hk.prototype.toJSON=function(){return this.value},hk.prototype.peek=function(){var e=this;return ak(function(){return e.value})},Object.defineProperty(hk.prototype,`value`,{get:function(){var e=mk(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(lk>100)throw Error(`Cycle detected`);(function(e){ck!==0&&lk===0&&e.l!==dk&&(e.l=dk,fk={S:e,v:e.v,i:e.i,o:fk})})(this),this.v=e,this.i++,pk++,ck++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{nk()}}}});function gk(e,t){return new hk(e,t)}function _k(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function vk(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function yk(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function bk(e,t){hk.call(this,void 0),this.x=e,this.s=void 0,this.g=pk-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}bk.prototype=new hk,bk.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===pk))return!0;if(this.g=pk,this.f|=1,this.i>0&&!_k(this))return this.f&=-2,!0;var e=ik;try{vk(this),ik=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ik=e,yk(this),this.f&=-2,!0},bk.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}hk.prototype.S.call(this,e)},bk.prototype.U=function(e){if(this.t!==void 0&&(hk.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},bk.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(bk.prototype,`value`,{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=mk(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function xk(e,t){return new bk(e,t)}function Sk(e){var t=e.m;if(e.m=void 0,typeof t==`function`){ck++;var n=ik;ik=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Ck(e),t}finally{ik=n,nk()}}}function Ck(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Sk(e)}function wk(e){if(ik!==this)throw Error(`Out-of-order effect`);yk(this),ik=e,this.f&=-2,8&this.f&&Ck(this),nk()}function Tk(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,ok&&ok.push(this)}Tk.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.m=t)}finally{e()}},Tk.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,Sk(this),vk(this),ck++;var e=ik;return ik=this,wk.bind(this,e)},Tk.prototype.N=function(){2&this.f||(this.f|=2,this.u=sk,sk=this)},Tk.prototype.d=function(){this.f|=8,1&this.f||Ck(this)},Tk.prototype.dispose=function(){this.d()};function Ek(e,t){var n=new Tk(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}var Dk=Object.create,Ok=Object.defineProperty,kk=Object.defineProperties,Ak=Object.getOwnPropertyDescriptor,jk=Object.getOwnPropertyDescriptors,Mk=Object.getOwnPropertySymbols,Nk=Object.prototype.hasOwnProperty,Pk=Object.prototype.propertyIsEnumerable,Fk=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),Ik=e=>{throw TypeError(e)},Lk=(e,t,n)=>t in e?Ok(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rk=(e,t)=>{for(var n in t||={})Nk.call(t,n)&&Lk(e,n,t[n]);if(Mk)for(var n of Mk(t))Pk.call(t,n)&&Lk(e,n,t[n]);return e},zk=(e,t)=>kk(e,jk(t)),Bk=(e,t)=>Ok(e,`name`,{value:t,configurable:!0}),Vk=e=>[,,,Dk(e?.[Fk(`metadata`)]??null)],Hk=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Uk=e=>e!==void 0&&typeof e!=`function`?Ik(`Function expected`):e,Wk=(e,t,n,r,i)=>({kind:Hk[e],name:t,metadata:r,addInitializer:e=>n._?Ik(`Already initialized`):i.push(Uk(e||null))}),Gk=(e,t)=>Lk(t,Fk(`metadata`),e[3]),Kk=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},qk=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=Hk[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&Ak(d<4?i:{get[n](){return Xk(this,a)},set[n](e){return Qk(this,a,e)}},n));d?p&&d<4&&Bk(a,(d>2?`set `:d>1?`get `:``)+n):Bk(i,n);for(var y=r.length-1;y>=0;y--)l=Wk(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Yk(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?Xk:$k)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Qk(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Uk(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?Ik(`Object expected`):(Uk(o=s.get)&&(v.get=o),Uk(o=s.set)&&(v.set=o),Uk(o=s.init)&&g.unshift(o));return d||Gk(e,i),v&&Ok(i,n,v),p?d^4?a:v:i},Jk=(e,t,n)=>t.has(e)||Ik(`Cannot `+n),Yk=(e,t)=>Object(t)===t?e.has(t):Ik(`Cannot use the "in" operator on this value`),Xk=(e,t,n)=>(Jk(e,t,`read from private field`),n?n.call(e):t.get(e)),Zk=(e,t,n)=>t.has(e)?Ik(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Qk=(e,t,n,r)=>(Jk(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),$k=(e,t,n)=>(Jk(e,t,`access private method`),n);function eA(e,t){if(t){let n;return xk(()=>{let r=e();return r&&n&&t(n,r)?n:(n=r,r)})}return xk(e)}function tA(e,t){if(Object.is(e,t))return!0;if(e===null||t===null)return!1;if(typeof e==`function`&&typeof t==`function`)return e===t;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(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:!e.some((e,n)=>!tA(e,t[n]));if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?!n.some(n=>!tA(e[n],t[n])):!1}return!1}function nA({get:e},t){return{init(e){return gk(e)},get(){return e.call(this).value},set(t){let n=e.call(this);n.peek()!==t&&(n.value=t)}}}function rA(e,t){let n=new WeakMap;return function(){let t=n.get(this);return t||(t=eA(e.bind(this)),n.set(this,t)),t.value}}function iA(e=!0){return function(t,n){n.addInitializer(function(){let t=n.kind===`field`||n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(t,n.name);r&&Object.defineProperty(t,n.name,zk(Rk({},r),{enumerable:e}))})}}function aA(...e){let t=e.map(e=>Ek(e));return()=>t.forEach(e=>e())}var oA,sA,cA,lA,uA,dA=[nA],fA,pA,mA,hA,gA,_A,vA,yA,bA,xA,SA,CA,wA,TA;uA=[nA],lA=[nA],cA=[iA()],sA=[iA()],oA=[iA()];var EA=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,Kk(fA,5,this),Zk(this,_A),Zk(this,pA,Kk(fA,8,this)),Kk(fA,11,this),Zk(this,vA,Kk(fA,12,this)),Kk(fA,15,this),Zk(this,SA,Kk(fA,16,this)),Kk(fA,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return Xk(this,_A,wA)}get initial(){return Xk(this,_A,hA)}get previous(){return Xk(this,_A,bA)}set current(e){let t=ak(()=>Xk(this,_A,wA));e&&t&&this.equals(t,e)||rk(()=>{Xk(this,_A,hA)||Qk(this,_A,e,gA),Qk(this,_A,t,xA),Qk(this,_A,e,TA)})}reset(e=this.defaultValue){rk(()=>{Qk(this,_A,void 0,xA),Qk(this,_A,e,gA),Qk(this,_A,e,TA)})}};fA=Vk(null),pA=new WeakMap,_A=new WeakSet,vA=new WeakMap,SA=new WeakMap,mA=qk(fA,20,`#initial`,dA,_A,pA),hA=mA.get,gA=mA.set,yA=qk(fA,20,`#previous`,uA,_A,vA),bA=yA.get,xA=yA.set,CA=qk(fA,20,`#current`,lA,_A,SA),wA=CA.get,TA=CA.set,qk(fA,2,`current`,cA,EA),qk(fA,2,`initial`,sA,EA),qk(fA,2,`previous`,oA,EA),Gk(fA,EA);function DA(e){return ak(()=>{let t={};for(let n in e)t[n]=e[n];return t})}var OA,kA=class{constructor(){Zk(this,OA,new WeakMap)}get(e,t){return e?Xk(this,OA).get(e)?.get(t):void 0}set(e,t,n){if(e)return Xk(this,OA).has(e)||Xk(this,OA).set(e,new Map),Xk(this,OA).get(e)?.set(t,n)}clear(e){return e?Xk(this,OA).get(e)?.clear():void 0}};OA=new WeakMap;var AA=Object.create,jA=Object.defineProperty,MA=Object.getOwnPropertyDescriptor,NA=Object.getOwnPropertySymbols,PA=Object.prototype.hasOwnProperty,FA=Object.prototype.propertyIsEnumerable,IA=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),LA=e=>{throw TypeError(e)},RA=Math.pow,zA=(e,t,n)=>t in e?jA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BA=(e,t)=>{for(var n in t||={})PA.call(t,n)&&zA(e,n,t[n]);if(NA)for(var n of NA(t))FA.call(t,n)&&zA(e,n,t[n]);return e},VA=(e,t)=>jA(e,`name`,{value:t,configurable:!0}),HA=e=>[,,,AA(e?.[IA(`metadata`)]??null)],UA=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],WA=e=>e!==void 0&&typeof e!=`function`?LA(`Function expected`):e,GA=(e,t,n,r,i)=>({kind:UA[e],name:t,metadata:r,addInitializer:e=>n._?LA(`Already initialized`):i.push(WA(e||null))}),KA=(e,t)=>zA(t,IA(`metadata`),e[3]),qA=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},JA=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=UA[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&MA(d<4?i:{get[n](){return ZA(this,a)},set[n](e){return $A(this,a,e)}},n));d?p&&d<4&&VA(a,(d>2?`set `:d>1?`get `:``)+n):VA(i,n);for(var y=r.length-1;y>=0;y--)l=GA(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>XA(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?ZA:ej)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>$A(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?WA(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?LA(`Object expected`):(WA(o=s.get)&&(v.get=o),WA(o=s.set)&&(v.set=o),WA(o=s.init)&&g.unshift(o));return d||KA(e,i),v&&jA(i,n,v),p?d^4?a:v:i},YA=(e,t,n)=>t.has(e)||LA(`Cannot `+n),XA=(e,t)=>Object(t)===t?e.has(t):LA(`Cannot use the "in" operator on this value`),ZA=(e,t,n)=>(YA(e,t,`read from private field`),n?n.call(e):t.get(e)),QA=(e,t,n)=>t.has(e)?LA(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),$A=(e,t,n,r)=>(YA(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ej=(e,t,n)=>(YA(e,t,`access private method`),n),tj=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},nj=class e{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){let{top:r,left:i,width:a,height:o,scale:s}=this,c=new e(i+t,r+n,a,o);return c.scale=BA({},s),c}get boundingRectangle(){let{width:e,height:t,left:n,top:r,right:i,bottom:a}=this;return{width:e,height:t,left:n,top:r,right:i,bottom:a}}get center(){let{left:e,top:t,right:n,bottom:r}=this;return new tj((e+n)/2,(t+r)/2)}get area(){let{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;let{left:n,top:r,width:i,height:a}=this;return n===t.left&&r===t.top&&i===t.width&&a===t.height}containsPoint(e){let{top:t,left:n,bottom:r,right:i}=this;return t<=e.y&&e.y<=r&&n<=e.x&&e.x<=i}intersectionArea(t){return t instanceof e?rj(this,t):0}intersectionRatio(e){let{area:t}=this,n=this.intersectionArea(e);return n/(e.area+t-n)}get bottom(){let{top:e,height:t}=this;return e+t}get right(){let{left:e,width:t}=this;return e+t}get aspectRatio(){let{width:e,height:t}=this;return e/t}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new e(n,t,r,i)}static delta(e,t,n={x:`center`,y:`center`}){let r=(e,t)=>{let r=n[t],i=t===`x`?e.left:e.top,a=t===`x`?e.width:e.height;return r==`start`?i:r==`end`?i+a:i+a/2};return tj.delta({x:r(e,`x`),y:r(e,`y`)},{x:r(t,`x`),y:r(t,`y`)})}static intersectionRatio(t,n){return e.from(t).intersectionRatio(e.from(n))}};function rj(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;return r<i&&n<a?o*s:0}var ij,aj,oj,sj,cj,lj=class extends (oj=EA,aj=[rA],ij=[rA],oj){constructor(e){let t=tj.from(e);super(t,(e,t)=>tj.equals(e,t)),qA(cj,5,this),QA(this,sj,0),this.velocity={x:0,y:0}}get delta(){return tj.delta(this.current,this.initial)}get direction(){let{current:e,previous:t}=this;if(!t)return null;let n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?`right`:`left`:n.y>0?`down`:`up`}get current(){return super.current}set current(e){let{current:t}=this,n=tj.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),a=i-ZA(this,sj),o=e=>Math.round(e/a*100);rk(()=>{$A(this,sj,i),this.velocity={x:o(r.x),y:o(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(tj.from(e)),this.velocity={x:0,y:0}}};cj=HA(oj),sj=new WeakMap,JA(cj,2,`delta`,aj,lj),JA(cj,2,`direction`,ij,lj),KA(cj,lj);function uj({x:e,y:t},n){let r=Math.abs(e),i=Math.abs(t);return typeof n==`number`?Math.sqrt(RA(r,2)+RA(i,2))>n:`x`in n&&`y`in n?r>n.x&&i>n.y:`x`in n?r>n.x:`y`in n?i>n.y:!1}var dj=(e=>(e.Horizontal=`x`,e.Vertical=`y`,e))(dj||{}),fj=Object.values(dj),pj=Object.create,mj=Object.defineProperty,hj=Object.defineProperties,gj=Object.getOwnPropertyDescriptor,_j=Object.getOwnPropertyDescriptors,vj=Object.getOwnPropertySymbols,yj=Object.prototype.hasOwnProperty,bj=Object.prototype.propertyIsEnumerable,xj=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),Sj=e=>{throw TypeError(e)},Cj=(e,t,n)=>t in e?mj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wj=(e,t)=>{for(var n in t||={})yj.call(t,n)&&Cj(e,n,t[n]);if(vj)for(var n of vj(t))bj.call(t,n)&&Cj(e,n,t[n]);return e},Tj=(e,t)=>hj(e,_j(t)),Ej=(e,t)=>mj(e,`name`,{value:t,configurable:!0}),Dj=(e,t)=>{var n={};for(var r in e)yj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vj)for(var r of vj(e))t.indexOf(r)<0&&bj.call(e,r)&&(n[r]=e[r]);return n},Oj=e=>[,,,pj(e?.[xj(`metadata`)]??null)],kj=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],Aj=e=>e!==void 0&&typeof e!=`function`?Sj(`Function expected`):e,jj=(e,t,n,r,i)=>({kind:kj[e],name:t,metadata:r,addInitializer:e=>n._?Sj(`Already initialized`):i.push(Aj(e||null))}),Mj=(e,t)=>Cj(t,xj(`metadata`),e[3]),Nj=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},Pj=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=kj[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&gj(d<4?i:{get[n](){return Lj(this,a)},set[n](e){return zj(this,a,e)}},n));d?p&&d<4&&Ej(a,(d>2?`set `:d>1?`get `:``)+n):Ej(i,n);for(var y=r.length-1;y>=0;y--)l=jj(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Ij(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?Lj:Bj)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>zj(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?Aj(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?Sj(`Object expected`):(Aj(o=s.get)&&(v.get=o),Aj(o=s.set)&&(v.set=o),Aj(o=s.init)&&g.unshift(o));return d||Mj(e,i),v&&mj(i,n,v),p?d^4?a:v:i},Fj=(e,t,n)=>t.has(e)||Sj(`Cannot `+n),Ij=(e,t)=>Object(t)===t?e.has(t):Sj(`Cannot use the "in" operator on this value`),Lj=(e,t,n)=>(Fj(e,t,`read from private field`),n?n.call(e):t.get(e)),Rj=(e,t,n)=>t.has(e)?Sj(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),zj=(e,t,n,r)=>(Fj(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Bj=(e,t,n)=>(Fj(e,t,`access private method`),n);function Vj(e,t){return{plugin:e,options:t}}function Hj(e){return t=>Vj(e,t)}function Uj(e){return typeof e==`function`?{plugin:e,options:void 0}:e}var Wj=[nA],Gj,Kj,qj,Jj=class{constructor(e,t){this.manager=e,this.options=t,Rj(this,Kj,Nj(Gj,8,this,!1)),Nj(Gj,11,this),Rj(this,qj,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return ak(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){let t=Ek(e.bind(this));return Lj(this,qj).add(t),t}destroy(){Lj(this,qj).forEach(e=>e())}static configure(e){return Vj(this,e)}};Gj=Oj(null),Kj=new WeakMap,qj=new WeakMap,Pj(Gj,4,`disabled`,Wj,Jj,Kj),Mj(Gj,Jj);var Yj=class extends Jj{},Xj,Zj=class{constructor(e){this.manager=e,this.instances=new Map,Rj(this,Xj,[])}get values(){return Array.from(this.instances.values())}set values(e){let t=e.map(Uj).reduce((e,t)=>{let n=e.find(({plugin:e})=>e===t.plugin);return n?(n.options=t.options,e):[...e,t]},[]),n=t.map(({plugin:e})=>e);for(let e of Lj(this,Xj))if(!n.includes(e)){if(e.prototype instanceof Yj)continue;this.unregister(e)}for(let{plugin:e,options:n}of t)this.register(e,n);zj(this,Xj,n)}get(e){return this.instances.get(e)}register(e,t){let n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;let r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){let t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(let e of this.instances.values())e.destroy();this.instances.clear()}};Xj=new WeakMap;function Qj(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}var $j=[],eM,tM,nM=class extends Jj{constructor(e){super(e),Rj(this,eM),Rj(this,tM),this.computeCollisions=this.computeCollisions.bind(this),zj(this,tM,gk($j)),this.destroy=aA(()=>{let e=this.computeCollisions(),t=ak(()=>this.manager.dragOperation.position.current);if(e!==$j){let e=Lj(this,eM);if(zj(this,eM,t),e&&t.x==e.x&&t.y==e.y)return}else zj(this,eM,void 0);Lj(this,tM).value=e},()=>{let{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){ak(()=>{e?Lj(this,tM).value=this.computeCollisions():zj(this,eM,void 0)})}computeCollisions(e,t){let{registry:n,dragOperation:r}=this.manager,{source:i,shape:a,status:o}=r;if(!o.initialized||!a)return $j;let s=[],c=[];for(let a of e??n.droppables){if(a.disabled||i&&!a.accepts(i))continue;let e=t??a.collisionDetector;if(!e)continue;c.push(a),a.shape;let n=ak(()=>e({droppable:a,dragOperation:r}));n&&(a.collisionPriority!=null&&(n.priority=a.collisionPriority),s.push(n))}return c.length===0?$j:(s.sort(Qj),s)}get collisions(){return Lj(this,tM).value}};eM=new WeakMap,tM=new WeakMap;var rM,iM,aM=[nA],oM,sM,cM,lM,uM,dM,fM;iM=[nA],rM=[nA];var pM=class e{constructor(e,t){Rj(this,lM,Nj(cM,8,this)),Nj(cM,11,this),Rj(this,uM),Rj(this,dM,Nj(cM,12,this)),Nj(cM,15,this),Rj(this,fM,Nj(cM,16,this)),Nj(cM,19,this);let{effects:n,id:r,data:i={},disabled:a=!1,register:o=!0}=e,s=r;zj(this,uM,gk(r)),this.manager=t,this.data=i,this.disabled=a,this.effects=()=>[()=>{let{id:e,manager:t}=this;if(e!==s)return s=e,t?.registry.register(this),()=>t?.registry.unregister(this)},...n?.()??[]],this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&o&&queueMicrotask(this.register)}get id(){let t=Lj(this,uM).value;return e.pendingIdChanges?.get(this)??t}set id(t){t!==(e.pendingIdChanges?.get(this)??Lj(this,uM).peek())&&(e.pendingIdChanges||(e.pendingIdChanges=new Map,queueMicrotask(()=>{var t;return Bj(t=e,oM,sM).call(t)})),e.pendingIdChanges.set(this,t))}register(){return this.manager?.registry.register(this)}unregister(){var e;(e=this.manager)==null||e.registry.unregister(this)}destroy(){var e;(e=this.manager)==null||e.registry.unregister(this)}};cM=Oj(null),oM=new WeakSet,sM=function(){let e=pM.pendingIdChanges;pM.pendingIdChanges=null,e&&rk(()=>{for(let[t,n]of e)Lj(t,uM).value=n})},lM=new WeakMap,uM=new WeakMap,dM=new WeakMap,fM=new WeakMap,Pj(cM,4,`manager`,aM,pM,lM),Pj(cM,4,`data`,iM,pM,dM),Pj(cM,4,`disabled`,rM,pM,fM),Rj(pM,oM),Mj(cM,pM),pM.pendingIdChanges=null;var mM=pM,hM=class{constructor(){this.map=gk(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{let n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;r&&r.id===e&&(this.cleanupFunctions.get(r)?.(),this.cleanupFunctions.delete(r));let a=new Map(n);for(let[r,i]of n)if(i===t&&r!==e){a.delete(r);break}a.set(e,t),this.map.value=a;let o=aA(...t.effects());return this.cleanupFunctions.set(t,o),i},this.unregister=(e,t)=>{let n=this.map.peek();if(n.get(e)!==t)return;this.cleanupFunctions.get(t)?.(),this.cleanupFunctions.delete(t);let r=new Map(n);r.delete(e),this.map.value=r}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(let e of this)this.cleanupFunctions.get(e)?.(),e.destroy();this.map.value=new Map}},gM,_M,vM,yM,bM,xM,SM,CM,wM,TM,EM,DM=class extends (SM=mM,xM=[nA],bM=[nA],yM=[nA],vM=[rA],_M=[rA],gM=[rA],SM){constructor(e,t){var n=e,{modifiers:r,type:i,sensors:a,plugins:o,effects:s}=n,c=Dj(n,[`modifiers`,`type`,`sensors`,`plugins`,`effects`]);super(Tj(wj({},c),{effects:()=>[...s?.()??[],()=>{let{manager:e,plugins:t}=this;if(!(!e||!t))for(let n of t){let{plugin:t}=Uj(n);e.registry.plugins.register(t)}}]}),t),Nj(CM,5,this),Rj(this,wM,Nj(CM,8,this)),Nj(CM,11,this),Rj(this,TM,Nj(CM,12,this)),Nj(CM,15,this),Rj(this,EM,Nj(CM,16,this,this.isDragSource?`dragging`:`idle`)),Nj(CM,19,this),this.type=i,this.sensors=a,this.modifiers=r,this.alignment=c.alignment,this.plugins=o}pluginConfig(e){if(this.plugins)for(let t of this.plugins){let n=Uj(t);if(n.plugin===e)return n.options}}get isDropping(){return this.status===`dropping`&&this.isDragSource}get isDragging(){return this.status===`dragging`&&this.isDragSource}get isDragSource(){return this.manager?.dragOperation.source?.id===this.id}};CM=Oj(SM),wM=new WeakMap,TM=new WeakMap,EM=new WeakMap,Pj(CM,4,`type`,xM,DM,wM),Pj(CM,4,`modifiers`,bM,DM,TM),Pj(CM,4,`status`,yM,DM,EM),Pj(CM,2,`isDropping`,vM,DM),Pj(CM,2,`isDragging`,_M,DM),Pj(CM,2,`isDragSource`,gM,DM),Mj(CM,DM);var OM,kM,AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM,VM=class extends (PM=mM,NM=[nA],MM=[nA],jM=[nA],AM=[nA],kM=[nA],OM=[rA],PM){constructor(e,t){var n=e,{accept:r,collisionDetector:i,collisionPriority:a,type:o}=n,s=Dj(n,[`accept`,`collisionDetector`,`collisionPriority`,`type`]);super(s,t),Nj(FM,5,this),Rj(this,IM,Nj(FM,8,this)),Nj(FM,11,this),Rj(this,LM,Nj(FM,12,this)),Nj(FM,15,this),Rj(this,RM,Nj(FM,16,this)),Nj(FM,19,this),Rj(this,zM,Nj(FM,20,this)),Nj(FM,23,this),Rj(this,BM,Nj(FM,24,this)),Nj(FM,27,this),this.accept=r,this.collisionDetector=i,this.collisionPriority=a,this.type=o}accepts(e){let{accept:t}=this;return t?typeof t==`function`?t(e):e.type?Array.isArray(t)?t.includes(e.type):e.type===t:!1:!0}get isDropTarget(){return this.manager?.dragOperation.target?.id===this.id}};FM=Oj(PM),IM=new WeakMap,LM=new WeakMap,RM=new WeakMap,zM=new WeakMap,BM=new WeakMap,Pj(FM,4,`accept`,NM,VM,IM),Pj(FM,4,`type`,MM,VM,LM),Pj(FM,4,`collisionDetector`,jM,VM,RM),Pj(FM,4,`collisionPriority`,AM,VM,zM),Pj(FM,4,`shape`,kM,VM,BM),Pj(FM,2,`isDropTarget`,OM,VM),Mj(FM,VM);var HM=class{constructor(){this.registry=new Map}addEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){let{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){let{registry:n}=this,r=n.get(e);if(r)for(let e of r)e(...t)}},UM=class extends HM{constructor(e){super(),this.manager=e}dispatch(e,t){let n=[t,this.manager];super.dispatch(e,...n)}};function WM(e,t=!0){let n=!1;return Tj(wj({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var GM=class extends Yj{constructor(e){super(e);let t=(e,t)=>e.map(({id:e})=>e).join(``)===t.map(({id:e})=>e).join(``),n=[];this.destroy=aA(()=>{let{dragOperation:t,collisionObserver:r}=e;t.status.initializing&&(n=[],r.enable())},()=>{let{collisionObserver:r,monitor:i}=e,{collisions:a}=r;if(r.isDisabled()||mM.pendingIdChanges)return;let o=WM({collisions:a});if(i.dispatch(`collision`,o),o.defaultPrevented||t(a,n))return;n=a;let[s]=a;ak(()=>{s?.id!==e.dragOperation.target?.id&&(r.disable(),e.actions.setDropTarget(s?.id).then(()=>{r.enable()}))})})}},KM=(e=>(e[e.Lowest=0]=`Lowest`,e[e.Low=1]=`Low`,e[e.Normal=2]=`Normal`,e[e.High=3]=`High`,e[e.Highest=4]=`Highest`,e))(KM||{}),qM=(e=>(e[e.Collision=0]=`Collision`,e[e.ShapeIntersection=1]=`ShapeIntersection`,e[e.PointerIntersection=2]=`PointerIntersection`,e))(qM||{}),JM,YM,XM,ZM,QM,$M,eN=[nA],tN,nN;$M=[rA],QM=[rA],ZM=[rA],XM=[rA],YM=[rA],JM=[rA];var rN=class{constructor(){Nj(tN,5,this),Rj(this,nN,Nj(tN,8,this,`idle`)),Nj(tN,11,this)}get current(){return this.value}get idle(){return this.value===`idle`}get initializing(){return this.value===`initializing`}get initialized(){let{value:e}=this;return e!==`idle`&&e!==`initialization-pending`}get dragging(){return this.value===`dragging`}get dropped(){return this.value===`dropped`}set(e){this.value=e}};tN=Oj(null),nN=new WeakMap,Pj(tN,4,`value`,eN,rN,nN),Pj(tN,2,`current`,$M,rN),Pj(tN,2,`idle`,QM,rN),Pj(tN,2,`initializing`,ZM,rN),Pj(tN,2,`initialized`,XM,rN),Pj(tN,2,`dragging`,YM,rN),Pj(tN,2,`dropped`,JM,rN),Mj(tN,rN);var iN=class{constructor(e){this.manager=e}setDragSource(e){let{dragOperation:t}=this.manager;t.sourceIdentifier=typeof e==`string`||typeof e==`number`?e:e.id}setDropTarget(e){return ak(()=>{let{dragOperation:t}=this.manager,n=e??null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;let r=WM({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch(`dragover`,r),this.manager.renderer.rendering.then(()=>r.defaultPrevented)})}start(e){return ak(()=>{let{dragOperation:t}=this.manager;if(e.source!=null&&this.setDragSource(e.source),!t.source)throw Error(`Cannot start a drag operation without a drag source`);if(!t.status.idle)throw Error(`Cannot start a drag operation while another is active`);let n=new AbortController,{event:r,coordinates:i}=e;rk(()=>{t.status.set(`initialization-pending`),t.shape=null,t.canceled=!1,t.activatorEvent=r??null,t.position.reset(i)});let a=WM({operation:t.snapshot()});return this.manager.monitor.dispatch(`beforedragstart`,a),a.defaultPrevented?(t.reset(),n.abort(),n):(t.status.set(`initializing`),t.controller=n,this.manager.renderer.rendering.then(()=>{if(n.signal.aborted)return;let{status:e}=t;e.current===`initializing`&&rk(()=>{t.status.set(`dragging`),this.manager.monitor.dispatch(`dragstart`,{nativeEvent:r,operation:t.snapshot(),cancelable:!1})})}),n)})}move(e){return ak(()=>{let{dragOperation:t}=this.manager,{status:n,controller:r}=t;if(!n.dragging||!r||r.signal.aborted)return;let i=WM({nativeEvent:e.event,operation:t.snapshot(),by:e.by,to:e.to},e.cancelable??!0);(e.propagate??!0)&&this.manager.monitor.dispatch(`dragmove`,i),queueMicrotask(()=>{if(i.defaultPrevented)return;let n=e.to??{x:t.position.current.x+(e.by?.x??0),y:t.position.current.y+(e.by?.y??0)};t.position.current=n})})}stop(e={}){return ak(()=>{let{dragOperation:t}=this.manager,{controller:n}=t;if(!n||n.signal.aborted)return;let r,i=()=>{let e={resume:()=>{},abort:()=>{}};return r=new Promise((t,n)=>{e.resume=t,e.abort=n}),e};n.abort();let a=()=>{this.manager.renderer.rendering.then(()=>{t.status.set(`dropped`);let e=ak(()=>t.source?.status===`dropping`),r=()=>{t.controller===n&&(t.controller=void 0),t.reset()};if(e){let{source:e}=t,n=Ek(()=>{e?.status===`idle`&&(n(),r())})}else this.manager.renderer.rendering.then(r)})};t.canceled=e.canceled??!1,this.manager.monitor.dispatch(`dragend`,{nativeEvent:e.event,operation:t.snapshot(),canceled:e.canceled??!1,suspend:i}),r?r.then(a).catch(()=>t.reset()):a()})}},aN=class extends Jj{constructor(e,t){super(e,t),this.manager=e,this.options=t}},oN=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(let t of e??[])t.controller=this}onEvent(e){if(!this.activated)if(this.constraints?.length)for(let t of this.constraints)t.onEvent(e);else this.activate(e)}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},sN,cN=class{constructor(e){this.options=e,Rj(this,sN)}set controller(e){zj(this,sN,e),e.signal.addEventListener(`abort`,()=>this.abort())}activate(e){var t;(t=Lj(this,sN))==null||t.activate(e)}};sN=new WeakMap;var lN=class extends Jj{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},uN=class{constructor(e){this.draggables=new hM,this.droppables=new hM,this.plugins=new Zj(e),this.sensors=new Zj(e),this.modifiers=new Zj(e)}register(e,t){if(e instanceof DM)return this.draggables.register(e.id,e);if(e instanceof VM)return this.droppables.register(e.id,e);if(e.prototype instanceof lN)return this.modifiers.register(e,t);if(e.prototype instanceof aN)return this.sensors.register(e,t);if(e.prototype instanceof Jj)return this.plugins.register(e,t);throw Error(`Invalid instance type`)}unregister(e){if(e instanceof mM)return e instanceof DM?this.draggables.unregister(e.id,e):e instanceof VM?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof lN)return this.modifiers.unregister(e);if(e.prototype instanceof aN)return this.sensors.unregister(e);if(e.prototype instanceof Jj)return this.plugins.unregister(e);throw Error(`Invalid instance type`)}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}},dN,fN,pN,mN,hN,gN,_N,vN,yN=[rA],bN,xN,SN,CN,wN,TN,EN,DN,ON,kN;vN=[nA],_N=[nA],gN=[nA],hN=[nA],mN=[nA],pN=[rA],fN=[rA],dN=[rA];var AN=class{constructor(e){Nj(CN,5,this),Rj(this,bN),Rj(this,xN),Rj(this,SN,new EA(void 0,(e,t)=>e&&t?e.equals(t):e===t)),this.status=new rN,Rj(this,wN,Nj(CN,8,this,!1)),Nj(CN,11,this),Rj(this,TN,Nj(CN,12,this,null)),Nj(CN,15,this),Rj(this,EN,Nj(CN,16,this,null)),Nj(CN,19,this),Rj(this,DN,Nj(CN,20,this,null)),Nj(CN,23,this),Rj(this,ON,Nj(CN,24,this,[])),Nj(CN,27,this),this.position=new lj({x:0,y:0}),Rj(this,kN,{x:0,y:0}),zj(this,bN,e)}get shape(){let{current:e,initial:t,previous:n}=Lj(this,SN);return!e||!t?null:{current:e,initial:t,previous:n}}set shape(e){e?Lj(this,SN).current=e:Lj(this,SN).reset()}get source(){let e=this.sourceIdentifier;if(e==null)return null;let t=Lj(this,bN).registry.draggables.get(e);return t&&zj(this,xN,t),t??Lj(this,xN)??null}get target(){let e=this.targetIdentifier;return e==null?null:Lj(this,bN).registry.droppables.get(e)??null}get transform(){let{x:e,y:t}=this.position.delta,n={x:e,y:t};for(let e of this.modifiers)n=e.apply(Tj(wj({},this.snapshot()),{transform:n}));return zj(this,kN,n),n}snapshot(){return ak(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:Lj(this,kN),shape:this.shape?DA(this.shape):null,position:DA(this.position),status:DA(this.status),canceled:this.canceled}))}reset(){rk(()=>{this.status.set(`idle`),this.sourceIdentifier=null,this.targetIdentifier=null,Lj(this,SN).reset(),this.position.reset({x:0,y:0}),zj(this,kN,{x:0,y:0}),this.modifiers=[]})}};CN=Oj(null),bN=new WeakMap,xN=new WeakMap,SN=new WeakMap,wN=new WeakMap,TN=new WeakMap,EN=new WeakMap,DN=new WeakMap,ON=new WeakMap,kN=new WeakMap,Pj(CN,2,`shape`,yN,AN),Pj(CN,4,`canceled`,vN,AN,wN),Pj(CN,4,`activatorEvent`,_N,AN,TN),Pj(CN,4,`sourceIdentifier`,gN,AN,EN),Pj(CN,4,`targetIdentifier`,hN,AN,DN),Pj(CN,4,`modifiers`,mN,AN,ON),Pj(CN,2,`source`,pN,AN),Pj(CN,2,`target`,fN,AN),Pj(CN,2,`transform`,dN,AN),Mj(CN,AN);var jN={get rendering(){return Promise.resolve()}};function MN(e,t){return typeof e==`function`?e(t):e??t}var NN=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach(e=>e.destroy()),this.registry.destroy(),this.collisionObserver.destroy()};let t=e??{},n=MN(t.plugins,[]),r=MN(t.sensors,[]),i=MN(t.modifiers,[]),a=t.renderer??jN,o=new UM(this),s=new uN(this);this.registry=s,this.monitor=o,this.renderer=a,this.actions=new iN(this),this.dragOperation=new AN(this),this.collisionObserver=new nM(this),this.plugins=[GM,...n],this.modifiers=i,this.sensors=r;let{destroy:c}=this,l=aA(()=>{let e=ak(()=>this.dragOperation.modifiers),t=this.modifiers;for(let n of e)t.includes(n)||n.destroy();this.dragOperation.modifiers=(this.dragOperation.source?.modifiers)?.map(e=>{let{plugin:t,options:n}=Uj(e);return new t(this,n)})??t});this.destroy=()=>{l(),c()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},PN=e=>{throw TypeError(e)},FN=(e,t,n)=>t.has(e)||PN(`Cannot `+n),IN=(e,t,n)=>(FN(e,t,`read from private field`),t.get(e)),LN=(e,t,n)=>t.has(e)?PN(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),RN=(e,t,n,r)=>(FN(e,t,`write to private field`),t.set(e,n),n),zN=(e,t,n)=>(FN(e,t,`access private method`),n);function BN(e){return e?e instanceof KeyframeEffect?!0:`getKeyframes`in e&&typeof e.getKeyframes==`function`:!1}function VN(e,t){let n=e.getAnimations(),r=null;for(let e of n){if(e.playState!==`running`)continue;let{effect:n}=e,i=(BN(n)?n.getKeyframes():[]).filter(t);i.length>0&&(r=[i[i.length-1],e])}return r}function HN(e){let{width:t,height:n,top:r,left:i,bottom:a,right:o}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:a,right:o}}function UN(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function WN(e){return`nodeType`in e}function GN(e){return e?UN(e)?e:WN(e)?`defaultView`in e?e.defaultView??window:e.ownerDocument?.defaultView??window:window:window}function KN(e){let{Document:t}=GN(e);return e instanceof t||`nodeType`in e&&e.nodeType===Node.DOCUMENT_NODE}function qN(e){return!e||UN(e)?!1:e instanceof GN(e).HTMLElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`html`)}function JN(e){return e instanceof GN(e).SVGElement||`namespaceURI`in e&&typeof e.namespaceURI==`string`&&e.namespaceURI.endsWith(`svg`)}function YN(e){return e?UN(e)?e.document:WN(e)?KN(e)?e:qN(e)||JN(e)?e.ownerDocument:document:document:document}function XN(e){let{documentElement:t}=YN(e),n=GN(e).visualViewport,r=n?.width??t.clientWidth,i=n?.height??t.clientHeight,a=n?.offsetTop??0,o=n?.offsetLeft??0;return{top:a,left:o,right:o+r,bottom:a+i,width:r,height:i}}function ZN(e,t){if(QN(e)&&e.open===!1)return!1;let{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return n===`visible`&&r===`visible`&&i===`visible`}function QN(e){return e.tagName===`DETAILS`}function $N(e,t=e.getBoundingClientRect(),n=0){let r=t,{ownerDocument:i}=e,a=i.defaultView??window,o=e.parentElement;for(;o&&o!==i.documentElement;){if(!ZN(o)){let e=o.getBoundingClientRect(),t=n*(e.bottom-e.top),i=n*(e.right-e.left),a=n*(e.bottom-e.top),s=n*(e.right-e.left);r={top:Math.max(r.top,e.top-t),right:Math.min(r.right,e.right+i),bottom:Math.min(r.bottom,e.bottom+a),left:Math.max(r.left,e.left-s),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top}o=o.parentElement}let s=a.visualViewport,c=s?.offsetTop??0,l=s?.offsetLeft??0,u=s?.width??a.innerWidth,d=s?.height??a.innerHeight,f=n*d,p=n*u;return r={top:Math.max(r.top,c-f),right:Math.min(r.right,l+u+p),bottom:Math.min(r.bottom,c+d+f),left:Math.max(r.left,l-p),width:0,height:0},r.width=r.right-r.left,r.height=r.bottom-r.top,r.width<0&&(r.width=0),r.height<0&&(r.height=0),r}function eP(e){return{x:e.clientX,y:e.clientY}}var tP=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function nP(e=document,t=new Set){if(t.has(e))return[];t.add(e);let n=[e];for(let r of Array.from(e.querySelectorAll(`iframe, frame`)))try{let e=r.contentDocument;e&&!t.has(e)&&n.push(...nP(e,t))}catch{}try{let r=e.defaultView;if(r&&r!==window.top){let i=r.parent;i&&i.document&&i.document!==e&&n.push(...nP(i.document,t))}}catch{}return n}function rP(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function iP(){let e=rP()?window.visualViewport:null;return{x:e?.offsetLeft??0,y:e?.offsetTop??0}}function aP(e){return!e||!WN(e)?!1:e instanceof GN(e).ShadowRoot}function oP(e){if(e&&WN(e)){let t=e.getRootNode();if(aP(t)||t instanceof Document)return t}return YN(e)}function sP(e){return e.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function cP(e){let t=`input, textarea, select, canvas, [contenteditable]`,n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach((e,t)=>{let n=r[t];lP(e)&&lP(n)&&(e.type!==`file`&&(e.value=n.value),e.type===`radio`&&e.name&&(e.name=`Cloned__${e.name}`)),uP(e)&&uP(n)&&n.width>0&&n.height>0&&e.getContext(`2d`)?.drawImage(n,0,0)}),n}function lP(e){return`value`in e}function uP(e){return e.tagName===`CANVAS`}function dP(e,{x:t,y:n}){let r=e.elementFromPoint(t,n);if(fP(r)){let{contentDocument:e}=r;if(e){let{left:i,top:a}=r.getBoundingClientRect();return dP(e,{x:t-i,y:n-a})}}return r}function fP(e){return e?.tagName===`IFRAME`}var pP=new WeakMap;function mP(e){return!!e.closest(`
|
|
89
|
-
input:not([disabled]),
|
|
90
|
-
select:not([disabled]),
|
|
91
|
-
textarea:not([disabled]),
|
|
92
|
-
button:not([disabled]),
|
|
93
|
-
a[href],
|
|
94
|
-
[contenteditable]:not([contenteditable="false"])
|
|
95
|
-
`)}var hP=class{constructor(){this.entries=new Set,this.clear=()=>{for(let e of this.entries){let[t,{type:n,listener:r,options:i}]=e;t.removeEventListener(n,r,i)}this.entries.clear()}}bind(e,t){let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t],i=[];for(let e of n)for(let t of r){let{type:n,listener:r,options:a}=t,o=[e,t];e.addEventListener(n,r,a),this.entries.add(o),i.push(o)}let a=this.entries;return function(){for(let e of i){let[t,{type:n,listener:r,options:i}]=e;t.removeEventListener(n,r,i),a.delete(e)}}}};function gP(e){let t=e?.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function _P(e){let t=new Set,n=gP(e);for(;n;)t.add(n),n=gP(n);return t}function vP(e,t){let n=setTimeout(e,t);return()=>clearTimeout(n)}function yP(e,t){let n=()=>performance.now(),r,i;return function(...a){let o=this;i?(r?.(),r=vP(()=>{e.apply(o,a),i=n()},t-(n()-i))):(e.apply(o,a),i=n())}}function bP(e,t){return e===t?!0:!e||!t?!1:e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}function xP(e,t=e.getBoundingClientRect()){let{width:n,height:r}=$N(e,t);return n>0&&r>0}var SP=tP?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},CP,wP=class extends SP{constructor(e){super(t=>{if(!IN(this,CP)){RN(this,CP,!0);return}e(t,this)}),LN(this,CP,!1)}};CP=new WeakMap;var TP=Array.from({length:100},(e,t)=>t/100),EP=75,DP,OP,kP,AP,jP,MP,NP,PP,FP,IP,LP,RP=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,LN(this,FP),this.disconnect=()=>{var e,t,n;RN(this,NP,!0),(e=IN(this,kP))==null||e.disconnect(),(t=IN(this,AP))==null||t.disconnect(),IN(this,jP).disconnect(),(n=IN(this,MP))==null||n.remove()},LN(this,DP,!0),LN(this,OP),LN(this,kP),LN(this,AP),LN(this,jP),LN(this,MP),LN(this,NP,!1),LN(this,PP,yP(()=>{var e;let{element:t}=this;if((e=IN(this,AP))==null||e.disconnect(),IN(this,NP)||!IN(this,DP)||!t.isConnected)return;let n=t.ownerDocument??document,{innerHeight:r,innerWidth:i}=n.defaultView??window,a=t.getBoundingClientRect(),{top:o,left:s,bottom:c,right:l}=$N(t,a),u=-Math.floor(o),d=-Math.floor(s),f=`${u}px ${-Math.floor(i-l)}px ${-Math.floor(r-c)}px ${d}px`;this.boundingClientRect=a,RN(this,AP,new IntersectionObserver(e=>{let[n]=e,{intersectionRect:r}=n;(n.intersectionRatio===1?nj.intersectionRatio(r,$N(t)):n.intersectionRatio)!==1&&IN(this,PP).call(this)},{threshold:TP,rootMargin:f,root:n})),IN(this,AP).observe(t),zN(this,FP,IP).call(this)},EP)),this.boundingClientRect=e.getBoundingClientRect(),RN(this,DP,xP(e,this.boundingClientRect));let r=!0;this.callback=e=>{r&&(r=!1,n.skipInitial)||t(e)};let i=e.ownerDocument;n?.debug&&(RN(this,MP,document.createElement(`div`)),IN(this,MP).style.background=`rgba(0,0,0,0.15)`,IN(this,MP).style.position=`fixed`,IN(this,MP).style.pointerEvents=`none`,i.body.appendChild(IN(this,MP))),RN(this,jP,new IntersectionObserver(t=>{var n,r;let{boundingClientRect:i,isIntersecting:a}=t[t.length-1],{width:o,height:s}=i,c=IN(this,DP);RN(this,DP,a),!(!o&&!s)&&(c&&!a?((n=IN(this,AP))==null||n.disconnect(),this.callback(null),(r=IN(this,kP))==null||r.disconnect(),RN(this,kP,void 0),IN(this,MP)&&(IN(this,MP).style.visibility=`hidden`)):IN(this,PP).call(this),a&&!IN(this,kP)&&(RN(this,kP,new wP(IN(this,PP))),IN(this,kP).observe(e)))},{threshold:TP,root:i})),IN(this,DP)&&!n.skipInitial&&this.callback(this.boundingClientRect),IN(this,jP).observe(e)}};DP=new WeakMap,OP=new WeakMap,kP=new WeakMap,AP=new WeakMap,jP=new WeakMap,MP=new WeakMap,NP=new WeakMap,PP=new WeakMap,FP=new WeakSet,IP=function(){IN(this,NP)||(zN(this,FP,LP).call(this),!bP(this.boundingClientRect,IN(this,OP))&&(this.callback(this.boundingClientRect),RN(this,OP,this.boundingClientRect)))},LP=function(){if(IN(this,MP)){let{top:e,left:t,width:n,height:r}=$N(this.element);IN(this,MP).style.overflow=`hidden`,IN(this,MP).style.visibility=`visible`,IN(this,MP).style.top=`${Math.floor(e)}px`,IN(this,MP).style.left=`${Math.floor(t)}px`,IN(this,MP).style.width=`${Math.floor(n)}px`,IN(this,MP).style.height=`${Math.floor(r)}px`}};var zP=new WeakMap,BP=new WeakMap;function poe(e,t){let n=zP.get(e);return n||={disconnect:new RP(e,t=>{let n=zP.get(e);n&&n.callbacks.forEach(e=>e(t))},{skipInitial:!0}).disconnect,callbacks:new Set},n.callbacks.add(t),zP.set(e,n),()=>{n.callbacks.delete(t),n.callbacks.size===0&&(zP.delete(e),n.disconnect())}}function moe(e,t){let n=new Set;for(let r of e){let e=poe(r,t);n.add(e)}return()=>n.forEach(e=>e())}function hoe(e,t){let n=e.ownerDocument;if(!BP.has(n)){let e=new AbortController,t=new Set;document.addEventListener(`scroll`,e=>t.forEach(t=>t(e)),{capture:!0,passive:!0,signal:e.signal}),BP.set(n,{disconnect:()=>e.abort(),listeners:t})}let{listeners:r,disconnect:i}=BP.get(n)??{};return!r||!i?()=>{}:(r.add(t),()=>{r.delete(t),r.size===0&&(i(),BP.delete(n))})}var VP,HP,UP,WP,goe=class{constructor(e,t,n){this.callback=t,LN(this,VP),LN(this,HP,!1),LN(this,UP),LN(this,WP,yP(e=>{if(!IN(this,HP)&&e.target&&`contains`in e.target&&typeof e.target.contains==`function`){for(let t of IN(this,UP))if(e.target.contains(t)){this.callback(IN(this,VP).boundingClientRect);break}}},EP));let r=_P(e),i=moe(r,t),a=hoe(e,IN(this,WP));RN(this,UP,r),RN(this,VP,new RP(e,t,n)),this.disconnect=()=>{IN(this,HP)||(RN(this,HP,!0),i(),a(),IN(this,VP).disconnect())}}};VP=new WeakMap,HP=new WeakMap,UP=new WeakMap,WP=new WeakMap;function GP(e){return`showPopover`in e&&`hidePopover`in e&&typeof e.showPopover==`function`&&typeof e.hidePopover==`function`}function KP(e){try{GP(e)&&e.isConnected&&e.hasAttribute(`popover`)&&!e.matches(`:popover-open`)&&e.showPopover()}catch{}}function qP(e){return!tP||!e?!1:e===YN(e).scrollingElement}function JP(e){let t=GN(e),n=qP(e)?XN(e):HN(e),r=t.visualViewport,i=qP(e)?{height:r?.height??t.innerHeight,width:r?.width??t.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-i.width,y:e.scrollHeight-i.height}};return{rect:n,position:a,isTop:a.current.y<=0,isLeft:a.current.x<=0,isBottom:a.current.y>=a.max.y,isRight:a.current.x>=a.max.x}}function _oe(e,t){let{isTop:n,isBottom:r,isLeft:i,isRight:a,position:o}=JP(e),{x:s,y:c}=t??{x:0,y:0},l=!n&&o.current.y+c>0,u=!r&&o.current.y+c<o.max.y,d=!i&&o.current.x+s>0,f=!a&&o.current.x+s<o.max.x;return{top:l,bottom:u,left:d,right:f,x:d||f,y:l||u}}var YP=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{let{tasks:e,resolvers:t}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(let t of e)t();for(let e of t)e()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(e=>this.resolvers.add(e))}},XP=new YP(e=>{typeof requestAnimationFrame==`function`?requestAnimationFrame(e):e()}),voe=new YP(e=>setTimeout(e,50)),ZP=new Map,yoe=ZP.clear.bind(ZP);function QP(e,t=!1){if(!t)return $P(e);let n=ZP.get(e);return n||(n=$P(e),ZP.set(e,n),voe.schedule(yoe),n)}function $P(e){return GN(e).getComputedStyle(e)}function boe(e,t=QP(e,!0)){return t.position===`fixed`||t.position===`sticky`}function xoe(e,t=QP(e,!0)){let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}var Soe={excludeElement:!0,escapeShadowDOM:!0};function eF(e,t=Soe){let{limit:n,excludeElement:r,escapeShadowDOM:i}=t,a=new Set;function o(t){if(n!=null&&a.size>=n||!t)return a;if(KN(t)&&t.scrollingElement!=null&&!a.has(t.scrollingElement))return a.add(t.scrollingElement),a;if(i&&aP(t))return o(t.host);if(!qN(t))return JN(t)?o(t.parentElement):a;if(a.has(t))return a;let s=QP(t,!0);if(r&&t===e||xoe(t,s)&&a.add(t),boe(t,s)){let{scrollingElement:e}=t.ownerDocument;return e&&a.add(e),a}return o(t.parentNode)}return e?o(e):a}function tF(e,t=window.frameElement){let n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=gP(e);for(;r;){if(r===t)return n;let e=HN(r),{x:i,y:a}=Coe(r,e);n.x+=e.left,n.y+=e.top,n.scaleX*=i,n.scaleY*=a,r=gP(r)}return n}function Coe(e,t=HN(e)){let n=Math.round(t.width),r=Math.round(t.height);if(qN(e))return{x:n/e.offsetWidth,y:r/e.offsetHeight};let i=QP(e,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function woe(e){if(e===`none`)return null;let t=e.split(` `),n=parseFloat(t[0]),r=parseFloat(t[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}function nF(e){if(e===`none`)return null;let[t,n,r=`0`]=e.split(` `),i={x:parseFloat(t),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function rF(e){let{scale:t,transform:n,translate:r}=e,i=woe(t),a=nF(r),o=Toe(n);if(!o&&!i&&!a)return null;let s={x:i?.x??1,y:i?.y??1},c={x:a?.x??0,y:a?.y??0},l={x:o?.x??0,y:o?.y??0,scaleX:o?.scaleX??1,scaleY:o?.scaleY??1};return{x:c.x+l.x,y:c.y+l.y,z:a?.z??0,scaleX:s.x*l.scaleX,scaleY:s.y*l.scaleY}}function Toe(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var iF=(e=>(e[e.Idle=0]=`Idle`,e[e.Forward=1]=`Forward`,e[e.Reverse=-1]=`Reverse`,e))(iF||{}),Eoe={x:.2,y:.2},Doe={x:10,y:10};function Ooe(e,t,n,r=25,i=Eoe,a=Doe){let{x:o,y:s}=t,{rect:c,isTop:l,isBottom:u,isLeft:d,isRight:f}=JP(e),p=tF(e),m=rF(QP(e,!0)),h=m===null?!1:m?.scaleX<0,g=m===null?!1:m?.scaleY<0,_=new nj(c.left*p.scaleX+p.x,c.top*p.scaleY+p.y,c.width*p.scaleX,c.height*p.scaleY),v={x:0,y:0},y={x:0,y:0},b={height:_.height*i.y,width:_.width*i.x};return b.height>0&&(!l||g&&!u)&&s<=_.top+b.height&&n?.y!==1&&o>=_.left-a.x&&o<=_.right+a.x?(v.y=g?1:-1,y.y=r*Math.abs((_.top+b.height-s)/b.height)):b.height>0&&(!u||g&&!l)&&s>=_.bottom-b.height&&n?.y!==-1&&o>=_.left-a.x&&o<=_.right+a.x&&(v.y=g?-1:1,y.y=r*Math.abs((_.bottom-b.height-s)/b.height)),b.width>0&&(!f||h&&!d)&&o>=_.right-b.width&&n?.x!==-1&&s>=_.top-a.y&&s<=_.bottom+a.y?(v.x=h?-1:1,y.x=r*Math.abs((_.right-b.width-o)/b.width)):b.width>0&&(!d||h&&!f)&&o<=_.left+b.width&&n?.x!==1&&s>=_.top-a.y&&s<=_.bottom+a.y&&(v.x=h?1:-1,y.x=r*Math.abs((_.left+b.width-o)/b.width)),{direction:v,speed:y}}function aF(e,{block:t=`nearest`,inline:n=`nearest`}={}){if(!qN(e))return;let r=eF(e),i=[];for(let a of r){if(!qN(a))continue;let{top:r,left:o}=koe(e,a),s=r,c=o;for(let e of i)s-=e.scrollTop,c-=e.scrollLeft;if(t!==`none`){let n=s<a.scrollTop;n!==s+e.offsetHeight>a.scrollTop+a.clientHeight&&(t===`center`?a.scrollTop=s-a.clientHeight/2+e.offsetHeight/2:n?a.scrollTop=s:a.scrollTop=s+e.offsetHeight-a.clientHeight)}if(n!==`none`){let t=c<a.scrollLeft;t!==c+e.offsetWidth>a.scrollLeft+a.clientWidth&&(n===`center`?a.scrollLeft=c-a.clientWidth/2+e.offsetWidth/2:t?a.scrollLeft=c:a.scrollLeft=c+e.offsetWidth-a.clientWidth)}i.push(a)}}function oF(e){let t=0,n=0,r=e;for(;r;){t+=r.offsetTop,n+=r.offsetLeft;let e=r.offsetParent;if(!qN(e))break;t+=e.clientTop,n+=e.clientLeft,r=e}return{top:t,left:n}}function koe(e,t){let n=oF(e),r=oF(t);return{top:n.top-r.top-t.clientTop,left:n.left-r.left-t.clientLeft}}function Aoe(e,t,n){let{scaleX:r,scaleY:i,x:a,y:o}=t,s=e.left+a+(1-r)*parseFloat(n),c=e.top+o+(1-i)*parseFloat(n.slice(n.indexOf(` `)+1)),l=r?e.width*r:e.width,u=i?e.height*i:e.height;return{width:l,height:u,top:c,right:s+l,bottom:c+u,left:s}}function joe(e,t,n){let{scaleX:r,scaleY:i,x:a,y:o}=t,s=e.left-a-(1-r)*parseFloat(n),c=e.top-o-(1-i)*parseFloat(n.slice(n.indexOf(` `)+1)),l=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:l,height:u,top:c,right:s+l,bottom:c+u,left:s}}function sF({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function cF(e,t=QP(e).translate,n=!0){if(n){let t=VN(e,e=>`translate`in e);if(t){let{translate:e=``}=t[0];if(typeof e==`string`){let t=nF(e);if(t)return t}}}if(t){let e=nF(t);if(e)return e}return{x:0,y:0,z:0}}var Moe=new YP(e=>setTimeout(e,0)),lF=new Map,Noe=lF.clear.bind(lF);function Poe(e){let t=e.ownerDocument,n=lF.get(t);if(n)return n;n=t.getAnimations(),lF.set(t,n),Moe.schedule(Noe);let r=n.filter(t=>BN(t.effect)&&t.effect.target===e);return lF.set(e,r),n}function Foe(e,t){let n=Poe(e).filter(e=>{if(BN(e.effect)){let{target:n}=e.effect;if((n&&t.isValidTarget?.call(t,n))??!0)return e.effect.getKeyframes().some(e=>{for(let n of t.properties)if(e[n])return!0})}}).map(e=>{let{effect:t,currentTime:n}=e,r=t?.getComputedTiming().duration;if(!(e.pending||e.playState===`finished`)&&typeof r==`number`&&typeof n==`number`&&n<r)return e.currentTime=r,()=>{e.currentTime=n}});if(n.length>0)return()=>n.forEach(e=>e?.())}var uF=class extends nj{constructor(e,t={}){let{frameTransform:n=tF(e),ignoreTransforms:r,getBoundingClientRect:i=HN}=t,a=Foe(e,{properties:[`transform`,`translate`,`scale`,`width`,`height`],isValidTarget:t=>(t!==e||rP())&&t.contains(e)}),o=i(e),{top:s,left:c,width:l,height:u}=o,d,f=QP(e),p=rF(f),m={x:p?.scaleX??1,y:p?.scaleY??1},h=Ioe(e,f);a?.(),p&&(d=joe(o,p,f.transformOrigin),(r||h)&&(s=d.top,c=d.left,l=d.width,u=d.height));let g={width:d?.width??l,height:d?.height??u};if(h&&!r&&d){let e=Aoe(d,h,f.transformOrigin);s=e.top,c=e.left,l=e.width,u=e.height,m.x=h.scaleX,m.y=h.scaleY}n&&(r||(c*=n.scaleX,l*=n.scaleX,s*=n.scaleY,u*=n.scaleY),c+=n.x,s+=n.y),super(c,s,l,u),this.scale=m,this.intrinsicWidth=g.width,this.intrinsicHeight=g.height}};function Ioe(e,t){let n=e.getAnimations();if(!n.length)return null;let r,i,a,o=!1;for(let e of n){if(e.playState!==`running`)continue;let t=BN(e.effect)?e.effect.getKeyframes():[],n=t[t.length-1];if(!n)continue;let{transform:s,translate:c,scale:l}=n;typeof s==`string`&&s&&(r=s,o=!0),typeof c==`string`&&c&&(i=c,o=!0),typeof l==`string`&&l&&(a=l,o=!0)}return o?rF({transform:r??t.transform,translate:i??t.translate,scale:a??t.scale}):null}function dF(e){return`style`in e&&typeof e.style==`object`&&e.style!==null&&`setProperty`in e.style&&`removeProperty`in e.style&&typeof e.style.setProperty==`function`&&typeof e.style.removeProperty==`function`}var Loe=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=``){let{element:n}=this;if(dF(n))for(let[r,i]of Object.entries(e)){let e=`${t}${r}`;this.initial.has(e)||this.initial.set(e,n.style.getPropertyValue(e)),n.style.setProperty(e,typeof i==`string`?i:`${i}px`)}}remove(e,t=``){let{element:n}=this;if(dF(n))for(let r of e){let e=`${t}${r}`;n.style.removeProperty(e)}}reset(){let{element:e}=this;if(dF(e)){for(let[t,n]of this.initial)e.style.setProperty(t,n);e.getAttribute(`style`)===``&&e.removeAttribute(`style`)}}};function fF(e){return e?e instanceof GN(e).Element||WN(e)&&e.nodeType===Node.ELEMENT_NODE:!1}function pF(e){if(!e)return!1;let{KeyboardEvent:t}=GN(e.target);return e instanceof t}function Roe(e){if(!e)return!1;let{PointerEvent:t}=GN(e.target);return e instanceof t}function zoe(e){if(!fF(e))return!1;let{tagName:t}=e;return t===`INPUT`||t===`TEXTAREA`||Boe(e)}function Boe(e){return e.hasAttribute(`contenteditable`)&&e.getAttribute(`contenteditable`)!==`false`}var mF={};function hF(e){let t=mF[e]==null?0:mF[e]+1;return mF[e]=t,`${e}-${t}`}var Voe=({dragOperation:e,droppable:t})=>{let n=e.position.current;if(!n)return null;let{id:r}=t;return t.shape&&t.shape.containsPoint(n)?{id:r,value:1/tj.distance(t.shape.center,n),type:qM.PointerIntersection,priority:KM.High}:null},Hoe=({dragOperation:e,droppable:t})=>{let{shape:n}=e;if(!t.shape||!n?.current)return null;let r=n.current.intersectionArea(t.shape);if(r){let{position:i}=e,a=tj.distance(t.shape.center,i.current),o=r/(n.current.area+t.shape.area-r)/a;return{id:t.id,value:o,type:qM.ShapeIntersection,priority:KM.Normal}}return null},gF=e=>Voe(e)??Hoe(e),Uoe=e=>{let{dragOperation:t,droppable:n}=e,{shape:r,position:i}=t;if(!n.shape)return null;let a=r?nj.from(r.current.boundingRectangle).corners:void 0,o=nj.from(n.shape.boundingRectangle).corners.reduce((e,t,n)=>e+tj.distance(tj.from(t),a?.[n]??i.current),0)/4;return{id:n.id,value:1/o,type:qM.Collision,priority:KM.Normal}},Woe=Object.create,_F=Object.defineProperty,Goe=Object.defineProperties,Koe=Object.getOwnPropertyDescriptor,qoe=Object.getOwnPropertyDescriptors,vF=Object.getOwnPropertySymbols,yF=Object.prototype.hasOwnProperty,bF=Object.prototype.propertyIsEnumerable,xF=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),SF=e=>{throw TypeError(e)},CF=(e,t,n)=>t in e?_F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wF=(e,t)=>{for(var n in t||={})yF.call(t,n)&&CF(e,n,t[n]);if(vF)for(var n of vF(t))bF.call(t,n)&&CF(e,n,t[n]);return e},TF=(e,t)=>Goe(e,qoe(t)),EF=(e,t)=>_F(e,`name`,{value:t,configurable:!0}),DF=(e,t)=>{var n={};for(var r in e)yF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&vF)for(var r of vF(e))t.indexOf(r)<0&&bF.call(e,r)&&(n[r]=e[r]);return n},OF=e=>[,,,Woe(e?.[xF(`metadata`)]??null)],kF=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],AF=e=>e!==void 0&&typeof e!=`function`?SF(`Function expected`):e,Joe=(e,t,n,r,i)=>({kind:kF[e],name:t,metadata:r,addInitializer:e=>n._?SF(`Already initialized`):i.push(AF(e||null))}),jF=(e,t)=>CF(t,xF(`metadata`),e[3]),MF=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},NF=(e,t,n,r,i,a)=>{var o,s,c,l,u,d=t&7,f=!!(t&8),p=!!(t&16),m=d>3?e.length+1:d?f?1:2:0,h=kF[d+5],g=d>3&&(e[m-1]=[]),_=e[m]||(e[m]=[]),v=d&&(!p&&!f&&(i=i.prototype),d<5&&(d>3||!p)&&Koe(d<4?i:{get[n](){return FF(this,a)},set[n](e){return LF(this,a,e)}},n));d?p&&d<4&&EF(a,(d>2?`set `:d>1?`get `:``)+n):EF(i,n);for(var y=r.length-1;y>=0;y--)l=Joe(d,n,c={},e[3],_),d&&(l.static=f,l.private=p,u=l.access={has:p?e=>Yoe(i,e):e=>n in e},d^3&&(u.get=p?e=>(d^1?FF:RF)(e,i,d^4?a:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>LF(e,i,t,d^4?a:v.set):(e,t)=>e[n]=t)),s=(0,r[y])(d?d<4?p?a:v[h]:d>4?void 0:{get:v.get,set:v.set}:i,l),c._=1,d^4||s===void 0?AF(s)&&(d>4?g.unshift(s):d?p?a=s:v[h]=s:i=s):typeof s!=`object`||!s?SF(`Object expected`):(AF(o=s.get)&&(v.get=o),AF(o=s.set)&&(v.set=o),AF(o=s.init)&&g.unshift(o));return d||jF(e,i),v&&_F(i,n,v),p?d^4?a:v:i},PF=(e,t,n)=>t.has(e)||SF(`Cannot `+n),Yoe=(e,t)=>Object(t)===t?e.has(t):SF(`Cannot use the "in" operator on this value`),FF=(e,t,n)=>(PF(e,t,`read from private field`),n?n.call(e):t.get(e)),IF=(e,t,n)=>t.has(e)?SF(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),LF=(e,t,n,r)=>(PF(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),RF=(e,t,n)=>(PF(e,t,`access private method`),n),zF={role:`button`,roleDescription:`draggable`},Xoe=`dnd-kit-description`,Zoe=`dnd-kit-announcement`,Qoe={draggable:`To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel.`},$oe={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(!(!e||e.id===t?.id))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function ese(e){let t=e.tagName.toLowerCase();return[`input`,`select`,`textarea`,`a`,`button`].includes(t)}function tse(e,t){let n=document.createElement(`div`);return n.id=e,n.style.setProperty(`display`,`none`),n.textContent=t,n}function nse(e){let t=document.createElement(`div`);return t.id=e,t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-atomic`,`true`),t.style.setProperty(`position`,`fixed`),t.style.setProperty(`width`,`1px`),t.style.setProperty(`height`,`1px`),t.style.setProperty(`margin`,`-1px`),t.style.setProperty(`border`,`0`),t.style.setProperty(`padding`,`0`),t.style.setProperty(`overflow`,`hidden`),t.style.setProperty(`clip`,`rect(0 0 0 0)`),t.style.setProperty(`clip-path`,`inset(100%)`),t.style.setProperty(`white-space`,`nowrap`),t}var rse=[`dragover`,`dragmove`],ise=class extends Jj{constructor(e,t){super(e);let{id:n,idPrefix:{description:r=Xoe,announcement:i=Zoe}={},announcements:a=$oe,screenReaderInstructions:o=Qoe,debounce:s=500}=t??{},c=n?`${r}-${n}`:hF(r),l=n?`${i}-${n}`:hF(i),u,d,f,p,m=(e=p)=>{!f||!e||f?.nodeValue!==e&&(f.nodeValue=e)},h=()=>XP.schedule(m),g=ase(h,s),_=Object.entries(a).map(([e,t])=>this.manager.monitor.addEventListener(e,(n,r)=>{let i=f;if(!i)return;let a=t?.(n,r);a&&i.nodeValue!==a&&(p=a,rse.includes(e)?g():(h(),g.cancel()))})),v=()=>{let e=[];u?.isConnected||(u=tse(c,o.draggable),e.push(u)),d?.isConnected||(d=nse(l),f=document.createTextNode(``),d.appendChild(f),e.push(d)),e.length>0&&document.body.append(...e)},y=new Set;function b(){for(let e of y)e()}this.registerEffect(()=>{y.clear();for(let e of this.manager.registry.draggables.value){let t=e.handle??e.element;if(t){(!u||!d)&&y.add(v),(!ese(t)||rP())&&!t.hasAttribute(`tabindex`)&&y.add(()=>t.setAttribute(`tabindex`,`0`)),!t.hasAttribute(`role`)&&t.tagName.toLowerCase()!==`button`&&y.add(()=>t.setAttribute(`role`,zF.role)),t.hasAttribute(`aria-roledescription`)||y.add(()=>t.setAttribute(`aria-roledescription`,zF.roleDescription)),t.hasAttribute(`aria-describedby`)||y.add(()=>t.setAttribute(`aria-describedby`,c));for(let n of[`aria-pressed`,`aria-grabbed`]){let r=String(e.isDragging);t.getAttribute(n)!==r&&y.add(()=>t.setAttribute(n,r))}let n=String(e.disabled);t.getAttribute(`aria-disabled`)!==n&&y.add(()=>t.setAttribute(`aria-disabled`,n))}}y.size>0&&XP.schedule(b)}),this.destroy=()=>{super.destroy(),u?.remove(),d?.remove(),_.forEach(e=>e())}}};function ase(e,t){let n,r=()=>{clearTimeout(n),n=setTimeout(e,t)};return r.cancel=()=>clearTimeout(n),r}var BF=new Map,VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI=class extends (GF=Yj,WF=[nA],UF=[rA],HF=[rA],VF=[rA],GF){constructor(e,t){super(e,t),MF(qF,5,this),IF(this,YF),IF(this,KF,new Set),IF(this,JF,MF(qF,8,this,new Set)),MF(qF,11,this),this.registerEffect(RF(this,YF,XF))}register(e){return FF(this,KF).add(e),()=>{FF(this,KF).delete(e)}}addRoot(e){return ak(()=>{let t=new Set(this.additionalRoots);t.add(e),this.additionalRoots=t}),()=>{ak(()=>{let t=new Set(this.additionalRoots);t.delete(e),this.additionalRoots=t})}}get sourceRoot(){let{source:e}=this.manager.dragOperation;return oP(e?.element??null)}get targetRoot(){let{target:e}=this.manager.dragOperation;return oP(e?.element??null)}get roots(){let{status:e}=this.manager.dragOperation;if(e.initializing||e.initialized){let e=[this.sourceRoot,this.targetRoot].filter(e=>e!=null);return new Set([...e,...this.additionalRoots])}return new Set}};qF=OF(GF),KF=new WeakMap,JF=new WeakMap,YF=new WeakSet,XF=function(){let{roots:e}=this,t=[];for(let n of e)for(let e of FF(this,KF))t.push(RF(this,YF,ZF).call(this,n,e));return()=>{for(let e of t)e()}},ZF=function(e,t){let n=BF.get(e);n||(n=new Map,BF.set(e,n));let r=n.get(t);if(!r){let i=KN(e)?RF(this,YF,QF).call(this,e,n,t):RF(this,YF,$F).call(this,e,n,t);if(!i)return()=>{};r=i,n.set(t,r)}r.refCount++;let i=!1;return()=>{i||(i=!0,r.refCount--,r.refCount===0&&r.cleanup())}},QF=function(e,t,n){let r=e.createElement(`style`),{nonce:i}=this.options??{};i&&r.setAttribute(`nonce`,i),r.textContent=n,e.head.prepend(r);let a=new MutationObserver(t=>{for(let n of t)for(let t of Array.from(n.removedNodes))if(t===r){e.head.prepend(r);return}});return a.observe(e.head,{childList:!0}),{refCount:0,cleanup:()=>{a.disconnect(),r.remove(),t.delete(n),t.size===0&&BF.delete(e)}}},$F=function(e,t,n){!(`adoptedStyleSheets`in e&&Array.isArray(e.adoptedStyleSheets))&&process.env.NODE_ENV!==`production`&&console.error(`Cannot inject styles: This browser doesn't support adoptedStyleSheets`);let{CSSStyleSheet:r}=e.ownerDocument.defaultView??{};if(!r)return process.env.NODE_ENV!==`production`&&console.error(`Cannot inject styles: CSSStyleSheet constructor not available`),null;let i=new r;return i.replaceSync(n),e.adoptedStyleSheets.push(i),{refCount:0,cleanup:()=>{if(aP(e)&&e.host?.isConnected){let t=e.adoptedStyleSheets.indexOf(i);t!==-1&&e.adoptedStyleSheets.splice(t,1)}t.delete(n),t.size===0&&BF.delete(e)}}},NF(qF,4,`additionalRoots`,WF,eI,JF),NF(qF,2,`sourceRoot`,UF,eI),NF(qF,2,`targetRoot`,HF,eI),NF(qF,2,`roots`,VF,eI),jF(qF,eI),eI.configure=Hj(eI);var tI=eI,ose=class extends Jj{constructor(e,t){super(e,t),this.manager=e;let{cursor:n=`grabbing`}=t??{},r=e.registry.plugins.get(tI)?.register(`* { cursor: ${n} !important; }`);if(r){let e=this.destroy.bind(this);this.destroy=()=>{r(),e()}}}},nI=`data-dnd-`,rI=`${nI}dropping`,iI=`--dnd-`,aI=`${nI}dragging`,oI=`${nI}placeholder`,sse=[aI,oI,`popover`,`aria-pressed`,`aria-grabbing`],cse=[`view-transition-name`],lse=`
|
|
96
|
-
:is(:root,:host) [${aI}] {
|
|
97
|
-
position: fixed !important;
|
|
98
|
-
pointer-events: none !important;
|
|
99
|
-
touch-action: none;
|
|
100
|
-
z-index: calc(infinity);
|
|
101
|
-
will-change: translate;
|
|
102
|
-
top: var(${iI}top, 0px) !important;
|
|
103
|
-
left: var(${iI}left, 0px) !important;
|
|
104
|
-
right: unset !important;
|
|
105
|
-
bottom: unset !important;
|
|
106
|
-
width: var(${iI}width, auto);
|
|
107
|
-
max-width: var(${iI}width, auto);
|
|
108
|
-
height: var(${iI}height, auto);
|
|
109
|
-
max-height: var(${iI}height, auto);
|
|
110
|
-
transform: var(${iI}transform, none) !important;
|
|
111
|
-
transition: var(${iI}transition) !important;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
:is(:root,:host) [${oI}] {
|
|
115
|
-
transition: none;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
:is(:root,:host) [${oI}='hidden'] {
|
|
119
|
-
visibility: hidden;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
[${aI}] * {
|
|
123
|
-
pointer-events: none !important;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
[${aI}]:not([${rI}]) {
|
|
127
|
-
translate: var(${iI}translate) !important;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
[${aI}][style*='${iI}scale'] {
|
|
131
|
-
scale: var(${iI}scale) !important;
|
|
132
|
-
transform-origin: var(${iI}transform-origin) !important;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
@layer dnd-kit {
|
|
136
|
-
:where([${aI}][popover]) {
|
|
137
|
-
overflow: visible;
|
|
138
|
-
background: unset;
|
|
139
|
-
border: unset;
|
|
140
|
-
margin: unset;
|
|
141
|
-
padding: unset;
|
|
142
|
-
color: inherit;
|
|
143
|
-
|
|
144
|
-
&:is(input, button) {
|
|
145
|
-
border: revert;
|
|
146
|
-
background: revert;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
[${aI}]::backdrop, [${nI}overlay]:not([${aI}]) {
|
|
151
|
-
display: none;
|
|
152
|
-
visibility: hidden;
|
|
153
|
-
}
|
|
154
|
-
`.replace(/\n+/g,` `).replace(/\s+/g,` `).trim();function use(e,t=`hidden`){return ak(()=>{let{element:n,manager:r}=e;if(!n||!r)return;let i=dse(n,r.registry.droppables),a=[],o=cP(n),{remove:s}=o;return fse(i,o,a),pse(o,t),o.remove=()=>{a.forEach(e=>e()),s.call(o)},o})}function dse(e,t){let n=new Map;for(let r of t)if(r.element&&(e===r.element||e.contains(r.element))){let e=`${nI}${hF(`dom-id`)}`;r.element.setAttribute(e,``),n.set(r,e)}return n}function fse(e,t,n){for(let[r,i]of e){if(!r.element)continue;let e=`[${i}]`,a=t.matches(e)?t:t.querySelector(e);if(r.element.removeAttribute(i),!a)continue;let o=r.element;r.proxy=a,a.removeAttribute(i),pP.set(o,a),n.push(()=>{pP.delete(o),r.proxy=void 0})}}function pse(e,t=`hidden`){e.setAttribute(`inert`,`true`),e.setAttribute(`tab-index`,`-1`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(oI,t)}function sI(e,t){return e===t?!0:gP(e)===gP(t)}function cI(e){let{target:t}=e;`newState`in e&&e.newState===`closed`&&fF(t)&&t.hasAttribute(`popover`)&&requestAnimationFrame(()=>KP(t))}function lI(e){return e.tagName===`TR`}function mse(e,t,n){let r=new MutationObserver(r=>{let i=!1;for(let n of r){if(n.target!==e){i=!0;continue}if(n.type!==`attributes`)continue;let r=n.attributeName;if(r.startsWith(`aria-`)||sse.includes(r))continue;let a=e.getAttribute(r);if(r===`style`){if(dF(e)&&dF(t)){let n=e.style;for(let e of Array.from(t.style))n.getPropertyValue(e)===``&&t.style.removeProperty(e);for(let e of Array.from(n)){if(cse.includes(e)||e.startsWith(iI))continue;let r=n.getPropertyValue(e);t.style.setProperty(e,r)}}}else a===null?t.removeAttribute(r):t.setAttribute(r,a)}i&&n&&t.replaceChildren(...e.cloneNode(!0).childNodes)});return r.observe(e,{attributes:!0,subtree:!0,childList:!0}),r}function hse(e,t,n){let r=new MutationObserver(r=>{for(let i of r)if(i.addedNodes.length!==0)for(let r of Array.from(i.addedNodes)){if(r.contains(e)&&e.nextElementSibling!==t){e.insertAdjacentElement(`afterend`,t),KP(n);return}if(r.contains(t)&&t.previousElementSibling!==e){t.insertAdjacentElement(`beforebegin`,e),KP(n);return}}e.isConnected&&t.isConnected&&e.nextElementSibling!==t&&(e.insertAdjacentElement(`afterend`,t),KP(n))});return r.observe(e.ownerDocument.body,{childList:!0,subtree:!0}),r}function gse(e){return new ResizeObserver(()=>{var t;let n=new uF(e.placeholder,{frameTransform:e.frameTransform,ignoreTransforms:!0}),r=e.transformOrigin??{x:1,y:1},i=(e.width-n.width)*r.x+e.delta.x,a=(e.height-n.height)*r.y+e.delta.y,o=iP();if(e.styles.set({width:n.width-e.widthOffset,height:n.height-e.heightOffset,top:e.top+a+o.y,left:e.left+i+o.x},iI),(t=e.getElementMutationObserver())==null||t.takeRecords(),lI(e.element)&&lI(e.placeholder)){let t=Array.from(e.element.cells),n=Array.from(e.placeholder.cells);e.getSavedCellWidths()||e.setSavedCellWidths(t.map(e=>e.style.width));for(let[e,r]of t.entries()){let t=n[e];r.style.width=`${t.getBoundingClientRect().width}px`}}let s=e.getTranslate()??{x:0,y:0},c=e.left+i+o.x+s.x,l=e.top+a+o.y+s.y,u=n.width-e.widthOffset,d=n.height-e.heightOffset,f=e.frameTransform;e.dragOperation.shape=new nj(c*f.scaleX+f.x,l*f.scaleY+f.y,u*f.scaleX,d*f.scaleY)})}var _se=250,vse=`ease`;function yse(e){var t;let{animation:n}=e;if(typeof n==`function`){let t=n({source:e.source,element:e.element,feedbackElement:e.feedbackElement,placeholder:e.placeholder,translate:e.translate,moved:e.moved});Promise.resolve(t).then(()=>{e.cleanup(),requestAnimationFrame(e.restoreFocus)});return}let{duration:r=_se,easing:i=vse}=n??{};KP(e.feedbackElement);let[,a]=VN(e.feedbackElement,e=>`translate`in e)??[];a?.pause();let o=e.placeholder??e.element,s={frameTransform:sI(e.feedbackElement,o)?null:void 0},c=new uF(e.feedbackElement,s),l=nF(QP(e.feedbackElement).translate)??e.translate,u=new uF(o,s),d=nj.delta(c,u,e.alignment),f={x:l.x-d.x,y:l.y-d.y},p=Math.round(c.intrinsicHeight)===Math.round(u.intrinsicHeight)?{}:{minHeight:[`${c.intrinsicHeight}px`,`${u.intrinsicHeight}px`],maxHeight:[`${c.intrinsicHeight}px`,`${u.intrinsicHeight}px`]},m=Math.round(c.intrinsicWidth)===Math.round(u.intrinsicWidth)?{}:{minWidth:[`${c.intrinsicWidth}px`,`${u.intrinsicWidth}px`],maxWidth:[`${c.intrinsicWidth}px`,`${u.intrinsicWidth}px`]};e.styles.set({transition:e.transition},iI),e.feedbackElement.setAttribute(rI,``),(t=e.getElementMutationObserver())==null||t.takeRecords(),sF({element:e.feedbackElement,keyframes:TF(wF(wF({},p),m),{translate:[`${l.x}px ${l.y}px 0`,`${f.x}px ${f.y}px 0`]}),options:{duration:sP(GN(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?r:0,easing:i}}).then(()=>{e.feedbackElement.removeAttribute(rI),a?.finish(),e.cleanup(),requestAnimationFrame(e.restoreFocus)})}var uI,dI,fI,pI,mI,hI,gI,_I=class extends (dI=Jj,uI=[nA],dI){constructor(e,t){super(e,t),IF(this,mI),IF(this,pI,MF(fI,8,this)),MF(fI,11,this),this.state={initial:{},current:{}};let n=e.registry.plugins.get(tI),r=n?.register(lse);if(r){let e=this.destroy.bind(this);this.destroy=()=>{r(),e()}}this.registerEffect(RF(this,mI,hI).bind(this,n)),this.registerEffect(RF(this,mI,gI))}};fI=OF(dI),pI=new WeakMap,mI=new WeakSet,hI=function(e){let{overlay:t}=this;if(!t||!e)return;let n=oP(t);if(n)return e.addRoot(n)},gI=function(){let{state:e,manager:t,options:n}=this,{dragOperation:r}=t,{position:i,source:a,status:o}=r;if(o.idle){e.current={},e.initial={};return}if(!a)return;let{element:s}=a,c=a.pluginConfig(_I),l=c?.feedback??n?.feedback??`default`,u=typeof l==`function`?l(a,t):l;if(!s||u===`none`||!o.initialized||o.initializing)return;let{initial:d}=e,f=this.overlay??s,p=tF(f),m=tF(s),h=!sI(s,f),g=new uF(s,{frameTransform:h?m:null,ignoreTransforms:!h}),_={x:m.scaleX/p.scaleX,y:m.scaleY/p.scaleY},{width:v,height:y,top:b,left:x}=g;h&&(v/=_.x,y/=_.y);let S=new Loe(f),C=QP(s),{transition:w,translate:T,boxSizing:E,paddingBlockStart:D,paddingBlockEnd:O,paddingInlineStart:k,paddingInlineEnd:A,borderInlineStartWidth:j,borderInlineEndWidth:M,borderBlockStartWidth:N,borderBlockEndWidth:ee}=C,P=w.split(`,`).filter(e=>!/^\s*(transform|translate|scale)\b/.test(e)).join(`,`),F=rF(C),I=C.transform,L=u===`clone`,te=E===`content-box`,ne=te?parseInt(k)+parseInt(A)+parseInt(j)+parseInt(M):0,re=te?parseInt(D)+parseInt(O)+parseInt(N)+parseInt(ee):0,ie=u!==`move`&&!this.overlay?use(a,L?`clone`:`hidden`):null,ae=ak(()=>pF(t.dragOperation.activatorEvent));if(!d.translate){if(this.overlay&&F)d.translate={x:F.x,y:F.y};else if(T!==`none`){let e=nF(T);e&&(d.translate=e)}}if(!d.transformOrigin){let e=ak(()=>i.current),t=x+(F?.x??0),n=b+(F?.y??0);d.transformOrigin={x:(e.x-t*p.scaleX-p.x)/(v*p.scaleX),y:(e.y-n*p.scaleY-p.y)/(y*p.scaleY)}}let{transformOrigin:oe}=d,se=b*p.scaleY+p.y,ce=x*p.scaleX+p.x;if(!d.coordinates&&(d.coordinates={x:ce,y:se},_.x!==1||_.y!==1)){let{scaleX:e,scaleY:t}=m,{x:n,y:r}=oe;d.coordinates.x+=(v*e-v)*n,d.coordinates.y+=(y*t-y)*r}d.dimensions||={width:v,height:y},d.frameTransform||=p;let le={x:d.coordinates.x-ce,y:d.coordinates.y-se},ue={width:(d.dimensions.width*d.frameTransform.scaleX-v*p.scaleX)*oe.x,height:(d.dimensions.height*d.frameTransform.scaleY-y*p.scaleY)*oe.y},de={x:le.x/p.scaleX+ue.width,y:le.y/p.scaleY+ue.height},fe={left:x+de.x,top:b+de.y};f.setAttribute(aI,`true`);let pe=ak(()=>r.transform),me=d.translate??{x:0,y:0},he=pe.x*p.scaleX+me.x,ge=pe.y*p.scaleY+me.y,_e=iP();S.set({width:v-ne,height:y-re,top:fe.top+_e.y,left:fe.left+_e.x,translate:`${he}px ${ge}px 0`,transform:this.overlay?`none`:I,transition:P?`${P}, translate 0ms linear`:`translate 0ms linear`,scale:h?`${_.x} ${_.y}`:``,"transform-origin":`${oe.x*100}% ${oe.y*100}%`},iI),ie&&(s.insertAdjacentElement(`afterend`,ie),n?.rootElement&&(typeof n.rootElement==`function`?n.rootElement(a):n.rootElement).appendChild(s)),GP(f)&&(f.hasAttribute(`popover`)||f.setAttribute(`popover`,`manual`),KP(f),f.addEventListener(`beforetoggle`,cI));let ve,ye,be,xe=gse({placeholder:ie,element:s,feedbackElement:f,frameTransform:p,transformOrigin:oe,width:v,height:y,top:b,left:x,widthOffset:ne,heightOffset:re,delta:de,styles:S,dragOperation:r,getTranslate:()=>e.current.translate,getElementMutationObserver:()=>ve,getSavedCellWidths:()=>be,setSavedCellWidths:e=>{be=e}}),Se=new uF(f);ak(()=>r.shape=Se);let Ce=GN(f),we=e=>{this.manager.actions.stop({event:e})},Te=sP(Ce);ae&&Ce.addEventListener(`resize`,we),ak(()=>a.status)===`idle`&&requestAnimationFrame(()=>a.status=`dragging`),ie&&(xe.observe(ie),ve=mse(s,ie,L),ye=hse(s,ie,f));let Ee=t.dragOperation.source?.id,De=()=>{if(!ae||Ee==null)return;let e=t.registry.draggables.get(Ee),n=e?.handle??e?.element;qN(n)&&n.focus()},Oe=()=>{if(ve?.disconnect(),ye?.disconnect(),xe.disconnect(),Ce.removeEventListener(`resize`,we),GP(f)&&(f.removeEventListener(`beforetoggle`,cI),f.removeAttribute(`popover`)),f.removeAttribute(aI),S.reset(),be&&lI(s)){let e=Array.from(s.cells);for(let[t,n]of e.entries())n.style.width=be[t]??``}a.status=`idle`;let t=e.current.translate!=null,n=r.status.dragging;ie&&(!n&&t||ie.parentElement!==f.parentElement)&&f.isConnected&&ie.replaceWith(f),ie?.remove()},ke=n?.dropAnimation,Ae=this,je=aA(()=>{let{transform:t,status:i}=r;if(!(!t.x&&!t.y&&!e.current.translate)&&i.dragging){let i=d.translate??{x:0,y:0},a={x:t.x/p.scaleX+i.x,y:t.y/p.scaleY+i.y},o=e.current.translate,s=ak(()=>r.modifiers),c=ak(()=>r.shape?.current),l=n?.keyboardTransition,u=ae&&!Te&&l!==null?`${l?.duration??250}ms ${l?.easing??`cubic-bezier(0.25, 1, 0.5, 1)`}`:`0ms linear`;if(S.set({transition:P?`${P}, translate ${u}`:`translate ${u}`,translate:`${a.x}px ${a.y}px 0`},iI),ve?.takeRecords(),c&&c!==Se&&o&&!s.length){let e=tj.delta(a,o);r.shape=nj.from(c.boundingRectangle).translate(e.x*p.scaleX,e.y*p.scaleY)}else r.shape=new uF(f);e.current.translate=a}},function(){if(r.status.dropped){this.dispose(),a.status=`dropping`;let n=c?.dropAnimation===void 0?Ae.dropAnimation===void 0?ke:Ae.dropAnimation:c.dropAnimation,r=e.current.translate,i=r!=null;if(!r&&s!==f&&(r={x:0,y:0}),!r||n===null){Oe();return}t.renderer.rendering.then(()=>{yse({source:a,element:s,feedbackElement:f,placeholder:ie,translate:r,moved:i,transition:w,alignment:a.alignment,styles:S,animation:n??void 0,getElementMutationObserver:()=>ve,cleanup:Oe,restoreFocus:De})})}});return()=>{Oe(),je()}},NF(fI,4,`overlay`,uI,_I,pI),jF(fI,_I),_I.configure=Hj(_I);var vI=_I,yI=!0,bse=!1,bI,xI,SI,xse=(SI=[nA],iF.Forward),CI,wI,TI;xI=(bI=[nA],iF.Reverse);var EI=class{constructor(){IF(this,wI,MF(CI,8,this,yI)),MF(CI,11,this),IF(this,TI,MF(CI,12,this,yI)),MF(CI,15,this)}isLocked(e){return e===iF.Idle?!1:e==null?this[iF.Forward]===yI&&this[iF.Reverse]===yI:this[e]===yI}unlock(e){e!==iF.Idle&&(this[e]=bse)}};CI=OF(null),wI=new WeakMap,TI=new WeakMap,NF(CI,4,xse,SI,EI,wI),NF(CI,4,xI,bI,EI,TI),jF(CI,EI);var Sse=[iF.Forward,iF.Reverse],DI=class{constructor(){this.x=new EI,this.y=new EI}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},Cse=class extends Jj{constructor(e){super(e);let t=gk(new DI),n=null;this.signal=t,Ek(()=>{let{status:r}=e.dragOperation;if(!r.initialized){n=null,t.value=new DI;return}let{delta:i}=e.dragOperation.position;if(n){let e={x:OI(i.x,n.x),y:OI(i.y,n.y)},r=t.peek();rk(()=>{for(let t of fj)for(let n of Sse)e[t]===n&&r[t].unlock(n);t.value=r})}n=i})}get current(){return this.signal.peek()}};function OI(e,t){return Math.sign(e-t)}var kI,AI,jI,MI,NI,PI,FI=class extends (AI=Yj,kI=[nA],AI){constructor(e){super(e),IF(this,MI,MF(jI,8,this,!1)),MF(jI,11,this),IF(this,NI),IF(this,PI,()=>{if(!FF(this,NI))return;let{element:e,by:t}=FF(this,NI);t.y&&(e.scrollTop+=t.y),t.x&&(e.scrollLeft+=t.x)}),this.scroll=(e,t)=>{if(this.disabled)return!1;let n=this.getScrollableElements();if(!n)return LF(this,NI,void 0),!1;let{position:r}=this.manager.dragOperation,i=r?.current;if(i){let{by:r}=e??{},a=r?{x:II(r.x),y:II(r.y)}:void 0,o=a?void 0:this.scrollIntentTracker.current;if(o?.isLocked())return!1;for(let e of n){let n=_oe(e,r);if(n.x||n.y){let{speed:n,direction:s}=Ooe(e,i,a,t?.acceleration,t?.threshold);if(o)for(let e of fj)o[e].isLocked(s[e])&&(n[e]=0,s[e]=0);if(s.x||s.y){let{x:t,y:i}=r??s,a=t*n.x,o=i*n.y;if(a||o){let t=FF(this,NI)?.by;if(this.autoScrolling&&t&&(t.x&&!a||t.y&&!o))continue;return LF(this,NI,{element:e,by:{x:a,y:o}}),XP.schedule(FF(this,PI)),!0}}}}}return LF(this,NI,void 0),!1};let t=null,n=null,r=eA(()=>{let{position:n,source:r}=e.dragOperation;if(!n)return null;let i=dP(oP(r?.element),n.current);return i&&(t=i),i??t}),i=eA(()=>{let t=r.value,{documentElement:i}=YN(t);if(!t||t===i){let{target:t}=e.dragOperation,r=t?.element;if(r){let e=eF(r,{excludeElement:!1});return n=e,e}}if(t){let e=eF(t,{excludeElement:!1});return this.autoScrolling&&n&&e.size<n?.size?n:(n=e,e)}return n=null,null},tA);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new Cse(e),this.destroy=e.monitor.addEventListener(`dragmove`,t=>{this.disabled||t.defaultPrevented||!pF(e.dragOperation.activatorEvent)||!t.by||this.scroll({by:t.by})&&t.preventDefault()})}};jI=OF(AI),MI=new WeakMap,NI=new WeakMap,PI=new WeakMap,NF(jI,4,`autoScrolling`,kI,FI,MI),jF(jI,FI);function II(e){return e>0?iF.Forward:e<0?iF.Reverse:iF.Idle}var wse=new class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{let{tasks:e,resolvers:t}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(let t of e)t();for(let e of t)e()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise(e=>this.resolvers.add(e))}}(e=>{typeof requestAnimationFrame==`function`?requestAnimationFrame(e):e()}),Tse=10,LI=class extends Jj{constructor(e,t){super(e,t);let n=e.registry.plugins.get(FI);if(!n)throw Error(`AutoScroller plugin depends on Scroller plugin`);this.destroy=Ek(()=>{if(this.disabled)return;let{position:t,status:r}=e.dragOperation;if(r.dragging){let e={acceleration:this.options?.acceleration,threshold:typeof this.options?.threshold==`number`?{x:this.options.threshold,y:this.options.threshold}:this.options?.threshold};if(n.scroll(void 0,e)){n.autoScrolling=!0;let t=setInterval(()=>wse.schedule(()=>n.scroll(void 0,e)),Tse);return()=>{clearInterval(t)}}else n.autoScrolling=!1}})}};LI.configure=Hj(LI);var RI=LI,zI={capture:!0,passive:!0},BI,Ese=class extends Yj{constructor(e){super(e),IF(this,BI),this.handleScroll=()=>{FF(this,BI)??LF(this,BI,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),LF(this,BI,void 0)},50))};let{dragOperation:t}=this.manager;this.destroy=Ek(()=>{if(t.status.dragging){let e=t.source?.element?.ownerDocument??document;return e.addEventListener(`scroll`,this.handleScroll,zI),()=>{e.removeEventListener(`scroll`,this.handleScroll,zI)}}})}};BI=new WeakMap;var Dse=`* { user-select: none !important; -webkit-user-select: none !important; }`,Ose=class extends Jj{constructor(e){super(e),this.manager=e;let t=e.registry.plugins.get(tI)?.register(Dse);if(this.destroy=Ek(()=>{let{dragOperation:e}=this.manager;if(e.status.initialized)return VI(),document.addEventListener(`selectionchange`,VI,{capture:!0}),()=>{document.removeEventListener(`selectionchange`,VI,{capture:!0})}}),t){let e=this.destroy.bind(this);this.destroy=()=>{t(),e()}}}};function VI(){var e;(e=document.getSelection())==null||e.removeAllRanges()}var HI=Object.freeze({offset:10,keyboardCodes:{start:[`Space`,`Enter`],cancel:[`Escape`],end:[`Space`,`Enter`,`Tab`],up:[`ArrowUp`],down:[`ArrowDown`],left:[`ArrowLeft`],right:[`ArrowRight`]},preventActivation(e,t){let n=t.handle??t.element;return e.target!==n}}),UI,WI=class extends aN{constructor(e,t){super(e),this.manager=e,this.options=t,IF(this,UI,[]),this.listeners=new hP,this.handleSourceKeyDown=(e,t,n)=>{if(this.disabled||e.defaultPrevented||!fF(e.target)||t.disabled)return;let{keyboardCodes:r=HI.keyboardCodes,preventActivation:i=HI.preventActivation}=n??{};r.start.includes(e.code)&&this.manager.dragOperation.status.idle&&(i?.(e,t)||this.handleStart(e,t,n))}}bind(e,t=this.options){return Ek(()=>{let n=e.handle??e.element,r=n=>{pF(n)&&this.handleSourceKeyDown(n,e,t)};if(n)return n.addEventListener(`keydown`,r),()=>{n.removeEventListener(`keydown`,r)}})}handleStart(e,t,n){let{element:r}=t;if(!r)throw Error(`Source draggable does not have an associated element`);e.preventDefault(),e.stopImmediatePropagation(),aF(r);let{center:i}=new uF(r);if(this.manager.actions.start({event:e,coordinates:{x:i.x,y:i.y},source:t}).signal.aborted)return this.cleanup();this.sideEffects();let a=YN(r),o=[this.listeners.bind(a,[{type:`keydown`,listener:e=>this.handleKeyDown(e,t,n),options:{capture:!0}}])];FF(this,UI).push(...o)}handleKeyDown(e,t,n){let{keyboardCodes:r=HI.keyboardCodes}=n??{};if(GI(e,[...r.end,...r.cancel])){e.preventDefault();let t=GI(e,r.cancel);this.handleEnd(e,t);return}GI(e,r.up)?this.handleMove(`up`,e):GI(e,r.down)&&this.handleMove(`down`,e),GI(e,r.left)?this.handleMove(`left`,e):GI(e,r.right)&&this.handleMove(`right`,e)}handleEnd(e,t){this.manager.actions.stop({event:e,canceled:t}),this.cleanup()}handleMove(e,t){let{shape:n}=this.manager.dragOperation,r=t.shiftKey?5:1,i={x:0,y:0},a=this.options?.offset??HI.offset;if(typeof a==`number`&&(a={x:a,y:a}),n){switch(e){case`up`:i={x:0,y:-a.y*r};break;case`down`:i={x:0,y:a.y*r};break;case`left`:i={x:-a.x*r,y:0};break;case`right`:i={x:a.x*r,y:0};break}(i.x||i.y)&&(t.preventDefault(),this.manager.actions.move({event:t,by:i}))}}sideEffects(){let e=this.manager.registry.plugins.get(RI);e?.disabled===!1&&(e.disable(),FF(this,UI).push(()=>{e.enable()}))}cleanup(){FF(this,UI).forEach(e=>e()),LF(this,UI,[])}destroy(){this.cleanup(),this.listeners.clear()}};UI=new WeakMap,WI.configure=Hj(WI),WI.defaults=HI;var kse=WI;function GI(e,t){return t.includes(e.code)}var KI,Ase=class extends cN{constructor(){super(...arguments),IF(this,KI)}onEvent(e){switch(e.type){case`pointerdown`:LF(this,KI,eP(e));break;case`pointermove`:if(!FF(this,KI))return;let{x:t,y:n}=eP(e),r={x:t-FF(this,KI).x,y:n-FF(this,KI).y},{tolerance:i}=this.options;if(i&&uj(r,i)){this.abort();return}uj(r,this.options.value)&&this.activate(e);break;case`pointerup`:this.abort();break}}abort(){LF(this,KI,void 0)}};KI=new WeakMap;var qI,JI,jse=class extends cN{constructor(){super(...arguments),IF(this,qI),IF(this,JI)}onEvent(e){switch(e.type){case`pointerdown`:LF(this,JI,eP(e)),LF(this,qI,setTimeout(()=>this.activate(e),this.options.value));break;case`pointermove`:if(!FF(this,JI))return;let{x:t,y:n}=eP(e);uj({x:t-FF(this,JI).x,y:n-FF(this,JI).y},this.options.tolerance)&&this.abort();break;case`pointerup`:this.abort();break}}abort(){FF(this,qI)&&(clearTimeout(FF(this,qI)),LF(this,JI,void 0),LF(this,qI,void 0))}};qI=new WeakMap,JI=new WeakMap;var YI=class{};YI.Delay=jse,YI.Distance=Ase;var XI=Object.freeze({activationConstraints(e,t){let{pointerType:n,target:r}=e;if(!(n===`mouse`&&fF(r)&&(t.handle===r||t.handle?.contains(r))))return n===`touch`?[new YI.Delay({value:250,tolerance:5})]:zoe(r)&&!e.defaultPrevented?[new YI.Delay({value:200,tolerance:0})]:[new YI.Delay({value:200,tolerance:10}),new YI.Distance({value:5})]},preventActivation(e,t){let{target:n}=e;return n===t.element||n===t.handle||!fF(n)||t.handle?.contains(n)?!1:mP(n)}}),ZI,QI=class extends aN{constructor(e,t){super(e),this.manager=e,this.options=t,IF(this,ZI,new Set),this.listeners=new hP,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{let{event:e,coordinates:t}=this.latest;!e||!t||this.manager.actions.move({event:e,to:t})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(e,t,n=this.options){let{activationConstraints:r=XI.activationConstraints}=n??{};return typeof r==`function`?r(e,t):r}bind(e,t=this.options){return Ek(()=>{let n=new AbortController,{signal:r}=n,i=n=>{Roe(n)&&this.handlePointerDown(n,e,t)},a=[e.handle??e.element];t?.activatorElements&&(a=Array.isArray(t.activatorElements)?t.activatorElements:t.activatorElements(e));for(let e of a)e&&(Pse(e.ownerDocument.defaultView),e.addEventListener(`pointerdown`,i,{signal:r}));return()=>n.abort()})}handlePointerDown(e,t,n){if(this.disabled||!e.isPrimary||e.button!==0||!fF(e.target)||t.disabled||Mse(e)||!this.manager.dragOperation.status.idle)return;let{preventActivation:r=XI.preventActivation}=n??{};if(r?.(e,t))return;let{target:i}=e,a=qN(i)&&i.draggable&&i.getAttribute(`draggable`)===`true`,o=tF(t.element),{x:s,y:c}=eP(e);this.initialCoordinates={x:s*o.scaleX+o.x,y:c*o.scaleY+o.y};let l=this.activationConstraints(e,t,n);e.sensor=this;let u=new oN(l,e=>this.handleStart(t,e));u.signal.onabort=()=>this.handleCancel(e),u.onEvent(e),this.controller=u;let d=nP(),f=this.listeners.bind(d,[{type:`pointermove`,listener:e=>this.handlePointerMove(e,t)},{type:`pointerup`,listener:this.handlePointerUp,options:{capture:!0}},{type:`pointercancel`,listener:this.handleCancel},{type:`dragstart`,listener:a?this.handleCancel:eL,options:{capture:!0}}]);FF(this,ZI).add(()=>{f(),this.initialCoordinates=void 0})}handlePointerMove(e,t){var n;if(this.controller?.activated===!1){(n=this.controller)==null||n.onEvent(e);return}if(this.manager.dragOperation.status.dragging){let n=eP(e),r=tF(t.element);n.x=n.x*r.scaleX+r.x,n.y=n.y*r.scaleY+r.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=n,XP.schedule(this.handleMove)}}handlePointerUp(e){let{status:t}=this.manager.dragOperation;if(!t.idle){e.preventDefault(),e.stopPropagation();let n=!t.initialized;this.manager.actions.stop({event:e,canceled:n})}this.cleanup()}handleKeyDown(e){e.key===`Escape`&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,t){let{manager:n,initialCoordinates:r}=this;if(!r||!n.dragOperation.status.idle||t.defaultPrevented)return;if(n.actions.start({coordinates:r,event:t,source:e}).signal.aborted)return this.cleanup();t.preventDefault();let i=YN(t.target).body;try{i.setPointerCapture(t.pointerId)}catch{this.handleCancel(t);return}let a=fF(t.target)?[t.target,i]:i,o=this.listeners.bind(a,[{type:`touchmove`,listener:eL,options:{passive:!1}},{type:`click`,listener:eL},{type:`contextmenu`,listener:eL},{type:`keydown`,listener:this.handleKeyDown}]);FF(this,ZI).add(o)}handleCancel(e){let{dragOperation:t}=this.manager;t.status.initialized&&this.manager.actions.stop({event:e,canceled:!0}),this.cleanup()}cleanup(){let{controller:e}=this;this.controller=void 0,e&&!e.signal.aborted&&e.abort(),this.latest={event:void 0,coordinates:void 0},FF(this,ZI).forEach(e=>e()),FF(this,ZI).clear()}destroy(){this.cleanup(),this.listeners.clear()}};ZI=new WeakMap,QI.configure=Hj(QI),QI.defaults=XI;var $I=QI;function Mse(e){return`sensor`in e}function eL(e){e.preventDefault()}function Nse(){}var tL=new WeakSet;function Pse(e){!e||tL.has(e)||(e.addEventListener(`touchmove`,Nse,{capture:!1,passive:!1}),tL.add(e))}var nL={modifiers:[],plugins:[ise,RI,ose,vI,Ose],sensors:[$I,kse]},rL=class extends NN{constructor(e={}){let t=MN(e.plugins,nL.plugins),n=MN(e.sensors,nL.sensors),r=MN(e.modifiers,nL.modifiers);super(TF(wF({},e),{plugins:[Ese,FI,tI,...t],sensors:n,modifiers:r}))}},iL,aL,oL,sL,cL,lL,uL=class extends (oL=DM,aL=[nA],iL=[nA],oL){constructor(e,t){var n=e,{element:r,effects:i=()=>[],handle:a}=n,o=DF(n,[`element`,`effects`,`handle`]);super(wF({effects:()=>[...i(),()=>{let{manager:e}=this;if(!e)return;let t=(this.sensors?.map(Uj)??[...e.sensors]).map(t=>{let n=t instanceof aN?t:e.registry.register(t.plugin),r=t instanceof aN?void 0:t.options;return n.bind(this,r)});return function(){t.forEach(e=>e())}}]},o),t),IF(this,cL,MF(sL,8,this)),MF(sL,11,this),IF(this,lL,MF(sL,12,this)),MF(sL,15,this),this.element=r,this.handle=a}};sL=OF(oL),cL=new WeakMap,lL=new WeakMap,NF(sL,4,`handle`,aL,uL,cL),NF(sL,4,`element`,iL,uL,lL),jF(sL,uL);var dL,fL,pL,mL,hL,gL,_L,vL,yL,bL,xL=class extends (pL=VM,fL=[nA],dL=[nA],pL){constructor(e,t){var n=e,{element:r,effects:i=()=>[]}=n,a=DF(n,[`element`,`effects`]);let{collisionDetector:o=gF}=a,s=e=>{let{manager:t,element:n}=this;if(!n||e===null){this.shape=void 0;return}if(!t)return;let r=new uF(n),i=ak(()=>this.shape);return r&&i?.equals(r)?i:(this.shape=r,r)},c=gk(!1);super(TF(wF({},a),{collisionDetector:o,effects:()=>[...i(),()=>{let{element:e,manager:t}=this;if(!t)return;let{dragOperation:n}=t,{source:r}=n;c.value=!!(r&&n.status.initialized&&e&&!this.disabled&&this.accepts(r))},()=>{let{element:e}=this;if(c.value&&e){let t=new goe(e,s);return()=>{t.disconnect(),this.shape=void 0}}},()=>{if(this.manager?.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),IF(this,yL),IF(this,hL,MF(mL,8,this)),MF(mL,11,this),IF(this,bL,MF(mL,12,this)),MF(mL,15,this),this.element=r,this.refreshShape=()=>s()}set element(e){LF(this,yL,e,vL)}get element(){return this.proxy??FF(this,yL,_L)}};mL=OF(pL),hL=new WeakMap,yL=new WeakSet,bL=new WeakMap,gL=NF(mL,20,`#element`,fL,yL,hL),_L=gL.get,vL=gL.set,NF(mL,4,`proxy`,dL,xL,bL),jF(mL,xL);function Fse(e){return typeof e==`object`&&!!e&&`current`in e}function SL(e){if(e!=null)return Fse(e)?e.current??void 0:e}var CL=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?f.useLayoutEffect:f.useEffect;function wL(){let e=(0,f.useState)(0)[1];return(0,f.useCallback)(()=>{e(e=>e+1)},[e])}function Ise(e,t=!1){let n=(0,f.useRef)(e.peek()),r=(0,f.useRef)(!1),i=wL();return CL(()=>Ek(()=>{let a=n.current,o=e.value;if(a!==o){if(n.current=o,!r.current)return;t?(0,p.flushSync)(i):i()}}),[e,t,i]),{get value(){return r.current=!0,e.peek()}}}function Lse(e,t=[],n=!1){let r=(0,f.useRef)(e);return r.current=e,Ise((0,f.useMemo)(()=>eA(()=>r.current()),t),n)}function TL(e,t){let n=(0,f.useRef)(new Map),r=wL();return CL(()=>{if(!e){n.current.clear();return}return Ek(()=>{let i=!1,a=!1;for(let r of n.current){let[o]=r,s=ak(()=>r[1]),c=e[o];s!==c&&(i=!0,n.current.set(o,c),a=t?.(o,s,c)??!1)}i&&(a?queueMicrotask(()=>(0,p.flushSync)(r)):r())})},[e]),(0,f.useMemo)(()=>e&&new Proxy(e,{get(e,t){let r=e[t];return n.current.set(t,r),r}}),[e])}function Rse(e,t){e()}function EL(e){let t=(0,f.useRef)(e);return CL(()=>{t.current=e},[e]),t}function DL(e,t,n=f.useEffect,r=Object.is){let i=(0,f.useRef)(e);n(()=>{let n=i.current;r(e,n)||(i.current=e,t(e,n))},[t,e])}function OL(e,t){let n=(0,f.useRef)(SL(e));CL(()=>{let r=SL(e);r!==n.current&&(n.current=r,t(r))})}var zse=Object.defineProperty,Bse=Object.defineProperties,Vse=Object.getOwnPropertyDescriptors,kL=Object.getOwnPropertySymbols,AL=Object.prototype.hasOwnProperty,jL=Object.prototype.propertyIsEnumerable,ML=(e,t,n)=>t in e?zse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hse=(e,t)=>{for(var n in t||={})AL.call(t,n)&&ML(e,n,t[n]);if(kL)for(var n of kL(t))jL.call(t,n)&&ML(e,n,t[n]);return e},Use=(e,t)=>Bse(e,Vse(t)),Wse=(e,t)=>{var n={};for(var r in e)AL.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kL)for(var r of kL(e))t.indexOf(r)<0&&jL.call(e,r)&&(n[r]=e[r]);return n},NL=(0,f.createContext)(new rL),Gse=(0,f.memo)((0,f.forwardRef)(({children:e},t)=>{let[n,r]=(0,f.useState)(0),i=(0,f.useRef)(null),a=(0,f.useRef)(null),o=(0,f.useMemo)(()=>({renderer:{get rendering(){return i.current??Promise.resolve()}},trackRendering(e){i.current||=new Promise(e=>{a.current=e}),(0,f.startTransition)(()=>{e(),r(e=>e+1)})}}),[]);return CL(()=>{var e;(e=a.current)==null||e.call(a),i.current=null},[e,n]),(0,f.useImperativeHandle)(t,()=>o),null})),PL=[void 0,tA];function FL(e){var t=e,{children:n,onCollision:r,onBeforeDragStart:i,onDragStart:a,onDragMove:o,onDragOver:s,onDragEnd:c}=t,l=Wse(t,[`children`,`onCollision`,`onBeforeDragStart`,`onDragStart`,`onDragMove`,`onDragOver`,`onDragEnd`]);let u=(0,f.useRef)(null),{plugins:d,modifiers:p,sensors:h}=l,g=MN(d,nL.plugins),_=MN(h,nL.sensors),v=MN(p,nL.modifiers),y=EL(i),b=EL(a),x=EL(s),S=EL(o),C=EL(c),w=EL(r),T=Kse(()=>l.manager??new rL(l));return(0,f.useEffect)(()=>{if(!u.current)throw Error(`Renderer not found`);let{renderer:e,trackRendering:t}=u.current,{monitor:n}=T;T.renderer=e;let r=[n.addEventListener(`beforedragstart`,e=>{let n=y.current;n&&t(()=>n(e,T))}),n.addEventListener(`dragstart`,e=>b.current?.call(b,e,T)),n.addEventListener(`dragover`,e=>{let n=x.current;n&&t(()=>n(e,T))}),n.addEventListener(`dragmove`,e=>{let n=S.current;n&&t(()=>n(e,T))}),n.addEventListener(`dragend`,e=>{let n=C.current;n&&t(()=>n(e,T))}),n.addEventListener(`collision`,e=>w.current?.call(w,e,T))];return()=>r.forEach(e=>e())},[T]),DL(g,()=>T&&(T.plugins=g),...PL),DL(_,()=>T&&(T.sensors=_),...PL),DL(v,()=>T&&(T.modifiers=v),...PL),(0,m.jsxs)(NL.Provider,{value:T,children:[(0,m.jsx)(Gse,{ref:u,children:n}),n]})}function Kse(e){let t=(0,f.useRef)(null);return t.current||=e(),(0,f.useInsertionEffect)(()=>()=>t.current?.destroy(),[]),t.current}function IL(){return(0,f.useContext)(NL)}function LL(e){let t=IL()??void 0,[n]=(0,f.useState)(()=>e(t));return n.manager!==t&&(n.manager=t),CL(n.register,[t,n]),n}function qse({children:e,className:t,dropAnimation:n,style:r,tag:i,disabled:a}){let o=(0,f.useRef)(null),s=IL(),c=Lse(()=>s?.dragOperation.source,[s]).value??null,l=typeof a==`function`?a(c):a;(0,f.useEffect)(()=>{if(!o.current||!s||l)return;let e=s.plugins.find(e=>e instanceof vI);if(e)return e.overlay=o.current,()=>{e.overlay=void 0}},[s,l]),(0,f.useEffect)(()=>{if(!s)return;let e=s.plugins.find(e=>e instanceof vI);if(e)return e.dropAnimation=n,()=>{e.dropAnimation=void 0}},[s,n]);let u=(0,f.useMemo)(()=>{if(!s)return null;let e=new Proxy(s.registry,{get(e,t){return t===`register`||t===`unregister`?Jse:e[t]}});return new Proxy(s,{get(t,n){return n===`registry`?e:t[n]}})},[s]);return(0,m.jsx)(NL.Provider,{value:u,children:(0,f.createElement)(i||`div`,{ref:o,className:t,style:r,"data-dnd-overlay":!0},d())});function d(){return!c||l?null:typeof e==`function`?(0,m.jsx)(Yse,{source:c,children:e}):e}}function Jse(){return()=>{}}function Yse({children:e,source:t}){return e(TL(t))}var Xse=Object.create,RL=Object.defineProperty,Zse=Object.getOwnPropertyDescriptor,zL=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),BL=e=>{throw TypeError(e)},Qse=(e,t,n)=>t in e?RL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$se=e=>[,,,Xse(e?.[zL(`metadata`)]??null)],VL=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],HL=e=>e!==void 0&&typeof e!=`function`?BL(`Function expected`):e,ece=(e,t,n,r,i)=>({kind:VL[e],name:t,metadata:r,addInitializer:e=>n._?BL(`Already initialized`):i.push(HL(e||null))}),tce=(e,t)=>Qse(t,zL(`metadata`),e[3]),nce=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)a[i].call(n);return r},UL=(e,t,n,r,i,a)=>{for(var o,s,c,l,u=t&7,d=!1,f=!1,p=2,m=VL[u+5],h=e[p]||(e[p]=[]),g=(i=i.prototype,Zse(i,n)),_=r.length-1;_>=0;_--)c=ece(u,n,s={},e[3],h),c.static=d,c.private=f,l=c.access={has:e=>n in e},l.get=e=>e[n],o=(0,r[_])(g[m],c),s._=1,HL(o)&&(g[m]=o);return g&&RL(i,n,g),i},WL=(e,t,n)=>t.has(e)||BL(`Cannot `+n),GL=(e,t,n)=>(WL(e,t,`read from private field`),t.get(e)),KL=(e,t,n)=>t.has(e)?BL(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),qL=(e,t,n,r)=>(WL(e,t,`write to private field`),t.set(e,n),n),JL=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},YL,XL,ZL,QL,$L,eR=class extends (ZL=EA,XL=[rA],YL=[rA],ZL){constructor(e){let t=JL.from(e);super(t,(e,t)=>JL.equals(e,t)),nce($L,5,this),KL(this,QL,0),this.velocity={x:0,y:0}}get delta(){return JL.delta(this.current,this.initial)}get direction(){let{current:e,previous:t}=this;if(!t)return null;let n={x:e.x-t.x,y:e.y-t.y};return!n.x&&!n.y?null:Math.abs(n.x)>Math.abs(n.y)?n.x>0?`right`:`left`:n.y>0?`down`:`up`}get current(){return super.current}set current(e){let{current:t}=this,n=JL.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),a=i-GL(this,QL),o=e=>Math.round(e/a*100);rk(()=>{qL(this,QL,i),this.velocity={x:o(r.x),y:o(r.y)},super.current=n})}reset(e=this.defaultValue){super.reset(JL.from(e)),this.velocity={x:0,y:0}}};$L=$se(ZL),QL=new WeakMap,UL($L,2,`delta`,XL,eR),UL($L,2,`direction`,YL,eR),tce($L,eR);var tR=(e=>(e.Horizontal=`x`,e.Vertical=`y`,e))(tR||{});Object.values(tR);var nR=({dragOperation:e,droppable:t})=>{let n=e.position.current;if(!n)return null;let{id:r}=t;return t.shape&&t.shape.containsPoint(n)?{id:r,value:1/JL.distance(t.shape.center,n),type:qM.PointerIntersection,priority:KM.High}:null},rR=({dragOperation:e,droppable:t})=>{let{shape:n}=e;if(!t.shape||!n?.current)return null;let r=n.current.intersectionArea(t.shape);if(r){let{position:i}=e,a=JL.distance(t.shape.center,i.current),o=r/(n.current.area+t.shape.area-r)/a;return{id:t.id,value:o,type:qM.ShapeIntersection,priority:KM.Normal}}return null},iR=e=>nR(e)??rR(e);function aR(e){let{collisionDetector:t,data:n,disabled:r,element:i,id:a,accept:o,type:s}=e,c=LL(t=>new xL(Use(Hse({},e),{register:!1,element:SL(i)}),t)),l=TL(c);return DL(a,()=>c.id=a),OL(i,e=>c.element=e),DL(o,()=>c.accept=o,void 0,tA),DL(t,()=>c.collisionDetector=t??iR),DL(n,()=>n&&(c.data=n)),DL(r,()=>c.disabled=r===!0),DL(s,()=>c.type=s),{droppable:l,get isDropTarget(){return l.isDropTarget},ref:(0,f.useCallback)(e=>{!e&&c.element?.isConnected&&!c.manager?.dragOperation.status.idle||(c.element=e??void 0)},[c])}}var oR=Object.create,sR=Object.defineProperty,cR=Object.defineProperties,lR=Object.getOwnPropertyDescriptor,uR=Object.getOwnPropertyDescriptors,dR=Object.getOwnPropertySymbols,fR=Object.prototype.hasOwnProperty,pR=Object.prototype.propertyIsEnumerable,mR=(e,t)=>(t=Symbol[e])?t:Symbol.for(`Symbol.`+e),hR=e=>{throw TypeError(e)},gR=(e,t,n)=>t in e?sR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_R=(e,t)=>{for(var n in t||={})fR.call(t,n)&&gR(e,n,t[n]);if(dR)for(var n of dR(t))pR.call(t,n)&&gR(e,n,t[n]);return e},vR=(e,t)=>cR(e,uR(t)),yR=(e,t)=>{var n={};for(var r in e)fR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dR)for(var r of dR(e))t.indexOf(r)<0&&pR.call(e,r)&&(n[r]=e[r]);return n},bR=e=>[,,,oR(null)],xR=[`class`,`method`,`getter`,`setter`,`accessor`,`field`,`value`,`get`,`set`],SR=e=>e!==void 0&&typeof e!=`function`?hR(`Function expected`):e,CR=(e,t,n,r,i)=>({kind:xR[e],name:t,metadata:r,addInitializer:e=>n._?hR(`Already initialized`):i.push(SR(e||null))}),wR=(e,t)=>gR(t,mR(`metadata`),e[3]),TR=(e,t,n,r)=>{for(var i=0,a=e[t>>1],o=a&&a.length;i<o;i++)t&1?a[i].call(n):r=a[i].call(n,r);return r},ER=(e,t,n,r,i,a)=>{for(var o,s,c,l,u,d=t&7,f=!1,p=!1,m=e.length+1,h=xR[d+5],g=e[m-1]=[],_=e[m]||(e[m]=[]),v=(i=i.prototype,lR({get[n](){return OR(this,a)},set[n](e){return AR(this,a,e)}},n)),y=r.length-1;y>=0;y--)l=CR(d,n,c={},e[3],_),l.static=f,l.private=p,u=l.access={has:e=>n in e},u.get=e=>e[n],u.set=(e,t)=>e[n]=t,s=(0,r[y])({get:v.get,set:v.set},l),c._=1,s===void 0?SR(s)&&(v[h]=s):typeof s!=`object`||!s?hR(`Object expected`):(SR(o=s.get)&&(v.get=o),SR(o=s.set)&&(v.set=o),SR(o=s.init)&&g.unshift(o));return v&&sR(i,n,v),i},DR=(e,t,n)=>t.has(e)||hR(`Cannot `+n),OR=(e,t,n)=>(DR(e,t,`read from private field`),t.get(e)),kR=(e,t,n)=>t.has(e)?hR(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),AR=(e,t,n,r)=>(DR(e,t,`write to private field`),t.set(e,n),n);function jR(e){return e instanceof pz||e instanceof fz}function MR(e){return jR(e.source)&&jR(e.target)}var NR=10,PR=class extends Jj{constructor(e){super(e);let t=Ek(()=>{let{dragOperation:t}=e;if(pF(t.activatorEvent)&&jR(t.source)&&t.status.initialized){let t=e.registry.plugins.get(FI);if(t)return t.disable(),()=>t.enable()}}),n=e.monitor.addEventListener(`dragmove`,(e,t)=>{queueMicrotask(()=>{if(this.disabled||e.defaultPrevented||!e.nativeEvent)return;let{dragOperation:n}=t;if(!pF(e.nativeEvent)||!jR(n.source)||!n.shape)return;let{actions:r,collisionObserver:i,registry:a}=t,{by:o}=e;if(!o)return;let s=FR(o),{source:c,target:l}=n,{center:u}=n.shape.current,d=[],f=[];rk(()=>{for(let e of a.droppables){let{id:t}=e;if(!e.accepts(c)||t===l?.id&&jR(e)||!e.element)continue;let n=e.shape,r=new uF(e.element,{getBoundingClientRect:e=>$N(e,void 0,.2)});!r.height||!r.width||(s==`down`&&u.y+NR<r.center.y||s==`up`&&u.y-NR>r.center.y||s==`left`&&u.x-NR>r.center.x||s==`right`&&u.x+NR<r.center.x)&&(d.push(e),e.shape=r,f.push(()=>e.shape=n))}}),e.preventDefault(),i.disable();let p=i.computeCollisions(d,Uoe);rk(()=>f.forEach(e=>e()));let[m]=p;if(!m)return;let{id:h}=m,{index:g,group:_}=c.sortable;r.setDropTarget(h).then(()=>{let{source:e,target:t,shape:a}=n;if(!e||!jR(e)||!a)return;let{index:o,group:s,target:c}=e.sortable,l=g!==o||_!==s,u=l?c:t?.element;if(!u)return;aF(u);let d=new uF(u);if(!d)return;let f=nj.delta(d,nj.from(a.current.boundingRectangle),e.alignment);r.move({by:f}),l?r.setDropTarget(e.id).then(()=>i.enable()):i.enable()})})});this.destroy=()=>{n(),t()}}};function FR(e){let{x:t,y:n}=e;if(t>0)return`right`;if(t<0)return`left`;if(n>0)return`down`;if(n<0)return`up`}var IR=Object.defineProperty,LR=Object.defineProperties,RR=Object.getOwnPropertyDescriptors,zR=Object.getOwnPropertySymbols,BR=Object.prototype.hasOwnProperty,VR=Object.prototype.propertyIsEnumerable,HR=(e,t,n)=>t in e?IR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UR=(e,t)=>{for(var n in t||={})BR.call(t,n)&&HR(e,n,t[n]);if(zR)for(var n of zR(t))VR.call(t,n)&&HR(e,n,t[n]);return e},WR=(e,t)=>LR(e,RR(t));function GR(e,t,n){if(t===n)return e;let r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function KR(e){return`initialIndex`in e&&typeof e.initialIndex==`number`&&`index`in e&&typeof e.index==`number`}function qR(e,t,n){let{source:r,target:i,canceled:a}=t.operation;if(!r||!i||a)return`preventDefault`in t&&t.preventDefault(),e;let o=(e,t)=>e===t||typeof e==`object`&&`id`in e&&e.id===t;if(Array.isArray(e)){let s=e.findIndex(e=>o(e,r.id)),c=e.findIndex(e=>o(e,i.id));if(s===-1||c===-1){if(KR(r)){let i=r.initialIndex,a=r.index;return i===a||i<0||i>=e.length?(`preventDefault`in t&&t.preventDefault(),e):n(e,i,a)}return e}if(!a&&`index`in r&&typeof r.index==`number`){let t=r.index;if(t!==s)return n(e,s,t)}return n(e,s,c)}let s=Object.entries(e),c=-1,l,u=-1,d;for(let[e,t]of s)if(c===-1&&(c=t.findIndex(e=>o(e,r.id)),c!==-1&&(l=e)),u===-1&&(u=t.findIndex(e=>o(e,i.id)),u!==-1&&(d=e)),c!==-1&&u!==-1)break;if(c===-1&&KR(r)){let i=r.initialGroup,a=r.initialIndex,o=r.group,s=r.index;if(i==null||o==null||!(i in e)||!(o in e)||i===o&&a===s)return`preventDefault`in t&&t.preventDefault(),e;if(i===o)return WR(UR({},e),{[i]:n(e[i],a,s)});let c=e[i][a];return WR(UR({},e),{[i]:[...e[i].slice(0,a),...e[i].slice(a+1)],[o]:[...e[o].slice(0,s),c,...e[o].slice(s)]})}if(!r.manager)return e;let{dragOperation:f}=r.manager,p=f.shape?.current.center??f.position.current;if(d==null&&i.id in e){let t=i.shape&&p.y>i.shape.center.y?e[i.id].length:0;d=i.id,u=t}if(l==null||d==null||l===d&&c===u){if(l!=null&&l===d&&c===u&&KR(r)){let t=r.group!=null&&r.group!==l,i=r.index!==c;if(t||i){let t=r.group??l;if(t in e){if(l===t)return WR(UR({},e),{[l]:n(e[l],c,r.index)});let i=e[l][c];return WR(UR({},e),{[l]:[...e[l].slice(0,c),...e[l].slice(c+1)],[t]:[...e[t].slice(0,r.index),i,...e[t].slice(r.index)]})}}}return`preventDefault`in t&&t.preventDefault(),e}if(l===d)return WR(UR({},e),{[l]:n(e[l],c,u)});let m=i.shape&&Math.round(p.y)>Math.round(i.shape.center.y)?1:0,h=e[l][c];return WR(UR({},e),{[l]:[...e[l].slice(0,c),...e[l].slice(c+1)],[d]:[...e[d].slice(0,u+m),h,...e[d].slice(u+m)]})}function JR(e,t){return qR(e,t,GR)}var YR=`__default__`,XR=class extends Jj{constructor(e){super(e);let t=()=>{let t=new Map;for(let n of e.registry.droppables)if(n instanceof pz){let{sortable:e}=n,{group:r}=e,i=t.get(r);i||(i=new Set,t.set(r,i)),i.add(e)}for(let[e,n]of t)t.set(e,new Set($R(n)));return t},n=[e.monitor.addEventListener(`dragover`,(e,n)=>{if(this.disabled)return;let{dragOperation:r}=n,{source:i,target:a}=r;if(!jR(i)||!jR(a)||i.sortable===a.sortable)return;let o=t(),s=i.sortable.group===a.sortable.group,c=o.get(i.sortable.group),l=s?c:o.get(a.sortable.group);!c||!l||queueMicrotask(()=>{e.defaultPrevented||n.renderer.rendering.then(()=>{let r=t();for(let[e,t]of o.entries()){let n=Array.from(t).entries();for(let[t,i]of n)if(i.index!==t||i.group!==e||!r.get(e)?.has(i))return}let u=i.sortable.element,d=a.sortable.element;if(!d||!u||!s&&a.id===i.sortable.group)return;let f=$R(c),p=s?f:$R(l),m=i.sortable.group??YR,h=a.sortable.group??YR,g={[m]:f,[h]:p},_=JR(g,e);if(g===_)return;let v=_[h].indexOf(i.sortable),y=_[h].indexOf(a.sortable);n.collisionObserver.disable(),ZR(u,v,d,y),rk(()=>{for(let[e,t]of _[m].entries())t.index=e;if(!s)for(let[e,t]of _[h].entries())t.group=a.sortable.group,t.index=e}),n.actions.setDropTarget(i.id).then(()=>n.collisionObserver.enable())})})}),e.monitor.addEventListener(`dragend`,(e,n)=>{if(!e.canceled)return;let{dragOperation:r}=n,{source:i}=r;jR(i)&&(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group||queueMicrotask(()=>{let e=t(),r=e.get(i.sortable.initialGroup);r&&n.renderer.rendering.then(()=>{for(let[t,n]of e.entries()){let e=Array.from(n).entries();for(let[n,r]of e)if(r.index!==n||r.group!==t)return}let t=$R(r),n=i.sortable.element,a=t[i.sortable.initialIndex],o=a?.element;!a||!o||!n||(ZR(n,a.index,o,i.index),rk(()=>{for(let[t,n]of e.entries()){let e=Array.from(n).values();for(let t of e)t.index=t.initialIndex,t.group=t.initialGroup}}))})}))})];this.destroy=()=>{for(let e of n)e()}}};function ZR(e,t,n,r){let i=r<t?`afterend`:`beforebegin`;n.insertAdjacentElement(i,e)}function QR(e,t){return e.index-t.index}function $R(e){return Array.from(e).sort(QR)}var ez=[PR,XR],tz={duration:250,easing:`cubic-bezier(0.25, 1, 0.5, 1)`,idle:!1},nz=new kA,rz,iz=[nA],az,oz,sz,cz,lz,uz;rz=[nA];var dz=class{constructor(e,t){kR(this,oz,TR(az,8,this)),TR(az,11,this),kR(this,sz),kR(this,cz),kR(this,lz,TR(az,12,this)),TR(az,15,this),kR(this,uz),this.register=()=>(rk(()=>{var e,t;(e=this.manager)==null||e.registry.register(this.droppable),(t=this.manager)==null||t.registry.register(this.draggable)}),()=>this.unregister()),this.unregister=()=>{rk(()=>{var e,t;(e=this.manager)==null||e.registry.unregister(this.droppable),(t=this.manager)==null||t.registry.unregister(this.draggable)})},this.destroy=()=>{rk(()=>{this.droppable.destroy(),this.draggable.destroy()})};var n=e,{effects:r=()=>[],group:i,index:a,sensors:o,type:s,transition:c=tz,plugins:l}=n,u=yR(n,[`effects`,`group`,`index`,`sensors`,`type`,`transition`,`plugins`]);let d=MN(l,ez);this.droppable=new pz(u,t,this),this.draggable=new fz(vR(_R({},u),{plugins:d,effects:()=>[()=>{let e=this.manager?.dragOperation.status;e?.initializing&&this.id===this.manager?.dragOperation.source?.id&&nz.clear(this.manager),e?.dragging&&nz.set(this.manager,this.id,ak(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{let{index:e,group:t,manager:n}=this,r=OR(this,cz),i=OR(this,sz);(e!==r||t!==i)&&(AR(this,cz,e),AR(this,sz,t),this.animate())},()=>{let{target:e}=this,{isDragSource:t}=this.draggable;(this.draggable.pluginConfig(vI)?.feedback??`default`)===`move`&&t&&(this.droppable.disabled=!e)},...r()],type:s,sensors:o}),t,this),AR(this,uz,u.element),this.manager=t,this.index=a,AR(this,cz,a),this.group=i,AR(this,sz,i),this.type=s,this.transition=c}get initialIndex(){return nz.get(this.manager,this.id)?.initialIndex??this.index}get initialGroup(){return nz.get(this.manager,this.id)?.initialGroup??this.group}animate(){ak(()=>{let{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;let{idle:r}=e.dragOperation.status;!n||!t||r&&!t.idle||e.renderer.rendering.then(()=>{let{element:r}=this;if(!r)return;for(let e of r.getAnimations())`transitionProperty`in e&&(e.transitionProperty===`transform`||e.transitionProperty===`translate`||e.transitionProperty===`scale`)&&e.cancel();let i=this.refreshShape();if(!i)return;let a={x:n.boundingRectangle.left-i.boundingRectangle.left,y:n.boundingRectangle.top-i.boundingRectangle.top},{translate:o}=QP(r),s=cF(r,o,!1),c=cF(r,o);if(a.x||a.y){let n=sP(GN(r))?vR(_R({},t),{duration:0}):t;sF({element:r,keyframes:{translate:[`${s.x+a.x}px ${s.y+a.y}px ${s.z}`,`${c.x}px ${c.y}px ${c.z}`]},options:n}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})}})})}get manager(){return this.draggable.manager}set manager(e){rk(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){rk(()=>{let t=OR(this,uz),n=this.droppable.element,r=this.draggable.element;(!n||n===t)&&(this.droppable.element=e),(!r||r===t)&&(this.draggable.element=e),AR(this,uz,e)})}get element(){let e=OR(this,uz);if(e)return pP.get(e)??e??this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set plugins(e){this.draggable.plugins=MN(e,ez)}set disabled(e){rk(()=>{this.droppable.disabled=e,this.draggable.disabled=e})}set data(e){rk(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){this.droppable.id=e,this.draggable.id=e}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=e??gF}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){rk(()=>{this.droppable.type=e,this.draggable.type=e})}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};az=bR(),oz=new WeakMap,sz=new WeakMap,cz=new WeakMap,lz=new WeakMap,uz=new WeakMap,ER(az,4,`index`,iz,dz,oz),ER(az,4,`group`,rz,dz,lz),wR(az,dz);var fz=class extends uL{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},pz=class extends xL{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}get group(){return this.sortable.group}},mz=Object.defineProperty,hz=Object.defineProperties,gz=Object.getOwnPropertyDescriptors,_z=Object.getOwnPropertySymbols,vz=Object.prototype.hasOwnProperty,yz=Object.prototype.propertyIsEnumerable,bz=(e,t,n)=>t in e?mz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xz=(e,t)=>{for(var n in t||={})vz.call(t,n)&&bz(e,n,t[n]);if(_z)for(var n of _z(t))yz.call(t,n)&&bz(e,n,t[n]);return e},Sz=(e,t)=>hz(e,gz(t));function Cz(e){let{accept:t,collisionDetector:n,collisionPriority:r,id:i,data:a,element:o,handle:s,index:c,group:l,disabled:u,modifiers:d,sensors:p,target:m,type:h,plugins:g}=e,_=xz(xz({},tz),e.transition),v=LL(t=>new dz(Sz(xz({},e),{transition:_,register:!1,handle:SL(s),element:SL(o),target:SL(m)}),t)),y=TL(v,wz);return DL(i,()=>v.id=i),CL(()=>{rk(()=>{v.group=l,v.index=c})},[v,l,c]),DL(h,()=>v.type=h),DL(t,()=>v.accept=t,void 0,tA),DL(a,()=>a&&(v.data=a)),DL(c,()=>{v.manager?.dragOperation.status.idle&&_?.idle&&v.refreshShape()},Rse),OL(s,e=>v.handle=e),OL(o,e=>v.element=e),OL(m,e=>v.target=e),DL(u,()=>v.disabled=u===!0),DL(p,()=>v.sensors=p),DL(n,()=>v.collisionDetector=n),DL(r,()=>v.collisionPriority=r),DL(g,()=>v.plugins=g,void 0,tA),DL(_,()=>v.transition=_,void 0,tA),DL(d,()=>v.modifiers=d,void 0,tA),DL(e.alignment,()=>v.alignment=e.alignment),{sortable:y,get isDragging(){return y.isDragging},get isDropping(){return y.isDropping},get isDragSource(){return y.isDragSource},get isDropTarget(){return y.isDropTarget},handleRef:(0,f.useCallback)(e=>{v.handle=e??void 0},[v]),ref:(0,f.useCallback)(e=>{!e&&v.element?.isConnected&&!v.manager?.dragOperation.status.idle||(v.element=e??void 0)},[v]),sourceRef:(0,f.useCallback)(e=>{!e&&v.source?.isConnected&&!v.manager?.dragOperation.status.idle||(v.source=e??void 0)},[v]),targetRef:(0,f.useCallback)(e=>{!e&&v.target?.isConnected&&!v.manager?.dragOperation.status.idle||(v.target=e??void 0)},[v])}}function wz(e,t,n){return!!(e===`isDragSource`&&!n&&t)}var Tz=({item:e})=>{let t=tD(),n=q(e=>e.selectedLocale),r=q(e=>e.editorItemRegistry),i=(0,d.useMemo)(()=>({coreRegistry:r.coreRegistry,getRenderer:e=>r.definitions[e]?.renderComponent,localizations:r.playerLocalizations}),[r]),a=(0,d.useMemo)(()=>t?new u.A(t,{locale:n}):null,[n,t]),o=(0,d.useMemo)(()=>{if(a)return a.getRenderedSurveyItem(e.id)??{id:e.id,type:e.type}},[e.id,e.type,a]);return!t||!a||!o?null:(0,m.jsx)(Xg,{survey:t,locale:n,surveyEngine:a,surveyPlayerRegistry:i,children:(0,m.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,m.jsx)(Q9,{item:o})})})};function Ez({state:e,itemTypeLabel:t,onEdit:n,className:r}){let i=J(`itemPreview`),a=e===i_.blank;return(0,m.jsxs)(`div`,{className:z(`flex min-h-32 flex-col items-center justify-center rounded-xl border border-primary/35 bg-primary/[0.025] px-6 py-5 text-center`,r),children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:a?i(`blankTitle`,{itemType:t}):i(`incompleteTitle`)}),(0,m.jsx)(`p`,{className:`mt-1 max-w-sm text-sm leading-6 text-muted-foreground`,children:i(a?`blankDescription`:`incompleteDescription`)}),n?(0,m.jsxs)(B,{variant:`outline`,size:`sm`,className:`mt-3 border-primary/35`,onClick:n,children:[(0,m.jsx)(gT,{className:`size-3.5`,"aria-hidden":!0}),i(`openToStart`)]}):null]})}function Dz({children:e,onEdit:t,className:n}){let r=J(`itemPreview`);return(0,m.jsxs)(`div`,{className:z(`relative rounded-xl border border-amber-500/35`,n),children:[t?(0,m.jsxs)(B,{variant:`outline`,size:`sm`,className:`absolute -bottom-2.5 right-3 z-10 h-6 rounded-full border-amber-500/30 bg-background px-2.5 text-xs text-muted-foreground shadow-sm hover:border-amber-500/45 hover:bg-background hover:text-foreground`,onClick:t,children:[(0,m.jsx)(gT,{className:`size-3`,"aria-hidden":!0}),r(`openToComplete`)]}):null,e]})}var Oz=({children:e})=>(0,m.jsx)(`div`,{className:`h-full w-full overflow-auto`,children:(0,m.jsx)(`div`,{style:{pointerEvents:`none`,userSelect:`none`},"aria-hidden":`true`,children:e})}),kz=(e,t)=>{if(!e)return null;let n=new Date(e);return Number.isNaN(n.getTime())?null:u.N(n,`PPPP p`,{locale:t})},Az=({item:e,mode:t=`interactive`})=>{let n=J(`common.actions`),r=J(`copyItem`),i=J(`itemPreview`),a=qE(),o=eD(),s=tD(),c=q(e=>e.editorItemRegistry),l=q(e=>e.selectedLocale),{navigateToItem:u}=oD(),d=t===`static`;if(!e)return(0,m.jsx)(`div`,{className:`flex items-center justify-center h-full text-center text-muted-foreground`,children:(0,m.jsx)(`p`,{className:`text-sm`,children:i(`noItemSelected`)})});let f=cD(e),p=dD(e,c),h=YC(c,e),g=s?.getItemTranslations(e.id),_=ZC({item:e,definition:h,itemContent:g,locales:s?.locales??[],locale:l}),v=[{label:i(`created`),value:kz(e.editorMetadata.createdAt,a)},{label:i(`modified`),value:kz(e.editorMetadata.updatedAt,a)}].filter(e=>e.value!==null),y=(0,m.jsxs)(`div`,{className:`text-sm text-muted-foreground flex min-w-0 flex-col gap-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5`,children:[(0,m.jsx)(qO,{typeInfos:p,color:f,iconClassName:`size-5`}),(0,m.jsx)(`p`,{className:`font-mono min-w-0 flex-1 truncate`,style:{color:f},children:s?.getItemKey(e.id)?.fullKey})]}),(0,m.jsx)(`p`,{className:`text-muted-foreground font-medium shrink-0 max-w-[40%] truncate`,children:e.metadata?.itemLabel})]}),v.length>0&&(0,m.jsx)(`dl`,{className:`divide-y divide-border/70 border-y border-border/70 text-xs`,children:v.map(e=>(0,m.jsxs)(`div`,{className:`flex items-baseline justify-between gap-4 py-1.5`,children:[(0,m.jsx)(`dt`,{className:`shrink-0 text-muted-foreground`,children:e.label}),(0,m.jsx)(`dd`,{className:`min-w-0 truncate text-right font-medium text-foreground`,children:e.value})]},e.label))})]}),b=()=>{if(_===i_.blank)return(0,m.jsx)(Ez,{state:_,itemTypeLabel:p.label,onEdit:()=>u(e.id)});if(d&&h?.renderComponent)return(0,m.jsx)(`div`,{className:`max-w-[832px] w-full mx-auto @container/preview-content`,children:(0,m.jsx)(Tz,{item:e})});if(h?.previewComponent){let n=h.previewComponent;return(0,m.jsx)(`div`,{className:`max-w-[832px] w-full mx-auto @container/preview-content`,children:(0,m.jsx)(n,{item:e,itemConfig:e.config,itemContent:g,locale:l,mode:t})})}if(h?.renderComponent){let t=h.renderComponent;return(0,m.jsx)(`div`,{className:`max-w-[832px] w-full mx-auto @container/preview-content`,children:(0,m.jsx)(t,{renderedItem:{id:e.id,type:e.type}})})}return(0,m.jsx)(`div`,{className:`text-center text-muted-foreground py-10`,children:i(`noPreviewRenderer`,{itemType:e.type})})},x=t=>_===i_.incomplete?(0,m.jsx)(Dz,{onEdit:()=>u(e.id),children:t}):t;return(0,m.jsx)(`div`,{className:`gap-3 h-full flex flex-col @container/preview`,children:(0,m.jsx)(`div`,{className:`flex items-center justify-center flex-1`,children:(0,m.jsxs)(`div`,{className:`relative w-full space-y-2`,children:[d?(0,m.jsx)(m.Fragment,{children:x((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`h-full hidden @sm/preview:block`,children:(0,m.jsx)(Oz,{children:b()})}),(0,m.jsx)(`div`,{className:`flex min-h-[220px] w-full items-center justify-center rounded-md border border-dashed border-border/70 bg-(--surface-bg-color) py-6 @sm/preview:hidden`,children:(0,m.jsx)(`div`,{className:`flex items-center justify-center rounded-full border border-border bg-background p-6 shadow-sm`,style:{color:f},"aria-label":i(`previewIconAria`,{itemType:e.type}),children:(0,m.jsx)(p.icon,{className:`size-10`})})})]}))}):x(b()),(0,m.jsx)(`div`,{className:`flex justify-center py-2`,children:y}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3 w-fit mx-auto`,children:[(0,m.jsxs)(B,{variant:`ghost`,size:`sm`,onClick:()=>{e&&u(e.id)},className:`flex flex-col gap-1 h-auto py-2`,children:[(0,m.jsx)(hT,{className:`size-4`}),(0,m.jsx)(`span`,{className:`text-xs`,children:i(`openItem`)})]}),(0,m.jsxs)(iE,{children:[(0,m.jsx)(aE,{asChild:!0,children:(0,m.jsxs)(B,{variant:`ghost`,size:`sm`,className:`flex flex-col gap-1 h-auto py-2`,children:[(0,m.jsx)(Tw,{className:`size-4`}),(0,m.jsx)(`span`,{className:`text-xs`,children:n(`more`)})]})}),(0,m.jsxs)(oE,{align:`end`,className:`border-border`,children:[(0,m.jsxs)(cE,{onClick:()=>{if(e&&o){let t=o.copyItem(e.id);navigator.clipboard.writeText(JSON.stringify(t,null,2)).then(()=>{vE(),OE.success(r(`copied`))}).catch(()=>{OE.error(r(`failed`))})}},children:[(0,m.jsx)(Nw,{className:`size-4 mr-2`}),n(`copy`)]}),(0,m.jsx)(pE,{}),(0,m.jsx)(jD,{itemId:e.id}),(0,m.jsx)(pE,{}),(0,m.jsx)(vD,{overrideItemId:e.id})]})]})]})]})})})},jz=({itemId:e})=>{let t=J(),{canDelete:n,deleteItem:r}=_D({itemId:e});return(0,m.jsxs)(wD,{disabled:!n,onSelect:e=>{e.preventDefault(),r()},children:[(0,m.jsx)(zT,{className:`size-4 mr-2 text-destructive`}),t(`common.actions.delete`)]})},Mz=(0,d.createContext)(void 0),Nz=({children:e})=>{let[t,n]=(0,d.useState)(!1),[r,i]=(0,d.useState)(void 0),[a,o]=(0,d.useState)(void 0),[s,c]=(0,d.useState)(void 0),[l,u]=(0,d.useState)(null),f={addItemDialogOpen:t,setAddItemDialogOpen:n,openAddItemDialog:(e,t,r)=>{i(e),o(t),c(r),n(!0)},closeAddItemDialog:()=>n(!1),targetParentId:r,targetIndex:a,pendingItemType:s,clearPendingItemType:()=>c(void 0),preferredPreviewItemId:l,setPreferredPreviewItemId:u};return(0,m.jsx)(Mz.Provider,{value:f,children:e})},Pz=()=>{let e=(0,d.useContext)(Mz);if(e===void 0)throw Error(`useItemEditor must be used within an ItemEditorProvider`);return e},Fz=()=>{let{openAddItemDialog:e,closeAddItemDialog:t}=Pz();return{openAddItemDialog:e,closeAddItemDialog:t}},Iz=class e{survey;constructor(e){this.survey=e}copyItem(e){if(!this.survey.surveyItems.get(e))throw Error(`Item with id '${e}' not found`);let t=this.collectItemsForCopy(e),n=t.map(e=>{let t=this.survey.surveyItems.get(e);if(!t)throw Error(`Item with id '${e}' not found during copy`);return{itemId:e,itemData:t.rawItem}}),r={};return t.forEach(e=>{try{let t=this.survey.getItemTranslations(e);if(t?.locales?.length){let n={};t.locales.forEach(e=>{let r=t.getAllForLocale(e);r&&(n[e]=r)}),r[e]=n}else r[e]={}}catch{r[e]={}}}),{type:`survey-item`,version:`1.0.0`,items:n,translations:r,rootItemId:e,timestamp:Date.now()}}collectItemsForCopy(e){let t=[e],n=this.survey.surveyItems.get(e);if(!n)return[];if(n instanceof u.st){let e=n.items;e.length>0&&e.forEach(e=>{let n=this.collectItemsForCopy(e);t.push(...n)})}return t}addItemToParentGroup(e,t){let n=this.survey.surveyItems.get(e.parentId);if(!n)throw Error(`Parent item with id '${e.parentId}' not found`);if(!(n instanceof u.st))throw Error(`Parent item '${e.parentId}' is not a group item`);let r=n.items.map(e=>this.survey.surveyItems.get(e)).filter(e=>e!==void 0),i=new Set(r.map(e=>e.key)),a=t.key;if(i.has(a)){let e=1,n=t.key;for(;i.has(a);)a=n+`_${e}`,e++;if(a!==t.key){let e={...t.rawItem,key:a},n=this.survey.createItemFromRaw(e);this.survey.surveyItems.delete(t.id),this.survey.surveyItems.set(n.id,n),t=n}}let o=e.index===void 0?n.items.length:Math.min(e.index,n.items.length);n.addChild(t.id,o)}pasteItem(t,n){if(!e.isValidClipboardData(t))throw Error(`Invalid clipboard data format`);let r={};t.items.forEach(({itemId:e})=>{r[e]=u.bt()}),t.items.forEach(({itemId:e,itemData:i})=>{let a=r[e];if(a){let o=this.updateItemIdsInData(i,r);o.id=a;let s=this.survey.createItemFromRaw(o);this.survey.surveyItems.set(s.id,s),e===t.rootItemId&&this.addItemToParentGroup(n,s)}});let i=this.updateTranslations(t.translations,r);return Object.keys(i).forEach(e=>{let t=new u.ft,n=i[e];Object.keys(n).forEach(e=>{t.setAllForLocale(e,n[e])}),this.survey.translations.setItemTranslations(e,t)}),r[t.rootItemId]}updateItemIdsInData(e,t){let n=JSON.parse(JSON.stringify(e));if(n.itemType===`group`&&n.config){let e=n.config;e.items&&=e.items.map(e=>t[e]??e)}return this.updateExpressionsInItemData(n,t),n}updateExpressionsInItemData(e,t){e.displayConditions?.root&&this.updateExpressionReferences(e.displayConditions.root,t),e.displayConditions?.components&&Object.values(e.displayConditions.components).forEach(e=>{e&&this.updateExpressionReferences(e,t)}),e.disabledConditions?.components&&Object.values(e.disabledConditions.components).forEach(e=>{e&&this.updateExpressionReferences(e,t)}),e.validations&&Object.values(e.validations).forEach(e=>{e&&this.updateExpressionReferences(e,t)}),e.prefills&&e.prefills.forEach(e=>{e.when&&this.updateExpressionReferences(e.when,t),e.source.type===`expression`&&this.updateExpressionReferences(e.source.expression,t),e.source.type===`previousResponse`&&(e.source.ref.itemId=t[e.source.ref.itemId]??e.source.ref.itemId)})}updateExpressionReferences(e,t){if(!e||typeof e!=`object`)return;let n=e;Array.isArray(n.data)&&n.data.forEach(e=>{if(e&&typeof e==`object`&&e&&`str`in e){let n=e;typeof n.str==`string`&&Object.prototype.hasOwnProperty.call(t,n.str)&&(n.str=t[n.str]),this.updateExpressionReferences(e,t)}}),Object.keys(n).forEach(e=>{let r=n[e];r&&typeof r==`object`&&this.updateExpressionReferences(r,t)})}updateTranslations(e,t){let n={};return Object.keys(e).forEach(r=>{let i=e[r],a=t[r];n[a]=i}),n}static isValidClipboardData(e){if(typeof e!=`object`||!e||e===void 0)return!1;let t=e;return t.rootItemId===void 0||typeof t.rootItemId!=`string`||!Array.isArray(t.items)||t.items.length===0||typeof t.translations!=`object`||t.translations===null||Array.isArray(t.translations)?!1:t.type===`survey-item`&&t.version===`1.0.0`&&t.items.every(e=>typeof e==`object`&&!!e&&typeof e.itemId==`string`&&e.itemId.length>0&&typeof e.itemData==`object`&&e.itemData!==null&&!Array.isArray(e.itemData)&&typeof e.itemData.itemType==`string`)&&t.items.some(e=>e.itemId===t.rootItemId)}},Lz={USER:`user`,SYSTEM:`system`,ASSISTANT:`assistant`},Rz=class{static encoder=new TextEncoder;static calculateSize(e){let t=JSON.stringify(e);return this.encoder.encode(t).length}static formatBytes(e){let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}};function zz(e){if(!(!e||Object.keys(e).length===0))return u.Et(e)}function Bz(e){return`kind`in e?e.kind===`survey-snapshot`?{kind:`survey-snapshot`,survey:u.Et(e.survey),timestamp:e.timestamp,meta:e.meta,memorySize:e.memorySize}:{kind:`asset-change`,changes:u.Et(e.changes),timestamp:e.timestamp,meta:e.meta,memorySize:e.memorySize}:{kind:`survey-snapshot`,survey:u.Et(e.survey),timestamp:e.timestamp,meta:e.meta,memorySize:e.memorySize}}var Vz=class e{history=[];currentIndex=-1;_config;_initialAssets;constructor(e,t={},n={label:`Initial state`,source:Lz.SYSTEM},r){this._config={maxTotalMemoryMB:50,minHistorySize:10,maxHistorySize:200,...t},this._initialAssets=zz(r),this.saveSnapshot(e,n)}saveEntry(e){let t=e.kind===`survey-snapshot`?{kind:e.kind,survey:e.survey}:{kind:e.kind,changes:e.changes},n=Rz.calculateSize(t);this.history=this.history.slice(0,this.currentIndex+1),this.history.push({...u.Et(e),timestamp:Date.now(),memorySize:n}),this.currentIndex++,this.cleanupHistory()}saveSnapshot(e,t){this.saveEntry({kind:`survey-snapshot`,survey:u.Et(e),meta:t})}getBaseAssetsSize(){return this._initialAssets?Rz.calculateSize(this._initialAssets):0}cleanupHistory(){let e=this._config.maxTotalMemoryMB*1024*1024;for(;this.history.length>this._config.minHistorySize&&(this.getTotalMemoryUsage()>e||this.history.length>this._config.maxHistorySize)&&!(this.dropOldestState()<=0););}dropOldestState(){if(this.history.length<=1)return 0;let e=this.getStateAtIndex(1),t=this.getAssetsAtIndex(1),n=this.history[1],r={kind:`survey-snapshot`,survey:e,meta:n.meta,timestamp:n.timestamp,memorySize:Rz.calculateSize({kind:`survey-snapshot`,survey:e})},i=this.history[0].memorySize;return this._initialAssets=zz(t),this.history=[r,...this.history.slice(2)],this.currentIndex--,i}getTotalMemoryUsage(){return this.getBaseAssetsSize()+this.history.reduce((e,t)=>e+t.memorySize,0)}getStateAtIndex(e){if(e<0||e>=this.history.length)throw Error(`Invalid history state`);for(let t=e;t>=0;t--){let e=this.history[t];if(e.kind===`survey-snapshot`)return u.Et(e.survey)}throw Error(`Invalid history state`)}applyAssetPatch(e,t){let n=u.Et(e);return t.next?n[t.assetId]=u.Et(t.next):delete n[t.assetId],n}getAssetsAtIndex(e){if(e<0||e>=this.history.length)throw Error(`Invalid history state`);let t=zz(this._initialAssets)??{};for(let n=1;n<=e;n++){let e=this.history[n];if(e.kind===`asset-change`)for(let n of e.changes)t=this.applyAssetPatch(t,n)}return Object.keys(t).length>0?t:void 0}commit(e,t){this.saveSnapshot(e,t)}commitAssetChange(e,t){e.length!==0&&this.saveEntry({kind:`asset-change`,changes:u.Et(e),meta:t})}getCurrentState(){if(this.currentIndex<0||this.currentIndex>=this.history.length)throw Error(`Invalid history state`);return this.getStateAtIndex(this.currentIndex)}getCurrentAssets(){if(this.currentIndex<0||this.currentIndex>=this.history.length)throw Error(`Invalid history state`);return this.getAssetsAtIndex(this.currentIndex)}undo(){return this.canUndo()?(this.currentIndex--,this.getCurrentState()):null}redo(){return this.canRedo()?(this.currentIndex++,this.getCurrentState()):null}canUndo(){return this.currentIndex>0}canRedo(){return this.currentIndex<this.history.length-1}getUndoMeta(){return this.canUndo()?this.history[this.currentIndex].meta:null}getRedoMeta(){return this.canRedo()?this.history[this.currentIndex+1].meta:null}getMemoryUsage(){return{totalMB:this.getTotalMemoryUsage()/(1024*1024),entries:this.history.length}}getConfig(){return{...this._config}}getHistory(){return this.history.map((e,t)=>({index:t,kind:e.kind,meta:e.meta,timestamp:e.timestamp,memorySize:e.memorySize,isCurrent:t===this.currentIndex}))}getCommitsSinceInitial(){return this.history.slice(1,this.currentIndex+1).map((e,t)=>{let n=t+1;return{index:n,kind:e.kind,meta:e.meta,timestamp:e.timestamp,memorySize:e.memorySize,isCurrent:n===this.currentIndex}})}getCurrentIndex(){return this.currentIndex}getHistoryLength(){return this.history.length}jumpToIndex(e){return e<0||e>=this.history.length||e===this.currentIndex?null:(this.currentIndex=e,this.getCurrentState())}canJumpToIndex(e){return e>=0&&e<this.history.length&&e!==this.currentIndex}serialize(){return{history:this.history.map(e=>e.kind===`survey-snapshot`?{kind:`survey-snapshot`,survey:e.survey,timestamp:e.timestamp,meta:e.meta,memorySize:e.memorySize}:{kind:`asset-change`,changes:e.changes,timestamp:e.timestamp,meta:e.meta,memorySize:e.memorySize}),currentIndex:this.currentIndex,config:{...this._config},initialAssets:zz(this._initialAssets)}}static deserialize(t,n){if(!t.history||!Array.isArray(t.history)||t.history.length===0)throw Error(`Invalid object: history must be an array and must not be empty`);if(typeof t.currentIndex!=`number`||t.currentIndex<0||t.currentIndex>=t.history.length)throw Error(`Invalid object: currentIndex must be a valid index within the history array`);if(!t.config)throw Error(`Invalid object: config is required`);let r=t.history.map(Bz),i=r[0],a=new e(i.kind===`survey-snapshot`?i.survey:(()=>{throw Error(`Invalid object: first history entry must resolve to a survey snapshot`)})(),t.config,i.meta,n??t.initialAssets);return a.history=r,a.currentIndex=t.currentIndex,a._initialAssets=zz(n??t.initialAssets),a}};function Hz(e){let t=u.Et(e);return delete t.assets,t}function Uz(e,t){let n=u.Et(e);return t&&Object.keys(t).length>0?n.assets=u.Et(t):delete n.assets,n}var Wz=class e{_survey;_undoRedo;_hasUncommittedChanges=!1;_pluginRegistry;constructor(e,t={},n){this._survey=e;let{pluginRegistry:r,...i}=t;this._pluginRegistry=r;let a=e.serialize();this._undoRedo=new Vz(Hz(a),i,n,a.assets)}get survey(){let e=this._survey.serialize(),t=this._pluginRegistry??this._survey.getPluginRegistry();return u.dt.fromJson(e,t)}get hasUncommittedChanges(){return this._hasUncommittedChanges}get undoRedo(){return this._undoRedo}commit(e){this._hasUncommittedChanges&&=(this._undoRedo.commit(Hz(this._survey.serialize()),e),!1)}restoreHistoryState(e,t){this._survey=u.dt.fromJson(Uz(e,t),this._pluginRegistry)}commitIfNeeded(){this._hasUncommittedChanges&&this.commit({label:`Latest content changes`,source:Lz.SYSTEM})}undo(){if(this._hasUncommittedChanges)return this.restoreHistoryState(this._undoRedo.getCurrentState(),this._undoRedo.getCurrentAssets()),this._hasUncommittedChanges=!1,!0;{let e=this._undoRedo.undo();return e?(this.restoreHistoryState(e,this._undoRedo.getCurrentAssets()),this._hasUncommittedChanges=!1,!0):!1}}redo(){if(this._hasUncommittedChanges)return!1;let e=this._undoRedo.redo();return e?(this.restoreHistoryState(e,this._undoRedo.getCurrentAssets()),this._hasUncommittedChanges=!1,!0):!1}jumpToIndex(e){if(this._hasUncommittedChanges)return!1;let t=this._undoRedo.jumpToIndex(e);return t?(this.restoreHistoryState(t,this._undoRedo.getCurrentAssets()),this._hasUncommittedChanges=!1,!0):!1}canUndo(){return this._hasUncommittedChanges||this._undoRedo.canUndo()}canRedo(){return!this._hasUncommittedChanges&&this._undoRedo.canRedo()}getUndoMeta(){return this._hasUncommittedChanges?{label:`Latest content changes`,source:Lz.SYSTEM}:this._undoRedo.getUndoMeta()}getRedoMeta(){return this._hasUncommittedChanges?null:this._undoRedo.getRedoMeta()}getMemoryUsage(){return this._undoRedo.getMemoryUsage()}getUndoRedoConfig(){return this._undoRedo.getConfig()}getCommitsSinceInitial(){return this._undoRedo.getCommitsSinceInitial()}toJson(){return{version:`1.0.0`,survey:this._survey.serialize(),undoRedo:this._undoRedo.serialize(),hasUncommittedChanges:this._hasUncommittedChanges}}static fromJson(t,n){if(!t.survey)throw Error(`Invalid object: survey is required`);if(!t.undoRedo)throw Error(`Invalid object: undoRedo is required`);if(typeof t.hasUncommittedChanges!=`boolean`)throw Error(`Invalid object: hasUncommittedChanges must be a boolean`);t.version&&!t.version.startsWith(`1.`)&&console.warn(`Warning: Loading SurveyEditor with version ${t.version}, current version is 1.0.0`);let r=new e(u.dt.fromJson(t.survey,n),{pluginRegistry:n});return r._undoRedo=Vz.deserialize({...t.undoRedo,history:t.undoRedo.history.map(e=>`survey`in e?{...e,survey:Hz(e.survey)}:e)},t.survey.assets),r._hasUncommittedChanges=JSON.stringify(Hz(t.survey))!==JSON.stringify(r._undoRedo.getCurrentState()),r}markAsModified(){this._hasUncommittedChanges=!0}createEditorTimestamp(){return new Date().toISOString()}touchItemModifiedMetadata(e,t=this.createEditorTimestamp()){let n=this._survey.surveyItems.get(e);n&&n.setModifiedAt(t)}addItem(e,t,n){this.markAsModified();let r=this.createEditorTimestamp(),i;if(e){let t=this._survey.surveyItems.get(e.parentId);if(!t)throw Error(`Parent item with id '${e.parentId}' not found`);if(!(t instanceof u.st))throw Error(`Parent item '${e.parentId}' is not a group item (${t.type})`);i=t}else{let e=this._survey.rootItem;if(!e)throw Error(`No root group found in survey`);if(!(e instanceof u.st))throw Error(`Root item is not a group item`);i=e}if(i.hasChild(t.id))throw Error(`Item ${t.id} already in this group`);let a=Array.from(this._survey.surveyItems.values()).filter(e=>i.items?.includes(e.id)),o=1,s=t.key,c=s;for(;a.some(e=>e.key===c);)c=`${s}_${o}`,o++;let l;l=e?.index===void 0?i.items.length:Math.min(e.index,i.items.length),t.updateRawItem({...t.rawItem,key:c}),t.setCreatedAt(r),t.setModifiedAt(r),this._survey.surveyItems.set(t.id,t),i.addChild(t.id,l),this.touchItemModifiedMetadata(i.id,r),n&&this._survey.translations.setItemTranslations(t.id,n)}removeItem(e,t=!1){this.markAsModified();let n=this.createEditorTimestamp(),r=this._survey.surveyItems.get(e);if(!r)return!1;let i=this._survey.getParentItem(e);if(!i)throw Error(`Item with id '${e}' is the root item`);if(r instanceof u.st)for(let e of r.getChildrenIds())this.removeItem(e,!0);return this._survey.surveyItems.delete(e),this._survey.translations?.onItemDeleted(e),t||(i.removeChild(e),this.touchItemModifiedMetadata(i.id,n)),!0}moveItem(e,t){this.markAsModified();let n=this.createEditorTimestamp(),r=this._survey.surveyItems.get(e);if(!r)throw Error(`Item with id '${e}' not found`);let i=this._survey.surveyItems.get(t.parentId);if(!i)throw Error(`Target parent with id '${t.parentId}' not found`);if(!(i instanceof u.st))throw Error(`Target parent '${t.parentId}' is not a group item (${i.type})`);if(this._survey.isDescendantOf(t.parentId,e))throw Error(`Cannot move item '${e}' to its descendant '${t.parentId}'`);let a=this._survey.getParentItem(e);if(a?.id===t.parentId)throw Error(`Item '${e}' is already in the target parent '${t.parentId}'`);if(a){let t=a;t.removeChild(e),this.touchItemModifiedMetadata(t.id,n)}let o=i,s=Array.from(this._survey.surveyItems.values()).filter(e=>o.hasChild(e.id)),c=1,l=r.key;for(;s.some(e=>e.key===l);)l=`${r.key}_${c}`,c++;l!==r.key&&r.updateRawItem({...r.rawItem,key:l});let d=t.index===void 0?o.items.length:Math.min(t.index,o.items.length);return o.addChild(e,d),this.touchItemModifiedMetadata(o.id,n),this.touchItemModifiedMetadata(e,n),!0}getItemDataCopy(e){let t=this._survey.surveyItems.get(e);if(!t)throw Error(`Item with id '${e}' not found`);return JSON.parse(JSON.stringify(t.rawItem))}updateItem(e,t){let n=this._survey.surveyItems.get(e);if(!n)throw Error(`Item with id '${e}' not found`);if(`id`in t&&t.id!==void 0&&t.id!==e)throw Error(`Cannot change item id from '${e}' to '${t.id}'`);let r={...n.rawItem,...t,id:e},i=r.key??n.key,a=this._survey.getParentItem(e);if(a){let t=(a.items??[]).filter(t=>t!==e).map(e=>this._survey.surveyItems.get(e)).find(e=>e!==void 0&&e.key===i);if(t)throw Error(`Key '${i}' is already in use by sibling item '${t.id}'`)}let o=this._survey.createItemFromRaw({...r,editorMetadata:n.rawItem.editorMetadata});o.setModifiedAt(this.createEditorTimestamp()),this._survey.surveyItems.set(e,o),this.markAsModified()}updateItemTranslations(e,t){let n=this._survey.surveyItems.get(e);return n?(this.markAsModified(),n.setModifiedAt(this.createEditorTimestamp()),this._survey.translations.setItemTranslations(e,t),!0):!1}updateSurveyTranslations(e){this.markAsModified(),e.surveyCard&&this._survey.translations.setSurveyCardContent(e.surveyCard.locale,e.surveyCard.content),e.navigation&&this._survey.translations.setNavigationContent(e.navigation.locale,e.navigation.content),e.validationMessages&&this._survey.translations.setValidationMessages(e.validationMessages.locale,e.validationMessages.content)}getMaxItemsPerPage(){let e=this._survey.maxItemsPerPage;return e?{...e}:void 0}updateMaxItemsPerPage(e){this.markAsModified(),this._survey.maxItemsPerPage=e?{...e}:void 0}getMetadata(){let e=this._survey.metadata;return e?{...e}:void 0}updateMetadata(e){this.markAsModified(),this._survey.metadata=e?{...e}:void 0}getTemplateValue(e){let t=this._survey.getTemplateValue(e);return t?u.Et(t):void 0}getTemplateValues(){let e=this._survey.getTemplateValueKeys(),t=new Map;for(let n of e){let e=this._survey.getTemplateValue(n);e&&t.set(n,u.Et(e))}return t}setTemplateValue(e,t){this.markAsModified(),this._survey.setTemplateValue(e,u.Et(t))}removeTemplateValue(e){this.markAsModified(),this._survey.deleteTemplateValue(e)}getAsset(e){let t=this._survey.getAsset(e);return t?u.Et(t):void 0}getAssets(){return this._survey.getAssets()}setAsset(e,t){let n=this._survey.getAsset(e);this._survey.setAsset(e,u.Et(t)),this._undoRedo.commitAssetChange([{assetId:e,prev:n,next:u.Et(t)}],{label:`Update asset: ${e}`,source:Lz.USER})}removeAsset(e){let t=this._survey.getAsset(e);t&&(this._survey.deleteAsset(e),this._undoRedo.commitAssetChange([{assetId:e,prev:t}],{label:`Remove asset: ${e}`,source:Lz.USER}))}copyItem(e){return new Iz(this._survey).copyItem(e)}pasteItem(e,t){this.markAsModified();let n=this.createEditorTimestamp(),r=new Set(this._survey.surveyItems.keys()),i=new Iz(this._survey).pasteItem(e,t),a=Array.from(this._survey.surveyItems.keys()).filter(e=>!r.has(e));for(let e of a){let t=this._survey.surveyItems.get(e);t&&(t.setCreatedAt(n),t.setModifiedAt(n))}return this.touchItemModifiedMetadata(t.parentId,n),i}},Gz=e=>{let t=e;return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t?.isContentEditable===!0||t?.closest(`[contenteditable="true"]`)!==null},Kz=()=>window.getSelection()?.isCollapsed===!1,qz=e=>{let t=e instanceof HTMLElement?e.closest(`[data-group-list-target]`):null;if(!t)return null;let n=t.dataset.groupListTarget;return n===`add`?{kind:`add`}:n===`item`&&t.dataset.groupListItemId?{kind:`item`,itemId:t.dataset.groupListItemId}:null},Jz=(e,t)=>e.kind===t.kind&&(e.kind!==`item`||t.kind!==`item`||e.itemId===t.itemId),Yz=e=>[...e.map(e=>({kind:`item`,itemId:e})),{kind:`add`}],Xz=e=>{switch(e.kind){case`add`:return`[data-group-list-target="add"]`;case`item`:return`[data-group-list-target="item"][data-group-list-item-id="${CSS.escape(e.itemId)}"]`}},Zz=(e,t)=>{e.querySelector(Xz(t))?.focus()},Qz=(e,t)=>e&&t.includes(e)?{kind:`item`,itemId:e}:t.length>0?{kind:`item`,itemId:t[0]}:{kind:`add`},$z=e=>{e instanceof HTMLElement&&e.closest(`[data-group-list-target]`)?.click()},eB=({addItemDialogOpen:e,containerRef:t,groupId:n,itemIds:r,clipboardValue:i,previewItemId:a,openAddDialogForCurrentGroup:o,openFocusedItem:s,selectPreviewItem:c,moveItemByOffset:l,parseSurveyItemClipboard:u,pasteItemFromClipboardData:f,onPasteCommitted:p,copyItemToClipboard:m})=>{let h=J(`groupItems`),g=(0,d.useCallback)(()=>{n&&(async()=>{let e=i;try{e=await navigator.clipboard.readText()}catch{}let t=u(e);if(t)try{let e=f(t,n);if(!e)return;p(e)}catch(e){console.error(`Error pasting item:`,e),OE.error(h(`pasteFailed`))}})()},[i,n,p,u,f,h]),_=(0,d.useCallback)(()=>{if(!a){OE.info(h(`selectItemToCopy`));return}m(a)},[m,a,h]),v=(0,d.useCallback)((e,t,n)=>{let i=n??Qz(a,r);if(n||Zz(t,i),e===`ArrowUp`||e===`ArrowDown`){let n=Yz(r),a=n.findIndex(e=>Jz(e,i));if(a<0||n.length<1)return;Zz(t,n[(a+(e===`ArrowUp`?-1:1)+n.length)%n.length]);return}i.kind===`item`&&l(i.itemId,e===`ArrowLeft`?-1:1)&&requestAnimationFrame(()=>{Zz(t,i)})},[r,l,a]),y=(0,d.useCallback)(e=>({"data-group-list-target":`item`,"data-group-list-item-id":e,onFocus:()=>{c(e)}}),[c]),b=(0,d.useCallback)(()=>({"data-group-list-target":`add`}),[]),x=(0,d.useCallback)(t=>{if(e||Gz(t.target))return;let n=t.currentTarget,r=qz(t.target);if(t.metaKey||t.ctrlKey)switch(t.key.toLowerCase()){case`enter`:t.preventDefault(),o();return;case`v`:t.preventDefault(),g();return;case`c`:if(Kz())return;t.preventDefault(),_();return;default:return}if(r)switch(t.key){case`ArrowUp`:case`ArrowDown`:t.preventDefault(),v(t.key,n,r);return;case`ArrowLeft`:case`ArrowRight`:t.preventDefault(),v(t.key,n,r);return;case`Enter`:case` `:if(t.preventDefault(),r.kind===`item`){s(r.itemId);return}$z(t.target);return;default:return}},[e,v,_,g,o,s]),S=(0,d.useEffectEvent)(n=>{let r=t.current;if(!(!r||e||Gz(n.target)||r.contains(n.target))){if(n.metaKey||n.ctrlKey)switch(n.key.toLowerCase()){case`enter`:n.preventDefault(),o();return;case`c`:if(Kz())return;n.preventDefault(),_();return;case`v`:n.preventDefault(),g();return;default:return}switch(n.key){case`ArrowUp`:case`ArrowDown`:case`ArrowLeft`:case`ArrowRight`:n.preventDefault(),v(n.key,r,null);return;default:return}}});return(0,d.useEffect)(()=>(document.addEventListener(`keydown`,S),()=>{document.removeEventListener(`keydown`,S)}),[]),{getItemButtonProps:y,getAddButtonProps:b,onListKeyDown:x}},tB=()=>(0,m.jsxs)(`svg`,{viewBox:`0 0 220 180`,className:`text-slate-400 h-24 w-36`,fill:`none`,"aria-hidden":`true`,children:[(0,m.jsx)(`rect`,{x:`48`,y:`16`,width:`124`,height:`148`,rx:`14`,fill:`currentColor`,fillOpacity:`0.12`,stroke:`currentColor`,strokeWidth:`3`}),(0,m.jsx)(`rect`,{x:`76`,y:`7`,width:`68`,height:`14`,rx:`10`,fill:`#94A3B8`}),(0,m.jsx)(`rect`,{x:`65`,y:`52`,width:`72`,height:`10`,rx:`5`,fill:`currentColor`,fillOpacity:`0.2`}),(0,m.jsx)(`rect`,{x:`65`,y:`72`,width:`94`,height:`10`,rx:`5`,fill:`currentColor`,fillOpacity:`0.16`}),(0,m.jsx)(`rect`,{x:`65`,y:`92`,width:`66`,height:`10`,rx:`5`,fill:`currentColor`,fillOpacity:`0.18`})]}),nB=({children:e})=>{let t=J(`groupItems`);return(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:e}),(0,m.jsxs)(IE,{align:`center`,side:`bottom`,className:`flex gap-1 flex-col`,children:[(0,m.jsx)(`span`,{className:`text-nowrap`,children:t(`addNewItemToGroup`)}),(0,m.jsxs)(ID,{children:[(0,m.jsx)(FD,{children:`Cmd+Enter`}),(0,m.jsx)(FD,{children:`Ctrl+Enter`})]})]})]})},rB=({groupId:e,itemID:t,index:n,itemIdForPreview:r,commonActionsT:i,copyItemToClipboard:a,editorItemRegistry:o,getItemButtonProps:s,navigateToItem:c,setPreferredPreviewItemId:l,survey:d,t:f})=>{let{ref:p,isDragging:h}=Cz({id:t,index:n,group:e}),g=d.surveyItems.get(t);if(!g)return null;let _={typeInfos:dD(g,o),color:cD(g)};return(0,m.jsx)(`li`,{ref:p,className:z(`group list-none touch-none`,h&&`bg-muted/60 backdrop-blur-xs`),tabIndex:-1,children:(0,m.jsxs)(yD,{children:[(0,m.jsx)(bD,{asChild:!0,children:(0,m.jsxs)(`div`,{tabIndex:0,className:z(`relative flex h-auto w-full items-center gap-2 px-3 py-2 text-start`,`hover:bg-muted backdrop-blur-xl transition-colors border rounded-lg`,_.typeInfos.defaultItemClassName,{"font-bold ring-4 ring-ring/50":g.id===r}),style:{color:_.color,borderColor:_.color},onClick:()=>{l(g.id)},onDoubleClick:()=>{l(null),c(g.id)},...s(g.id),children:[(0,m.jsx)(`span`,{className:`absolute -left-4 top-0 hidden h-full items-center group-hover:flex`,children:(0,m.jsx)(qw,{className:`size-4 text-muted-foreground`})}),(0,m.jsx)(`div`,{children:(0,m.jsx)(_.typeInfos.icon,{className:`size-4`})}),(0,m.jsxs)(`span`,{className:`grow space-x-2`,children:[(0,m.jsx)(`span`,{className:`font-mono text-sm`,style:{borderColor:_.color},children:g.type===u.lt.PageBreak?f(`pageBreak`):d.getItemKey(g.id)?.itemKey??g.id}),(0,m.jsx)(`span`,{className:`font-semibold italic`,children:g.metadata?.itemLabel})]})]})}),(0,m.jsxs)(CD,{className:`border-border`,children:[(0,m.jsx)(wD,{onClick:()=>{l(null),c(g.id)},children:(0,m.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(hT,{className:`size-4`}),(0,m.jsx)(`span`,{className:`ml-2`,children:i(`open`)})]})}),(0,m.jsxs)(wD,{onClick:()=>{a(g.id)},children:[(0,m.jsx)(Ow,{className:`size-4`}),(0,m.jsx)(`span`,{className:`ml-2`,children:i(`copy`)})]}),(0,m.jsx)(OD,{}),(0,m.jsx)(MD,{itemId:g.id}),(0,m.jsx)(OD,{}),(0,m.jsx)(jz,{itemId:g.id})]})]})})},iB=()=>{let e=J(`groupItems`),t=J(`common.actions`),n=J(`copyItem`),r=J(`history`),i=q(e=>e.copyItem),a=q(e=>e.editorItemRegistry),o=q(e=>e.updateItem),s=q(e=>e.commitByUser),c=q(e=>e.pasteItem),{selectedItemId:l,navigateToItem:f}=oD(),p=tD(),h=rD(e=>e.setAssistantHighlight),{addItemDialogOpen:g,openAddItemDialog:_,preferredPreviewItemId:v,setPreferredPreviewItemId:y}=Pz(),[b,x]=yE(),S=(0,d.useRef)(null),C=(0,d.useRef)(g),w=(0,d.useRef)(null),T=(0,d.useRef)(null),E=(0,d.useMemo)(()=>!p||l&&p.surveyItems.get(l)instanceof u.st?l:p.rootItem?.id,[l,p]),D=(0,d.useMemo)(()=>{if(!p||!E)return null;let e=p.surveyItems.get(E);return e instanceof u.st?e:null},[E,p]),O=(0,d.useCallback)(e=>{if(!e)return null;try{let t=JSON.parse(e);return Iz.isValidClipboardData(t)?t:null}catch{return null}},[]),k=(0,d.useMemo)(()=>O(b),[b,O]),A=(0,d.useMemo)(()=>k?k.items.find(e=>e.itemId===k.rootItemId)?.itemData??null:null,[k]),j=(0,d.useMemo)(()=>A?A.metadata?.itemLabel?`${A.key} - ${A.metadata.itemLabel}`:A.key||A.itemType:null,[A]),M=(0,d.useMemo)(()=>A?fD(A.itemType,a)?.label??A.itemType:null,[A,a]),N=(0,d.useCallback)(()=>{E&&_(E)},[E,_]),ee=(0,d.useCallback)(e=>{try{let t=i(e);navigator.clipboard.writeText(JSON.stringify(t,null,2)).then(()=>{x(),OE.success(n(`copied`))}).catch(()=>{OE.error(n(`failedToClipboard`))})}catch(e){console.error(`Error copying item:`,e),OE.error(n(`failed`))}},[i,n,x]),P=(0,d.useCallback)(e=>{p?.surveyItems.get(e)&&(y(null),f(e))},[f,y,p]),F=(0,d.useCallback)((e,t)=>{if(!D)return!1;let n=D.items.indexOf(e),i=n+t;return n<0||i<0||i>=D.items.length?!1:(D.swapItemsByIndex(n,i),o(D.id,D.rawItem),s({label:r(`moveItem`)}),y(e),!0)},[s,D,r,y,o]),I=(0,d.useMemo)(()=>{let e=D?.items??[];return e.length<1?null:v&&e.includes(v)?v:e[0]},[D?.items,v]);(0,d.useEffect)(()=>(h(`group-items-preview`,I?{kind:`highlighted-item`,itemId:I,details:`Highlighted in the current group item list without opening the item.`}:void 0),()=>h(`group-items-preview`)),[I,h]),(0,d.useEffect)(()=>{x()},[x]),(0,d.useEffect)(()=>{let e=()=>{x()};return window.addEventListener(`focus`,e),()=>{window.removeEventListener(`focus`,e)}},[x]),(0,d.useEffect)(()=>{let e=S.current;if(S.current=E??null,!D||!e||e===D.id)return;let t=D.items??[];if(!(v&&t.includes(v))){if(t.includes(e)){y(e);return}v&&!t.includes(v)&&y(null)}},[E,D,v,y]),(0,d.useEffect)(()=>{let e=T.current,t=w.current;if(w.current=E??null,!e||g){C.current=g;return}let n=C.current&&!g,r=!e.contains(document.activeElement),i=t!==(E??null);if(C.current=g,!r&&!n&&!i)return;let a=I?`[data-group-list-target="item"][data-group-list-item-id="${CSS.escape(I)}"]`:`[data-group-list-target="add"]`,o=0,s=0;return o=window.requestAnimationFrame(()=>{s=window.requestAnimationFrame(()=>{e.querySelector(a)?.focus({preventScroll:!0})})}),()=>{window.cancelAnimationFrame(o),window.cancelAnimationFrame(s)}},[g,E,I]);let{getAddButtonProps:L,getItemButtonProps:te,onListKeyDown:ne}=eB({addItemDialogOpen:g,containerRef:T,groupId:E,itemIds:D?.items??[],clipboardValue:b,previewItemId:I,openAddDialogForCurrentGroup:N,openFocusedItem:P,selectPreviewItem:y,moveItemByOffset:F,parseSurveyItemClipboard:O,pasteItemFromClipboardData:(e,t)=>c(e,{parentId:t}),onPasteCommitted:t=>{s({label:r(`pasteItem`)}),y(t),x(),OE.success(e(`itemPasted`))},copyItemToClipboard:ee});if(!D||!p)return(0,m.jsx)(`p`,{children:e(`loadingGroupItem`)});let re=e=>{if(e.canceled||!MR(e.operation)||!e.operation.source)return;let{source:t}=e.operation,{initialIndex:n,index:i}=t;n!==i&&(D.moveItemToIndex(String(t.id),i),o(D.id,D.rawItem),s({label:r(`moveItem`)}))},ie=(D.items?.length??0)<1,ae=j?(0,m.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/20 px-3 py-2 text-xs text-muted-foreground`,children:[(0,m.jsxs)(`p`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,m.jsx)(jw,{className:`size-3.5 text-foreground/70`}),(0,m.jsx)(`span`,{className:`font-semibold text-foreground`,children:e(`insert`)}),(0,m.jsx)(`span`,{children:j}),M&&(0,m.jsxs)(`span`,{children:[`(`,M,`)`]})]}),(0,m.jsxs)(`p`,{className:`mt-1.5 flex flex-wrap items-center gap-1.5`,children:[(0,m.jsx)(`span`,{children:e(`press`)}),(0,m.jsx)(FD,{children:`Cmd+V`}),(0,m.jsx)(`span`,{children:e(`or`)}),(0,m.jsx)(FD,{children:`Ctrl+V`}),(0,m.jsx)(`span`,{children:e(`toInsert`)})]})]}):null;return(0,m.jsxs)(`div`,{className:`flex grow h-full min-h-0`,children:[(0,m.jsx)(`div`,{className:`flex-1 pt-2 px-4 pb-4 border-r border-border flex flex-col min-h-0`,children:(0,m.jsxs)(`div`,{className:`flex flex-col h-full min-h-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-2 shrink-0`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{children:(0,m.jsxs)(`h3`,{className:`font-semibold text-sm`,children:[e(`items`),(0,m.jsxs)(`span`,{className:`text-sm text-muted-foreground ml-2`,children:[`(`,D.items?.length??0,`)`]})]})}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:e(`doubleClickHelp`)})]}),(0,m.jsx)(nB,{children:(0,m.jsx)(B,{variant:`ghost`,size:`icon`,className:`-mr-2`,onClick:N,children:(0,m.jsx)(yT,{className:`size-4`})})})]}),(0,m.jsxs)(`div`,{ref:T,className:`flex-1 min-h-0 overflow-y-auto -mx-4 px-4 space-y-4 py-4`,onKeyDown:ne,children:[ie?(0,m.jsxs)(`div`,{className:`flex flex-col items-center text-center border border-dashed border-border rounded-lg p-8`,children:[(0,m.jsx)(tB,{}),(0,m.jsx)(`h4`,{className:`mt-5 text-base font-semibold text-muted-foreground`,children:e(`noItemsYet`)}),(0,m.jsx)(`p`,{className:`mt-2 max-w-2xl text-xs text-muted-foreground text-balance mb-4`,children:e(`emptyDescription`)}),(0,m.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col gap-2`,children:[ae,(0,m.jsx)(nB,{children:(0,m.jsxs)(B,{variant:`default`,className:`border-dashed w-full`,onClick:N,...L(),children:[(0,m.jsx)(yT,{className:`size-4`}),e(`addItem`)]})})]})]}):(0,m.jsx)(FL,{sensors:[$I.configure({activationConstraints:[new YI.Distance({value:5})]})],onDragEnd:re,children:(0,m.jsx)(`ol`,{className:`space-y-1.5`,children:D.items.map((n,r)=>(0,m.jsx)(rB,{groupId:D.id,itemID:n,index:r,itemIdForPreview:I,commonActionsT:t,copyItemToClipboard:ee,editorItemRegistry:a,getItemButtonProps:te,navigateToItem:f,setPreferredPreviewItemId:y,survey:p,t:e},n))})}),!ie&&(0,m.jsx)(`div`,{className:`flex justify-center`,children:(0,m.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[ae,(0,m.jsx)(nB,{children:(0,m.jsxs)(B,{variant:`outline`,className:`border-dashed w-full`,onClick:N,...L(),children:[(0,m.jsx)(yT,{className:`size-4`}),e(`addItem`)]})})]})})]})]})}),(0,m.jsx)(`div`,{className:`flex-1 pt-2 px-4 pb-4 flex-col min-h-0 bg-muted/30 hidden @2xl/main:flex`,children:(0,m.jsx)(`div`,{className:`flex-1 min-h-0 overflow-y-auto`,children:(0,m.jsx)(d.Suspense,{children:(0,m.jsx)(Az,{item:I?p.surveyItems.get(I):void 0,mode:`static`},I)})})})]})},aB=e=>{let t=J(`defaultEditors.root`),n=PO(e.item,`conditions`),r=[{id:`items`,label:t(`items`),icon:aT},...n>0?[{id:`conditions`,label:t(`conditions`),icon:Gw,hasIndicator:!0,indicatorCount:n}]:[]];return(0,m.jsxs)(QO,{surveyItem:e.item,menu:{hideDeleteItem:!0,items:[]},navItems:r,children:[(0,m.jsx)(QE,{value:`items`,className:`flex flex-col h-full min-h-0`,children:(0,m.jsx)(iB,{})}),(0,m.jsx)(QE,{value:`preview`,className:`space-y-4 h-full min-h-0 overflow-y-auto`,children:t(`previewTodo`)}),(0,m.jsx)(QE,{value:`conditions`,className:`space-y-4 h-full min-h-0 overflow-y-auto`,children:(0,m.jsx)(`div`,{className:`mx-auto w-full max-w-3xl p-4`,children:(0,m.jsx)(GO,{item:e.item,scope:`conditions`})})})]})};function oB({className:e,...t}){return(0,m.jsx)(xd,{"data-slot":`radio-group`,className:z(`grid w-full gap-2`,e),...t})}function sB({className:e,...t}){return(0,m.jsx)(Ed,{"data-slot":`radio-group-item`,className:z(`group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,e),...t,children:(0,m.jsx)(Od,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:(0,m.jsx)(`span`,{className:`absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground`})})})}function Y(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function cB(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var lB=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,uB=lB&&`documentMode`in document?document.documentMode:null,dB=lB&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),fB=lB&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),pB=!(!lB||!(`InputEvent`in window)||uB)&&`getTargetRanges`in new window.InputEvent(`input`),mB=lB&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,hB=lB&&/Android/.test(navigator.userAgent),gB=lB&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!hB,_B=lB&&/^(?=.*Chrome).*/i.test(navigator.userAgent),vB=lB&&hB&&_B,yB=lB&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&dB&&!_B,bB=0,xB=1,SB=2,CB=1,wB=2,TB=3,EB=4,DB=5,OB=6,kB=gB||mB||yB?`\xA0`:``,AB=`
|
|
155
|
-
|
|
156
|
-
`,jB=fB?`\xA0`:kB,MB={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},NB={directionless:1,unmergeable:2},PB={center:2,end:6,justify:4,left:1,right:3,start:5},FB={[wB]:`center`,[OB]:`end`,[EB]:`justify`,[CB]:`left`,[TB]:`right`,[DB]:`start`},IB={normal:0,segmented:2,token:1},LB={[bB]:`normal`,[SB]:`segmented`,[xB]:`token`},RB=`$config`;function zB(){return DJ()._blockCursorElement}function BB(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var VB=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&Y(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&Y(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&Y(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=HB(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=HB(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function HB(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var UB=class e extends VB{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;BB(t);)e=t,t=t.nextSibling;let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===zB()?n:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(yB||mB||gB);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=cJ().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),n.insertBefore(i,r),e){let e=cJ().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=zB(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=WB(t,n);i.push(r);let a=WB(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function WB(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&Y(225),n.reverse()}var GB;try{GB=`0.48.0+prod.esm`}catch{}var KB=GB??`"<unknown>+source"`,qB=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},JB=null;function YB(e,t=1e3){return e instanceof XB?e.clone():e.size<t?new Map(e):new XB().init(new Map(e),void 0,e.size)}var XB=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===JB?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===JB?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==JB&&n!==void 0||(this._size++,n===JB&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,JB),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(t)for(let n of t){let t=n[0],r=e?e.get(t):void 0;r!==JB&&(r!==void 0&&(n[1]=r),yield n)}if(e)for(let n of e)n[1]===JB||t&&t.has(n[0])||(yield n)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}};function ZB(e,t,n,r,i,a){if($(e)){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(($(o)||$J(o)&&o.__slots!==null)&&ZB(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}for(let o of $J(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&eY(e)&&e.__slotHost===t&&(($(e)||$J(e)&&e.__slots!==null)&&ZB(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var QB=!1,$B=0;function eV(e){$B=e.timeStamp}function tV(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&lq(e,n)!==void 0}function nV(e,t,n){let r=tJ(Wq(n)),i=r&&dJ(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&Sq(t,s,a,o,!1)}function rV(e,t,n){if(Z(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return XK(t)&&n.isAttached()}function iV(e,t,n){for(let r=e;r&&!VJ(r);r=Rq(r)){let e=lq(r,t);if(e!==void 0){let t=oq(e,n);if(t)return lK(t)||!yJ(r)?void 0:[r,t]}}}function aV(e,t,n){QB=!0;let r=performance.now()-$B>100;try{iK(e,()=>{let i=Q()||function(e){return e.read(`latest`,()=>{let e=Q();return e===null?null:e.clone()})}(e),a=new Map,o=e._editorState,s=e._blockCursorElement,c=!1,l=``;for(let n=0;n<t.length;n++){let u=t[n],d=u.type,f=u.target,p=iV(f,e,o);if(!p)continue;let[m,h]=p;if(d===`characterData`)r&&X(h)&&XK(f)&&rV(i,f,h)&&nV(f,h,e);else if(d===`childList`){c=!0;let t=u.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=sq(r),a=r.parentNode;if(!(a==null||r===s||i!==null||tV(r,a,e)||e._slotsUsed&&yJ(r)&&r.hasAttribute(`data-lexical-slot`)||VJ(r))){if(fB){let e=(yJ(r)?r.innerText:null)||r.nodeValue;e&&(l+=e)}a.removeChild(r)}}let n=u.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(tV(r,f,e)||s===r)&&(f.appendChild(r),t++)}r!==t&&a.set(m,h)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let u=n.takeRecords();if(u.length>0){for(let t=0;t<u.length;t++){let n=u[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||tV(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(c&&mq(i),fB&&Fq(e)&&i.insertRawText(l))})}finally{QB=!1}}function oV(e){let t=e._observer;t!==null&&aV(e,t.takeRecords(),t)}function sV(e){(function(e){$B===0&&Wq(e).addEventListener(`textInput`,eV,!0)})(e),e._observer=new MutationObserver((t,n)=>{aV(e,t,n)})}var cV=`latest`,lV=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||yV).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function uV(e,t){return new lV(e,t)}function dV(e,t,n=cV){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function fV(e,t,n){let r;if(RG(),typeof n==`function`){let i=e.getLatest(),a=dV(i,t);if(r=n(a),t.isEqual(a,r))return i}else r=n;let i=e.getWritable();return gV(i).updateFromKnown(t,r),i}function pV(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of qJ(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var mV=new Set([`__proto__`,`constructor`,`prototype`]),hV=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return vV(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(mV.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=vV(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(mV.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function gV(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new hV(t,_V(t));return t.__state=n,n}function _V(e){return e.__state?e.__state.sharedNodeState:BK(DJ(),e.getType()).sharedNodeState}function vV(e){if(e)for(let t in e)return e}function yV(e){return e}function bV(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function xV(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function SV(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function CV(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&bV(n,e,t)||t&&bV(n,t,e)||e&&xV(n,e,t)||t&&xV(n,t,e))}(c,l))}function wV(e,t){let n=e.mergeWithSibling(t),r=HG()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function TV(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&X(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(CV(t,r)){r=wV(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&X(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(CV(r,n)){r=wV(r,n);break}break}n.remove()}}else r.remove()}function EV(e){return DV(e.anchor),DV(e.focus),e}function DV(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),X(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!$(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var OV=Symbol.for(`@lexical/CachedTextSize`);function kV(e,t){return KV.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=GV.get(r);if(i===void 0&&Y(345,r),$(i)){let a=qV.get(r);if(a!==void 0&&$(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=JV.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&Y(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else{let e=i[OV];e===void 0&&Y(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:NV})}function AV(e){$(e)||e[OV]===void 0&&(e[OV]=X(e)?e.__text.length:e.getTextContentSize())}var jV=4,MV,NV,PV,FV=``,IV=null,LV=null,RV=null;function zV(){return{firstTextKey:RV,format:IV,style:LV}}function BV(e){e.firstTextKey!==null&&(IV=e.format,LV=e.style,RV=e.firstTextKey)}function VV(e){if(RV!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&Y(348),t===null)return;let n=qV.get(t);X(n)&&(IV=n.getFormat(),LV=n.getStyle(),RV=t)}var HV,UV,WV,GV,KV,qV,JV,YV,XV,ZV,QV=!1,$V=!1;function eH(e,t){let n=GV.get(e),r=qV.has(e);if(t!==null){let n=wH(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(NV._keyToDOMMap.delete(e),$(n)){let e=XJ(n,GV);tH(e,0,e.length-1,null)}if(n!==void 0){for(let e of uH(n).values()){let t=fH(e);eH(e,null),t!==null&&t.remove()}Mq(XV,PV,HV,n,`destroyed`)}}}function tH(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&eH(t,r)}}function nH(e,t){e.setProperty(`text-align`,t)}var rH=`40px`;function iH(e,t){let n=MV.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${rH}))`)}function aH(e,t){let n=e.style;t===0?nH(n,``):t===1?nH(n,`left`):t===2?nH(n,`center`):t===3?nH(n,`right`):t===4?nH(n,`justify`):t===5?nH(n,`start`):t===6&&nH(n,`end`)}function oH(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(dK(e))return null;let n=e.getParent();return n===null||Jq(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function sH(e){let t=cJ().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function cH(e,t,n){t||e.contentEditable===`false`?HJ(n,NV):n.removeAttribute(`contenteditable`)}function lH(e,t,n){let r=FV,i=zV();FV=``;let a=``,o=lK(e);for(let[r,i]of n){let n=sH(r);cH(t,o,n),t.appendChild(n),FV=``;let s=zV();mH(i,kJ(e,n,NV)),BV(s),dH(e,r,t,n),a+=FV}return BV(i),FV=r,a}function uH(e){return $J(e)&&e.__slots!==null?e.__slots:QJ}function dH(e,t,n,r){let i=ZV.$getSlotTargetElement(e,t,n,NV);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function fH(e){let t=JV.get(e);return t===void 0?null:t.parentElement}function pH(e,t,n){let r=uH(e),i=uH(t);for(let[e,t]of r)if(!i.has(e)){let e=fH(t);eH(t,null),e!==null&&e.remove()}let a=FV,o=zV(),s=``,c=null,l=lK(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:fH(i);FV=``;let u=zV();if(o===null){o=sH(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),mH(a,kJ(t,o,NV))}else i===a?yH(a,o):(i!==void 0&&eH(i,o),mH(a,kJ(t,o,NV)));if(BV(u),cH(n,l,o),dH(t,e,n,o),s+=FV,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return BV(o),FV=a,s}function mH(e,t){let n=qV.get(e);if(n===void 0&&Y(60),t!==null){let r=GV.get(e);if(r!==void 0){let i=JV.get(e);if(i!==void 0){let a=eY(r)?r.__slotHost:null,o=eY(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),yH(e,t.element)}}}let r=ZV.$createDOM(n,NV);if(function(e,t,n){let r=n._keyToDOMMap;cq(t,n,e),r.set(e,t)}(e,r,NV),X(n)?r.setAttribute(`data-lexical-text`,`true`):lK(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),BJ(r,{captureSelection:!0})),$(n)){let e=n.__indent,t=n.__size;oH(r,n),e!==0&&iH(r,e);let i=uH(n),a=i.size>0?lH(n,r,i):``;if(t===0)r.__lexicalTextContent=a,r.__lexicalFirstTextKey=null,FV+=a,i.size>0&&(r.__lexicalSlotTextLength=a.length);else{let e=FV,o=t-1;if(hH(XJ(n,qV),n,0,o,kJ(n,r,NV)),a!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=a+t,FV=e+a+t}i.size>0&&(r.__lexicalSlotTextLength=a.length)}let o=n.__format;o!==0&&aH(r,o),n.isInline()||gH(null,n,r)}else{let t=n.getTextContent();if(lK(n)){let t=n.decorate(NV,MV);t!==null&&bH(e,t),r.contentEditable=`false`;let i=uH(n);i.size>0&&lH(n,r,i)}FV+=t}return t!==null&&t.insertChild(r),ZV.$decorateDOM(n,null,r,NV),AV(n),Mq(XV,PV,HV,n,`created`),r}function hH(e,t,n,r,i){let a=FV,o=zV();FV=``,IV=null,LV=null,RV=null;let s=n;for(;s<=r;++s){let t=zV();mH(e[s],i);let n=qV.get(e[s]);n!==null&&X(n)?IV===null&&(IV=n.getFormat(),LV=n.getStyle(),RV=n.__key):$(n)&&s<r&&!n.isInline()&&(FV+=AB),BV(t)}let c=NV._keyToDOMMap.get(t.__key);c===void 0&&Y(349,t.__key),c.__lexicalTextContent=FV,c.__lexicalFirstTextKey=RV,FV=a+FV,BV(o)}function gH(e,t,n){let r=kJ(t,n,NV),i=r.element.__lexicalLastChildKind??null,a=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return xK(e)?`line-break`:lK(e)&&e.isInline()?`decorator`:null}return uH(e).size>0?null:`empty`}return null}(t,qV);i!==a&&r.setManagedLineBreak(a)}function _H(e,t,n){var r;IV=null,LV=null,RV=null,function(e,t,n){let r=FV,i=e.__size,a=t.__size;FV=``;let o=n.element,s=NV._keyToDOMMap.get(t.__key);s===void 0&&Y(351,t.__key);let c=a-i;if(!QV&&Math.abs(c)<=1&&i>=jV&&e.__first===t.__first&&(c!==0||!NV._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=YV.get(e.__key);if(!QV&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=qV.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=kV(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=qV.get(n);if(e===void 0)break;let t=zV();yH(n,o),X(e)&&IV===null&&(IV=e.getFormat(),LV=e.getStyle(),RV=e.__key),BV(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=qV.get(n);if(e===void 0)break;let t;if($(e)){let r=NV._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&Y(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&$(e)&&!e.isInline()&&(d+=AB),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,FV=r+m,vH(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=GV.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=qV.get(a),d=GV.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=qV.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=GV.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=kV(l,c);for(let e of _){let t=zV();if(e.kind===`reconcile`)yH(e.key,n.element);else if(e.kind===`destroy`)eH(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=NV._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}mH(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=qV.get(e.key);t&&X(t)&&IV===null&&(IV=t.getFormat(),LV=t.getStyle(),RV=t.__key)}BV(t)}let x=``;for(let e=0;e<o;e++){let t=qV.get(f[e]);if(t===void 0)return!1;let n;if($(t)){let r=NV._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&Y(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&$(t)&&!t.isInline()&&(x+=AB)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&Y(353),FV=r+e,vH(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=qV.get(t);if(e===void 0)break;let r=QV||WV.has(t)||UV.has(t),i=zV();if(r)yH(t,o);else{let n,r;if($(e)){r=JV.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&Y(354,e.getType()),n=i}else n=e.getTextContent();FV+=n,r!==void 0&&VV(r)}X(e)?IV===null&&(IV=e.getFormat(),LV=e.getStyle(),RV=e.__key):$(e)&&n<a-1&&!e.isInline()&&(FV+=AB),BV(i),t=e.__next,n++}s.__lexicalTextContent=FV,s.__lexicalFirstTextKey=RV,FV=r+FV;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)yH(r,o);else{let e=wH(r),t=mH(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}eH(r,null)}let a=qV.get(i);X(a)&&IV===null&&(IV=a.getFormat(),LV=a.getStyle(),RV=a.__key)}else{let r=XJ(e,GV),s=XJ(t,qV);if(r.length!==i&&Y(227),s.length!==a&&Y(228),i===0)a!==0&&hH(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&uH(t).size===0&&n.element.__lexicalLineBreak==null;tH(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else (function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=zV();if(e===r)u=xH(yH(r,a.element)),d++,f++;else{if(l===void 0&&(l=SH(n,f)),c===void 0)c=SH(t,d);else if(!c.has(e)){d++,BV(i);continue}if(!l.has(e)){u=xH(wH(e)),eH(e,a.element),d++,c.delete(e),BV(i);continue}if(c.has(r)){let e=Lq(NV,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=xH(yH(r,a.element)),d++,f++}else mH(r,a.withBefore(u??a.before)),f++}let o=qV.get(r);o!==null&&X(o)?IV===null&&(IV=o.getFormat(),LV=o.getStyle(),RV=o.__key):$(o)&&f<=s&&!o.isInline()&&(FV+=AB),BV(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:NV.getElementByKey(t);hH(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&tH(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=FV,s.__lexicalFirstTextKey=RV,FV=r+FV}(e,t,kJ(t,n,NV)),Jq(t)||(r=t,IV==null||IV===r.__textFormat||$V||r.setTextFormat(IV),function(e){LV==null||LV===e.__textStyle||$V||e.setTextStyle(LV)}(t))}function vH(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=qV.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=qV.get(r);if(X(e))return IV=e.getFormat(),void(LV=e.getStyle())}}t.__lexicalFirstTextKey=RV}function yH(e,t){let n=GV.get(e),r=qV.get(e);n!==void 0&&r!==void 0||Y(61);let i=QV||WV.has(e)||UV.has(e),a=Lq(NV,e);if(n===r&&!i){let e;if($(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&Y(355,n.getType()),e=t,VV(a)}else e=n.getTextContent();return FV+=e,a}if(n!==r&&i&&Mq(XV,PV,HV,r,`updated`),ZV.$updateDOM(r,n,a,NV)){let n=mH(e,null);return t===null&&Y(62),t.replaceChild(n,a),eH(e,null),n}if($(n)){$(r)||Y(334,e);let t=r.__indent;(QV||t!==n.__indent)&&iH(a,t);let o=r.__format;(QV||o!==n.__format)&&aH(a,o);let s=i&&(uH(r).size>0||uH(n).size>0)?pH(n,r,a):``;if(i){let e=FV;if(_H(n,r,a),dK(r)||r.isInline()||gH(0,r,a),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,FV=e+s+t,a.__lexicalSlotTextLength=s.length}else (uH(r).size>0||uH(n).size>0)&&(a.__lexicalSlotTextLength=0)}else{let e=a.__lexicalTextContent;typeof e!=`string`&&Y(356,n.getType()),FV+=e,VV(a)}if((QV||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(oH(a,r),dK(r)&&!QV))for(let e of r.getChildren())$(e)&&oH(Lq(NV,e.getKey()),e)}else{let t=r.getTextContent();if(lK(r)){let t=r.decorate(NV,MV);t!==null&&bH(e,t),i&&(uH(r).size>0||uH(n).size>0)&&pH(n,r,a)}FV+=t}if(!$V&&dK(r)){let e=r.getLatest();if(e.__cachedText!==FV){let t=e.getWritable();t.__cachedText=FV,r=t}}return ZV.$decorateDOM(r,n,a,NV),AV(r),a}function bH(e,t){let n=NV._pendingDecorators,r=NV._decorators;if(n===null){if(r[e]===t)return;n=dq(NV)}n[e]=t}function xH(e){let t=e.nextSibling;return t!==null&&t===NV._blockCursorElement&&(t=t.nextSibling),t}function SH(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function CH(e,t,n,r,i,a){FV=``,IV=null,LV=null,RV=null,QV=r===2,NV=n,MV=n._config,ZV=n._config.dom||MK,PV=n._nodes,HV=NV._listeners.mutation,UV=i,WV=a,GV=e._nodeMap,KV=e,qV=t._nodeMap,$V=t._readOnly,JV=YB(n._keyToDOMMap),YV=function(){let e=new Map,t=t=>{for(let n of t){let t=qV.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(UV.keys()),t(WV),e}();let o=new Map;return XV=o,yH(`root`,null),NV=void 0,PV=void 0,UV=void 0,WV=void 0,GV=void 0,KV=void 0,qV=void 0,MV=void 0,JV=void 0,YV=void 0,XV=void 0,ZV=MK,o}function wH(e){let t=JV.get(e);return t===void 0&&Y(75,e),t}function TH(e){return{type:e}}var EH=TH(`SELECTION_CHANGE_COMMAND`),DH=TH(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),OH=TH(`CLICK_COMMAND`),kH=TH(`BEFORE_INPUT_COMMAND`),AH=TH(`INPUT_COMMAND`),jH=TH(`COMPOSITION_START_COMMAND`),MH=TH(`COMPOSITION_END_COMMAND`),NH=TH(`DELETE_CHARACTER_COMMAND`),PH=TH(`INSERT_LINE_BREAK_COMMAND`),FH=TH(`INSERT_PARAGRAPH_COMMAND`),IH=TH(`CONTROLLED_TEXT_INSERTION_COMMAND`),LH=TH(`PASTE_COMMAND`),RH=TH(`REMOVE_TEXT_COMMAND`),zH=TH(`DELETE_WORD_COMMAND`),BH=TH(`DELETE_LINE_COMMAND`),VH=TH(`FORMAT_TEXT_COMMAND`),HH=TH(`SET_TEXT_FORMAT_COMMAND`),UH=TH(`UNDO_COMMAND`),WH=TH(`REDO_COMMAND`),GH=TH(`KEYDOWN_COMMAND`),KH=TH(`KEY_ARROW_RIGHT_COMMAND`),qH=TH(`MOVE_TO_END`),JH=TH(`KEY_ARROW_LEFT_COMMAND`),YH=TH(`MOVE_TO_START`),XH=TH(`KEY_ARROW_UP_COMMAND`),ZH=TH(`KEY_ARROW_DOWN_COMMAND`),QH=TH(`KEY_ENTER_COMMAND`),$H=TH(`KEY_SPACE_COMMAND`),eU=TH(`KEY_BACKSPACE_COMMAND`),tU=TH(`KEY_ESCAPE_COMMAND`),nU=TH(`KEY_DELETE_COMMAND`),rU=TH(`KEY_TAB_COMMAND`),iU=TH(`INSERT_TAB_COMMAND`),aU=TH(`INDENT_CONTENT_COMMAND`),oU=TH(`OUTDENT_CONTENT_COMMAND`),sU=TH(`DROP_COMMAND`),cU=TH(`FORMAT_ELEMENT_COMMAND`),lU=TH(`DRAGSTART_COMMAND`),uU=TH(`DRAGOVER_COMMAND`),dU=TH(`DRAGEND_COMMAND`),fU=TH(`COPY_COMMAND`),pU=TH(`CUT_COMMAND`),mU=TH(`SELECT_ALL_COMMAND`),hU=TH(`CLEAR_EDITOR_COMMAND`),gU=TH(`CLEAR_HISTORY_COMMAND`),_U=TH(`CAN_REDO_COMMAND`),vU=TH(`CAN_UNDO_COMMAND`),yU=TH(`FOCUS_COMMAND`),bU=TH(`BLUR_COMMAND`),xU=TH(`KEY_MODIFIER_COMMAND`);function SU(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function CU(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}var wU=Object.freeze({}),TU=[[`keydown`,function(e,t){let n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&IU(n),!t.isComposing()&&Iq(t,GH,e)}],[`pointerdown`,function(e,t){let n=_J(e),r=e.pointerType;bJ(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&iK(t,()=>{UJ(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],[`compositionstart`,function(e,t){Iq(t,jH,e)}],[`compositionend`,function(e,t){let n=t._inputState;fB?n.compositionPhase=`ending-firefox`:mB||!gB&&!yB?Iq(t,MH,e):(n.compositionPhase=`ending-safari`,n.compositionEndData=e.data)}],[`input`,function(e,t){e.stopPropagation();let n=t._inputState;IU(n),iK(t,()=>{RU(e,t)||t.dispatchCommand(AH,e)},{event:e}),n.unprocessedBeforeInputData=null}],[`click`,function(e,t){iK(t,()=>{let n=Q(),r=tJ(Wq(t)),i=fG();if(r){if(Z(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!dK(t)&&pq().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=dJ(r,t._rootElement).anchorNode;(yJ(n)||XK(n))&&mq(dG(i,r,t,e))}}Iq(t,OH,e)})}],[`cut`,wU],[`copy`,wU],[`dragstart`,wU],[`dragover`,wU],[`dragend`,wU],[`paste`,wU],[`focus`,wU],[`blur`,wU],[`drop`,wU]];pB&&TU.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||fB&&Fq(t)||n!==`insertCompositionText`&&iK(t,()=>{RU(e,t)||Iq(t,kH,e)},{event:e})}(e,t)]);var EU=new WeakMap,DU=new WeakMap,OU=SU(e=>(e.addEventListener(`selectionchange`,JU),()=>e.removeEventListener(`selectionchange`,JU)));function kU(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=HG(),u;if(a!==void 0)u=a;else{let e=tJ(Wq(l));u=e===null?null:dJ(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!X(c)||(!i&&(!pB||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||_q(n))&&o.offset!==s.offset&&!c.isComposing()||YK(c)||c.isDirty()&&m>1||(i||!pB)&&p!==null&&!c.isComposing()&&d!==jJ(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=JK(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(X(t)||$(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function AU(e,t){return XK(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function jU(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=dJ(e,t._rootElement),s=t._inputState;s.isSelectionChangeFromDOMUpdate&&(s.isSelectionChangeFromDOMUpdate=!1,AU(r,i)&&AU(a,o)&&!s.postDeleteSelectionToRestore)||iK(t,()=>{if(!n)return void mq(null);if(!WK(t,r,a))return;let c=Q();if(s.postDeleteSelectionToRestore&&Z(c)&&c.isCollapsed()){let e=c.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(c=s.postDeleteSelectionToRestore.clone(),mq(c))}if(s.postDeleteSelectionToRestore=null,Z(c)){let n=c.anchor,l=n.getNode();if(c.isCollapsed()){e.type===`Range`&&r===a&&(c.dirty=!0);let i=Wq(t).event,o=i?i.timeStamp:performance.now(),{format:u,style:d,offset:f,key:p,timeStamp:m}=s.collapsedSelectionFormat,h=pq(),g=!1===t.isComposing()&&h.getTextContent()===``;if(o<m+200&&n.offset===f&&n.key===p)MU(c,u,d);else if(n.type===`text`)X(l)||Y(141),NU(c,l);else if(n.type===`element`&&!g){$(l)||Y(259);let e=n.getNode();e.isEmpty()?function(e,t){MU(e,t.getTextFormat(),t.getTextStyle())}(c,e):MU(c,c.format,``)}}else{let e=n.key,t=c.focus.key,r=c.getNodes(),a=r.length,s=c.isBackward(),l=s?o:i,u=s?i:o,d=s?t:e,f=s?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(X(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}c.format=m?p:0}}Iq(t,EH,void 0)})}function MU(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function NU(e,t){MU(e,t.getFormat(),t.getStyle())}function PU(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function FU(e){let{lastKeyCode:t}=HG()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
|
|
157
|
-
`:t===`Tab`?` `:null;if(!n)return;let r=Q();if(!Z(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!X(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===`
|
|
158
|
-
`){if(xK(e))e.selectEnd();else if(!e){let e=YJ(i,sG),t=e&&e.getNextSibling();$(t)&&t.selectStart()}}else n===` `?NW(e)&&e.selectEnd():X(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function IU(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function LU(e){IU(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>IU(e),0)}function RU(e,t){let n=_J(e);if(yJ(n)&&UJ(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=gJ(r.ownerDocument);return i!==null&&r.contains(i)&&UJ(i,t)}function zU(e){let t=e.inputType,n=PU(e),r=HG(),i=r._inputState,a=Q();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(IU(i),e.preventDefault(),Z(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=fG();if(!Z(e))return!0;mq(e.clone())}if(Z(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t<e.lastKeyDownTimeStamp+30}(i,e.timeStamp)&&r.isComposing()&&t){if(iq(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{iK(r,()=>{iq(null)})},30),Z(a)){let e=a.anchor.getNode();e.markDirty(),X(e)||Y(142),NU(a,e)}}else{if(iq(null),mB&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=vB&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!lK(Pq(a.anchor,!0))),!u){Iq(r,NH,!0);let e=Q();vB&&Z(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Z(a))return!0;let o=e.data;i.unprocessedBeforeInputData!==null&&xq(!1,r,i.unprocessedBeforeInputData),a.dirty&&i.unprocessedBeforeInputData===null||!a.isCollapsed()||dK(a.anchor.getNode())||n===null||a.applyDOMRange(n),i.unprocessedBeforeInputData=null;let s=a.anchor,c=a.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
|
|
159
|
-
`)e.preventDefault(),Iq(r,PH,!1);else if(o===AB)e.preventDefault(),Iq(r,FH,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&kU(a,n,o,e.timeStamp,!0)?(e.preventDefault(),Iq(r,IH,o),FU(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:Iq(r,IH,e),FU((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;iq(null),t||Iq(r,IH,e),UU(n);break}case`insertLineBreak`:iq(null),Iq(r,PH,!1);break;case`insertParagraph`:iq(null),i.isInsertLineBreak&&!mB?(i.isInsertLineBreak=!1,Iq(r,PH,!1)):Iq(r,FH,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:Iq(r,LH,e);break;case`deleteByComposition`:(function(e,t){return e!==t||$(e)||$(t)||!JK(e)||!JK(t)})(l,u)&&Iq(r,RH,e);break;case`deleteByDrag`:Bq(sW),Iq(r,RH,e);break;case`deleteByCut`:Iq(r,RH,e);break;case`deleteContent`:Iq(r,NH,!1);break;case`deleteWordBackward`:Iq(r,zH,!0);break;case`deleteWordForward`:Iq(r,zH,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:Iq(r,BH,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:Iq(r,BH,!1);break;case`formatStrikeThrough`:Iq(r,VH,`strikethrough`);break;case`formatBold`:Iq(r,VH,`bold`);break;case`formatItalic`:Iq(r,VH,`italic`);break;case`formatUnderline`:Iq(r,VH,`underline`);break;case`historyUndo`:Iq(r,UH,void 0);break;case`historyRedo`:Iq(r,WH,void 0)}return!0}function BU(e){let t=HG(),n=t._inputState,r=Q(),i=e.data,a=PU(e),o=!1;if(i!=null&&Z(r)){let s=tJ(Wq(t)),c=s===null?null:dJ(s,t._rootElement),l=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();l&&(n.hadOrphanedCompositionEvents=!0);let u=r.anchor.getNode(),d=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&X(u)&&YK(u);if(!l&&!d&&kU(r,a,i,e.timeStamp,!1,c)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=WU(t,i);if(n.compositionPhase=`idle`,e)return Bq(cW),hq(),!0}let a=r.anchor.getNode();if(s===null||c===null)return!0;let l=r.isBackward(),u=l?r.anchor.offset:r.focus.offset,d=l?r.focus.offset:r.anchor.offset;pB&&!r.isCollapsed()&&X(a)&&c.anchorNode!==null&&a.getTextContent().slice(0,u)+i+a.getTextContent().slice(u+d)===bq(c.anchorNode)||Iq(t,IH,i);let f=i.length;fB&&f>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=f,r._cachedNodes=null,r._cachedIsBackward=null),vB&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,iq(null))}}return o||(xq(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(WU(t,i||void 0),Bq(`composition-end`),n.compositionPhase=`idle`)),hq(),!0}function VU(e){let t=HG(),n=t._inputState,r=Q();if(Z(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(iq(i.key),Bq(`composition-start`),e.timeStamp<n.lastKeyDownTimeStamp+30||i.type===`element`||!r.isCollapsed()||!vB&&(a.getFormat()!==r.format||X(a)&&a.getStyle()!==r.style)||X(a)&&(YK(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){Iq(t,IH,jB);let e=Q();Z(e)&&iq(e.anchor.key)}}return!0}function HU(e){let t=HG();return t._inputState.compositionPhase=`idle`,WU(t,e.data),Bq(cW),!0}function UU(e){if(e===null)return;let t=oq(e);if(!X(t)||t.getType()===`text`||YK(t)||!t.isAttached())return;let n=Q(),r=Z(n)&&n.anchor.key===e?n.anchor.offset:null,i=kW(t.getTextContent());if(i.setFormat(t.getFormat()),i.setStyle(t.getStyle()),t.replace(i),r!==null){let e=Math.min(r,i.getTextContentSize());i.select(e,e)}}function WU(e,t){let n=e._compositionKey;if(iq(null),n!==null&&t!=null){if(t===``){let t=oq(n),r=e.getElementByKey(n),i=r!==null&&X(t)?jJ(t,r,e):null;if(i!==null&&i.nodeValue!==null&&X(t)){let n=tJ(Wq(e)),r=n&&dJ(n,e._rootElement),a=null,o=null;r!==null&&r.anchorNode===i&&(a=r.anchorOffset,o=r.focusOffset),Sq(t,i.nodeValue,a,o,!0)}return UU(n),!1}if(t[t.length-1]===`
|
|
160
|
-
`){let t=Q();if(Z(t)||VW(t)){if(Z(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return Iq(e,QH,null),UU(n),!1}}let r=oq(n);if(r!==null&&X(r)&&YK(r)){r.markDirty();let e=Q(),i=r.getTextContentSize(),a=Z(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return xq(!0,e,t),UU(n),!1}function GU(e){let t=HG(),n=t._inputState;if(e.key==null)return!0;if(n.compositionPhase===`ending-safari`){let r=kq(e);if(r&&iK(t,()=>{WU(t,n.compositionEndData)}),n.compositionPhase=`idle`,n.compositionEndData=``,r)return!0}if(function(e){return Eq(e,`ArrowRight`,{shiftKey:`any`})}(e))Iq(t,KH,e);else if(function(e){return Eq(e,`ArrowRight`,{...Dq,shiftKey:`any`})}(e))Iq(t,qH,e);else if(function(e){return Eq(e,`ArrowLeft`,{shiftKey:`any`})}(e))Iq(t,JH,e);else if(function(e){return Eq(e,`ArrowLeft`,{...Dq,shiftKey:`any`})}(e))Iq(t,YH,e);else if(function(e){return Eq(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))Iq(t,XH,e);else if(function(e){return Eq(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))Iq(t,ZH,e);else if(function(e){return Eq(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))n.isInsertLineBreak=!0,Iq(t,QH,e);else if(function(e){return e.key===` `}(e))Iq(t,$H,e);else if(function(e){return dB&&Eq(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),n.isInsertLineBreak=!0,Iq(t,PH,!0);else if(function(e){return Eq(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))n.isInsertLineBreak=!1,Iq(t,QH,e);else if(function(e){return Eq(e,`Backspace`,{shiftKey:`any`})||dB&&Eq(e,`h`,{ctrlKey:!0})}(e))kq(e)?Iq(t,eU,e)&&LU(n):(e.preventDefault(),Iq(t,NH,!0));else if(function(e){return e.key===`Escape`}(e))Iq(t,tU,e);else if(function(e){return Eq(e,`Delete`,{})||dB&&Eq(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?Iq(t,nU,e):(e.preventDefault(),Iq(t,NH,!1));else if(function(e){return Eq(e,`Backspace`,Oq)}(e))e.preventDefault(),Iq(t,zH,!0);else if(function(e){return Eq(e,`Delete`,Oq)}(e))e.preventDefault(),Iq(t,zH,!1);else if(function(e){return dB&&Eq(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),Iq(t,BH,!0);else if(function(e){return dB&&(Eq(e,`Delete`,{metaKey:!0})||Eq(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),Iq(t,BH,!1);else if(function(e){return Eq(e,`b`,Dq)}(e))e.preventDefault(),Iq(t,VH,`bold`);else if(function(e){return Eq(e,`u`,Dq)}(e))e.preventDefault(),Iq(t,VH,`underline`);else if(function(e){return Eq(e,`i`,Dq)}(e))e.preventDefault(),Iq(t,VH,`italic`);else if(function(e){return Eq(e,`Tab`,{shiftKey:`any`})}(e))Iq(t,rU,e);else if(function(e){return Eq(e,`z`,Dq)}(e))e.preventDefault(),Iq(t,UH,void 0);else if(function(e){return dB?Eq(e,`z`,{metaKey:!0,shiftKey:!0}):Eq(e,`y`,{ctrlKey:!0})||Eq(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),Iq(t,WH,void 0);else{let r=t._editorState._selection;(function(e){return Eq(e,`a`,Dq)})(e)?(e.preventDefault(),Iq(t,mU,e)&&LU(n)):r===null||Z(r)||(function(e){return Eq(e,`c`,Dq)}(e)?(e.preventDefault(),Iq(t,fU,e)):function(e){return Eq(e,`x`,Dq)}(e)&&(e.preventDefault(),Iq(t,pU,e)))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(xU,e),!0}function KU(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var qU=new Map;function JU(e){let t=nJ(e.target);if(t===null)return;let n=zq(e.target),r=null,i=null,a=n===null?void 0:DU.get(n);if(n!==null){if(a!==void 0){let e=a.editors,n=a.hasShadowEditor;if(n===void 0){n=!1;for(let t of e)if(t._rootElement!==null&&rJ(t._rootElement.getRootNode())){n=!0;break}a.hasShadowEditor=n}if(n){let n=null,a=null;for(let o of e){let e=o._rootElement;if(e===null)continue;let s=dJ(t,e).anchorNode;if(s!==null&&KK(s)===o){if(rJ(e.getRootNode())){r=o,i=s;break}n===null&&(n=o,a=s)}}r===null&&n!==null&&(r=n,i=a)}else{let e=t.anchorNode;e===null||yJ(e)&&e.shadowRoot!==null||(r=KK(e),r!==null&&(i=e))}}if(r===null){let e=gJ(n);r=e===null?null:KK(e)}}if(r===null)return;if(r._inputState.isSelectionChangeFromMouseDown){if(a!==void 0)for(let e of a.editors)e._inputState.isSelectionChangeFromMouseDown=!1;iK(r,()=>{let n=fG(),a=i??dJ(t,r._rootElement).anchorNode;(yJ(a)||XK(a))&&mq(dG(n,t,r,e))})}let o=vq(r),s=o[o.length-1],c=s._key,l=qU.get(c),u=l||s;u!==r&&jU(t,u,!1),jU(t,r,!0),r===s?l&&qU.delete(c):qU.set(c,r)}function YU(e){e._lexicalHandled=!0}function XU(e){return!0===e._lexicalHandled}function ZU(e){let t=EU.get(e);if(t===void 0)return;let n=DU.get(t);if(n===void 0)return;EU.delete(e);let r=qK(e);GK(r)?(function(e){if(e._parentEditor!==null){let t=vq(e),n=t[t.length-1]._key;qU.get(n)===e&&qU.delete(n)}else qU.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&Y(198);let i=KU(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}function QU(e,t,n){RG();let r=e.__key,i=e.getParent();if(i===null)return void(tY(e)!==null&&Y(367,r,String(tY(e))));let a=function(e){let t=Q();if(!Z(t)||!$(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return Hq(i,e)&&n.set(e.__key,0,`element`),Hq(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(Z(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(hG(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(hG(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else VW(a)&&t&&e.isSelected()&&e.selectPrevious();if(Z(a)&&t&&!o){let t=e.getIndexWithinParent();nq(e),pG(a,i,t,-1)}else nq(e);n||Jq(i)||i.canBeEmpty()||!i.isEmpty()||QU(i,t),t&&a&&dK(i)&&i.isEmpty()&&i.selectEnd()}function $U(e){return e}var eW=Symbol.for(`ephemeral`);function tW(e){return e[eW]||!1}var nW={configurable:!0,enumerable:!1,value:void 0,writable:!0},rW=class{__type;__key;__parent;__prev;__next;__state;[OV];static getType(){let{ownNodeType:e}=KJ(this);return e===void 0&&Y(64,this.name),e}static clone(e){Y(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||ZJ(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,`__state`,nW),Object.defineProperty(this,OV,nW),tq(this,e)}getType(){return this.__type}isInline(){Y(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=oq(e);if(t===null)break;e=t.__parent===null?tY(t):t.__parent}return!1}isSelected(e){let t=e||Q();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(X(this))return n;if(Z(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(lK(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:oq(e)}getParentOrThrow(){let e=this.getParent();return e===null&&Y(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(Jq(t)||tY(e)!==null)return $(e)||e===this&&lK(e)||Y(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&Y(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:oq(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:oq(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=$(this)?this:this.getParent(),n=$(e)?e:e.getParent(),r=t&&n?ZY(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=ZY(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?JY(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&Y(279),!1)))}isParentOf(e){return Hq(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=$(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&Y(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=HG()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(tW(this))return this;let e=oq(this.__key);return e===null&&Y(113),e}getWritable(){if(tW(this))return this;RG();let e=BG(),t=HG(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=Q();if(o!==null&&o.setCachedNodes(null),a.has(r))return rq(i),i;let s=FJ(i);return a.add(r),rq(s),n.set(r,s),s}getTextContent(){return mY(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){Y(70)}updateDOM(e,t,n){Y(71)}getDOMSlot(e){return new VB(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){Y(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of _V(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&gV(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){QU(this,!0,e)}replace(e,t){RG();let n=Q();n!==null&&(n=n.clone()),Zq(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size,l=o.getParent(),u=l===null?-1:o.getIndexWithinParent();nq(o),l!==null&&Z(n)&&pG(n,l,u,-1);let d=r.getPreviousSibling(),f=r.getNextSibling(),p=r.__prev,m=r.__next,h=r.__parent;QU(r,!1,!0),d===null?s.__first=a:d.getWritable().__next=a,o.__prev=p,f===null?s.__last=a:f.getWritable().__prev=a,o.__next=m,o.__parent=h,s.__size=c;let g=0;t&&($(this)&&$(o)||Y(139),g=o.getChildrenSize(),o.splice(g,0,this.getChildren()));let _=oY(this);if(_.length>0){$J(this)&&$J(o)||Y(368,this.__key,o.__key);for(let e of _){let t=sY(this,e);t!==null&&(vY(this,e),_Y(o,e,t))}}if(Z(n)){mq(n);let e=n.anchor,r=n.focus;e.key===i&&(t&&e.type===`element`?e.set(o.__key,g+e.offset,`element`):LW(e,o)),r.key===i&&(t&&r.type===`element`?r.set(o.__key,g+r.offset,`element`):LW(r,o))}return aq()===i&&iq(a),o}insertAfter(e,t=!0){RG(),Zq(this,e);let n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();let i=r.getParent(),a=Q(),o=!1,s=!1;if(i!==null){let n=e.getIndexWithinParent();if(Z(a)){let e=i.__key,t=a.anchor,r=a.focus;o=t.type===`element`&&t.key===e&&t.offset===n+1,s=r.type===`element`&&r.key===e&&r.offset===n+1}nq(r),t&&Z(a)&&pG(a,i,n,-1)}else nq(r);let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Z(a)){let e=this.getIndexWithinParent();pG(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){RG(),Zq(this,e);let n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();let i=r.__key,a=Q(),o=r.getParent(),s=o===null?-1:r.getIndexWithinParent();nq(r),o!==null&&t&&Z(a)&&pG(a,o,s,-1);let c=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),u=n.__prev,d=this.getIndexWithinParent();return c===null?l.__first=i:c.getWritable().__next=i,l.__size++,n.__prev=i,r.__prev=u,r.__next=n.__key,r.__parent=n.__parent,t&&Z(a)&&pG(a,this.getParentOrThrow(),d),e}isParentRequired(){return!1}createParentElementNode(){return DK()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){RG();let n=nY(this);if(n!==null)return n.selectPrevious(e,t);let r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if($(r))return r.select();if(!X(r)){let e=r.getIndexWithinParent()+1;return i.select(e,e)}return r.select(e,t)}selectNext(e,t){RG();let n=nY(this);if(n!==null)return n.selectNext(e,t);let r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if($(r))return r.select(0,0);if(!X(r)){let e=r.getIndexWithinParent();return i.select(e,e)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function iW(e){return e instanceof rW}var aW=`history-push`,oW=`history-merge`,sW=`skip-selection-focus`,cW=`composition-end`,lW=`!important`;function uW(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null)if(l!==`/`||e[d+1]!==`*`)if(l!==`"`&&l!==`'`)if(l!==`(`)if(l!==`)`)if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0;else u===-1&&(u=d),c=Math.max(0,c-1);else u===-1&&(u=d),c++;else u===-1&&(u=d),i=l;else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++;else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function dW(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===lW?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function fW(e,t,n=``){if(t===n)return;let r=uW(n),i=uW(t);for(let t in i)delete r[t],dW(e,t,i[t]);for(let t in r)e.removeProperty(t)}function pW(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function mW(e,t){return 1&t?`strong`:2&t?`em`:`span`}function hW(e,t,n,r,i){let a=r.classList,o=jq(i,`base`);o!==void 0&&a.add(...o),o=jq(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in MB){let r=MB[e];if(o=jq(i,e),o!==void 0)if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}function gW(e,t,n){let r=n.isComposing(),i=e+(r?kB:``),a=DJ(),o=OJ(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(cJ().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i)if(r||fB){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);t!==0&&c.deleteData(e,t),c.insertData(e,n)}else c.nodeValue=i}function _W(e,t,n,r,i,a){gW(i,e,t);let o=a.theme.text;o!==void 0&&hW(0,0,r,e,o)}function vW(e,t){let n=cJ().createElement(t);return n.appendChild(e),n}function yW(e){return e!=null&&!0===e.__isInlineFormattable}var bW=class e extends rW{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return LB[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===aq()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=MB[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return $K(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=pW(0,n),i=mW(0,n),a=r===null?i:r,o=cJ().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=cJ().createElement(i),o.appendChild(s)),_W(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&fW(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=pW(0,i),s=pW(0,a),c=mW(0,i),l=mW(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??Y(48);let i=cJ().createElement(l);return _W(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??Y(49)),gW(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&hW(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&fW(t.style,p,f),!1}static importDOM(){return{"#text":()=>({conversion:TW,priority:0}),b:()=>({conversion:SW,priority:0}),code:()=>({conversion:OW,priority:0}),em:()=>({conversion:OW,priority:0}),i:()=>({conversion:OW,priority:0}),mark:()=>({conversion:OW,priority:0}),s:()=>({conversion:OW,priority:0}),span:()=>({conversion:xW,priority:0}),strong:()=>({conversion:OW,priority:0}),sub:()=>({conversion:OW,priority:0}),sup:()=>({conversion:OW,priority:0}),u:()=>({conversion:OW,priority:0})}}static importJSON(e){return kW().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return yJ(t)||Y(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=vW(t,`b`)),this.hasFormat(`italic`)&&(t=vW(t,`i`)),this.hasFormat(`strikethrough`)&&(t=vW(t,`s`)),this.hasFormat(`underline`)&&(t=vW(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?MB[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?NB[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=$K(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=IB[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){RG();let n=e,r=t,i=Q(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!Z(i))return cG(o,n,o,r,`text`,`text`);{let e=aq();e!==i.anchor.key&&e!==i.focus.key||iq(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=Q();if(r&&Z(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){RG();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=aq(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=Q();if(Z(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=kW(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=SV(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=kW(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=SV(t,n);let a=n.__key;i===r&&iq(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&rq(t),n!==null&&rq(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Z(v)&&pG(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||Y(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;aq()===r&&iq(n);let o=Q();if(Z(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&gG(i,t,n,e,a),s!==null&&s.key===r&&gG(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function xW(e){return{forChild:AW(e.style),node:null}}function SW(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:AW(t.style,n?void 0:`bold`),node:null}}var CW=new WeakMap;function wW(e){if(!yJ(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function TW(e){let t=e;e.parentElement===null&&Y(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=CW.get(n))===void 0&&!wW(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)CW.set(r[e],i);return i}(t)!==null)return{node:SG(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=EW(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=EW(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:kW(n)}}function EW(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,yJ(n)){let e=n.style.display;if(e===``&&!CJ(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(XK(n))return n;if(n.nodeName===`BR`)return null}}var DW={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function OW(e){let t=DW[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:AW(e.style,t),node:null}}function kW(e=``){return Xq(new bW(e))}function X(e){return e instanceof bW}function AW(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>X(e)||yW(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var jW=class e extends bW{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=jq(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return MW().updateFromJSON(e)}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||Y(286),this}setDetail(e){return e!==2&&Y(127),this}setMode(e){return e!==`normal`&&Y(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function MW(){return Xq(new jW)}function NW(e){return e instanceof jW}var PW=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:qY(sX(QY(this,`next`)),sX(QY(e,`next`)))<0}getNode(){let e=oq(this.key);return e===null&&Y(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,LG()||(aq()===a&&iq(e),i!==null&&(i.setCachedNodes(null),Z(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function FW(e,t,n){return new PW(e,t,n)}function IW(e,t){let n=t.__key,r=e.offset,i=`element`;if(X(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!$(t)){let e=t.getNextSibling();if(X(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function LW(e,t){if($(t)){let n=t.getLastDescendant();$(n)||X(n)?IW(e,n):IW(e,t)}else IW(e,t)}var RW=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!VW(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>tY(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(X(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=oq(e);t!==null&&n.push(t)}return LG()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>tY(e)===null);if((Q()||fG())===this&&e[0]){let t=PY(e[0],`next`);eX(GY(t,t))}for(let t of e)t.remove();zW()}};function zW(){let e=pq();if(e.isEmpty()){let t=DK();e.append(t),t.select()}}function Z(e){return e instanceof BW}var BW=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Z(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(AY(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;$(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),kY(e.focus)&&$(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=RY(e.focus.origin,`previous`);AY(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=BY(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!$(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=sX(e.anchor),r=sX(e.anchor.getFlipped()),i=e=>OY(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(uX(nX(this),`next`));return LG()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=KW(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if($(d)&&!d.isInline()){l||(c+=`
|
|
161
|
-
`);let e=``;for(let t of oY(d)){let n=sY(d,t);n!==null&&(e+=n.getTextContent())}e===``?l=!d.isEmpty():(c+=e,l=!1)}else if(l=!1,X(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else !lK(d)&&!xK(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=HG(),n=t.getEditorState()._selection,r=oG(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),EV(this)}clone(){let t=this.anchor,n=this.focus;return new e(FW(t.key,t.offset,t.type),FW(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=$K(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=MB[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(SG(e))}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=kW();if(o.setFormat(n),o.setStyle(r),OK(a))a.splice(0,0,[o]);else if(a!==null){let e=Jq(i)?DK().append(o):o;a.insertBefore(e)}else if(Jq(i)){let e=i.getLastChild();$(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(DK().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&$Y(o,sX(QY(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];X(d)||Y(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(YK(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling(),n;if(X(t)&&t.canInsertTextBefore()&&!YK(t)?n=t:(n=kW(),n.setFormat(r),n.setStyle(i),p.canInsertTextAfter()?d.insertAfter(n):p.insertAfter(n)),n.select(0,0),d=n,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(YK(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling(),n;if(!X(t)||YK(t)?(n=kW(),n.setFormat(r),p.canInsertTextBefore()?d.insertBefore(n):p.insertBefore(n)):n=t,n.select(),d=n,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f)if(aq()!==null)d=d.setMode(`normal`).setFormat(r).setStyle(i);else{let e=kW(d.getTextContent());e.setFormat(r),d.replace(e),d=e}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||$(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),nG(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(JK(d)){let t=kW(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(NW(d)){let t=kW(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=kW(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=$(d)?d:d.getParentOrThrow(),r=$(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c)if(X(m)&&!JK(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=kW(m.getTextContent());m.replace(e),m=e}dK(o.getNode())||o.type!==`text`||(X(m)||Y(395),m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||$(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(JK(d))if(s===f)d.select();else{let t=kW(e);t.select(),d.replace(t)}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null));for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=Q()===this;tX(this,oX(nX(this))),e&&Q()!==this&&mq(this)}formatText(e,t=null){WW(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&$(t)&&tY(t)!==null){let n=t.isShadowRoot()?t.getFirstChild()??t.append(DK()).getFirstChild():t.getFirstChild();if(t.isShadowRoot()&&n!==null&&!$(n)){let e=DK();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=Q();return Z(t)||Y(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&Jq(t)){let n=DG(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=(this.isBackward()?this.focus:this.anchor).getNode(),r=YJ(n,EJ),i=e[e.length-1];if($(r)&&`__language`in r){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=wG(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some(e=>($(e)||lK(e))&&!e.isInline())){$(r)||Y(211,n.constructor.name,n.getType());let t=wG(this);r.splice(t,0,e),i.selectEnd();return}if($(r)&&tY(r)!==null){let t=wG(this),n=CG(e);r.splice(t,0,n);let i=n[n.length-1];i===void 0?r.select(t,t):i.selectEnd();return}if(r===null){let t=DG(e),n=t.getLastDescendant(),r=QY(this.anchor,`next`);for(let e of t.getChildren())r=hX(e,r);n!==null&&n.selectEnd();return}if($(r)&&!r.isParentRequired()&&!Jq(r.getParentOrThrow())){let t=wG(this),n=CG(e);r.splice(t,0,n);let i=n[n.length-1];i===void 0?r.select(t,t):i.selectEnd();return}let a=DG(e),o=a.getLastDescendant(),s=a.getChildren(),c=!$(r)||!r.isEmpty()?this.insertParagraph():null;c&&!r.isAttached()&&(n=this.anchor.getNode(),r=YJ(n,EJ));let l=s[s.length-1],u=s[0];var d;$(d=u)&&EJ(d)&&!d.isEmpty()&&$(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&($(r)||Y(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=s[1]),u&&(r===null&&Y(212,n.constructor.name,n.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||Y(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(r,u));let f=YJ(o,EJ);c&&$(f)&&(c.canMergeWhenEmpty()||EJ(l))&&(f.append(...c.getChildren()),c.remove()),$(r)&&r.isEmpty()&&r.remove(),o.selectEnd();let p=$(r)?r.getLastChild():null;xK(p)&&f!==r&&p.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type===`element`&&Jq(e)){let t=DK();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let t=wG(this),n=YJ(this.anchor.getNode(),EJ);if(n!==null&&tY(n)!==null)return null;$(n)||Y(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=bK();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=KW(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(X(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(X(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),X(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(OG(this,e,t,n))return;let r=e===`move`,i=HG(),a=tJ(Wq(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!$(c)||c.isInline()||c.canBeEmpty()||eJ(o,i,s);let l=Lq(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=X(c)?jJ(c,l,i):null),this.dirty){let e=Lq(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=X(n)?jJ(n,e,i):null}t&&u&&_G(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&X(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=PY(c,t?`previous`:`next`).getNodeAtCaret();if(X(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?jJ(e,n,i):null;if(r){let e=t?r.length:0;_G(a,r,e,r,e)}}}}if(YW(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=lJ(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=dK(o)?o:Kq(o);this.applyDOMRange(n),this.dirty=!0,!r&&(XW(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||JW(this))}n===`lineboundary`&&OG(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&$(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if($(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=UY(QY(t,e?`previous`:`next`));if(r.getTextSlices().every(e=>e===null||e.distance===0)){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(AY(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if($(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=sX(t);tX(this,GY(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(kY(t)){if($(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(lK(t.origin)){if(!t.origin.isIsolated())if(oY(t.origin).length>0){if($(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=uG();e.add(t.origin.getKey()),mq(e)}}else if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&$(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=uG();e.add(t.origin.getKey()),mq(e)}else t.origin.remove();return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return oY(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(tX(this,GY(!t.origin.isEmpty()&&n.isEmpty()?rX(PY(n,t.direction)):r.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(tY(e)!==null)return;if($(e)&&e.isShadowRoot())break;e=e.getParent()}}let i=this.focus;if(ZW(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&qW(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void $W(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void $W(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!(_q(e)||QW(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&dK(e.getParent())&&e.getPreviousSibling()===null&&qW(this,e),zW()}}deleteLine(e){let t=rG(this.anchor);if(t!==null&&lK(nY(t)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&ZW(this,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):YJ(this.anchor.getNode(),EJ)===YJ(this.focus.getNode(),EJ)?this.removeText():(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e))}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;ZW(this,e,`word`)}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return LG()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function VW(e){return e instanceof RW}function HW(e,t){if(VW(e)){for(let n of e.getNodes())yW(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void iq(null);let n=[];for(let r of e.getNodes())X(r)?n.push(r):$(r)?r.setTextFormat(t(r.getTextFormat())):yW(r)&&r.setFormat(t(r.getFormat()));let r=n.length;if(r===0)return e.setFormat(t(e.format)),void iq(null);let i=e.anchor,a=e.focus,o=e.isBackward(),s=o?a:i,c=o?i:a,l=0,u=n[0],d=s.type===`element`?0:s.offset;if(s.type===`text`&&d===u.getTextContentSize()&&(l=1,u=n[1],d=0),u==null)return;let f=r-1,p=n[f],m=c.type===`text`?c.offset:p.getTextContentSize();if(u.is(p)){if(d===m)return;let n=t(u.getFormat());if(YK(u)||d===0&&m===u.getTextContentSize())u.setFormat(n);else{let e=u.splitText(d,m),t=d===0?e[0]:e[1];t.setFormat(n),s.type===`text`&&s.set(t.__key,0,`text`),c.type===`text`&&c.set(t.__key,m-d,`text`)}e.format=n;return}d===0||YK(u)||([,u]=u.splitText(d),d=0);let h=t(u.getFormat());u.setFormat(h);let g=t(p.getFormat());m>0&&(m===p.getTextContentSize()||YK(p)||([p]=p.splitText(m)),p.setFormat(g));for(let e=l+1;e<f;e++){let r=n[e];r.setFormat(t(r.getFormat()))}s.type===`text`&&s.set(u.__key,d,`text`),c.type===`text`&&c.set(p.__key,m,`text`),e.format=h|g}function UW(e,t){let n=[];for(let[e,r]of Object.entries(t))typeof r==`boolean`&&n.push([e,r]);n.length!==0&&HW(e,e=>{for(let[t,r]of n)e=$K(e,t,r?MB[t]:0);return e})}function WW(e,t,n=null){let r=n===null&&Z(e)?$K(e.format,t,null):n;HW(e,e=>$K(e,t,r))}function GW(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function KW(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[GW(n),GW(r)]}function qW(e,t){for(let n=t;n;n=n.getParent()){if($(n)){if(n.collapseAtStart(e))return!0;if(Jq(n))break}if(n.getPreviousSibling())break}return!1}function JW(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function YW(e,t,n,r){e.modify(t,n,r)}function XW(e,t,n){let r=e.getNodes(),i=r.filter(e=>Hq(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=$(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function ZW(e,t,n){if(OG(e,`extend`,t,n))return;let r=HG(),i=tJ(Wq(r));if(!i||typeof i.modify!=`function`)return;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!$(c)||c.isInline()||c.canBeEmpty()||eJ(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&X(t)?jJ(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return;let g=m.offset;if(_G(i,h,g,h,g),YW(i,`move`,t?`backward`:`forward`,n),i.rangeCount===0)return;let _=lJ(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(p&&n===`character`&&s.type===`text`&&X(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=PY(u,t?`previous`:`next`).getNodeAtCaret();if(X(n)){let r=t?n.getTextContentSize()-1:1;e.focus.set(n.__key,r,`text`),e.dirty=!0;return}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return void(r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0))}let[b,x,S,C]=t?[v,y,d,f]:[d,f,v,y],w=dK(u)?u:Kq(u);e.applyDOMRange({collapsed:!1,endContainer:S,endOffset:C,startContainer:b,startOffset:x}),e.dirty=!0,!XW(e,t,w)&&t&&JW(e),n===`lineboundary`&&OG(e,`extend`,t,n,`decorators`)}var QW=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function $W(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function eG(e,t,n,r){let i,a=t,o=!1;if(yJ(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),lq(e,r)!==void 0||UJ(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=gq(d),X(i))a=IY(i,s?`next`:`previous`);else{let c=gq(e);if(c===null)return null;if($(c)){let o=r.getElementByKey(c.getKey());o===null&&Y(214);let l=kJ(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),$(c)||Y(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if($(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=$(u)?u:u.getParentOrThrow()),a=0}X(u)?(i=u,c=null,a=IY(u,s?`next`:`previous`)):u!==c&&s&&!f&&($(c)||Y(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=nY(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&gq(e)===c){let n=kJ(c,s,r);n.element===s?t===0&&lK(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if($(c))return[FW(c.__key,a,`element`),o]}}else i=gq(e);return X(i)?[FW(i.__key,IY(i,a,`clamp`),`text`),o]:null}function tG(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&$(a)&&a.isInline()){let t=a.getPreviousSibling();X(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else $(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):X(r)&&!i.isUnmergeable()&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&$(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&$(a)&&a.isInline()&&!a.canInsertTextAfter()&&a.getTextContentSize()>1){let t=a.getNextSibling();X(t)&&e.set(t.__key,0,`text`)}}}function nG(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);tG(e,n,r),tG(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function rG(e){let t=oq(e.key);return t===null?null:iY(t)}function iG(e,t,n){let r=rG(e),i=rG(t);if(r===i||r!==null&&i!==null&&r.is(i))return!1;let a=n(r,i);if(r!==null)return $(r)?t.set(r.getKey(),a?r.getChildrenSize():0,`element`):t.set(r.getKey(),a?r.getTextContentSize():0,`text`),!0;let o=nY(i);if(o===null)return!1;let s=o.getParent();if(s===null)return!1;let c=o.getIndexWithinParent();return t.set(s.getKey(),a?c+1:c,`element`),!0}function aG(e){let t=iG(e.anchor,e.focus,(t,n)=>function(e,t,n,r){if(n!==null&&r!==null){let e=nY(n),t=nY(r);if(e!==null&&e.is(t)){for(let t of aY(e).values()){if(t===n.getKey())return!0;if(t===r.getKey())return!1}return!0}return e===null||t===null||e.isBefore(t)}if(n!==null){let e=nY(n),r=oq(t.key);return e===null||r===null||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}let i=nY(r),a=oq(e.key);return i!==null&&a!==null&&!i.is(a)&&!i.isParentOf(a)&&a.isBefore(i)}(e.anchor,e.focus,t,n));return t&&(e.dirty=!0),t}function oG(e,t,n,r,i,a){if(e===null||n===null||!WK(i,e,n))return null;let o=eG(e,t,Z(a)?a.anchor:null,i);if(o===null)return null;let s=eG(n,r,Z(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=gq(e),r=gq(n);if(lK(t)&&lK(r))return null}let f=i._slotsUsed&&iG(c,u,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return nG(c,u),[c,u,l||d||f]}function sG(e){return $(e)&&!e.isInline()}function cG(e,t,n,r,i,a){let o=BG(),s=new BW(FW(e,t,i),FW(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function lG(){return new BW(FW(`root`,0,`element`),FW(`root`,0,`element`),0,``)}function uG(){return new RW(new Set)}function dG(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!QB&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(Z(e)&&!c)return e.clone();{if(t===null)return null;let r=dJ(t,n._rootElement);if(l=r.anchorNode,u=r.focusNode,d=r.anchorOffset,f=r.focusOffset,(s||o===void 0)&&Z(e)&&!WK(n,l,u))return e.clone()}let p=oG(l,d,u,f,n,e);if(p===null)return null;let[m,h,g]=p,_=0,v=``;if(Z(e)){let t=e.anchor;if(m.key===t.key)_=e.format,v=e.style;else{let e=m.getNode();X(e)?(_=e.getFormat(),v=e.getStyle()):$(e)&&(_=e.getTextFormat(),v=e.getTextStyle())}}let y=new BW(m,h,_,v);return g&&(y.dirty=!0),y}function Q(){return BG()._selection}function fG(){return HG()._editorState._selection}function pG(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),mG(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}mG(e)}function mG(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!$(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(X(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}return}if($(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(X(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if($(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(X(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}function hG(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,X(i)?s=`text`:$(i)&&(s=`element`)):(a=r.__key,X(r)?(o=r.getTextContentSize(),s=`text`):$(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function gG(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function _G(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function vG(e,t,n){let r=Lq(e,t.getKey());if($(t)){let i=kJ(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function yG(e,t,n,r,i,a){let o=a.getRootNode(),s=ZK(o)||rJ(o)?gJ(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&UK(s,s))return;let c=dJ(r,a),l;if(!Z(t))return void(e!==null&&WK(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=vG(n,f,u.offset),[g,_]=vG(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=X(f)?jJ(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):Z(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=X(p)?jJ(p,g,n):null),x!==null&&S!==null){if(b&&(e===null||C||Z(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,h,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===_&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:KK(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(_G(r,x,h,S,_),fB&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=hJ(a);if(e===null||!a.contains(e)){let e=gJ(a.ownerDocument),t=e===null?null:KK(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===hJ(a)){let e=Z(t)&&t.anchor.type===`element`?x.childNodes[h]||null:(l===void 0&&(l=uJ(r,a)),l);if(e!==null){let t;if(XK(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=zq(n),i=Uq(r);if(r===null||i===null)return;let a=n.getBoundingClientRect();if(t.bottom<a.top)return;let{top:o,bottom:s}=t,c=0,l=0,u=n;for(;u!==null;){let t=u===r.body;if(t){let t=i.visualViewport;if(t){let e=t.offsetTop;c=e,l=e+t.height}else c=0,l=Wq(e).innerHeight;let n=i.getComputedStyle(r.documentElement),a=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(a)&&(c+=a),isFinite(o)&&(l-=o)}else{let e=u===n?a:u.getBoundingClientRect();c=e.top,l=e.bottom}let d=0;if(o<c?d=-(c-o):s>l&&(d=s-l),d!==0)if(t)i.scrollBy(0,d);else{let e=u.scrollTop;u.scrollTop+=d;let t=u.scrollTop-e;o-=t,s-=t}if(t)break;u=Rq(u)}})(n,t,a)}}(function(e){e._inputState.isSelectionChangeFromDOMUpdate=!0})(n)}}function bG(e){let t=Q()||fG();t===null&&(t=pq().selectEnd()),t.insertNodes(e)}function xG(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
|
|
162
|
-
`||n===`\r
|
|
163
|
-
`?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function SG(e){let t=[];return xG(e,{linebreak:()=>t.push(bK()),tab:()=>t.push(MW()),text:e=>t.push(kW(e))}),t}function CG(e){let t=[];for(let n of e)xK(n)||(!$(n)&&!lK(n)||n.isInline()?t.push(n):$(n)&&t.push(...CG(n.getChildren())));return t}function wG(e){let t=e;e.isCollapsed()||t.removeText();let n=Q();Z(n)&&(t=n),Z(t)||Y(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!EJ(i)&&tY(i)===null;){let e=i;if([i,a]=TG(i,a),e.is(i))break}return a}function TG(e,t){let n=e.getParent();if(!n){let e=DK();return pq().append(e),e.select(),[pq(),0]}if(X(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!$(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new BW(FW(e.__key,t,`element`),FW(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function EG(e){return xK(e)||Gq(e)||X(e)||e.isParentRequired()}function DG(e){let t=DK(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(EG(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(xK(i)&&(a===void 0||!EG(a)))continue}n.append(i)}else t.append(i),n=null}return t}function OG(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=QY(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!cX(c)){for(let e of c){l=!1;let{origin:t}=e;if(!lK(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of UY(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(AY(e))e.origin.isInline()||(c=e);else{if($(e.origin))continue;lK(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&lK(c.origin)&&c.origin.isKeyboardSelectable()){let e=uG();return e.add(c.origin.getKey()),mq(e),!0}return c=sX(c),s&&$Y(e.anchor,c),$Y(e.focus,c),l||!o}var kG=null,AG=null,jG=!1,MG=!1,NG=!1,PG=new Set,FG=0,IG={characterData:!0,childList:!0,subtree:!0};function LG(){return jG||kG!==null&&kG._readOnly}function RG(){jG&&Y(13)}function zG(){FG>99&&Y(14)}function BG(){return kG===null&&Y(195,WG()),kG}function VG(e){BG()!==null&&AG===null&&(AG=e),AG!==e&&cB(378)}function HG(){return AG===null&&Y(337,WG()),AG}function UG(){HG()._dirtyType=2}function WG(){let e=0,t=new Set,n=IK.version;if(typeof window<`u`)for(let r of oJ(document)){let i=qK(r);if(GK(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function GG(){return AG}function KG(e,t,n){let r=t.__type,i=BK(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function qG(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function JG(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function YG(e){return XG(e,HG()._nodes)}function XG(e,t){let n=e.type,r=t.get(n);r===void 0&&Y(17,n);let i=r.klass;e.type!==i.getType()&&Y(18,i.name);let a=i.importJSON(e),o=e.children;if($(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=XG(o[e],t);a.append(n)}let s=e.$slots;if(s){$J(a)||Y(379,i.name);for(let e in s)_Y(a,e,XG(s[e],t))}return a}function ZG(e,t,n){let r=kG,i=jG,a=AG;kG=t,jG=!0,AG=e;try{return n()}finally{kG=r,jG=i,AG=a}}function QG(e,t){let n=NG;NG=!0;try{(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&tK(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=kG,u=jG,d=AG,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){AG=e,kG=n,jG=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=CH(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),MG)throw t;AK(e,null,r,n),sV(e),e._dirtyType=2,MG=!0,QG(e,a),MG=!1;return}finally{p.observe(r,IG),e._updating=f,kG=l,jG=u,AG=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set,function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=dq(e)),delete r[a])}(e,n);let y=i?null:tJ(Wq(e));if(e._editable&&y!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){AG=e,kG=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&eJ(t,e,r),yG(o,s,e,y,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(Z(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(hJ(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())$q(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&$q(t)){let n=t.getPreviousSibling();(n===null||$q(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=kJ(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=cJ().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=yX(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&eJ(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,IG),AG=d,kG=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),Z(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(EH,void 0);let b=e._pendingDecorators;b!==null&&(e._decorators=b,e._pendingDecorators=null,$G(`decorator`,e,!0,b)),function(e,t,n){let r=fq(t),i=fq(n);r!==i&&$G(`textcontent`,e,!0,i)}(e,t||a,n),$G(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),!f&&tK(e,e._deferred),(function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){PG.has(e)||(PG.add(e),setTimeout(()=>{PG.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${e._config.namespace}`));let n=t.shift();if(n){let[t,r]=n;rK(e,t,r)}})(e)})(e,t)}finally{NG=n}}function $G(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function eK(e,t,n,r){let i=vq(e),a;if(!NG)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(iK(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{eK(a,t,n,r)}),!1}function tK(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function nK(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&Y(191),a._flushSync=!0),o&&e._deferred.push(o),JG(e,i.tag)),a==null?rK(e,n,i):n()}}return r}function rK(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,JG(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=fK(c||s),l=!0),c._flushSync=o;let u=kG,d=jG,f=AG,p=e._updating;kG=c,jG=!1,e._updating=!0,AG=e;let m=e._headless||e.getRootElement()===null;RK(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=tJ(Wq(e));return Z(n)||n==null?dG(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=nK(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(Z(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==0&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);X(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&TV(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=aq(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);X(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&TV(r),r!==void 0&&qG(r,a)&&KG(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){FG++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&qG(c,a)&&KG(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,FG++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),nK(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||($(t)&&ZB(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||($J(t)&&t.__slots!==null&&ZB(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}for(let e of o)a.delete(e);let s=HG(),c=s._compositionKey;c===null||a.has(c)||(s._compositionKey=null)}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(Z(i)){e._slotsUsed&&aG(i);let t=c._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||Y(19)}else VW(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),QG(e);return}finally{kG=u,jG=d,AG=f,e._updating=p,FG=0}e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,QG(e)):l&&HK(()=>{QG(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function iK(e,t,n){AG===e&&n===void 0?t():rK(e,t,n)}function aK(e){if(Jq(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var oK=class extends rW{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:aK,extends:rW})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Y(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return FB[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&oY(this).length===0}isDirty(){let e=HG()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of oY(this)){let n=sY(this,t);$(n)&&e.push(...n.getAllTextNodes())}let t=this.getFirstChild();for(;t!==null;){if(X(t)&&e.push(t),$(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;$(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;$(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return $(e)&&e.getLastDescendant()||e||null}let r=t[e];return $(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:oq(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&Y(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:oq(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&Y(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=mY(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),$(i)&&r!==n-1&&!i.isInline()&&(e+=AB)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of oY(e)){let r=sY(e,n);r!==null&&(t+=r.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),$(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=PB[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=MB[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return $K(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){RG();let n=Q(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(X(e)||$(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(X(e)||$(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return Z(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):cG(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==``&&PB[e]||0,this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){tW(this)&&Y(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||Y(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0)if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&Y(100);let t=e.getNextSibling(),n=e.__key;nq(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling());let t=e.getWritable();t.__parent===a&&u--,nq(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&Y(76),t.__parent=a,o.push(n),d=e}if(e+t===r)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=Q();if(Z(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;sK(r,t,n)&&hG(r,r.getNode(),this,l,c),sK(i,t,n)&&hG(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||Jq(this)||this.remove()}}return i}getDOMSlot(e){return new UB(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(yJ(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===``||Jq(this)||this.getChildren().some(X)||(t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=kJ(this,e,t),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function $(e){return e instanceof oK}function sK(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var cK=class extends rW{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&Y(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function lK(e){return e instanceof cK}var uK=class e extends oK{__cachedText;static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let e=this.__cachedText;return e===null||!LG()&&HG()._dirtyType!==0?super.getTextContent():e}remove(){Y(52)}replace(e){Y(53)}insertBefore(e){Y(54)}insertAfter(e){Y(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)$(e)||lK(e)||Y(282);return super.splice(e,t,n)}static importJSON(e){return pq().updateFromJSON(e)}collapseAtStart(){return!0}};function dK(e){return e instanceof uK}function fK(e){return new gK(YB(e._nodeMap),null,e._slotsUsed)}function pK(){return new gK(new Map([[`root`,new uK]]),null,!1)}function mK(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Y(130,n.name),$(e)){let r=t.children;Array.isArray(r)||Y(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=mK(i[e]);r.push(t)}}let r=oY(e);if(r.length>0){let i={};for(let t of r){let r=sY(e,t);r===null&&Y(366,n.name,t),i[t]=mK(r)}t.$slots=i}return t}function hK(e){return e instanceof gK}var gK=class e{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return ZG(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n}toJSON(){return ZG(null,this,()=>({root:mK(pq())}))}},_K=class extends oK{static getType(){return`artificial`}createDOM(e){return cJ().createElement(`div`)}},vK=class e extends rW{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
|
|
164
|
-
`}createDOM(){return cJ().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>SK(e)||CK(e)?null:{conversion:yK,priority:0}}}static importJSON(e){return bK().updateFromJSON(e)}};function yK(e){return{node:bK()}}function bK(){return Xq(new vK)}function xK(e){return e instanceof vK}function SK(e){let t=e.parentElement;if(t!==null&&TJ(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&wK(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&wK(n))return!0}}return!1}function CK(e){let t=e.parentElement;if(t!==null&&TJ(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&wK(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&wK(r))return!0}return!1}function wK(e){return XK(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}var TK=class e extends oK{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=cJ().createElement(`p`),n=jq(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:EK,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(yJ(t)){this.isEmpty()&&t.append(cJ().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return DK().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(X);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=DK();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||X(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function EK(e){let t=DK();if(zJ(t,e),LJ(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in PB&&t.setFormat(n)}return RJ(t,e),{node:t}}function DK(){return Xq(new TK)}function OK(e){return e instanceof TK}function kK(e){console.warn(e)}function AK(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=pK(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){let n=`__lexicalKey_${t._key}`;delete e[n]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),cq(n,e,`root`))}function jK(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of qJ(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var MK={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=VK(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>$(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>$(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function NK(e){let t=e||{},n=GG(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=pK(),s=t.namespace||(i===null?yq():i._config.namespace),c=t.editorState,l=[uK,bW,vK,jW,TK,_K,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===rW||n.prototype instanceof rW)){let r=`<unknown>`;try{r=JSON.parse(KB)}catch{}Y(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}KJ(n);let a=n.getType(),o=jK(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:pV(l[e]),transforms:o})}}let h=new IK(o,i,m,{disableEvents:a,dom:{...MK,...e&&e.dom},namespace:s,theme:r},u||console.error,d||kK,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(kH,zU,0),e.registerCommand(AH,BU,0),e.registerCommand(jH,VU,0),e.registerCommand(MH,HU,0),e.registerCommand(GH,GU,0)}(h),h}function PK(e,t){let n=e.get(t);e.delete(t),n&&n()}function FK(e,t,n){return e.set(t,n),PK.bind(null,e,t)}var IK=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new XB,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=yq(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return FK(this._listeners.update,e)}registerEditableListener(e){return FK(this._listeners.editable,e)}registerDecoratorListener(e){return FK(this._listeners.decorator,e)}registerTextContentListener(e){return FK(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return SX(FK(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&Y(35);let r=this._commands;r.has(e)||r.set(e,[new qB,new qB,new qB,new qB,new qB]);let i=r.get(e);i===void 0&&Y(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&Y(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=PJ(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=PJ(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=oq(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:oW}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Iq(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=jq(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,AK(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||ZU(t),n!=null&&t.classList.remove(...n)),e!==null){let t=Uq(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,sV(this),this._updateTags.add(oW),QG(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;EU.set(e,n);let r=DU.get(n);r===void 0&&(r={editors:new Set,hasShadowEditor:void 0},DU.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=KU(e);i.push(OU.register(n));for(let n=0;n<TU.length;n++){let[r,a]=TU[n],o=typeof a==`function`?e=>{XU(e)||(YU(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(XU(e))return;YU(e);let n=t.isEditable();switch(r){case`cut`:return n&&Iq(t,pU,e);case`copy`:return Iq(t,fU,e);case`paste`:return n&&Iq(t,LH,e);case`dragstart`:return n&&Iq(t,lU,e);case`dragover`:return n&&Iq(t,uU,e);case`dragend`:return n&&Iq(t,dU,e);case`focus`:return n&&Iq(t,yU,e);case`blur`:return n&&Iq(t,bU,e);case`drop`:return n&&Iq(t,sU,e)}};i.push(CU(e,r,o))}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(oW),QG(this);$G(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&Y(38);let n=e;n._readOnly&&(n=fK(e),n._selection=e._selection?e._selection.clone():null),oV(this);let r=this._pendingEditorState,i=t===void 0?null:t.tag;r===null||r.isEmpty()||(i!=null&&this._updateTags.add(i),QG(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,iK(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(let[e,t]of n._nodeMap.entries())$(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=pK(),i=kG,a=jG,o=AG,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,kG=r,jG=!1,AG=t,RK(null);try{let i=t._nodes;XG(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,kG=i,jG=a,AG=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&QG(this),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):rK(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),iK(this,()=>{let r=Q(),i=pq();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||mq(r.clone()),Bq(`focus`),Vq(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=tJ(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,$G(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>UG()))}toJSON(){return{editorState:this._editorState.toJSON()}}};IK.version=KB;var LK=null;function RK(e){LK=e}var zK=1;function BK(e,t){let n=VK(e,t);return n===void 0&&Y(30,t),n}function VK(e,t){return e._nodes.get(t)}var HK=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function UK(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return ZK(t)||rJ(t)?gJ(t):null})():t;if(!yJ(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=uq(n),i=n.nodeName;return iW(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&qK(n)==null)}function WK(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return KK(t)===e&&e.read(`latest`,()=>!UK(t))}function GK(e){return e instanceof IK}function KK(e){let t=e;for(;t!=null;){let e=qK(t);if(GK(e))return e;t=Rq(t)}return null}function qK(e){return e?e.__lexicalEditor:null}function JK(e){return NW(e)||e.isToken()}function YK(e){return JK(e)||e.isSegmented()}function XK(e){return bJ(e)&&e.nodeType===3}function ZK(e){return bJ(e)&&e.nodeType===9}function QK(e){let t=e;for(;t!=null;){if(XK(t))return t;t=t.firstChild}return null}function $K(e,t,n){let r=MB[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~MB.superscript:t===`superscript`?i&=~MB.subscript:t===`lowercase`?(i&=~MB.uppercase,i&=~MB.capitalize):t===`uppercase`?(i&=~MB.lowercase,i&=~MB.capitalize):t===`capitalize`&&(i&=~MB.lowercase,i&=~MB.uppercase),i}function eq(e){return X(e)||xK(e)||lK(e)}function tq(e,t){let n=function(){let e=LK;return LK=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);RG(),zG();let r=HG(),i=BG(),a=``+ zK++;i._nodeMap.set(a,e),$(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function nq(e){tY(e)!==null&&Y(380,e.__key,String(tY(e)));let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function rq(e){zG(),tW(e)&&Y(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent===null?eY(t)?t.__slotHost:null:t.__parent,r=BG(),i=HG(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?eY(e)?e.__slotHost:null:e.__parent}}(n,a,o);let s=t.__key;i._dirtyType===0&&(i._dirtyType=1),$(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function iq(e){RG();let t=HG(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=oq(n);e!==null&&e.getWritable()}if(e!==null){let t=oq(e);t!==null&&t.getWritable()}}}function aq(){return LG()?null:HG()._compositionKey}function oq(e,t){let n=(t||BG())._nodeMap.get(e);return n===void 0?null:n}function sq(e,t){let n=lq(e,HG());return n===void 0?null:oq(n,t)}function cq(e,t,n){e[`__lexicalKey_${t._key}`]=n}function lq(e,t){return e[`__lexicalKey_${t._key}`]}function uq(e,t){let n=e;for(;n!=null;){let e=sq(n,t);if(e!==null)return e;n=Rq(n)}return null}function dq(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function fq(e){return e.read(()=>pq().getTextContent())}function pq(){return BG()._nodeMap.get(`root`)}function mq(e){RG();let t=BG();e!==null&&(e.dirty=!0,e.setCachedNodes(null),Z(e)&&HG()._slotsUsed&&aG(e)),t._selection=e}function hq(){RG(),oV(HG())}function gq(e){let t=function(e,t){let n=e;for(;n!=null;){let e=lq(n,t);if(e!==void 0)return e;n=Rq(n)}return null}(e,HG());return t===null?null:oq(t)}function _q(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function vq(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function yq(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function bq(e){return XK(e)?e.nodeValue:null}function xq(e,t,n){let r=tJ(Wq(t));if(r===null)return;let i=dJ(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=bq(a),r=uq(a);if(t!==null&&X(r)){if((t===kB||t===jB)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&Sq(r,t,o,s,e)}}}function Sq(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing();if(a.isToken()&&o)return;let s=t;if((o||i)&&(t.endsWith(kB)&&(s=t.slice(0,-kB.length)),i)){let e=jB,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){let t=Q();if(s===``){if(iq(null),gB||mB||yB)a.remove();else{let e=HG();Cq(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let i=a.getParent(),c=fG(),l=a.getTextContentSize(),u=aq(),d=a.getKey();if(a.isToken()&&!o||u!==null&&d===u&&!o||Z(c)&&(i!==null&&!i.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===e.__key&&c.anchor.offset===0&&!a.canInsertTextBefore()&&!o||c.focus.key===e.__key&&c.focus.offset===l&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!Z(t)||n===null||r===null)return void Cq(a,s,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=kW(a.getTextContent());a.replace(e),a=e}Cq(a,s,t)}}}function Cq(e,t,n){if(e.setTextContent(t),Z(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=IY(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function wq(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function Tq(e,t){return wq(e,t,`altKey`)&&wq(e,t,`ctrlKey`)&&wq(e,t,`shiftKey`)&&wq(e,t,`metaKey`)}function Eq(e,t,n){if(!Tq(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith(`Digit`)&&/^\d$/.test(t))return e.code===`Digit${t}`;let r=`Key`+t.toUpperCase();return e.code===r}var Dq={ctrlKey:!dB,metaKey:dB},Oq={altKey:dB,ctrlKey:!dB};function kq(e){return e.key===`Backspace`}function Aq(e){let t=pq();if(Z(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(dK(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),EV(e),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();if(a===null)return $(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),EV(e)),e;let o=a;return t.set(o.getKey(),0,`element`),n.set(o.getKey(),o.getChildrenSize(),`element`),EV(e),e}{let e=t.select(0,t.getChildrenSize());return mq(EV(e)),e}}function jq(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=yX(i);return n[t]=e,e}return i}function Mq(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&Y(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function Nq(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function Pq(e,t){let n=e.offset;if(e.type===`element`)return Nq(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?Nq(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function Fq(e){let t=Wq(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function Iq(e,t,n){return eK(e,t,n,e)}function Lq(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&Y(75,t),n}function Rq(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return rJ(n)?n.host:null}function zq(e){return ZK(e)?e:yJ(e)?e.ownerDocument:null}function Bq(e){RG(),HG()._updateTags.add(e)}function Vq(e){RG(),HG()._deferred.push(e)}function Hq(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function Uq(e){let t=zq(e);return t?t.defaultView:null}function Wq(e){let t=e._window;return t===null&&Y(78),t}function Gq(e){return $(e)&&e.isInline()||lK(e)&&e.isInline()}function Kq(e){let t=e.getLatest();for(;t!==null;){if(tY(t)!==null&&$(t))return t;let e=t.getParentOrThrow();if(Jq(e))return e;t=e}return t}function qq(e){return $(e)&&e.isShadowRoot()}function Jq(e){return dK(e)||qq(e)}function Yq(e,t=!1){let n=e.constructor.clone(e);return tq(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Xq(e){let t=HG(),n=e.getType(),r=VK(t,n);r===void 0&&Y(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||Y(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||Y(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&Y(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Zq(e,t){!dK(e.getParent())||$(t)||lK(t)||Y(99)}function Qq(e){let t=oq(e);return t===null&&Y(63,e),t}function $q(e){if(!e||e.isInline())return!1;if(lK(e))return!0;if($(e)){if(e.isShadowRoot()){let t=e.getParent();return!($(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function eJ(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function tJ(e){return lB?(e||window).getSelection():null}function nJ(e){let t=Uq(e);return t?t.getSelection():null}function rJ(e){return xJ(e)&&`host`in e}var iJ=[];function aJ(e){let t=e.getRootNode();if(t===e||!rJ(t))return iJ;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!rJ(e))break;n.push(e),r=e.host}return n}function*oJ(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(ZK(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function sJ(e){return e===null?document:e.ownerDocument}function cJ(){let e=GG();return sJ(e===null?null:e._rootElement)}function lJ(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=aJ(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function uJ(e,t){let n=lJ(e,t);if(n!==null){let e=fJ(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function dJ(e,t){let n=lJ(e,t);return n===null?e:pJ(n,mJ(e))}function fJ(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function pJ(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function mJ(e){return e.direction}function hJ(e){let t=e.getRootNode();return ZK(t)||rJ(t)?t.activeElement:null}function gJ(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function _J(e){let t=e.target;if(t!==null&&yJ(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function vJ(e){return yJ(e)&&e.tagName===`A`}function yJ(e){return bJ(e)&&e.nodeType===1}function bJ(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function xJ(e){return bJ(e)&&e.nodeType===11}var SJ=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function CJ(e){return!(!yJ(e)||!e.style.display.startsWith(`inline`))||SJ.test(e.nodeName)}var wJ=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function TJ(e){return(!yJ(e)||!e.style.display.startsWith(`inline`))&&wJ.test(e.nodeName)}function EJ(e){if(lK(e)&&!e.isInline())return!0;if(!$(e)||Jq(e))return!1;let t=e.getFirstChild(),n=t===null||xK(t)||X(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function DJ(){return HG()}function OJ(e=DJ()){return e._config.dom||MK}function kJ(e,t,n=DJ()){let r=OJ(n).$getDOMSlot(e,t,n);return $(e)&&(AJ(r)||Y(344,e.getKey(),e.getType())),r}function AJ(e){return e instanceof UB}function jJ(e,t,n=DJ()){return QK(kJ(e,t,n).element)}var MJ=new WeakMap,NJ=new Map;function PJ(e){if(!e._readOnly&&e.isEmpty())return NJ;e._readOnly||Y(192);let t=MJ.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),MJ.set(e,t)),t}function FJ(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function IJ(e){return(t=FJ(e))[eW]=!0,t;var t}function LJ(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function RJ(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function zJ(e,t){let n=t.style.textAlign;return n&&n in PB?e.setFormat(n):e}function BJ(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function VJ(e){return!0===e.__lexicalUnmanaged}function HJ(e,t=DJ()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function UJ(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(yJ(n)&&n.hasAttribute(`data-lexical-slot`)||lq(n,t)!==void 0)return!1;n=Rq(n)}return!1}function WJ(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==rW[t]}var GJ=new WeakMap;function KJ(e){let t=GJ.get(e);if(t)return t;let n=e.prototype!=null&&RB in e.prototype?e.prototype[RB]():void 0,r=function(e){if(!(e===rW||e.prototype instanceof rW)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{IK.version&&(n=JSON.parse(IK.version))}catch{}Y(290,e.name,t,n)}return e===cK||e===oK||e===rW}(e),i=!r&&WJ(e,`getType`)?e.getType():void 0,a,o=i;if(n)if(i)a=n[i];else{for(let[e,t]of Object.entries(n))o=e,a=t;if(!a)for(let e of Object.getOwnPropertySymbols(n)){let t=n[e];if(t){a=t;break}}}if(!r&&o&&(WJ(e,`getType`)||(e.getType=()=>o),WJ(e,`clone`)||(e.clone=t=>(RK(t),new e)),WJ(e,`importJSON`)||(e.importJSON=a&&a.$importJSON||(t=>new e().updateFromJSON(t))),!WJ(e,`importDOM`)&&a)){let{importDOM:t}=a;t&&(e.importDOM=()=>t)}let s={klass:e,ownNodeConfig:a,ownNodeType:o};return GJ.set(e,s),s}function*qJ(e){for(let t=e;t&&(t===rW||iW(t.prototype));){let e=KJ(t);yield e,t=e.ownNodeConfig&&e.ownNodeConfig.extends||ZJ(t)}}function JJ(e){let t=DJ();return RG(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var YJ=(e,t)=>{let n=e;for(;n!=null&&!dK(n);){if(t(n))return n;n=n.getParent()}return null};function XJ(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?oq(r):t.get(r);e??Y(174),n.push(r),r=e.__next}return n}function ZJ(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}var QJ=new Map;function $J(e){return $(e)||lK(e)}function eY(e){return $(e)||lK(e)}function tY(e){let t=e.getLatest();return eY(t)?t.__slotHost:null}function nY(e){let t=tY(e);if(t===null)return null;let n=oq(t);return $(n)||lK(n)||Y(370),n}function rY(e){let t=nY(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of aY(t))if(r===n)return e;return null}function iY(e){let t=e.getLatest();for(;t!==null;){if(tY(t)!==null)return t;t=t.getParent()}return null}function aY(e){let t=e.getLatest();return $J(t)&&t.__slots!==null?t.__slots:QJ}function oY(e){return Array.from(aY(e).keys())}function sY(e,t){let n=aY(e).get(t);return n===void 0?null:oq(n)}var cY=[`__proto__`,`constructor`,`prototype`],lY=Symbol(`slotMapOwner`);function uY(e){let t=e.__slots;return t!==null&&t[lY]===e||(t=new Map(t),t[lY]=e,e.__slots=t),t}var dY=new WeakMap,fY=[];function pY(e){for(let{ownNodeConfig:t}of qJ(e)){let e=t&&t.slots;if(e)return e}return fY}function mY(e){let t=``;for(let n of oY(e)){let r=sY(e,n);r!==null&&(t+=r.getTextContent())}return t}function hY(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function gY(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=dY.get(e);if(t===void 0){let n=pY(e),r=new Map;for(let t of n)cY.includes(t)&&Y(371,e.name,t),r.has(t)&&Y(372,e.name,t),r.set(t,r.size);t=r,dY.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&hY(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>hY(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}function _Y(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||Y(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!$(n)&&!lK(n)||n.isInline())&&Y(374,n.__key);let i=e.getWritable(),a=uY(i),o=a.get(t);o!==void 0&&yY(o);let s=n.getWritable(),c=nY(s);if(c!==null){let e=rY(s);e!==null&&uY(c.getWritable()).delete(e),s.__slotHost=null}return nq(s),s.__slotHost=i.__key,a.set(t,s.__key),gY(i),function(){let e=DJ();e._slotsUsed=!0,e._pendingEditorState&&(e._pendingEditorState._slotsUsed=!0)}(),i}function vY(e,t){let n=e.getWritable();if(n.__slots===null)return n;let r=n.__slots.get(t);return r!==void 0&&(yY(r),uY(n).delete(t)),n}function yY(e){let t=oq(e);if(t===null)return;let n=t.getWritable();eY(n)||Y(377,e),n.__slotHost=null,n.remove()}var bY={next:`previous`,previous:`next`},xY=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return KY({hasNext:kY,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return PY(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return PY(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&Y(263,Array.from(o).join(` `))}else i.insert(e);i=PY(e,this.direction)}for(let e of o.values())e.remove();return this}},SY=class e extends xY{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:RY(e,this.direction)}getParentCaret(e=`root`){return PY(TY(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=wY(this.direction);return PY(this.getNodeAtCaret(),e)||RY(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},CY={root:dK,shadowRoot:Jq};function wY(e){return bY[e]}function TY(e,t=`root`){return e===null||CY[t](e)?null:tY(e)===null?e:null}var EY=class e extends xY{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:PY(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return $(this.origin)?RY(this.origin,this.direction):null}getParentCaret(e=`root`){return PY(TY(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=wY(this.direction);return PY(this.getNodeAtCaret(),e)||RY(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof DY)&&this.direction===t.direction&&this.origin.is(t.origin)}},DY=class e extends xY{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:FY(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return PY(TY(this.getParentAtCaret(),e),this.direction)}getFlipped(){return FY(this.origin,wY(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof EY||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return PY(this.origin,this.direction)}};function OY(e){return e instanceof DY}function kY(e){return e instanceof EY}function AY(e){return e instanceof SY}var jY={next:class extends DY{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends DY{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},MY={next:class extends EY{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends EY{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},NY={next:class extends SY{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends SY{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function PY(e,t){return e?new MY[t](e):null}function FY(e,t,n){return e?new jY[t](e,IY(e,n)):null}function IY(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&cB(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function LY(e,t){return new HY(e,t)}function RY(e,t){return $(e)?new NY[t](e):null}function zY(e){return e&&e.getChildCaret()||e}function BY(e){return e&&zY(e.getAdjacentCaret())}var VY=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return OY(t)?function(e,t){let{direction:n,origin:r}=e;return LY(e,IY(r,t===`focus`?wY(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[LY(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=OY(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=OY(n),i=t=>t.isSameNodeCaret(n)?null:BY(t)||t.getParentCaret(e);return KY({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},HY=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return FY(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function UY(e){return GY(e,PY(pq(),e.direction))}function WY(e){return GY(e,e)}function GY(e,t){return e.direction!==t.direction&&Y(265),new VY(e,t,e.direction)}function KY(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function qY(e,t){let n=ZY(e.origin,t.origin);switch(n===null&&Y(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return JY(n)}}function JY(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function YY(e,t){return t.is(e)}function XY(e){return $(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function ZY(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=XY(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=XY(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(YY(e,r)||Y(276),{commonAncestor:r,type:`ancestor`}):i===null?(YY(t,r)||Y(277),{commonAncestor:r,type:`descendant`}):(($(a)||YY(e,a))&&($(i)||YY(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||Y(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function QY(e,t){let{type:n,key:r,offset:i}=e,a=Qq(e.key);return n===`text`?(X(a)||Y(266,a.getType(),r),FY(a,t,i)):($(a)||Y(267,a.getType(),r),dX(a,e.offset,t))}function $Y(e,t){let{origin:n,direction:r}=t,i=r===`next`;OY(t)?e.set(n.getKey(),t.offset,`text`):kY(t)?X(n)?e.set(n.getKey(),IY(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(AY(t)&&$(n)||Y(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function eX(e){let t=Q(),n=Z(t)?t:lG();return tX(n,e),mq(n),n}function tX(e,t){$Y(e.anchor,t.anchor),$Y(e.focus,t.focus)}function nX(e){let{anchor:t,focus:n}=e,r=QY(t,`next`),i=QY(n,`next`),a=qY(r,i)<=0?`next`:`previous`;return GY(lX(r,a),lX(i,a))}function rX(e){let{direction:t,origin:n}=e,r=PY(n,wY(t)).getNodeAtCaret();return r?PY(r,t):RY(n.getParentOrThrow(),t)}function iX(e,t=`root`){let n=[e];for(let r=AY(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(rX(r));return n}function aX(e){return!!e&&e.origin.isAttached()}function oX(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=uX(e,r),o=iX(a.anchor,n),s=iX(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(AY(e))c.add(e.origin.getKey());else if(kY(e)){let{origin:t}=e;$(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=rX(PY(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=kW(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=FY(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(aX(e)){u=sX(e);break}for(let e of s)if(aX(e)){d=sX(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c;for(c=0;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(Jq(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,EJ),d=u&&l(o,e=>n.has(e.getKey())&&EJ(e));return d&&oY(d).length>0?null:u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;RY(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(d){let e=function(e){if(AY(e)){let t=e.origin;if(EJ(t))return t}else{let t=e.getParentAtCaret();if(t&&EJ(t))return t}return null}(d),t=e&&e.getParent(),n=e&&e.getParents().findLast(qq);if(e&&t&&!dK(t)&&e.isEmpty()&&c.has(e.getKey())&&oY(e).length===0&&(!n||c.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!dK(n)&&n.isEmpty();){let e=n.getParent();if(e&&dK(e)&&e.getChildrenSize()<=1)break;let t=n;n=e,t.remove(!0)}}}let p=[u,d,...o,...s].find(aX);if(p)return WY(lX(sX(p),e.direction));Y(269,JSON.stringify(o.map(e=>e.origin.__key)))}function sX(e){let t=function(e){let t=e;for(;AY(t);){let e=BY(t);if(!AY(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(X(t.origin))return OY(t)?t:FY(t.origin,n,n);let r=t.getAdjacentCaret();return kY(r)&&X(r.origin)?FY(r.origin,n,wY(n)):t}function cX(e){return OY(e)&&e.offset!==IY(e.origin,e.direction)}function lX(e,t){return e.direction===t?e:e.getFlipped()}function uX(e,t){return e.direction===t?e:GY(lX(e.focus,t),lX(e.anchor,t))}function dX(e,t,n){let r=RY(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return lX(r,n)}function fX(e){let{origin:t,offset:n,direction:r}=e;if(n===IY(t,r))return e.getSiblingCaret();if(n===IY(t,wY(r)))return rX(e.getSiblingCaret());let[i]=t.splitText(n);return X(i)||Y(281),lX(PY(i,`next`),r)}function pX(e,t){return!0}function mX(e,{$copyElementNode:t=Yq,$splitTextPointCaretNext:n=fX,rootMode:r=`shadowRoot`,$shouldSplit:i=pX,removeEmptyDestination:a=!1}={}){if(OY(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(AY(e)){let e=rX(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}return o}function hX(e,t,n){let r=lX(t,`next`);OY(r)&&(r.offset===0?r=PY(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=PY(r.origin,`next`))),r.origin.is(e)&&(kY(r)||Y(342,e.getKey(),e.getType()),r=rX(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=mX(e,n))r=e;return OY(r)&&Y(283),r.insert(e.isInline()?DK().append(e):e),lX(PY(e.getLatest(),`next`),t.direction)}function gX(e){return e}function _X(e){return e}function vX(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function yX(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function bX(e,...t){let n=yX(...t);n.length>0&&e.classList.add(...n)}function xX(e,...t){let n=yX(...t);n.length>0&&e.classList.remove(...n)}function SX(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}var CX=2;function wX(e,t,n){let r=n.theme.heading;if(!r)return;let i=r[`h${t}`];if(typeof i==`string`){let t=yX(i);t.length>0&&bX(e,...t)}}function TX(e,t){let n=DX(t);if(e.style?.textAlign&&n.setFormat(e.style.textAlign),LJ(e,n),n.getFormatType()===``){let t=e.getAttribute(`align`);(t===`left`||t===`center`||t===`right`||t===`justify`||t===`start`||t===`end`)&&n.setFormat(t)}return n}var EX=class e extends TK{__level;static getType(){return`survey-rich-text-heading`}static clone(t){return new e(t.__level,t.__key)}constructor(e=CX,t){super(t),this.__level=e}getHeadingLevel(){return this.getLatest().__level}createDOM(e){let t=cJ().createElement(`h${this.__level}`);return t.dataset.richTextHeading=``,wX(t,this.__level,e),t}updateDOM(e){return e.__level!==this.__level}static importDOM(){return{h1:()=>({conversion:e=>({node:TX(e,1)})}),h2:()=>({conversion:e=>({node:TX(e,2)})}),h3:()=>({conversion:e=>({node:TX(e,3)})}),h4:()=>({conversion:e=>({node:TX(e,4)})}),h5:()=>({conversion:e=>({node:TX(e,5)})}),h6:()=>({conversion:e=>({node:TX(e,6)})})}}exportDOM(e){let t=cJ().createElement(`h${this.__level}`);return this.getFormatType()&&(t.style.textAlign=this.getFormatType()),{element:t}}static importJSON(e){return DX(e.level>=1&&e.level<=6?e.level:CX).updateFromJSON(e)}exportJSON(){let t=super.exportJSON();return t.type=e.getType(),t.level=this.__level,t}collapseAtStart(){let e=DK();return e.setTextFormat(this.getTextFormat()),e.setTextStyle(this.getTextStyle()),e.setDirection(this.getDirection()),e.setFormat(this.getFormatType()),e.setStyle(this.getStyle()),e.setIndent(this.getIndent()),this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}insertNewAfter(e,t){let n=DK();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}};function DX(e=CX){return Xq(new EX(e))}function OX(e){return e instanceof EX}function kX(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function AX(e){let t=``;for(let n in e)n&&(t+=`${n}: ${e[n]};`);return t}function jX(e){let t=DJ().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function MX(e){return jX(dK(e)?e:e.getParentOrThrow())}function NX(e){let t=MX(e);return t!==null&&t.direction===`rtl`}function PX(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!YK(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=KW(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=IJ(t)),t.__text=p)}}return t}function FX(e,t){(Z(e)?e.isCollapsed():X(e)||$(e))||kX(280);let n=uW(Z(e)?e.style:X(e)?e.getStyle():e.getTextStyle()),r=AX(Object.entries(t).reduce((t,[r,i])=>(typeof i==`function`?t[r]=i(n[r],e):i===null?delete t[r]:t[r]=i,t),{...n}));Z(e)||X(e)?e.setStyle(r):e.setTextStyle(r)}function IX(e,t){if(Z(e)&&e.isCollapsed()){FX(e,t);let n=e.anchor.getNode();$(n)&&n.isEmpty()&&FX(n,t)}LX(e=>{FX(e,t)});let n=e.getNodes();if(n.length>0){let e=new Set;for(let r of n){if(!$(r)||!r.canBeEmpty()||r.getChildrenSize()!==0)continue;let n=r.getKey();e.has(n)||(e.add(n),FX(r,t))}}}function LX(e){let t=Q();if(!t)return;let n=new Map,r=e=>n.get(e.getKey())||[0,e.getTextContentSize()];if(Z(t))for(let e of nX(t).getTextSlices())e&&n.set(e.caret.origin.getKey(),e.getSliceIndices());let i=t.getNodes();for(let t of i){if(!X(t)||!t.canHaveFormat())continue;let[n,i]=r(t);i!==n&&(YK(t)||n===0&&i===t.getTextContentSize()?e(t):e(t.splitText(n,i)[n===0?0:1]))}Z(t)&&t.anchor.type===`text`&&t.focus.type===`text`&&t.anchor.key===t.focus.key&&RX(t)}function RX(e){if(e.isBackward()){let{anchor:t,focus:n}=e,{key:r,offset:i,type:a}=t;t.set(n.key,n.offset,n.type),n.set(r,i,a)}}function zX(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function BX(e,t,n){let r=QY(e,n);if(cX(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function VX(e,t,n=zX){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=new Map;if(r){let[t,n]=r,s=YJ(t.getNode(),EJ);a=YJ(n.getNode(),EJ);let c=e.isBackward()?`previous`:`next`;i=$(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!$(r)||!r.isEmpty())&&BX(e,t,n)}(n,a,wY(c)),$(s)&&o.set(s.getKey(),s),$(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if($(t)&&EJ(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=YJ(t,EJ);$(e)&&o.set(e.getKey(),e)}for(let e of o.values()){let r=t();n(e,r),e.replace(r,!0)}}function HX(e){let t=UX(e);return t!==null&&t.writingMode===`vertical-rl`}function UX(e){let t=e.anchor.getNode();return $(t)?jX(t):MX(t)}function WX(e,t){let n=HX(e)?!t:t;KX(e)&&(n=!n);let r=QY(e.focus,n?`previous`:`next`);if(cX(r))return!1;if(OY(r)&&!NW(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(X(e)&&!NW(e))return!0}for(let e of UY(r)){if(AY(e))return!e.origin.isInline();if(!$(e.origin)){if(lK(e.origin))return!0;break}}return!1}function GX(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function KX(e){let t=UX(e);return t!==null&&t.direction===`rtl`}function qX(e,t,n){let r=KX(e),i;i=HX(e)||r?!n:n,GX(e,t,i,`character`)}function JX(e,t,n){let r=uW(e.getStyle());return r!==null&&r[t]||n}function YX(e,t,n=``){let r=null,i=e.getNodes(),a,o;if(Z(e)){if(e.isCollapsed()&&e.style!==``){let n=uW(e.style);if(n!==null&&t in n)return n[t]}let{anchor:n,focus:r}=e,i=e.isBackward(),s=i?r.getNode():n.getNode(),c=i?n.getNode():r.getNode(),l=i?r.offset:n.offset,u=i?n.offset:r.offset;X(s)&&l===s.getTextContentSize()&&(a=s),u===0&&(o=c)}for(let e=0;e<i.length;e++){let s=i[e];if(X(s)&&!s.is(e===0?a:o)){let e=JX(s,t,n);if(r===null)r=e;else if(r!==e){r=``;break}}}return r===null?n:r}function XX(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function ZX(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function QX(e){let t=YJ(e,e=>$(e)&&!e.isInline());return $(t)||XX(4,e.__key),t}function $X(e){let t=Q()||fG(),n;if(Z(t))n=QY(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=PY(r,`next`))}n||=RY(pq(),`previous`).getFlipped().insert(DK())}let r=hX(e,n),i=BY(r);return eX(WY(AY(i)?sX(i):r)),e.getLatest()}function eZ(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function tZ(e){let t=null;if(eZ(e,DragEvent)?t=e.dataTransfer:eZ(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function nZ(e){let t=Q();if(!Z(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=YJ(i,e=>$(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}var rZ=Symbol.for(`preact-signals`);function iZ(){if(lZ>1)return void lZ--;let e,t=!1;for(function(){let e=cZ;for(cZ=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();oZ!==void 0;){let n=oZ;for(oZ=void 0,uZ++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&gZ(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(uZ=0,lZ--,t)throw e}var aZ,oZ;function sZ(e){let t=aZ;aZ=void 0;try{return e()}finally{aZ=t}}var cZ,lZ=0,uZ=0,dZ=0,fZ=0;function pZ(e){if(aZ===void 0)return;let t=e.n;return t===void 0||t.t!==aZ?(t={i:0,S:e,p:aZ.s,n:void 0,t:aZ,e:void 0,x:void 0,r:t},aZ.s!==void 0&&(aZ.s.n=t),aZ.s=t,e.n=t,32&aZ.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=aZ.s,t.n=void 0,aZ.s.n=t,aZ.s=t),t):void 0}function mZ(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function hZ(e,t){return new mZ(e,t)}function gZ(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function _Z(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function vZ(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function yZ(e,t){mZ.call(this,void 0),this.x=e,this.s=void 0,this.g=fZ-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function bZ(e){let t=e.m;if(e.m=void 0,typeof t==`function`){lZ++;let n=aZ;aZ=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,xZ(e),t}finally{aZ=n,iZ()}}}function xZ(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,bZ(e)}function SZ(e){if(aZ!==this)throw Error(`Out-of-order effect`);vZ(this),aZ=e,this.f&=-2,8&this.f&&xZ(this),iZ()}function CZ(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function wZ(e,t){let n=new CZ(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}mZ.prototype.brand=rZ,mZ.prototype.h=function(){return!0},mZ.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?sZ(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},mZ.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&sZ(()=>{var e;(e=this.Z)==null||e.call(this)}))}},mZ.prototype.subscribe=function(e){return wZ(()=>{let t=this.value,n=aZ;aZ=void 0;try{e(t)}finally{aZ=n}},{name:`sub`})},mZ.prototype.valueOf=function(){return this.value},mZ.prototype.toString=function(){return this.value+``},mZ.prototype.toJSON=function(){return this.value},mZ.prototype.peek=function(){let e=aZ;aZ=void 0;try{return this.value}finally{aZ=e}},Object.defineProperty(mZ.prototype,`value`,{get(){let e=pZ(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(uZ>100)throw Error(`Cycle detected`);(function(e){lZ!==0&&uZ===0&&e.l!==dZ&&(e.l=dZ,cZ={S:e,v:e.v,i:e.i,o:cZ})})(this),this.v=e,this.i++,fZ++,lZ++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{iZ()}}}}),yZ.prototype=new mZ,yZ.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===fZ))return!0;if(this.g=fZ,this.f|=1,this.i>0&&!gZ(this))return this.f&=-2,!0;let e=aZ;try{_Z(this),aZ=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return aZ=e,vZ(this),this.f&=-2,!0},yZ.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}mZ.prototype.S.call(this,e)},yZ.prototype.U=function(e){if(this.t!==void 0&&(mZ.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},yZ.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(yZ.prototype,`value`,{get(){if(1&this.f)throw Error(`Cycle detected`);let e=pZ(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),CZ.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},CZ.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,bZ(this),_Z(this),lZ++;let e=aZ;return aZ=this,SZ.bind(this,e)},CZ.prototype.N=function(){2&this.f||(this.f|=2,this.u=oZ,oZ=this)},CZ.prototype.d=function(){this.f|=8,1&this.f||xZ(this)},CZ.prototype.dispose=function(){this.d()};function TZ(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}function EZ(e,t){let n;return hZ(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}function DZ(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var OZ;try{OZ=`0.48.0+prod.esm`}catch{}var kZ=OZ??`"<unknown>+source"`,AZ=new Set([`__proto__`,`constructor`,`prototype`]);function jZ(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!AZ.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=jZ(n[e],r[e]));return e}return t}var MZ=0,NZ=1,PZ=2,FZ=3,IZ=4,LZ=5,RZ=6,zZ=7;function BZ(e){return e.id===MZ}function VZ(e){return e.id===PZ}function HZ(e){return function(e){return e.id===NZ}(e)||DZ(305,String(e.id),String(NZ)),Object.assign(e,{id:PZ})}var UZ=new Set,WZ=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:MZ}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):vX;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;VZ(t)||DZ(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:FZ,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:IZ,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==IZ&&DZ(307,String(t.id),String(LZ)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:LZ,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==LZ&&DZ(308,String(n.id),String(LZ));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:RZ})}(n),()=>{let e=this.state;e.id!==zZ&&DZ(309,String(n.id),String(zZ)),this.state=function(e){return Object.assign(e,{id:LZ})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==RZ&&DZ(310,String(t.id),String(RZ)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:zZ})}(t),n}getSignal(){return this._signal===void 0&&DZ(311),this._signal}getInitResult(){this.extension.init===void 0&&DZ(312,this.extension.name);let e=this.state;return function(e){return e.id>=IZ}(e)||DZ(313,String(e.id),String(IZ)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=FZ}(e)||DZ(314,String(e.id),String(FZ)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&DZ(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&DZ(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=zZ}(e)||DZ(316,String(e.id),String(zZ)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||UZ}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=LZ})(e)||DZ(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},GZ={tag:oW};function KZ(){let e=pq();e.isEmpty()&&e.append(DK())}var qZ=gX({config:_X({setOptions:GZ,updateOptions:GZ}),init:({$initialEditorState:e=KZ})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(hK(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[uK,bW,vK,jW,TK]}),JZ=Symbol.for(`@lexical/extension/LexicalBuilder`);function YZ(){}function XZ(e){throw e}function ZZ(e){return Array.isArray(e)?e:[e]}var QZ=kZ,$Z=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=QZ,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[ZZ(qZ)];for(let e of t)n.push(ZZ(e));return new e(n)}static maybeFromEditor(t){let n=t[JZ];return n&&(n.PACKAGE_VERSION!==QZ&&DZ(292,n.PACKAGE_VERSION,QZ),n instanceof e||DZ(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&DZ(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(NK({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[JZ]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=YZ;function t(){try{e()}finally{e=YZ}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=SX(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&DZ(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&DZ(296);let[t]=ZZ(e);typeof t.name!=`string`&&DZ(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&DZ(298,t.name),!n){n=new WZ(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&DZ(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&DZ(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=ZZ(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(VZ(i))return;let a=n.extension.name;var o;BZ(i)||DZ(300,a,r||`[unknown]`),BZ(o=i)||DZ(304,String(o.id),String(MZ)),i=Object.assign(o,{id:NZ}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=HZ(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())BZ(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&DZ(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return SX(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of TZ(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&DZ(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&jZ(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=XZ,e}};function eQ(e,t){let n=$Z.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}function tQ(e){return eQ(DJ(),e)}var nQ=TH(`INSERT_HORIZONTAL_RULE_COMMAND`),rQ=class e extends cK{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return aQ().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:iQ,priority:0})}}exportDOM(){return{element:cJ().createElement(`hr`)}}createDOM(e){let t=cJ().createElement(`hr`);return bX(t,e.theme.hr),t}getTextContent(){return`
|
|
165
|
-
`}isInline(){return!1}updateDOM(){return!1}};function iQ(){return{node:aQ()}}function aQ(){return JJ(rQ)}function oQ(e){return e instanceof rQ}Date.now;function sQ(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var cQ;function lQ(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function uQ(e){return cQ&&cQ.editor===e?cQ:void 0}function dQ(e,t){let n=uQ(t);return n&&n[e]}function fQ(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r(lQ(e,n))]}return t}function pQ(e,t){let n=t;for(let r of e){let[e,i]=fQ(n,r),a=e.key;if(n===t&&lQ(n,e)===i)continue;let o=n===t||n===void 0?mQ(t):n;o[a]=i,n=o}return n}function mQ(e){return Object.create(e||null)}function hQ(e,t){return[e,t]}function gQ(e,t,n,r=DJ()){let i=cQ,a=uQ(r);try{return cQ={...a,editor:r,[e]:t},n()}finally{cQ=i}}function _Q(e,t=()=>{}){return(n,r=DJ())=>i=>{let a=uQ(r),o=a&&a[e],s=pQ(n,o||t(r));return s&&s!==o?gQ(e,s,i,r):i()}}function vQ(e,t,n,r){return Object.assign(uV(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}function yQ(e){if(!ZK(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=new Map;function r(e){let t=n.get(e);if(t===void 0){t=new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(let e of Array.from(t.styleSheets)){let n;try{n=e.cssRules}catch{continue}for(let e of Array.from(n)){if(!eZ(e,CSSStyleRule))continue;let n;try{n=t.querySelectorAll(e.selectorText)}catch{continue}for(let t of Array.from(n)){if(!yJ(t))continue;let n=r(t);for(let r=0;r<e.style.length;r++){let i=e.style[r];n.has(i)||t.style.setProperty(i,e.style.getPropertyValue(i),e.style.getPropertyPriority(i))}}}}}catch{}}var bQ=`@lexical/html/DOM`,xQ=Symbol.for(`@lexical/html/DOMExportContext`),SQ=`@lexical/html/DOMImport`,CQ=Symbol.for(`@lexical/html/DOMImportContext`);function wQ(e,t,n){return vQ(xQ,e,t,n)}var TQ=wQ(`isExport`,Boolean);function EQ(e){let t=eQ(e,bQ);return t?t.output.defaults:void 0}function DQ(e){let t=eQ(e,bQ);return t?t.output.runtime:void 0}function OQ(e=DJ()){let t=DQ(e);return t?t.getSessionConfig():OJ(e)}var kQ=_Q(xQ,EQ),AQ=Symbol.for(`@lexical/html/SelectorImpl`);function jQ(e,t){let n={kind:`element`,predicate:(r=t,r.length===0?yJ:r.length===1?r[0]:(e,t)=>{for(let n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;let i=n=>jQ(e,[...t,n]);return{[AQ]:n,attr:(e,t,n)=>i(PQ(e,t,n)),classAll:(...e)=>i(NQ(e)),classAny:(...e)=>i(function(e){let t=MQ(e);return t.length===0?()=>!1:e=>{if(!yJ(e))return!1;let n=e.classList;for(let e of t)if(n.contains(e))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if(typeof t==`string`)return n=>yJ(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!yJ(t))return!1;let a=t.style.getPropertyValue(e);if(!a)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}sQ(362,JSON.stringify(e))}(e,t,n))}}function MQ(e){let t=[];for(let n of e)n&&t.push(n);return t}function NQ(e){let t=MQ(e);return t.length===0?()=>!0:e=>{if(!yJ(e))return!1;let n=e.classList;for(let e of t)if(!n.contains(e))return!1;return!0}}function PQ(e,t,n){if(!0===t)return t=>yJ(t)&&t.hasAttribute(e);if(typeof t==`string`)return n=>yJ(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!yJ(t))return!1;let a=t.getAttribute(e);if(a==null)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}sQ(361,JSON.stringify(e))}var FQ={kind:`text`,predicate:XK,tags:new Set},IQ={[AQ]:FQ},LQ={kind:`comment`,predicate:e=>e.nodeType===8,tags:new Set},RQ={[AQ]:LQ},zQ={any:()=>jQ(new Set,[]),comment:()=>RQ,tag(...e){e.length>0||sQ(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return jQ(t,[])},text:()=>IQ},BQ=/[A-Za-z0-9_-]/,VQ=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||``}consume(){return this.source[this.pos++]||``}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&BQ.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e===`"`||e===`'`,`expected quote`);let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()===`\\`?this.pos+=2:this.pos++;this.assert(!this.eof(),`unterminated string`);let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,`$1`)}assert(e,t){e||sQ(364,String(this.pos+1),t,this.source)}};function HQ(e){let t=new Set,n=[],r=[];if(e.skipWhitespace(),e.peek()===`*`)e.consume();else if(BQ.test(e.peek())){let n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){let t=e.peek();if(t===`.`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected class name after "."`),r.push(t)}else if(t===`#`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected id after "#"`),n.push(PQ(`id`,t))}else{if(t!==`[`)break;{e.consume(),e.skipWhitespace();let t=e.readIdent();e.assert(t!==``,`expected attribute name after "["`),e.skipWhitespace();let r=!0;if(e.peek()===`=`){e.consume(),e.skipWhitespace();let t=e.peek();t===`"`||t===`'`?r=e.readQuoted():(r=e.readIdent(),e.assert(r!==``,`expected attribute value`)),e.skipWhitespace()}e.assert(e.peek()===`]`,`expected "]"`),e.consume(),n.push(PQ(t,r))}}}return r.length>0&&n.push(NQ(r)),{predicates:n,tags:t}}function UQ(e){let t=new VQ(e,0),n=[];for(;;){let e=HQ(t);if(n.push(e),t.skipWhitespace(),t.eof())break;t.assert(t.peek()===`,`,`expected "," (selector lists are the only supported combinator)`),t.consume(),t.skipWhitespace()}if(n.length===1)return jQ(n[0].tags,n[0].predicates);let r=new Set;for(let e of n)for(let t of e.tags)r.add(t);return jQ(r,[(e,t)=>{for(let r of n){let n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(let n of r.predicates)if(!n(e,t)){i=!1;break}if(i)return!0}return!1}])}function WQ(e){let t=eQ(e,SQ);return t?t.output.defaults:void 0}function GQ(e,t=DJ()){return lQ(function(e){return dQ(CQ,e)||WQ(e)}(t),e)}var KQ=_Q(CQ,WQ);function qQ(e){return sG(e)||lK(e)&&!e.isInline()}function JQ(e,t){let n=[],r=[],i=()=>{r.length!==0&&(n.push(t().splice(0,0,r)),r=[])};for(let a of e)if(qQ(a)){if(i(),$(a)){let e=JQ(a.getChildren(),t);a.splice(0,a.getChildrenSize(),e)}n.push(a)}else r.push(a);return i(),n}var YQ=zQ;YQ.tag(`b`,`strong`,`em`,`i`,`code`,`mark`,`s`,`sub`,`sup`,`u`,`span`),YQ.text(),YQ.tag(`script`,`style`),YQ.tag(`br`),YQ.tag(`p`),YQ.tag(`hr`),YQ.any();function XQ(e,t){return XK(t)?e.textIndices:t.nodeType===8?e.commentIndices:yJ(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:ZQ}var ZQ=Object.freeze([]),QQ=Object.freeze({});function $Q(e,t){return{$importChildren:(t,n)=>function(e,t,n){let r=n&&n.rules?n.rules.dispatch:void 0;r&&e.overlays.push(r);try{let r=()=>e$(e,t,n);return n&&n.context?KQ(n.context,e.editor)(r):r()}finally{r&&e.overlays.pop()}}(e,t,n),$importOne:(t,n)=>t$(e,t,n),captures:t,get:t=>GQ(t,e.editor),session:e.session}}function e$(e,t,n){let r=n&&n.$onChild,i=[];for(let n of Array.from(t.childNodes)){let t=t$(e,n,void 0);for(let e of t){let t=r?r(e):e;t!=null&&i.push(t)}}let a=n&&n.$after?n.$after(i):i,o=n&&n.schema;return o?function(e,t,n,r){let i=[],a=null,o=()=>{if(a===null)return;let t=a;if(a=null,e.$packageRun){let a=e.$packageRun(t,n,r);if(a.length>0){for(let e of a)i.push(e);return}}if(e.onReject===`hoist`)for(let e of t)i.push(e)};for(let r of t)e.$accepts(r,n)?(o(),i.push(r)):(a===null&&(a=[]),a.push(r));return o(),e.$finalize?e.$finalize(i,n):i}(o,a,null,t):a}function t$(e,t,n){let r=()=>function(e,t){let n=function(e,t){let n=[];for(let r=e.overlays.length-1;r>=0;r--){let i=e.overlays[r],a=XQ(i,t);a.length>0&&n.push({dispatch:i,indices:a})}let r=XQ(e.dispatch,t);return r.length>0&&n.push({dispatch:e.dispatch,indices:r}),n}(e,t);if(n.length===0)return n$(e,t);let r=0,i=0,a=()=>{for(;r<n.length;){let{dispatch:o,indices:s}=n[r];for(;i<s.length;){let n=s[i++],r=o.rules[n],c={};if(r.predicate(t,c)){let n=$Q(e,Object.keys(c).length===0?QQ:c);try{return r.$import(n,t,a)}catch(e){throw e}}}r++,i=0}return n$(e,t)};return a()}(e,t);return n&&n.context?KQ(n.context,e.editor)(r):r()}function n$(e,t){if(t.childNodes.length===0)return[];let n=[];for(let r of Array.from(t.childNodes)){let t=t$(e,r,void 0);for(let e of t)n.push(e)}return n}zQ.any();var r$={any:zQ.any,comment:zQ.comment,css:UQ,tag:zQ.tag,text:zQ.text},i$=new Set([`STYLE`,`SCRIPT`]);function a$(e,t){yQ(t);let n=ZK(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!i$.has(t.nodeName)){let n=l$(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof _K&&t.insertAfter(bK());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function o$(e,t=null,n=DJ()){return kQ([hQ(TQ,!0)],n)(()=>{let r=pq(),i=OQ(n),a=Z(t)?iY(t.anchor.getNode()):null,o=e.append.bind(e);for(let e of($(a)?a:r).getChildren())c$(n,e,o,t,i);return e})}function s$(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&sQ(338),VG(e),o$(cJ().createElement(`div`),t,e).innerHTML}function c$(e,t,n,r=null,i=OJ(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&X(t)&&(s=PX(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=cJ().createDocumentFragment(),p=d?d():$(s)?s.getChildren():[],m=a&&VW(r)&&$(t)?null:r,h=f.append.bind(f);for(let n of p){let o=c$(e,n,h,m,i);!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((yJ(c)||xJ(c))&&(u?u(f):c.append(f)),n(c),l){let e=l.call(s,c);e&&(xJ(c)?c.replaceChildren(e):c.replaceWith(e))}}else n(f);return a}function l$(e,t,n,r,i=new Map,a){let o=[];if(i$.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!Jq(s))&&(s!=null&&sG(s)||r);for(let e=0;e<d.length;e++)f.push(...l$(d[e],t,n,p,new Map(i),s));if(u!=null&&(f=u(f)),TJ(e)&&(f=u$(e,f,p?()=>{let e=new _K;return n.push(e),e}:DK)),s==null)if(f.length>0)for(let e of f)o.push(e);else TJ(e)&&function(e){return e.nextSibling==null||e.previousSibling==null?!1:CJ(e.nextSibling)&&CJ(e.previousSibling)}(e)&&o.push(bK());else $(s)&&s.append(...f);return o}function u$(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(sG(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&sG(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}function d$(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function f$(e){let t=1,n=e.getParent();for(;n!=null;){if(j$(n)){let e=n.getParent();if(L$(e)){t++,n=e.getParent();continue}d$(40)}return t}return t}function p$(e){let t=e.getParent();L$(t)||d$(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),L$(r)&&(n=r);return n}function m$(e){let t=[],n=e.getChildren().filter(j$);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();L$(i)?t=t.concat(m$(i)):t.push(r)}return t}function h$(e){return j$(e)&&L$(e.getFirstChild())}function g$(e,t){return j$(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function _$(e){let t=Q();if(t!==null){let n=t.getNodes();if(Z(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(Jq(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=DK();i.append(e),n=e.select().getNodes()}}else if(g$(i,n)){let t=I$(e);if(Jq(a)){i.replace(t);let e=A$();$(i)&&(e.setFormat(i.getFormatType()),e.setIndent(i.getIndent())),t.append(e)}else if(j$(i)){let e=i.getParentOrThrow();v$(t,e.getChildren()),e.replace(t)}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if($(i)&&i.isEmpty()&&!j$(i)&&!r.has(i.getKey())){y$(i,e);continue}let a=eq(i)?i.getParent():j$(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(L$(a)){if(!r.has(t)){let n=I$(e);v$(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(Jq(n)&&!r.has(t)){r.add(t),y$(a,e);break}a=n}}}}}function v$(e,t){e.splice(e.getChildrenSize(),0,t)}function y$(e,t){if(L$(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=A$(),a;if(v$(i,e.getChildren()),L$(n)&&t===n.getListType())n.append(i),L$(r)&&t===r.getListType()&&(v$(n,r.getChildren()),r.remove()),a=n;else if(L$(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=I$(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=Q();return Z(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function b$(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&h$(n)&&h$(r)&&(b$(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function x$(){let e=Q();if(Z(e)){let t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(g$(r,n))t.add(p$(r));else for(let e=0;e<n.length;e++){let r=n[e];if(eq(r)){let e=ZX(r,E$);e!=null&&t.add(p$(e))}}for(let n of t){let t=n,r=m$(n);for(let n of r){let r=DK().setTextStyle(e.style).setTextFormat(e.format);v$(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&$Y(e.anchor,sX(RY(r,`next`))),n.__key===e.focus.key&&$Y(e.focus,sX(RY(r,`next`))),n.remove()}n.remove()}}}function S$(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())j$(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),L$(r.getFirstChild())||n++)}function C$(e){let t=new Set;if(h$(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(h$(r)&&h$(i)){let n=i.getFirstChild();if(L$(n)){n.append(e);let i=r.getFirstChild();L$(i)&&(v$(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(h$(r)){let t=r.getFirstChild();if(L$(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(h$(i)){let t=i.getFirstChild();L$(t)&&t.append(e)}else if(L$(n)){let t=Yq(e),a=Yq(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function w$(e){if(h$(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(L$(n?n.getParent():void 0)&&j$(n)&&L$(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=Yq(e),i=Yq(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=Yq(e),o=Yq(t);a.append(o),v$(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function T$(e=!1){let t=Q();if(!Z(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(j$(n)&&n.getChildrenSize()===0)r=n;else if(X(n)){let e=n.getParent();j$(e)&&e.getChildren().every(e=>X(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=p$(r),a=r.getParent();L$(a)||d$(40);let o=a.getParent(),s;if(Jq(o))s=DK(),i.insertAfter(s);else{if(!j$(o))return!1;s=Yq(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(a,r):1,n=Yq(a).setStart(t);if(j$(s)){let e=Yq(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!j$(e)&&!L$(e))break;t=e}t.remove()}(r),!0}var E$=class extends oK{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(L$(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();L$(n)||d$(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of PY(e,t)){if(!j$(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),Jq(t)||(hX(n,rX(PY(n,`next`)),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:oK,importDOM:$U({li:()=>({conversion:D$,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=cJ().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!L$(n)||n.getListType()!==`check`||L$(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=L$(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>L$(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...yX(a)),u.length>0&&xX(e,...u);let d=[];if(i!==void 0&&d.push(...yX(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...yX(a)),d.length>0&&bX(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&fW(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=uW(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in uW(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),h$(this)?{after(e){if(yJ(e)){let t=e.previousElementSibling;if(yJ(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if($(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(j$(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!L$(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=Yq(n),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}let r=this.__key,i=0;if(t&&($(e)||d$(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&$(e)){let t=Q();if(Z(t))for(let n of t.getStartEndPoints())n.key===r&&n.type===`element`&&n.set(e.getKey(),i+n.offset,`element`)}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(L$(n)||d$(39),j$(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=Yq(n);r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&h$(t)&&h$(n)&&(b$(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=Yq(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(h$(this))return!1;let t=this.getParentOrThrow();if(j$(t.getParentOrThrow()))return w$(this),!0;let n=DK().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=Yq(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return L$(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;j$(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&d$(117),(e=Math.floor(e))>=0||d$(199);let t=this.getIndent();for(;t!==e;)t<e?(C$(this),t++):(w$(this),t--);return this}canInsertAfter(e){return j$(e)}canReplaceWith(e){return j$(e)}canMergeWith(e){return j$(e)||OK(e)}extractWithChild(e,t){if(!Z(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return I$(`bullet`)}canMergeWhenEmpty(){return!0}};function D$(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return O$(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return O$(t.children[0])}let t=e.getAttribute(`aria-checked`),n=A$(t===`true`||t!==`false`&&void 0);return zJ(n,e),{after:k$.bind(null,n),node:RJ(n,e)}}function O$(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=A$(e.hasAttribute(`checked`));return{after:k$.bind(null,t),node:t}}function k$(e,t){let n=t[0];return t.length===1&&OK(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function A$(e){return Xq(new E$(void 0,e))}function j$(e){return e instanceof E$}var M$=class extends oK{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();L$(t)&&e.getListType()===t.getListType()&&b$(e,t)})(e),S$(e)},extends:oK,importDOM:$U({ol:()=>({conversion:P$,priority:0}),ul:()=>({conversion:P$,priority:0})})})}constructor(e=`number`,t=1,n){super(n);let r=F$[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=cJ().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,N$(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(N$(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return yJ(t)&&(this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`)),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];j$(t)||(r===n&&(r=[...n]),r[e]=this.createListItemNode().append(!$(t)||L$(t)||t.isInline()?t:kW(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return j$(e)}createListItemNode(){return A$()}};function N$(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=f$(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...yX(s));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(l!==void 0){let e=yX(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&xX(e,...i),r.length>0&&bX(e,...r)}function P$(e){let t;if(function(e){return yJ(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=I$(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(yJ(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?I$(`check`):I$(`bullet`);return RJ(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){let i=e[t];if(j$(i)){r.push(i);let e=i.getChildren();e.length>1&&e.forEach(e=>{L$(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}var F$={ol:`number`,ul:`bullet`};function I$(e=`number`,t=1){return Xq(new M$(e,t))}function L$(e){return e instanceof M$}r$.tag(`ol`,`ul`),r$.tag(`li`),r$.tag(`li`).classAll(`task-list-item`),r$.tag(`li`).classAll(`joplin-checkbox`);var R$=TH(`UPDATE_LIST_START_COMMAND`),z$=TH(`INSERT_UNORDERED_LIST_COMMAND`),B$=TH(`INSERT_ORDERED_LIST_COMMAND`),V$=TH(`REMOVE_LIST_COMMAND`);function H$(e,t){return SX(e.registerCommand(B$,()=>(_$(`number`),!0),1),e.registerCommand(R$,e=>{let{listNodeKey:t,newStart:n}=e,r=oq(t);return!!L$(r)&&(r.getListType()===`number`&&(r.setStart(n),S$(r)),!0)},1),e.registerCommand(z$,()=>(_$(`bullet`),!0),1),e.registerCommand(V$,()=>(x$(),!0),1),e.registerCommand(FH,()=>T$(!!(t&&t.restoreNumbering)),1),e.registerCommand(eU,e=>{if(function(){let e=Q();if(!Z(e)||!e.isCollapsed()||e.anchor.offset!==0)return!1;let t=e.anchor.getNode(),n=YJ(t,j$);if(!j$(n))return!1;let r=n.getFirstDescendant();if(r===null||!n.is(t)&&!r.is(t))return!1;let i=n.getParent();if(!L$(i)||!n.is(i.getFirstChild()))return!1;let a=i.getPreviousSibling();if(!lK(a)||a.isIsolated()||!a.isKeyboardSelectable()&&a.isInline())return!1;let o=DK().append(...n.getChildren());return i.insertBefore(o),n.remove(),i.isEmpty()&&i.remove(),o.selectStart(),!0}())return e.preventDefault(),!0;let t=Q();if(!Z(t)||!t.isCollapsed())return!1;let{anchor:n}=t;if(n.offset!==0)return!1;let r=n.getNode();for(;!j$(r);){if(r.getPreviousSibling()!==null)return!1;let e=r.getParent();if(e===null)return!1;r=e}return!(!j$(r)||!r.collapseAtStart(t))&&(e.preventDefault(),!0)},-8),e.registerNodeTransform(E$,e=>{let t=e.getFirstChild();if(t){if(X(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=Q();Z(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(bW,e=>{let t=e.getParent();if(j$(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function U$(e){let t=e=>{let t=e.getParent();if(L$(e.getFirstChild())||!L$(t))return;let n=YJ(e,e=>j$(e)&&L$(e.getParent())&&j$(e.getPreviousSibling()));if(n===null&&e.getIndent()>0)e.setIndent(0);else if(j$(n)){let r=n.getPreviousSibling();if(j$(r)){let n=function(e){let t=e,n=t.getFirstChild();for(;L$(n);){let e=n.getLastChild();if(!j$(e))break;t=e,n=t.getFirstChild()}return t}(r).getParent();if(L$(n)){let r=f$(n);r+1<f$(t)&&e.setIndent(r)}}}};return e.registerNodeTransform(M$,e=>{let n=[e];for(;n.length>0;){let e=n.shift();if(L$(e)){for(let r of e.getChildren())if(j$(r)){t(r);let e=r.getFirstChild();L$(e)&&n.push(e)}}}})}var W$=(0,d.createContext)({editorVariant:`compact`,editable:!0});function G$({value:e,children:t}){return(0,m.jsx)(W$.Provider,{value:e,children:t})}function K$(){return(0,d.useContext)(W$)}var q$=(0,f.createContext)(null);function J$(e,t){let n=null;return e!=null&&(n=e[1]),{getTheme:function(){return t??(n==null?null:n.getTheme())}}}function Y$(){let e=(0,f.useContext)(q$);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}var X$=class extends cK{__format;constructor(e,t){super(t),this.__format=e||``}afterCloneFrom(e){super.afterCloneFrom(e),this.__format=e.__format}exportJSON(){return{...super.exportJSON(),format:this.__format||``}}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format||``)}canIndent(){return!1}createDOM(){return cJ().createElement(`div`)}updateDOM(){return!1}setFormat(e){let t=this.getWritable();return t.__format=e,t}getFormat(){return this.getLatest().__format}isInline(){return!1}},Z$=TH(`OPEN_RICH_TEXT_IMAGE_EDITOR_COMMAND`),Q$=TH(`UPDATE_RICH_TEXT_IMAGE_COMMAND`);function $$(e){if(e)return`${e.value}${e.unit}`}function e1(e){let t=`group/image relative my-3 cursor-pointer`;switch(e){case`center`:return`${t} flex flex-col items-center`;case`right`:case`end`:return`${t} flex flex-col items-end`;default:return t}}function t1(e){let t=`mt-2 text-xs text-muted-foreground`;switch(e){case`center`:return`${t} text-center`;case`right`:case`end`:return`${t} text-right`;default:return`${t} text-left`}}function n1({nodeKey:e,source:t,alt:n,caption:r,size:i,format:a}){let[o]=Y$(),{editable:s,resolveImageAssetUrl:c}=K$(),l=t.type===`external`?t.url:c?.(t.assetId),u=()=>{o.dispatchCommand(Z$,e)},d=()=>{o.update(()=>{let t=oq(e);if(!t)return;t.remove();let n=pq();if(n.getChildrenSize()===0){let e=DK();n.append(e),e.selectStart()}})},f={width:$$(i?.width),height:$$(i?.height),maxWidth:i?.maxWidth?$$(i.maxWidth):`100%`,maxHeight:$$(i?.maxHeight)},p=r?.trim()??``;return(0,m.jsxs)(`figure`,{className:e1(a),onClick:()=>{s&&u()},children:[l?(0,m.jsx)(`img`,{src:l,alt:n??``,style:f,className:`max-h-80 rounded-lg border border-border/70 object-contain`,draggable:!1}):(0,m.jsx)(`div`,{className:`flex min-h-36 w-full items-center justify-center rounded-lg border border-dashed border-border/80 bg-muted/30 text-sm text-muted-foreground`,children:(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,m.jsx)(Zw,{className:`size-4`}),t.type===`asset`?`Missing asset: ${t.assetId}`:`Image`]})}),p.length>0?(0,m.jsx)(`figcaption`,{className:t1(a),children:p}):null,s?(0,m.jsxs)(`div`,{className:`absolute right-2 top-2 flex gap-1 opacity-0 shadow-sm transition-opacity group-hover/image:opacity-100`,children:[(0,m.jsx)(B,{type:`button`,size:`icon-xs`,variant:`secondary`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{e.stopPropagation(),u()},"aria-label":`Edit image`,children:(0,m.jsx)(_T,{className:`size-3`})}),(0,m.jsx)(B,{type:`button`,size:`icon-xs`,variant:`secondary`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{e.stopPropagation(),d()},"aria-label":`Remove image`,children:(0,m.jsx)(zT,{className:`size-3`})})]}):null]})}var r1=class e extends X${__source;__alt;__caption;__size;static getType(){return`rich-text-image`}static clone(t){return new e(t.__source,t.__alt,t.__size,t.__caption,t.__format,t.__key)}static importJSON(e){return i1({source:e.source,alt:e.alt,size:e.size,caption:e.caption}).updateFromJSON(e)}constructor(e,t,n,r=``,i,a){super(i,a),this.__source=e,this.__alt=t,this.__size=n,this.__caption=r}updateFromJSON(e){let t=super.updateFromJSON(e);return t.__source=e.source,t.__alt=e.alt,t.__size=e.size,t.__caption=e.caption??``,t}exportJSON(){return{...super.exportJSON(),alt:this.__alt,caption:this.__caption||void 0,size:this.__size,source:this.__source,type:`rich-text-image`,version:1}}getSource(){return this.getLatest().__source}getAlt(){return this.getLatest().__alt}getCaption(){return this.getLatest().__caption}getSize(){return this.getLatest().__size}setSource(e){let t=this.getWritable();return t.__source=e,t}setAlt(e){let t=this.getWritable();return t.__alt=e,t}setCaption(e){let t=this.getWritable();return t.__caption=e,t}setSize(e){let t=this.getWritable();return t.__size=e,t}decorate(){return(0,m.jsx)(n1,{nodeKey:this.getKey(),source:this.__source,alt:this.__alt,caption:this.__caption,size:this.__size,format:this.__format})}};function i1({source:e,alt:t,size:n,caption:r=``,format:i,key:a}){return Xq(new r1(e,t,n,r,i,a))}function a1(e){return e instanceof r1}var o1=TH(`INSERT_RICH_TEXT_INFO_BOX_COMMAND`),s1=TH(`OPEN_RICH_TEXT_INFO_BOX_EDITOR_COMMAND`),c1=TH(`UPDATE_RICH_TEXT_INFO_BOX_COMMAND`);function l1(e){return e===`warning`?`border-amber-300/80 bg-amber-50/90 dark:bg-amber-950/25`:`border-sky-300/80 bg-sky-50/90 dark:bg-sky-950/25`}function u1({nodeKey:e,tone:t,title:n,content:r,collapsible:i}){let[a]=Y$(),{editable:o}=K$(),s=()=>{a.dispatchCommand(s1,e)},c=()=>{a.update(()=>{let t=oq(e);if(!t)return;t.remove();let n=pq();if(n.getChildrenSize()===0){let e=DK();n.append(e),e.selectStart()}})},l=t===`warning`?BT:$w,u=t===`warning`?`Warning`:`Info`;return(0,m.jsxs)(`div`,{className:`group/info-box relative my-2 rounded-lg border px-3 py-2.5 ${l1(t)} ${o?`cursor-pointer`:``}`,"data-rich-text-info-box":``,onClick:e=>{o&&(e.target.closest(`button`)||s())},children:[(0,m.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,m.jsx)(`span`,{className:`mt-0.5 shrink-0 text-foreground/80`,"aria-hidden":!0,children:(0,m.jsx)(l,{className:`size-4`})}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,m.jsxs)(`div`,{className:`text-sm font-medium text-foreground flex items-center gap-1`,children:[n.trim().length>0?n:(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`${u} (no title)`}),i?(0,m.jsx)(Sw,{className:`size-3`}):null]}),(0,m.jsx)(`div`,{className:`whitespace-pre-wrap text-sm text-foreground/90`,children:r.trim().length>0?r:(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:`No content`})})]})]}),o?(0,m.jsxs)(`div`,{className:`absolute right-2 top-2 flex gap-1 opacity-0 transition-opacity group-hover/info-box:opacity-100`,children:[(0,m.jsx)(B,{type:`button`,size:`icon-xs`,variant:`secondary`,className:`shadow-sm`,onMouseDown:e=>{e.preventDefault()},onClick:s,"aria-label":`Edit callout`,children:(0,m.jsx)(_T,{className:`size-3`})}),(0,m.jsx)(B,{type:`button`,size:`icon-xs`,variant:`secondary`,className:`shadow-sm`,onMouseDown:e=>{e.preventDefault()},onClick:c,"aria-label":`Remove callout`,children:(0,m.jsx)(zT,{className:`size-3`})})]}):null]})}var d1=class e extends X${__tone;__title;__content;__collapsible;__defaultOpen;static getType(){return`rich-text-info-box`}static clone(t){return new e(t.__tone,t.__title,t.__content,t.__collapsible,t.__defaultOpen,t.__key)}static importJSON(e){return f1({tone:e.tone,title:e.title,content:e.content,collapsible:e.collapsible,defaultOpen:e.defaultOpen}).updateFromJSON(e)}constructor(e,t,n,r,i,a){super(void 0,a),this.__tone=e,this.__title=t,this.__content=n,this.__collapsible=r,this.__defaultOpen=i}updateFromJSON(e){let t=super.updateFromJSON(e);return t.__tone=e.tone,t.__title=e.title,t.__content=e.content,t.__collapsible=e.collapsible,t.__defaultOpen=e.defaultOpen,t}exportJSON(){return{...super.exportJSON(),type:`rich-text-info-box`,version:1,tone:this.__tone,title:this.__title,content:this.__content,collapsible:this.__collapsible,defaultOpen:this.__defaultOpen}}getTone(){return this.getLatest().__tone}setTone(e){let t=this.getWritable();t.__tone=e}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();t.__title=e}getContent(){return this.getLatest().__content}setContent(e){let t=this.getWritable();t.__content=e}getCollapsible(){return this.getLatest().__collapsible}setCollapsible(e){let t=this.getWritable();t.__collapsible=e}getDefaultOpen(){return this.getLatest().__defaultOpen}setDefaultOpen(e){let t=this.getWritable();t.__defaultOpen=e}decorate(){return(0,m.jsx)(u1,{nodeKey:this.getKey(),tone:this.__tone,title:this.__title,content:this.__content,collapsible:this.__collapsible,defaultOpen:this.__defaultOpen})}};function f1({tone:e=`info`,title:t=``,content:n=``,collapsible:r=!0,defaultOpen:i=!0,key:a}){return Xq(new d1(e,t,n,r,i,a))}function p1(e){return e instanceof d1}var m1=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),h1=class e extends oK{__url;__target;__rel;__title;static getType(){return`link`}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let t=cJ().createElement(`a`);return this.updateLinkDOM(null,t,e),bX(t,e.theme.link),t}updateLinkDOM(e,t,n){if(vJ(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:g1,priority:1})}}static importJSON(e){return _1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){let t=e;e=y1(e);try{let t=new URL(y1(e));if(!m1.has(t.protocol))return`about:blank`}catch{let e=t.replace(/[\u0000-\u001F\u007F\s]/g,``).match(/^([a-z][a-z0-9+.-]*):/i);if(e!=null&&!m1.has(`${e[1].toLowerCase()}:`))return`about:blank`}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=Yq(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Z(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith(`mailto:`)}isWebSiteURI(){return this.__url.startsWith(`https://`)||this.__url.startsWith(`http://`)}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}};function g1(e){let t=null;if(vJ(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=_1(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function _1(e=``,t){return Xq(new h1(e,t))}var v1=/^\+?[0-9\s()-]{5,}$/;function y1(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:v1.test(e)?`tel:${e}`:`https://${e}`}r$.tag(`a`);var b1=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]);function x1(e){let t=y1(e.trim());try{let e=new URL(t);if(!b1.has(e.protocol))return`about:blank`}catch{return`about:blank`}return t}var S1=`rich-text-editor-sync-from-value`,C1=`var(--rich-text-editor-primary-color, var(--primary))`,w1=`var(--rich-text-editor-accent-color, var(--accent))`,T1=`var(--rich-text-editor-font-weight-strong, 600)`,E1=`var(--rich-text-editor-font-weight-normal, 400)`,D1={formatting:0,blocks:1,insert:2};function O1(e){return`{${e}}`}function k1(e){return`${e.kind}:${e.value}`}function A1(e){switch(e.kind){case`weight`:return{label:e.label??(e.value===`strong`?`B`:`N`),title:e.title??(e.value===`strong`?`Bold`:`Normal weight`),property:`font-weight`,value:e.value===`strong`?T1:E1};case`italic`:return{label:e.label??(e.value===`italic`?`I`:`Plain`),title:e.title??(e.value===`italic`?`Italic`:`Normal style`),property:`font-style`,value:e.value};case`underline`:return{label:e.label??(e.value===`underline`?`U`:`No U`),title:e.title??(e.value===`underline`?`Underline`:`Remove underline`),property:`text-decoration-line`,value:e.value};case`color`:return{label:e.label??(e.value===`primary`?`P`:`A`),title:e.title??(e.value===`primary`?`Primary color`:`Accent color`),property:`color`,value:e.value===`primary`?C1:w1}}}function j1(e,t,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1){let c=e.map(e=>{let t=A1(e);return{key:`style:${k1(e)}`,label:t.title,keywords:[t.title,e.kind,e.value,t.label].map(e=>e.toLowerCase()),group:`formatting`,kind:`style`,control:e}}),l=t.map(e=>({key:`template:${e.key}`,label:`Insert ${e.label??e.key}`,keywords:[`template`,`variable`,e.key,e.label??``].map(e=>e.toLowerCase()),group:`insert`,kind:`template`,templateVariable:e})),u=n?[{key:`link`,label:`Insert link`,keywords:[`link`,`url`,`href`,`anchor`,`website`],group:`insert`,kind:`link`}]:[],d=r?[{key:`bullet-list`,label:`Bullet list`,keywords:[`bullet`,`list`,`unordered`,`ul`,`dots`],group:`blocks`,kind:`bulletList`}]:[],f=i?[1,2].map(e=>({key:`heading-h${e}`,label:e===1?`Section heading`:`Subsection heading`,keywords:[`heading`,`section`,`title`,`h${e}`,`heading ${e}`,e===1?`section heading`:e===2?`subsection heading`:`subheading`].map(e=>e.toLowerCase()),group:`blocks`,kind:`heading`,level:e})):[],p=a?[{key:`info-box-info`,label:`Info callout`,keywords:[`info`,`callout`,`note`,`tip`,`aside`,`information`],group:`insert`,kind:`infoBox`,tone:`info`},{key:`info-box-warning`,label:`Warning callout`,keywords:[`warning`,`callout`,`caution`,`alert`,`important`],group:`insert`,kind:`infoBox`,tone:`warning`}]:[],m=o?[{key:`image`,label:`Image`,keywords:[`image`,`photo`,`picture`,`img`,`figure`,`asset`],group:`insert`,kind:`image`}]:[],h=s?[{key:`horizontal-divider`,label:`Horizontal divider`,keywords:[`divider`,`separator`,`horizontal`,`line`,`rule`,`hr`],group:`blocks`,kind:`separator`}]:[];return[...c,...l,...u,...d,...f,...p,...m,...h]}function M1(e){let t=Q();return Z(t)?(VX(t,()=>DX(e)),!0):!1}function N1(e){return YJ(e.anchor.getNode(),e=>OX(e)||OK(e))}function P1(e){let t=pq(),n=new Set,r=[],i=e=>{let i=e;for(;i!==null;){let e=i.getParent();if(e===null)return;if(e===t){n.has(i.getKey())||(n.add(i.getKey()),r.push(i));return}i=e}};for(let t of e.getNodes())i(t);return i(e.anchor.getNode()),i(e.focus.getNode()),r}function F1(e){let t=P1(e);return t.length===0?!1:t.every(e=>OX(e)||OK(e))}function I1(e){let t=pq(),n=e;for(;n!==null;){let e=n.getParent();if(e===null)return null;if(e===t)return n;n=e}return null}function L1(e){let t=e=>{e.setFormat(``);for(let n of e.getChildren())if(OK(n)&&!OX(n)&&n.setFormat(``),L$(n))for(let e of n.getChildren())j$(e)&&t(e)};for(let n of e.getChildren())j$(n)&&t(n)}function R1(){let e=Q();if(!Z(e))return!1;let t=I1(e.anchor.getNode()),n=t?.getPreviousSibling()??null,r=t?.getNextSibling()??null,i=L$(r)&&r.getListType()===`bullet`,a=L$(n)&&n.getListType()===`bullet`;_$(`bullet`);let o=Q(),s=Z(o)?YJ(o.anchor.getNode(),e=>j$(e)):null,c=a?n:i?r:s?.getParent();c&&L$(c)&&c.getListType()===`bullet`&&L1(c);let l=a?n.getLastChild():i?r.getFirstChild():s;return l&&j$(l)&&l.selectStart(),!0}function z1(){return NK({nodes:[c0,l0,M$,E$,rQ,r1,EX,d1],onError(e){throw e}})}function B1(e=``){let t=pq();t.clear();let n=DK();e.replace(/\r\n?/g,`
|
|
166
|
-
`).split(`
|
|
167
|
-
`).forEach((e,t)=>{t>0&&n.append(bK()),e.length>0&&n.append(kW(e))}),t.append(n)}function V1(e=``){let t=z1();return t.update(()=>{B1(e)},{discrete:!0}),t.getEditorState().toJSON()}function H1(e){switch(e.kind){case`weight`:return E1;case`italic`:return A1({kind:`italic`,value:`normal`}).value;case`underline`:return A1({kind:`underline`,value:`none`}).value;case`color`:return`inherit`}}function U1(e){let t=e.getNodes().filter(e=>e instanceof bW&&!(e instanceof c0));if(t.length===0)return{};let n=t[0];return{format:t.every(e=>e.getFormat()===n.getFormat())?n.getFormat():void 0,style:t.every(e=>e.getStyle()===n.getStyle())?n.getStyle():void 0}}function W1(e){let t=Q();if(!Z(t))return!1;let n=K1(e);if(n){let{property:r,value:i}=A1(e),a=t.hasFormat(n),o=YX(t,r,``)===i;return IX(t,{[r]:null}),o&&!a||t.formatText(n),!0}let{property:r,value:i}=A1(e),a=YX(t,r,``)===i,o=a?null:i,s=t.isCollapsed()&&a?H1(e):o;return IX(t,{[r]:s}),!0}function G1(e,t){let{property:n,value:r}=A1(t),i=YX(e,n,``)===r,a=K1(t);return a&&e.hasFormat(a)||i}function K1(e){return e.kind===`weight`&&e.value===`strong`?`bold`:e.kind===`italic`&&e.value===`italic`?`italic`:e.kind===`underline`&&e.value===`underline`?`underline`:null}function q1(e){let t=Q();return Z(t)?(t.insertNodes([u0(e.key)]),!0):!1}function J1(e,t){if(e==null||!OK(e)||OX(e)||e.getTextContent().trim().length!==0)return!1;e.replace(t);let n=DK();return t.insertAfter(n),n.selectStart(),!0}function Y1(e){let t=f1({tone:e.tone,title:``,content:``,collapsible:!0,defaultOpen:!0});if(e.replaceIfEmptyParagraphKey!==void 0&&J1(oq(e.replaceIfEmptyParagraphKey),t))return t.getKey();let n=Q();if(Z(n)||(n=fG()),Z(n)&&J1(I1(n.anchor.getNode()),t))return t.getKey();let r=pq();return r.getChildrenSize()===1&&J1(r.getFirstChild(),t)||$X(t),t.getKey()}function X1(e={}){let t=i1({source:{type:`external`,url:``},alt:``,caption:``,format:`center`});if(e.replaceIfEmptyParagraphKey!==void 0&&J1(oq(e.replaceIfEmptyParagraphKey),t))return t.getKey();let n=Q();if(Z(n)||(n=fG()),Z(n)&&J1(I1(n.anchor.getNode()),t))return t.getKey();let r=pq();return r.getChildrenSize()===1&&J1(r.getFirstChild(),t)||$X(t),t.getKey()}function Z1(e){let t=oq(e.key);if(!a1(t))return!1;let n=e.alt.trim();return t.setSource(e.source),t.setAlt(n.length>0?n:void 0),t.setCaption(e.caption.replace(/\r\n/g,`
|
|
168
|
-
`)),t.setSize(e.size),t.setFormat(e.format),!0}function Q1(e){let t=oq(e.key);return p1(t)?(t.setTone(e.tone),t.setTitle(e.title.replace(/\r\n/g,`
|
|
169
|
-
`)),t.setContent(e.content.replace(/\r\n/g,`
|
|
170
|
-
`)),t.setCollapsible(e.collapsible),t.setDefaultOpen(e.collapsible?e.defaultOpen:!0),!0):!1}function $1(e={}){let t=Q();if(!Z(t))return null;let n=t.getTextContent(),r=d0((e.text??n).trim().length>0?e.text??n:`Link`,e.url??`https://`),{format:i,style:a}=U1(t);return typeof i==`number`&&r.setFormat(i),a&&r.setStyle(a),t.insertNodes([r]),r.getKey()}function e0({key:e,text:t,url:n}){let r=oq(e);if(!f0(r))return!1;let i=t.trim().length>0?t:n.trim().length>0?n:`Link`;return r.setTextContent(i),r.setURL(n),!0}function t0(e){let t=oq(e);if(!f0(t))return!1;let n=kW(t.getTextContent());return n.setFormat(t.getFormat()),n.setStyle(t.getStyle()),t.replace(n),!0}var n0=TH(`APPLY_RICH_TEXT_STYLE_COMMAND`),r0=TH(`INSERT_RICH_TEXT_TEMPLATE_VARIABLE_COMMAND`),i0=TH(`INSERT_RICH_TEXT_LINK_COMMAND`),a0=TH(`OPEN_RICH_TEXT_LINK_EDITOR_COMMAND`),o0=TH(`UPDATE_RICH_TEXT_LINK_COMMAND`),s0=TH(`CONVERT_RICH_TEXT_LINK_TO_TEXT_COMMAND`),c0=class e extends bW{__templateKey;static getType(){return`template-variable`}static clone(t){return new e(t.__templateKey,t.__key)}static importJSON(e){let t=u0(e.templateKey);return t.setTextContent(e.text),t.setFormat(e.format),t.setStyle(e.style),t}constructor(e,t){super(O1(e),t),this.__templateKey=e}afterCloneFrom(e){super.afterCloneFrom(e),this.__mode=e.__mode,this.__detail=e.__detail}createDOM(e){let t=super.createDOM(e);return t.dataset.templateKey=this.__templateKey,t.className=z(t.className,`inline-flex rounded-md border border-border/70 bg-muted px-1.5 py-0.5 align-baseline text-[0.92em] font-medium text-foreground`),t}updateDOM(e,t,n){return t.dataset.templateKey=this.__templateKey,super.updateDOM(e,t,n)}exportJSON(){return{...super.exportJSON(),type:`template-variable`,templateKey:this.__templateKey}}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}isTextEntity(){return!0}},l0=class e extends bW{__url;static getType(){return`inline-link`}static clone(t){return new e(t.getTextContent(),t.__url,t.__key)}static importJSON(e){let t=d0(e.text,e.url);return t.setFormat(e.format),t.setStyle(e.style),t}constructor(e,t,n){super(e,n),this.__url=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__mode=e.__mode,this.__detail=e.__detail}createDOM(e){let t=super.createDOM(e);return t.dataset.inlineRichTextLink=`true`,t.dataset.inlineRichTextLinkUrl=this.__url,t.className=z(t.className,`cursor-pointer rounded-sm text-primary underline decoration-current underline-offset-3`),this.__url&&(t.title=this.__url),t}updateDOM(e,t,n){return t.dataset.inlineRichTextLink=`true`,t.dataset.inlineRichTextLinkUrl=this.__url,this.__url?t.title=this.__url:t.removeAttribute(`title`),super.updateDOM(e,t,n)}exportJSON(){return{...super.exportJSON(),type:`inline-link`,url:this.__url}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){let t=super.splitText(...e),n=this.getURL();return t.map(e=>{if(f0(e))return e;let t=d0(e.getTextContent(),n);return t.setFormat(e.getFormat()),t.setStyle(e.getStyle()),t.setDetail(e.getDetail()),e.replace(t),t})}isTextEntity(){return!1}};function u0(e){return new c0(e).setMode(`token`).toggleUnmergeable()}function d0(e,t){return new l0(e,t).toggleUnmergeable()}function f0(e){return e instanceof l0}var p0={variant:`compact`,allowLinks:!0,allowTemplateVariables:!0,allowLineBreaks:!0,allowedBlockTypes:{paragraph:!0},allowedStyleAttributes:{weight:!0,italic:!0,underline:!0,color:!0}},m0={...p0,variant:`block`,allowBlockAlignment:!0,allowedBlockTypes:{paragraph:!0,bulletList:!0,image:!0,separator:!0}};function h0(e,t){return t?{...e,...t,allowedBlockTypes:{...e.allowedBlockTypes,...t.allowedBlockTypes},allowedStyleAttributes:{...e.allowedStyleAttributes,...t.allowedStyleAttributes}}:e}function g0(e,t){return t?.allowedBlockTypes?.[e]===void 0?!(e===`heading`||e===`infoBox`):t.allowedBlockTypes[e]}function _0(e,t){return t?.allowedStyleAttributes?.[e]??!0}function v0(e){return e?.allowBlockAlignment===!0}function y0(e,t){if(v0(t))return e;let n={...e};return delete n.alignment,n}function b0(e,t){if(!e)return;let n={};return e.weight&&_0(`weight`,t)&&(n.weight=e.weight),e.italic&&_0(`italic`,t)&&(n.italic=e.italic),e.underline&&_0(`underline`,t)&&(n.underline=e.underline),e.color&&_0(`color`,t)&&(n.color=e.color),Object.keys(n).length>0?n:void 0}function x0(e,t){return e.flatMap(e=>{switch(e.type){case`text`:return[{...e,style:b0(e.style,t)}];case`template`:return t?.allowTemplateVariables===!1?[{type:`text`,text:`{${e.key}}`,style:b0(e.style,t)}]:[{...e,style:b0(e.style,t)}];case`lineBreak`:return t?.allowLineBreaks===!1?[{type:`text`,text:` `}]:[e];case`link`:{let n=S0(e.children,t);return n.length===0?[]:t?.allowLinks===!1?n:[{...e,children:n}]}case`inlineExtension`:return[]}})}function S0(e,t){return e.flatMap(e=>{switch(e.type){case`text`:return[{...e,style:b0(e.style,t)}];case`template`:return t?.allowTemplateVariables===!1?[{type:`text`,text:`{${e.key}}`,style:b0(e.style,t)}]:[{...e,style:b0(e.style,t)}];case`lineBreak`:return t?.allowLineBreaks===!1?[{type:`text`,text:` `}]:[e]}})}function C0(e,t){return e.map(e=>y0({...e,children:x0(e.children,t)},t))}function w0(e){return e.trim().length>0?[{type:`paragraph`,children:[{type:`text`,text:e}]}]:[]}function T0(e,t){return g0(`bulletList`,t)?{...e,items:e.items.map(e=>({...e,children:C0(e.children,t)}))}:e.items.flatMap(e=>C0(e.children,t))}function E0(e,t){switch(e.type){case`paragraph`:return[y0({...e,children:x0(e.children,t)},t)];case`bulletList`:{let n=T0(e,t);return Array.isArray(n)?n:[n]}case`image`:if(g0(`image`,t)){let n={...e,caption:e.caption?C0(e.caption,t):void 0};return v0(t)||delete n.alignment,[n]}return[...w0(e.alt??``),...e.caption?C0(e.caption,t):[]];case`separator`:return g0(`separator`,t)?[e]:[];case`heading`:if(g0(`heading`,t)){let n={...e,children:x0(e.children,t)};return v0(t)||delete n.alignment,[n]}return[y0({type:`paragraph`,children:x0(e.children,t)},t)];case`infoBox`:return g0(`infoBox`,t)?[{...e,title:e.title?x0(e.title,t):void 0,children:C0(e.children,t)}]:[...e.title?[{type:`paragraph`,children:x0(e.title,t)}]:[],...C0(e.children,t)];case`blockExtension`:return e.name===`separator`&&g0(`separator`,t)?[{type:`separator`}]:[]}}function D0(e,t){if(!e||!t||e.type!==u.tt.richText)return e;let n=e.doc.blocks.flatMap(e=>E0(e,t));return{...e,doc:{...e.doc,blocks:n}}}function O0(e){return e?.variant===`block`}function k0(e){if(e===`start`)return`left`;if(e===`end`)return`right`;if(e===`left`||e===`center`||e===`right`||e===`justify`)return e}function A0(e){return e}var j0=`var(--rich-text-editor-primary-color, var(--primary))`,M0=`var(--rich-text-editor-accent-color, var(--accent))`,N0=`var(--rich-text-editor-font-weight-strong, 600)`,P0=`var(--rich-text-editor-font-weight-normal, 400)`;function F0(e){if(!e)return;let t={};return e.weight&&(t.weight=e.weight),e.italic&&(t.italic=e.italic),e.underline&&(t.underline=e.underline),e.color&&(t.color=e.color),Object.keys(t).length>0?t:void 0}function I0(e){if(!e)return``;let t=[];return e.color===`primary`?t.push(`color: ${j0};`):e.color===`accent`?t.push(`color: ${M0};`):e.color===`default`&&t.push(`color: inherit;`),t.join(` `)}function L0(e){if(!e.trim())return;let t=new Map;e.split(`;`).map(e=>e.trim()).filter(Boolean).forEach(e=>{let[n,...r]=e.split(`:`);!n||r.length===0||t.set(n.trim(),r.join(`:`).trim())});let n={},r=t.get(`font-weight`),i=t.get(`font-style`),a=t.get(`text-decoration-line`),o=t.get(`color`);return r===N0||r===`600`||r===`700`?n.weight=`strong`:(r===P0||r===`400`||r===`normal`)&&(n.weight=`normal`),(i===`italic`||i===`normal`)&&(n.italic=i),(a===`underline`||a===`none`)&&(n.underline=a),o===j0?n.color=`primary`:o===M0?n.color=`accent`:o===`inherit`&&(n.color=`default`),F0(n)}function R0(e){let t=L0(e.getStyle())??{};return e.hasFormat(`bold`)&&(t.weight=`strong`),e.hasFormat(`italic`)&&(t.italic=`italic`),e.hasFormat(`underline`)&&(t.underline=`underline`),F0(t)}function z0(e,t){let n=I0(t);n&&e.setStyle(n),t?.weight===`strong`&&e.toggleFormat(`bold`),t?.italic===`italic`&&e.toggleFormat(`italic`),t?.underline===`underline`&&e.toggleFormat(`underline`)}function B0(e){return e.children.map(e=>{switch(e.type){case`text`:return e.text;case`template`:return`{${e.key}}`;case`lineBreak`:return`
|
|
171
|
-
`}}).join(``)}function V0(e){let t=e.filter(e=>e.type===`text`||e.type===`template`);if(t.length===0)return;let[n,...r]=t;return r.every(e=>JSON.stringify(e.style??null)===JSON.stringify(n.style??null))?n.style:void 0}function H0(e,t){t.forEach(t=>{if(t.type===`lineBreak`){e.append(bK());return}if(t.type===`template`){let n=u0(t.key);z0(n,t.style),e.append(n);return}if(t.type===`link`){let n=d0(B0(t),t.href);z0(n,V0(t.children)),e.append(n);return}if(t.type!==`text`)return;let n=kW(t.text);z0(n,t.style),e.append(n)})}function U0(e){return e.map(e=>{switch(e.type){case`text`:return e.text;case`template`:return`{${e.key}}`;case`lineBreak`:return`
|
|
172
|
-
`;case`link`:return e.children.map(e=>{switch(e.type){case`text`:return e.text;case`template`:return`{${e.key}}`;case`lineBreak`:return`
|
|
173
|
-
`}}).join(``);case`inlineExtension`:return``}}).join(``)}function W0(e){return e.map(e=>U0(e.children)).join(`
|
|
174
|
-
`)}function G0(e){return e.length===0?[{type:`paragraph`,children:[]}]:e.split(`
|
|
175
|
-
`).map(e=>({type:`paragraph`,children:e?[{type:`text`,text:e}]:[]}))}function K0(e){return e?.length?e.map(e=>U0(e.children)).join(`
|
|
176
|
-
`):``}function q0(e){let t=e.replace(/\r\n/g,`
|
|
177
|
-
`).trim();if(t.length!==0)return t.split(`
|
|
178
|
-
`).map(e=>({type:`paragraph`,children:e?[{type:`text`,text:e}]:[]}))}function J0(e){return e.map(e=>{let t=DK();if(H0(t,e.children),e.alignment){let n=A0(e.alignment);n&&t.setFormat(n)}return t})}function Y0(e){let t=pq();switch(e.type){case`paragraph`:{let n=DK();if(H0(n,e.children),e.alignment){let t=A0(e.alignment);t&&n.setFormat(t)}t.append(n);return}case`bulletList`:{let n=I$(`bullet`);e.items.forEach(e=>{let t=A$(),r=J0(e.children);r.length===0&&r.push(DK()),t.append(...r),n.append(t)}),t.append(n);return}case`image`:t.append(i1({source:e.source,alt:e.alt,size:e.size,caption:K0(e.caption),format:A0(e.alignment)}));return;case`separator`:t.append(Xq(aQ()));return;case`heading`:{let n=DX(e.level);if(e.alignment){let t=A0(e.alignment);t&&n.setFormat(t)}H0(n,e.children),t.append(n);return}case`infoBox`:{let n=e.title?U0(e.title):``,r=W0(e.children);t.append(f1({tone:e.tone===`warning`?`warning`:`info`,title:n,content:r,collapsible:e.collapsible!==!1,defaultOpen:e.defaultOpen!==!1}));return}case`blockExtension`:return}}function X0(e,t){let n=D0(e??u.vt(``),t)??u.vt(``);if(n.type!==u.tt.richText){B1(n.content);return}let r=t?.allowedBlockTypes?.heading===!0,i=t?.allowedBlockTypes?.infoBox===!0;if(n.doc.blocks.some(e=>e.type===`blockExtension`||e.type===`heading`&&!r||e.type===`infoBox`&&!i)){B1(u.St(n));return}let a=pq();a.clear(),n.doc.blocks.forEach(e=>{Y0(e)}),a.getChildrenSize()===0&&a.append(DK())}function Z0(e){return e.flatMap(e=>xK(e)?[{type:`lineBreak`}]:e instanceof c0?[{type:`template`,key:e.__templateKey,style:R0(e)}]:e instanceof l0?[{type:`link`,href:e.getURL(),children:[{type:`text`,text:e.getTextContent(),style:R0(e)}]}]:X(e)?e.getTextContent().length===0?[]:[{type:`text`,text:e.getTextContent(),style:R0(e)}]:[])}function Q0(e){let t=k0(e.getFormatType());return{type:`paragraph`,children:Z0(e.getChildren()),...t?{alignment:t}:{}}}function $0(e){let t=[],n=[],r=()=>{n.length!==0&&(t.push({type:`paragraph`,children:Z0(n)}),n=[])};for(let i of e.getChildren()){if(OK(i)){r(),t.push(Q0(i));continue}if(L$(i)){r();continue}n.push(i)}return r(),{type:`listItem`,children:t.length>0?t:[{type:`paragraph`,children:[]}]}}function e2(e,t){let n=[];return e.read(()=>{n=pq().getChildren().flatMap(e=>{if(OX(e)){let t=k0(e.getFormatType());return[{type:`heading`,level:e.getHeadingLevel(),children:Z0(e.getChildren()),...t?{alignment:t}:{}}]}if(OK(e))return[Q0(e)];if(L$(e)&&e.getListType()===`bullet`)return[{type:`bulletList`,items:e.getChildren().filter(j$).map(e=>$0(e))}];if(a1(e)){let t=q0(e.getCaption());return[{type:`image`,source:e.getSource(),alt:e.getAlt(),size:e.getSize(),alignment:k0(e.getFormat()),...t?{caption:t}:{}}]}if(oQ(e))return[{type:`separator`}];if(p1(e)){let t=e.getTitle().trim();return[{type:`infoBox`,tone:e.getTone(),...t.length>0?{title:[{type:`text`,text:e.getTitle()}]}:{},collapsible:e.getCollapsible(),defaultOpen:e.getDefaultOpen(),children:G0(e.getContent())}]}return[]})}),D0({type:u.tt.richText,version:1,doc:{type:`doc`,blocks:n.length>0?n:[{type:`paragraph`,children:[]}]}},t)}function t2(e,t){let n=z1();return n.update(()=>{X0(e,t)},{discrete:!0}),n.getEditorState().toJSON()}function n2(e=``,t){return e.length===0?V1(``):t2(u.vt(e),t)}function r2({defaultSelection:e}){let[t]=Y$();return(0,f.useEffect)(()=>{t.focus(()=>{let e=t.getRootElement(),n=e===null?null:hJ(e);e===null||n!==null&&e.contains(n)||e.focus({preventScroll:!0})},{defaultSelection:e})},[e,t]),null}var i2=lB?f.useLayoutEffect:f.useEffect,a2={tag:oW};function o2({initialConfig:e,children:t}){let n=(0,f.useMemo)(()=>{let{theme:t,namespace:n,nodes:r,onError:i,onWarn:a,editorState:o,html:s}=e,c=J$(null,t),l=NK({editable:e.editable,html:s,namespace:n,nodes:r,onError:e=>i(e,l),...a?{onWarn:e=>a(e,l)}:{},theme:t});return function(e,t){if(t!==null){if(t===void 0)e.update(()=>{let t=pq();if(t.isEmpty()){let n=DK();t.append(n);let r=e.getRootElement(),i=lB&&r!==null?hJ(r):null;(Q()!==null||i!==null&&i===r)&&n.select()}},a2);else if(t!==null)switch(typeof t){case`string`:{let n=e.parseEditorState(t);e.setEditorState(n,a2);break}case`object`:e.setEditorState(t,a2);break;case`function`:e.update(()=>{pq().isEmpty()&&t(e)},a2)}}}(l,o),[l,c]},[]);return i2(()=>{let t=e.editable,[r]=n;r.setEditable(t===void 0||t)},[]),(0,m.jsx)(q$.Provider,{value:n,children:t})}function s2(){return pq().getTextContent()}function c2(e,t=!0){if(e)return!1;let n=s2();return t&&(n=n.trim()),n===``}function l2(e){if(!c2(e,!1))return!1;let t=pq().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(lK(n))return!1;if($(n)){if(!OK(n)||n.__indent!==0)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){let n=t[e];if(!X(n))return!1}}}return!0}function u2(e){return()=>l2(e)}var d2=lB?f.useLayoutEffect:f.useEffect;function rce({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:p,autoCapitalize:h,className:g,id:_,role:v=`textbox`,spellCheck:y=!0,style:b,tabIndex:x,"data-testid":S,...C},w){let[T,E]=(0,f.useState)(e.isEditable()),D=(0,f.useCallback)(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),O=(0,f.useMemo)(()=>function(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}(w,D),[D,w]);return d2(()=>(E(e.isEditable()),e.registerEditableListener(e=>{E(e)})),[e]),(0,m.jsx)(`div`,{"aria-activedescendant":T?t:void 0,"aria-autocomplete":T?n:`none`,"aria-controls":T?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":T&&v===`combobox`?!!o:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":T?d:void 0,"aria-readonly":!T||void 0,"aria-required":p,autoCapitalize:h,className:g,contentEditable:T,"data-testid":S,id:_,ref:O,role:v,spellCheck:y,style:b,tabIndex:x??(T?void 0:-1),...C})}var ice=(0,f.forwardRef)(rce);function f2(e){return e.read(`latest`,u2(e.isComposing()))}var ace=(0,f.forwardRef)(oce);function oce(e,t){let{placeholder:n,...r}=e,[i]=Y$();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ice,{editor:i,...r,ref:t}),n!=null&&(0,m.jsx)(sce,{editor:i,content:n})]})}function sce({content:e,editor:t}){let n=function(e){let[t,n]=(0,f.useState)(()=>f2(e));return d2(()=>{function t(){n(f2(e))}return t(),SX(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,i]=(0,f.useState)(t.isEditable());if((0,f.useLayoutEffect)(()=>(i(t.isEditable()),t.registerEditableListener(e=>{i(e)})),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:(0,m.jsx)(`div`,{"aria-hidden":!0,children:a})}var cce=class extends f.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),t)}render(){return this.state.hasError?this.props.fallback:this.props.children}};function lce({children:e,fallback:t,onError:n}){return(0,m.jsx)(cce,{fallback:t===void 0?(0,m.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}):t,onError:n,children:e})}function uce(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(Z(a)&&Z(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||dK(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&X(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!X(l)||!X(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}function dce(e,t,n){let r=n(),i=0,a=r,o=0,s=null;return(c,l,u,d,f,p)=>{let m=n();if(p.has(`composition-start`)&&(a=r,o=i,s=c),p.has(`historic`))return i=0,r=m,2;p.has(`composition-end`)&&s&&(r=a,i=o,c=s);let h=p.has(`paste`)||p.has(`cut`)?0:uce(c,l,d,f,e.isComposing()),g=(()=>{let n=u===null||u.editor===e,a=p.has(aW);if(!a&&n&&p.has(`history-merge`))return 0;if(h===1)return 2;if(c===null)return 1;let o=l._selection;if(!(d.size>0||f.size>0))return o===null?2:0;let s=typeof t==`number`?t:t.peek();return!1===a&&h!==0&&h===i&&m<r+s&&n||d.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(Z(a)&&Z(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!X(r)||!X(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(d)[0],c,l)?0:1})();return r=m,i=h,g}}function p2(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function fce(e,t,n,r=Date.now,i,a=null){let o=dce(e,n,r),s=()=>{i&&i(t)};return s(),SX(e.registerCommand(UH,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();a!==null&&(r.push(a),e.dispatchCommand(_U,!0)),i.length===0&&e.dispatchCommand(vU,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(WH,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current;a!==null&&(i.push(a),e.dispatchCommand(vU,!0));let o=r.pop();r.length===0&&e.dispatchCommand(_U,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(hU,()=>(p2(t,i),!1),0),e.registerCommand(gU,()=>(p2(t,i),e.dispatchCommand(_U,!1),e.dispatchCommand(vU,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){if(d.length!==0&&(t.redoStack=[],e.dispatchCommand(_U,!1)),u!==null){f.push({...u});let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(vU,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function pce(){return{current:null,redoStack:[],undoStack:[]}}Date.now;function mce({delay:e,externalHistoryState:t}){let[n]=Y$();return function(e,t,n=1e3){let r=(0,f.useMemo)(()=>t||pce(),[t]);(0,f.useEffect)(()=>fce(e,r,n),[n,e,r])}(n,t,e),null}function hce({hasStrictIndent:e=!1,shouldPreserveNumbering:t=!1}){let[n]=Y$();return(0,f.useEffect)(()=>{if(!n.hasNodes([M$,E$]))throw Error(`ListPlugin: ListNode and/or ListItemNode not registered on editor`)},[n]),(0,f.useEffect)(()=>SX(H$(n,{restoreNumbering:t}),e?U$(n):()=>{}),[n,e,t]),function(e){(0,f.useEffect)(()=>H$(e),[e])}(n),null}var gce=lB?f.useLayoutEffect:f.useEffect;function _ce({ignoreHistoryMergeTagChange:e=!0,ignoreSelectionChange:t=!1,onChange:n}){let[r]=Y$();return gce(()=>{if(n)return r.registerUpdateListener(({editorState:i,dirtyElements:a,dirtyLeaves:o,prevEditorState:s,tags:c})=>{t&&a.size===0&&o.size===0||e&&c.has(`history-merge`)||s.isEmpty()||n(i,r,c)})},[r,e,t,n]),null}var vce=lB?f.useLayoutEffect:f.useEffect;function yce(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function bce(){return function(e){let[t]=Y$(),n=(0,f.useMemo)(()=>e(t),[t,e]),[r,i]=(0,f.useState)(()=>n.initialValueFn()),a=(0,f.useRef)(r);return vce(()=>{let{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,i(r)),t(e=>{a.current=e,i(e)})},[n,e]),r}(yce)}var xce=gX({name:`@lexical/react/ReactProvider`}),Sce={bold:`bold`,italic:`italic`,strikeThrough:`strikethrough`,subscript:`subscript`,superscript:`superscript`,underline:`underline`},m2=Symbol.for(`@lexical/dragon/WindowState`);function Cce(e,t,n){let r=function(e){let t=e[m2];return t===void 0&&(t={dispose:()=>{},editors:new Map,installs:new Set},e[m2]=t),t}(e);if(r.installs.size===0){let t=Ece.bind(e);e.addEventListener(`message`,t,!0),r.dispose=()=>{e.removeEventListener(`message`,t,!0)}}if(r.installs.add(t),n){let e=r.editors.get(n)||new Set;e.add(t),r.editors.set(n,e)}return wce.bind(null,e,r,t,n)}function wce(e,t,n,r){if(r){let e=t.editors.get(r);e&&e.delete(n)&&e.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[m2])}function h2(e){return e&&e.ownerDocument.defaultView}function Tce(e){let t=EZ(()=>h2(e.getRootElement()),t=>e.registerRootListener(e=>{t.value=h2(e)}));return wZ(()=>{let n=t.value;if(n)return Cce(n,Symbol(`@lexical/dragon/editorInstall`),e)})}function Ece(e){if(e.origin!==this.location.origin)return;let t=function(e){let t=e[m2];if(t===void 0)return null;let n=qK(gJ(e.document));return GK(n)&&t.editors.has(n)?n:null}(this);if(t===null)return;let n=e.data;if(typeof n==`string`){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol===`nuanria_messaging`&&r.type===`request`){let n=r.payload;if(n&&n.functionId===`makeChanges`){let r=n.args;if(Array.isArray(r)){let[n,i,a,o,s,c]=r;if(![n,i,o,s].every(Number.isFinite)||typeof a!=`string`&&a!==-1)return;t.update(()=>{let t=Q();if(Z(t)){let r=t.anchor,l=r.getNode(),u=0,d=0;if(X(l)&&n>=0&&i>=0&&(u=n,d=n+i,t.setTextNodeRange(l,u,l,d)),typeof a!=`string`||u===d&&a===``||(t.insertRawText(a),l=r.getNode()),X(l)){let e=l.getTextContentSize();u=Math.min(Math.max(o,0),e),d=o<0||s<0?u:Math.min(o+s,e),t.setTextNodeRange(l,u,l,d)}if(typeof c==`string`&&s>0&&!t.isCollapsed()){let e=Sce[c];e!==void 0&&t.formatText(e)}e.stopImmediatePropagation()}})}}}}}function g2(e,t,n=null){let r=sJ(n),i=n?aJ(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=Rq(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(rJ(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function _2(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var v2={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function Dce(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}var y2=(e,t)=>{if(!Z(t))return t.insertRawText(e),!0;let n=e=>{let t=Q();Z(t)&&e(t)};return xG(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([MW()])),text:e=>n(t=>t.insertText(e))}),!0},b2={"application/x-lexical-editor":[(e,t,n)=>{try{let n=DJ(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return E2(n,Fce(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=DJ();return E2(n,a$(n,new DOMParser().parseFromString(Dce(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[y2],"text/uri-list":[y2]};function Oce(e,t,n,r){if(!e)return!1;let i=a=>!!e[a]&&e[a](t,n,i.bind(null,a-1),r);return i(e.length-1)}function x2(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?t<n?-1:+(t>n):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&Oce(e.$importMimeType[i],a,n,t))return!0}return!1}var kce={$importMimeType:b2,$insertDataTransfer:(e,t)=>x2({$importMimeType:b2,priority:v2},e,t),priority:v2},Ace=gX({build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>x2(t,e,n),priority:t.priority}),config:_X({$importMimeType:b2,priority:v2}),mergeConfig(e,t){let n=vX(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`});function S2(e,t=Q()){return t??_2(166),Z(t)&&t.isCollapsed()||t.getNodes().length===0?``:s$(e,t)}function C2(e,t=Q()){return t??_2(166),Z(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(Pce(e,t))}function w2(e,t,n){(function(){let e=tQ(Ace.name);return e?e.output:kce})().$insertDataTransfer(e,t)}var T2=`application/x-lexical-drag`;function jce(e,t){let n={editorKey:t.getKey()};e.setData(T2,JSON.stringify(n))}function Mce(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(T2);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=g2(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=uq(n.node);if(r===null)return null;if(X(r))return FY(r,`next`,n.offset);if($(r))return dX(r,n.offset,`next`);let i=r.getParent();return i===null?null:dX(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=mX(a);if(o===null)return!1;let s=i.editorKey===t.getKey(),c=Q();if(s){if(!Z(c)||c.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=uX(nX(t),`next`);return qY(n,e)<0&&qY(e,r)<0}(a,c))return e.preventDefault(),!0;c.removeText()}if(!o.origin.isAttached())return e.preventDefault(),!0;if(n(r,eX(WY(o)),t),!s){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of oJ(t)){let t=qK(n);if(GK(t)&&t.getKey()===e&&yJ(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function Nce(e,t){return Mce(e,t,w2)}function E2(e,t,n){e.dispatchCommand(DH,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Z(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=QY(t,`previous`);if(r)if(OY(r))n=r.origin;else{let e=GY(r,RY(pq(),`next`).getFlipped());for(let t of e){if(X(t.origin)){n=t.origin;break}if($(t.origin)&&!t.origin.isInline())break}}if(n&&X(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function D2(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=$(n)&&n.excludeFromCopy(`html`),o=n;t!==null&&X(o)&&(o=PX(t,o,`clone`));let s=$(o)?o.getChildren():[],c=function(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&_2(58,n.name),$(e)){let e=t.children;Array.isArray(e)||_2(59,n.name)}return t}(o);X(o)&&o.getTextContentSize()===0&&(i=!1);let l=i&&VW(t)&&$(n)?null:t;for(let r=0;r<s.length;r++){let a=s[r],o=D2(e,l,a,c.children);!i&&$(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a){let t=oY(o);if(t.length>0){let n={};for(let r of t){let t=sY(o,r);t===null&&_2(366,o.constructor.name,r);let i=[];D2(e,null,t,i),i.length===1&&i[0].type===t.getType()||_2(385,r,o.constructor.name,String(i.length),String(i.length>0?i[0].type:`none`)),n[r]=i[0]}c.$slots=n}}if(i&&!a)r.push(c);else if(Array.isArray(c.children))for(let e=0;e<c.children.length;e++){let t=c.children[e];r.push(t)}return i}function Pce(e,t){let n=[],r=pq(),i=Z(t)?t.anchor.getNode():VW(t)?t.getNodes()[0]??null:null,a=i===null?null:iY(i),o=($(a)?a:r).getChildren();for(let r=0;r<o.length;r++)D2(e,t,o[r],n);return{namespace:e._config.namespace,nodes:n}}function Fce(e){let t=[];for(let n of e)t.push(YG(n));return t}var O2=null;async function k2(e,t,n){if(O2!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(A2(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=tJ(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(fU,r=>(eZ(r,ClipboardEvent)&&(o(),O2!==null&&(i.clearTimeout(O2),O2=null),t(A2(e,r,n))),!0),4);O2=i.setTimeout(()=>{o(),O2=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function A2(e,t,n){if(n===void 0){let t=tJ(e._window),r=Q();if(!r||r.isCollapsed()||!t)return!1;let i=dJ(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!WK(e,a,o))return!1;n=j2(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(M2(r,n),!0)}var Ice=[[`text/html`,S2],[`application/x-lexical-editor`,C2]];function j2(e=Q()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=Rce(i,t);e!==null&&(n[r]=e)}return n}(Lce(),e)}function M2(e,t){for(let[n]of Ice)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function Lce(e=DJ()){let t=eQ(e,zce.name);return t?t.output:N2}var N2={"application/x-lexical-editor":[(e,t)=>e?C2(DJ(),e):t()],"text/html":[(e,t)=>e?S2(DJ(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function Rce(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var zce=gX({build:(e,t,n)=>t.$exportMimeType,config:_X({$exportMimeType:N2}),mergeConfig(e,t){let n=vX(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`});r$.tag(`h1`,`h2`,`h3`,`h4`,`h5`,`h6`),r$.tag(`blockquote`),r$.tag(`blockquote`),r$.tag(`p`),r$.tag(`span`);var P2=TH(`DRAG_DROP_PASTE_FILE`),F2=uV(`shadowRoot`,{parse:Boolean}),Bce=class e extends oK{static getType(){return`quote`}static clone(t){return new e(t.__key)}$config(){return this.config(`quote`,{extends:oK,stateConfigs:[{flat:!0,stateConfig:F2}]})}isShadowRoot(){return dV(this,F2)}setIsShadowRoot(e){return fV(this,F2,e)}createDOM(e){let t=cJ().createElement(`blockquote`);return bX(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:Hce,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(yJ(t)){this.isEmpty()&&t.append(cJ().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return I2().updateFromJSON(e)}exportJSON(){return super.exportJSON()}insertNewAfter(e,t){let n=DK(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=DK();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function I2(e){let t=Xq(new Bce);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}var Vce=class e extends oK{__tag;static getType(){return`heading`}static clone(t){return new e(t.__tag,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=cJ().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];bX(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:R2,priority:0}),h2:e=>({conversion:R2,priority:0}),h3:e=>({conversion:R2,priority:0}),h4:e=>({conversion:R2,priority:0}),h5:e=>({conversion:R2,priority:0}),h6:e=>({conversion:R2,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&L2(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>L2(e)?{conversion:e=>({node:z2(`h1`)}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(yJ(t)){this.isEmpty()&&t.append(cJ().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return z2(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?DK():z2(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),n===0&&!this.isEmpty()&&e){let e=DK();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=DK();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function L2(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function R2(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=z2(t),LJ(e,n),zJ(n,e),RJ(n,e)),{node:n}}function Hce(e){let t=I2();return zJ(t,e),LJ(e,t),RJ(t,e),{node:t}}function z2(e=`h1`){return Xq(new Vce(e))}function B2(e){return lK(uq(e))}function V2(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(X(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&X(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var Uce={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function H2(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=QY(e.focus,t),r=YJ(n.origin,qq);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!Hq(i,r))return!1;let a=GY(n,PY(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=GY(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!kY(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of UY(PY(r,t))){if(!e.origin.is(c.getParent())){if($q(e.origin)){let e=PY(c,t);return eX(GY(e,e)),!0}break}if(!qq(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=QY(e.anchor,t).getNodeAtCaret();return!(!qq(n)||n.isInline()||(eX(WY(sX(RY(n,t)))),0))}(e,t)}function U2(e){return lK(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function W2(e){let t=uG();t.add(e),mq(t)}function G2(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=QY(n,i);if(n.type===`element`&&$(r)&&(dK(r)||qq(r))){let e=a.getNodeAtCaret();return!(e===null||!U2(e))&&(W2(e.__key),!0)}let o=YJ($(r)?r:r.getParentOrThrow(),e=>$(e)&&!e.isInline()&&Jq(e.getParent()));if(o===null)return!1;let s=PY(o,i).getNodeAtCaret();if(s===null||!U2(s))return!1;if(o.getTextContentSize()===0)return W2(s.__key),!0;let c=DJ().getRootElement();if(c===null)return!1;let l=tJ(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return K2(l,u,d,f,p),!1;let g=uq(m);return K2(l,u,d,f,p),g===null?!1:(m===u&&h===d||!g.is(o)&&!Hq(g,o))&&(W2(s.__key),!0)}function K2(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function q2(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=YJ($(n)?n:n.getParentOrThrow(),e=>$(e)&&!e.isInline());if(r===null)return!1;let i=DJ(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if($(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=PY(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!$(c)){if(t){let e=r.getFirstDescendant();X(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(X(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=tJ(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=g2(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(X(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function J2(e,t){let n=PY(e,t),r=n.getAdjacentCaret();r!==null&&$(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?eX(WY(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function Y2(e,t,n){n.preventDefault(),n.stopPropagation();let r=e.getNodes();if(r.length===0)return!0;let i=r.map(e=>PY(e,`next`)).sort(qY),a=(t?i[0]:i[i.length-1]).origin,o=YJ(a,e=>e!==a&&$(e)&&!e.isInline())??pq(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function Wce(e,t=hZ(Uce)){return SX(e.registerCommand(OH,()=>{let e=Q();return VW(e)?(e.clear(),!0):(Z(e)&&V2(e,`click`,`both`,t.peek()),!1)},0),e.registerCommand(NH,e=>{let t=Q();return Z(t)?(t.deleteCharacter(e),!0):!!VW(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(zH,e=>{let t=Q();return!!Z(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(BH,e=>{let t=Q();return!!Z(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(IH,t=>{let n=Q();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)w2(r,n,e);else if(Z(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(RH,()=>{let e=Q();return!!Z(e)&&(e.removeText(),!0)},0),e.registerCommand(VH,e=>{let t=Q();return!(!Z(t)&&!VW(t))&&(WW(t,e),!0)},0),e.registerCommand(HH,e=>{let t=Q();return!(!Z(t)&&!VW(t))&&(UW(t,e),!0)},0),e.registerCommand(cU,e=>{let t=Q();if(!Z(t)&&!VW(t))return!1;let n=t.getNodes();for(let t of n){let n=YJ(t,e=>$(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(PH,e=>{let t=Q();return!!Z(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(FH,()=>{let e=Q();return!!Z(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(iU,()=>{let e=MW(),t=Q();return Z(t)&&(e.setFormat(t.format),e.setStyle(t.style)),bG([e]),!0},0),e.registerCommand(aU,()=>nZ(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(oU,()=>nZ(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(XH,e=>{let t=Q();if(VW(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),J2(n[0],`previous`),!0}else if(Z(t)&&(!e.shiftKey&&H2(t,`previous`)||!e.shiftKey&&G2(t,!0)||!e.shiftKey&&q2(t,!0)))return e.preventDefault(),!0;return!1},0),e.registerCommand(ZH,e=>{let t=Q();if(VW(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),J2(n[0],`next`),!0}else if(Z(t)&&(function(e){let t=e.focus;return t.key===`root`&&t.offset===pq().getChildrenSize()}(t)||!e.shiftKey&&H2(t,`next`)||!e.shiftKey&&G2(t,!1)||!e.shiftKey&&q2(t,!1)))return e.preventDefault(),!0;return!1},0),e.registerCommand(JH,e=>{let n=Q();if(VW(n)){let t=n.getNodes();if(t.length>0)return e.preventDefault(),J2(t[0],NX(t[0])?`next`:`previous`),!0}if(!Z(n))return!1;if(!e.shiftKey&&H2(n,NX(n.anchor.getNode())?`next`:`previous`))return e.preventDefault(),!0;if(e.shiftKey||V2(n,`arrow`,`start`,t.peek()),WX(n,!0)){let t=e.shiftKey;return e.preventDefault(),qX(n,t,!0),!0}return!1},0),e.registerCommand(KH,e=>{let n=Q();if(VW(n)){let t=n.getNodes();if(t.length>0)return e.preventDefault(),J2(t[0],NX(t[0])?`previous`:`next`),!0}if(!Z(n))return!1;if(!e.shiftKey&&H2(n,NX(n.anchor.getNode())?`previous`:`next`))return e.preventDefault(),!0;if(e.shiftKey||V2(n,`arrow`,`end`,t.peek()),WX(n,!1)){let t=e.shiftKey;return e.preventDefault(),qX(n,t,!1),!0}return!1},0),e.registerCommand(eU,t=>{let n=Q();if(!VW(n)&&B2(t.target))return!1;if(Z(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(dK(n))return!1;let r=QX(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(oU,void 0);if(mB&&pB)return!1}else if(!VW(n))return!1;return t.preventDefault(),e.dispatchCommand(NH,!0)},0),e.registerCommand(nU,t=>{let n=Q();return!(!VW(n)&&B2(t.target))&&!(!Z(n)&&!VW(n))&&(t.preventDefault(),e.dispatchCommand(NH,!1))},0),e.registerCommand(QH,n=>{let r=Q();if(VW(r)){let e=r.getNodes();e.length===1&&lK(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Z(r))return!1;if(V2(r,`enter`,`both`,t.peek()),n!==null){if((mB||gB||yB)&&pB)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(PH,!1)}return e.dispatchCommand(FH,void 0)},0),e.registerCommand(tU,()=>!!Z(Q())&&(e.blur(),!0),0),e.registerCommand(sU,t=>{let[,n]=tZ(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=g2(r,i,e.getRootElement());if(a!==null){let{offset:t,node:r}=a,i=uq(r);if(i!==null){let e=lG();if(X(i))e.anchor.set(i.getKey(),t,`text`),e.focus.set(i.getKey(),t,`text`);else{let t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,`element`),e.focus.set(t,n,`element`)}mq(EV(e))}e.dispatchCommand(P2,n)}return t.preventDefault(),!0}return Nce(t,e)},0),e.registerCommand(lU,t=>{let[n]=tZ(t),r=Q();return!(n&&!Z(r))&&(Z(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(M2(t.dataTransfer,j2(r)),jce(t.dataTransfer,e)),!0)},0),e.registerCommand(uU,t=>{let[n]=tZ(t),r=Q();if(n&&!Z(r))return!1;let i=t.clientX,a=t.clientY,o=g2(i,a,e.getRootElement());return o!==null&&lK(uq(o.node))&&t.preventDefault(),!0},0),e.registerCommand(mU,()=>{let e=Q();return Aq(Z(e)&&iY(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(fU,t=>(k2(e,eZ(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(pU,t=>(async function(e,t){await k2(t,eZ(e,ClipboardEvent)?e:null),t.update(()=>{let e=Q();Z(e)?e.removeText():VW(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(LH,t=>{let[,n,r]=tZ(t);return n.length>0&&!r?(e.dispatchCommand(P2,n),!0):bJ(t.target)&&UK(t.target)?!1:Q()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=Q(),r=eZ(e,InputEvent)||eZ(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&w2(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand($H,()=>{let e=Q();return Z(e)&&V2(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(rU,()=>{let e=Q();return Z(e)&&V2(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(qH,e=>{let t=Q();if(VW(t))return Y2(t,!1,e);if(!Z(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!$(r))return!1;let i=r.getFirstChild();if(!lK(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(YH,e=>{let t=Q();if(VW(t))return Y2(t,!0,e);if(!Z(t))return!1;let{anchor:n,focus:r}=t,i=YJ(r.getNode(),e=>$(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!lK(a)||!a.isInline()||YJ(n.getNode(),e=>$(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function Gce(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var X2=lB?f.useLayoutEffect:f.useEffect;function Kce({editor:e,ErrorBoundary:t}){return function(e,t){let[n,r]=(0,f.useState)(()=>e.getDecorators());return X2(()=>e.registerDecoratorListener(e=>{(0,p.flushSync)(()=>{r(e)})}),[e]),(0,f.useEffect)(()=>{r(e.getDecorators())},[e]),(0,f.useMemo)(()=>{let r=[],i=Object.keys(n);for(let a=0;a<i.length;a++){let o=i[a],s=(0,m.jsx)(t,{onError:t=>e._onError(t),children:(0,m.jsx)(f.Suspense,{fallback:null,children:n[o]})}),c=e.getElementByKey(o);c!==null&&r.push((0,p.createPortal)(s,c,o))}return r},[t,n,e])}(e,t)}function qce({editor:e,ErrorBoundary:t}){return function(e){let t=$Z.maybeFromEditor(e);if(t&&t.hasExtensionByName(xce.name)){for(let e of[`@lexical/plain-text`,`@lexical/rich-text`])t.hasExtensionByName(e)&&Gce(320,e);return!0}return!1}(e)?null:(0,m.jsx)(Kce,{editor:e,ErrorBoundary:t})}function Z2(e){return e.read(`latest`,u2(e.isComposing()))}function Jce({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=Y$();return function(e){X2(()=>SX(Wce(e),Tce(e)),[e])}(r),(0,m.jsxs)(m.Fragment,{children:[e,(0,m.jsx)(Yce,{content:t}),(0,m.jsx)(qce,{editor:r,ErrorBoundary:n})]})}function Yce({content:e}){let[t]=Y$(),n=function(e){let[t,n]=(0,f.useState)(()=>Z2(e));return X2(()=>{function t(){n(Z2(e))}return t(),SX(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),r=bce();return n?typeof e==`function`?e(r):e:null}function Xce({horizontalRuleCommandEnabled:e=!1}){let[t]=Y$();return(0,d.useEffect)(()=>SX(t.registerCommand(n0,e=>W1(e),0),t.registerCommand(r0,e=>q1(e),0),t.registerCommand(i0,e=>{let n=$1(e);return e?.openEditor&&n&&t.dispatchCommand(a0,n),n!==null},0),t.registerCommand(o0,e=>e0(e),0),t.registerCommand(s0,e=>t0(e),0),t.registerCommand(o1,e=>{let n=Y1(e);return n&&window.requestAnimationFrame(()=>{t.dispatchCommand(s1,n)}),n!==null},0),t.registerCommand(c1,e=>Q1(e),0),t.registerCommand(Q$,e=>Z1(e),0)),[t]),(0,d.useEffect)(()=>{if(e)return SX(t.registerCommand(nQ,()=>{let e=Q();return Z(e)?(e.focus.getNode()!==null&&$X(aQ()),!0):!1},0))},[t,e]),null}function Zce({editable:e}){let[t]=Y$();return(0,d.useEffect)(()=>{t.setEditable(e)},[t,e]),null}function Q2({control:e,variant:t}){let n=t===`toolbar`?`size-3`:`size-4`,r=z(n,`shrink-0`,t===`menu`&&e.kind!==`color`?`text-muted-foreground`:void 0);switch(e.kind){case`weight`:return e.value===`strong`?(0,m.jsx)(dw,{className:r}):(0,m.jsx)(HT,{className:r});case`italic`:return e.value===`italic`?(0,m.jsx)(eT,{className:r}):(0,m.jsx)(ST,{className:r});case`underline`:return e.value===`underline`?(0,m.jsx)(UT,{className:r}):(0,m.jsx)(lT,{className:r});case`color`:return(0,m.jsx)(Dw,{className:z(n,`shrink-0`,e.value===`primary`?`fill-(--rich-text-editor-primary-color,var(--primary)) text-(--rich-text-editor-primary-color,var(--primary))`:`fill-(--rich-text-editor-accent-color,var(--accent)) text-(--rich-text-editor-accent-color,var(--accent))`)})}}function Qce(e){return e===`center`?`center`:e===`right`||e===`end`?`right`:e===`justify`?`justify`:`left`}var $2=[{value:`left`,key:`left`,title:`Align left`,Icon:FT},{value:`center`,key:`center`,title:`Align center`,Icon:MT},{value:`right`,key:`right`,title:`Align right`,Icon:PT},{value:`justify`,key:`justify`,title:`Justify`,Icon:NT}];function $ce({editable:e,linksEnabled:t,blockAlignmentEnabled:n,surfaceRef:r,toolbarClassName:i,styleControls:a,templateVariables:o}){let[s]=Y$(),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(!1),p=(0,d.useEffectEvent)(()=>{let i=s.getRootElement(),c=r.current,u=window.getSelection(),d=document.activeElement;if(!e||!i||!c||!u||!(d instanceof Node)||!i.contains(d)||u.rangeCount===0||a.length===0&&o.length===0&&!t&&!n){l(null),f(!1);return}let p=u.anchorNode;if(!p||!i.contains(p)){l(null),f(!1);return}s.getEditorState().read(()=>{let e=Q();if(!Z(e)||e.isCollapsed()){l(null),f(!1);return}let r=u.getRangeAt(0).getBoundingClientRect(),i=c.getBoundingClientRect();if(r.width===0&&r.height===0){l(null),f(!1);return}let s=r.left-i.left+r.width/2,d=r.top-i.top>40,p=new Set(a.flatMap(t=>G1(e,t)?[k1(t)]:[])),m=n&&F1(e)?N1(e):null,h=m!==null,g=m?Qce(m.getFormatType()):`left`;if(a.length===0&&o.length===0&&!t&&!h){l(null),f(!1);return}let _=h?$2.length:0,v=h&&a.length>0?10:0,y=_+a.length+ +(o.length>0)+ +!!t,b=Math.max(52,y*30+12+v)/2,x=i.width;l({left:Math.min(Math.max(s,b+8),Math.max(x-b-8,b+8)),top:d?r.top-i.top-10:r.bottom-i.top+10,side:d?`top`:`bottom`,activeControlKeys:p,showAlignmentControls:h,activeAlignment:g})})});return(0,d.useEffect)(()=>{if(e)return SX(s.registerCommand(EH,()=>(p(),!1),0),s.registerUpdateListener(()=>{p()}),s.registerRootListener(()=>{p()}))},[n,e,s]),(0,d.useEffect)(()=>{if(!e)return;let t=()=>{};return SX(s.registerRootListener(e=>{if(t(),!e){t=()=>{};return}let n=t=>{let n=t.relatedTarget;n instanceof Node&&e.contains(n)||(l(null),f(!1))};e.addEventListener(`focusout`,n),t=()=>{e.removeEventListener(`focusout`,n)}}),()=>{t()})},[e,s]),(0,d.useEffect)(()=>{if(!c)return;let e=()=>{p()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[c]),c?(0,m.jsxs)(`div`,{className:z(`absolute z-60 flex -translate-x-1/2 items-center gap-1 rounded-xl border border-border/80 bg-background/96 p-1 shadow-lg backdrop-blur-sm`,c.side===`top`?`-translate-y-full`:`translate-y-0`,i),style:{left:c.left,top:c.top},children:[c.showAlignmentControls?(0,m.jsx)(m.Fragment,{children:$2.map(({value:e,key:t,title:n,Icon:r})=>{let i=c.activeAlignment===t;return(0,m.jsx)(B,{type:`button`,size:`icon-xs`,variant:i?`outline`:`ghost`,title:n,"aria-pressed":i,className:z(i&&`border-primary/70 bg-primary/15 text-primary shadow-sm dark:bg-primary/20`),onMouseDown:e=>{e.preventDefault()},onClick:()=>{s.dispatchCommand(cU,e)},children:(0,m.jsx)(r,{className:`size-3`})},t)})}):null,c.showAlignmentControls&&a.length>0?(0,m.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,className:`mx-0.5 h-5 w-px shrink-0 self-center bg-border/80`}):null,a.map(e=>{let t=A1(e),n=c.activeControlKeys.has(k1(e));return(0,m.jsx)(B,{type:`button`,size:`icon-xs`,variant:n?`outline`:`ghost`,title:t.title,"aria-pressed":n,className:z(n&&`border-primary/70 bg-primary/15 text-primary shadow-sm dark:bg-primary/20`),onMouseDown:e=>{e.preventDefault()},onClick:()=>{s.dispatchCommand(n0,e)},children:(0,m.jsx)(Q2,{control:e,variant:`toolbar`})},k1(e))}),t?(0,m.jsx)(B,{type:`button`,size:`icon-xs`,variant:`ghost`,title:`Insert link`,onMouseDown:e=>{e.preventDefault()},onClick:()=>{s.dispatchCommand(i0,{openEditor:!0})},children:(0,m.jsx)(nT,{className:`size-3`})}):null,o.length>0?(0,m.jsxs)(`div`,{className:`relative`,children:[(0,m.jsx)(B,{type:`button`,size:`icon-xs`,variant:u?`outline`:`ghost`,title:`Insert template variable`,className:z(u&&`border-primary/70 bg-primary/15 text-primary shadow-sm dark:bg-primary/20`),onMouseDown:e=>{e.preventDefault()},onClick:()=>{f(e=>!e)},children:(0,m.jsx)(fw,{className:`size-3`})}),u?(0,m.jsx)(`div`,{className:`absolute left-1/2 top-full mt-2 flex min-w-44 -translate-x-1/2 flex-col gap-1 rounded-xl border border-border/80 bg-background p-1.5 shadow-lg`,children:o.map(e=>(0,m.jsxs)(`button`,{type:`button`,className:`flex items-center justify-between gap-3 rounded-lg px-2 py-1.5 text-left text-sm hover:bg-muted`,onMouseDown:e=>{e.preventDefault()},onClick:()=>{s.dispatchCommand(r0,e),f(!1)},children:[(0,m.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,m.jsx)(fw,{className:`size-4 shrink-0 text-muted-foreground`}),(0,m.jsx)(`span`,{className:`truncate`,children:e.label??e.key})]}),(0,m.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:O1(e.key)})]},e.key))}):null]}):null]}):null}var ele=o((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),tle=o((e=>{process.env.NODE_ENV!==`production`&&(function(){"use strict";var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)}function x(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case l:case u:case i:case o:case a:case f:return p;default:var g=p&&p.$$typeof;switch(g){case c:case d:case h:case m:case s:return g;default:return t}}case r:return t}}}var S=l,C=u,w=c,T=s,E=n,D=d,O=i,k=h,A=m,j=r,M=o,N=a,ee=f,P=!1;function F(e){return P||(P=!0,console.warn(`The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.`)),I(e)||x(e)===l}function I(e){return x(e)===u}function L(e){return x(e)===c}function te(e){return x(e)===s}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===n}function re(e){return x(e)===d}function ie(e){return x(e)===i}function ae(e){return x(e)===h}function oe(e){return x(e)===m}function se(e){return x(e)===r}function ce(e){return x(e)===o}function le(e){return x(e)===a}function ue(e){return x(e)===f}e.AsyncMode=S,e.ConcurrentMode=C,e.ContextConsumer=w,e.ContextProvider=T,e.Element=E,e.ForwardRef=D,e.Fragment=O,e.Lazy=k,e.Memo=A,e.Portal=j,e.Profiler=M,e.StrictMode=N,e.Suspense=ee,e.isAsyncMode=F,e.isConcurrentMode=I,e.isContextConsumer=L,e.isContextProvider=te,e.isElement=ne,e.isForwardRef=re,e.isFragment=ie,e.isLazy=ae,e.isMemo=oe,e.isPortal=se,e.isProfiler=ce,e.isStrictMode=le,e.isSuspense=ue,e.isValidElementType=b,e.typeOf=x})()})),e4=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=ele():t.exports=tle()})),nle=o(((e,t)=>{var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}})),t4=o(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),n4=o(((e,t)=>{t.exports=Function.call.bind(Object.prototype.hasOwnProperty)})),rle=o(((e,t)=>{var n=function(){};if(process.env.NODE_ENV!==`production`){var r=t4(),i={},a=n4();n=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}}}function o(e,t,o,s,c){if(process.env.NODE_ENV!==`production`){for(var l in e)if(a(e,l)){var u;try{if(typeof e[l]!=`function`){var d=Error((s||`React class`)+`: `+o+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name=`Invariant Violation`,d}u=e[l](t,l,s,o,null,r)}catch(e){u=e}if(u&&!(u instanceof Error)&&n((s||`React class`)+`: type specification of `+o+" `"+l+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+`. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).`),u instanceof Error&&!(u.message in i)){i[u.message]=!0;var f=c?c():``;n(`Failed `+o+` type: `+u.message+(f??``))}}}}o.resetWarningCache=function(){process.env.NODE_ENV!==`production`&&(i={})},t.exports=o})),ile=o(((e,t)=>{var n=e4(),r=nle(),i=t4(),a=n4(),o=rle(),s=function(){};process.env.NODE_ENV!==`production`&&(s=function(e){var t=`Warning: `+e;typeof console<`u`&&console.error(t);try{throw Error(t)}catch{}});function c(){return null}t.exports=function(e,t){var l=typeof Symbol==`function`&&Symbol.iterator,u=`@@iterator`;function d(e){var t=e&&(l&&e[l]||e[u]);if(typeof t==`function`)return t}var f=`<<anonymous>>`,p={array:_(`array`),bigint:_(`bigint`),bool:_(`boolean`),func:_(`function`),number:_(`number`),object:_(`object`),string:_(`string`),symbol:_(`symbol`),any:v(),arrayOf:y,element:b(),elementType:x(),instanceOf:S,node:E(),objectOf:w,oneOf:C,oneOfType:T,shape:O,exact:k};function m(e,t){return e===t?e!==0||1/e==1/t:e!==e&&t!==t}function h(e,t){this.message=e,this.data=t&&typeof t==`object`?t:{},this.stack=``}h.prototype=Error.prototype;function g(e){if(process.env.NODE_ENV!==`production`)var n={},r=0;function a(a,o,c,l,u,d,p){if(l||=f,d||=c,p!==i){if(t){var m=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw m.name=`Invariant Violation`,m}else if(process.env.NODE_ENV!==`production`&&typeof console<`u`){var g=l+`:`+c;!n[g]&&r<3&&(s("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[g]=!0,r++)}}return o[c]==null?a?o[c]===null?new h(`The `+u+" `"+d+"` is marked as required "+("in `"+l+"`, but its value is `null`.")):new h(`The `+u+" `"+d+"` is marked as required in "+("`"+l+"`, but its value is `undefined`.")):null:e(o,c,l,u,d)}var o=a.bind(null,!1);return o.isRequired=a.bind(null,!0),o}function _(e){function t(t,n,r,i,a,o){var s=t[n];if(M(s)!==e){var c=N(s);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+c+"` supplied to `"+r+"`, expected ")+("`"+e+"`."),{expectedType:e})}return null}return g(t)}function v(){return g(c)}function y(e){function t(t,n,r,a,o){if(typeof e!=`function`)return new h("Property `"+o+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){var c=M(s);return new h(`Invalid `+a+" `"+o+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l<s.length;l++){var u=e(s,l,r,a,o+`[`+l+`]`,i);if(u instanceof Error)return u}return null}return g(t)}function b(){function t(t,n,r,i,a){var o=t[n];if(!e(o)){var s=M(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return g(t)}function x(){function e(e,t,r,i,a){var o=e[t];if(!n.isValidElementType(o)){var s=M(o);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement type."))}return null}return g(e)}function S(e){function t(t,n,r,i,a){if(!(t[n]instanceof e)){var o=e.name||f,s=P(t[n]);return new h(`Invalid `+i+" `"+a+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+o+"`."))}return null}return g(t)}function C(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&(arguments.length>1?s(`Invalid arguments supplied to oneOf, expected an array, got `+arguments.length+` arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).`):s(`Invalid argument supplied to oneOf, expected an array.`)),c;function t(t,n,r,i,a){for(var o=t[n],s=0;s<e.length;s++)if(m(o,e[s]))return null;var c=JSON.stringify(e,function(e,t){return N(t)===`symbol`?String(t):t});return new h(`Invalid `+i+" `"+a+"` of value `"+String(o)+"` "+("supplied to `"+r+"`, expected one of "+c+`.`))}return g(t)}function w(e){function t(t,n,r,o,s){if(typeof e!=`function`)return new h("Property `"+s+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var c=t[n],l=M(c);if(l!==`object`)return new h(`Invalid `+o+" `"+s+"` of type "+("`"+l+"` supplied to `"+r+"`, expected an object."));for(var u in c)if(a(c,u)){var d=e(c,u,r,o,s+`.`+u,i);if(d instanceof Error)return d}return null}return g(t)}function T(e){if(!Array.isArray(e))return process.env.NODE_ENV!==`production`&&s(`Invalid argument supplied to oneOfType, expected an instance of array.`),c;for(var t=0;t<e.length;t++){var n=e[t];if(typeof n!=`function`)return s(`Invalid argument supplied to oneOfType. Expected an array of check functions, but received `+ee(n)+` at index `+t+`.`),c}function r(t,n,r,o,s){for(var c=[],l=0;l<e.length;l++){var u=e[l],d=u(t,n,r,o,s,i);if(d==null)return null;d.data&&a(d.data,`expectedType`)&&c.push(d.data.expectedType)}var f=c.length>0?`, expected one of type [`+c.join(`, `)+`]`:``;return new h(`Invalid `+o+" `"+s+"` supplied to "+("`"+r+"`"+f+`.`))}return g(r)}function E(){function e(e,t,n,r,i){return A(e[t])?null:new h(`Invalid `+r+" `"+i+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return g(e)}function D(e,t,n,r,i){return new h((e||`React class`)+`: `+t+" type `"+n+`.`+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function O(e){function t(t,n,r,a,o){var s=t[n],c=M(s);if(c!==`object`)return new h(`Invalid `+a+" `"+o+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var l in e){var u=e[l];if(typeof u!=`function`)return D(r,a,o,l,N(u));var d=u(s,l,r,a,o+`.`+l,i);if(d)return d}return null}return g(t)}function k(e){function t(t,n,o,s,c){var l=t[n],u=M(l);if(u!==`object`)return new h(`Invalid `+s+" `"+c+"` of type `"+u+"` "+("supplied to `"+o+"`, expected `object`."));for(var d in r({},t[n],e)){var f=e[d];if(a(e,d)&&typeof f!=`function`)return D(o,s,c,d,N(f));if(!f)return new h(`Invalid `+s+" `"+c+"` key `"+d+"` supplied to `"+o+`\`.
|
|
179
|
-
Bad object: `+JSON.stringify(t[n],null,` `)+`
|
|
180
|
-
Valid keys: `+JSON.stringify(Object.keys(e),null,` `));var p=f(l,d,o,s,c+`.`+d,i);if(p)return p}return null}return g(t)}function A(t){switch(typeof t){case`number`:case`string`:case`undefined`:return!0;case`boolean`:return!t;case`object`:if(Array.isArray(t))return t.every(A);if(t===null||e(t))return!0;var n=d(t);if(n){var r=n.call(t),i;if(n!==t.entries){for(;!(i=r.next()).done;)if(!A(i.value))return!1}else for(;!(i=r.next()).done;){var a=i.value;if(a&&!A(a[1]))return!1}}else return!1;return!0;default:return!1}}function j(e,t){return e===`symbol`?!0:t?t[`@@toStringTag`]===`Symbol`||typeof Symbol==`function`&&t instanceof Symbol:!1}function M(e){var t=typeof e;return Array.isArray(e)?`array`:e instanceof RegExp?`object`:j(t,e)?`symbol`:t}function N(e){if(e==null)return``+e;var t=M(e);if(t===`object`){if(e instanceof Date)return`date`;if(e instanceof RegExp)return`regexp`}return t}function ee(e){var t=N(e);switch(t){case`array`:case`object`:return`an `+t;case`boolean`:case`date`:case`regexp`:return`a `+t;default:return t}}function P(e){return!e.constructor||!e.constructor.name?f:e.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p}})),ale=o(((e,t)=>{var n=t4();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),ole=o(((e,t)=>{if(process.env.NODE_ENV!==`production`){var n=e4();t.exports=ile()(n.isElement,!0)}else t.exports=ale()()})),sle=new Map([[`1km`,`application/vnd.1000minds.decision-model+xml`],[`3dml`,`text/vnd.in3d.3dml`],[`3ds`,`image/x-3ds`],[`3g2`,`video/3gpp2`],[`3gp`,`video/3gp`],[`3gpp`,`video/3gpp`],[`3mf`,`model/3mf`],[`7z`,`application/x-7z-compressed`],[`7zip`,`application/x-7z-compressed`],[`123`,`application/vnd.lotus-1-2-3`],[`aab`,`application/x-authorware-bin`],[`aac`,`audio/x-acc`],[`aam`,`application/x-authorware-map`],[`aas`,`application/x-authorware-seg`],[`abw`,`application/x-abiword`],[`ac`,`application/vnd.nokia.n-gage.ac+xml`],[`ac3`,`audio/ac3`],[`acc`,`application/vnd.americandynamics.acc`],[`ace`,`application/x-ace-compressed`],[`acu`,`application/vnd.acucobol`],[`acutc`,`application/vnd.acucorp`],[`adp`,`audio/adpcm`],[`aep`,`application/vnd.audiograph`],[`afm`,`application/x-font-type1`],[`afp`,`application/vnd.ibm.modcap`],[`ahead`,`application/vnd.ahead.space`],[`ai`,`application/pdf`],[`aif`,`audio/x-aiff`],[`aifc`,`audio/x-aiff`],[`aiff`,`audio/x-aiff`],[`air`,`application/vnd.adobe.air-application-installer-package+zip`],[`ait`,`application/vnd.dvb.ait`],[`ami`,`application/vnd.amiga.ami`],[`amr`,`audio/amr`],[`apk`,`application/vnd.android.package-archive`],[`apng`,`image/apng`],[`appcache`,`text/cache-manifest`],[`application`,`application/x-ms-application`],[`apr`,`application/vnd.lotus-approach`],[`arc`,`application/x-freearc`],[`arj`,`application/x-arj`],[`asc`,`application/pgp-signature`],[`asf`,`video/x-ms-asf`],[`asm`,`text/x-asm`],[`aso`,`application/vnd.accpac.simply.aso`],[`asx`,`video/x-ms-asf`],[`atc`,`application/vnd.acucorp`],[`atom`,`application/atom+xml`],[`atomcat`,`application/atomcat+xml`],[`atomdeleted`,`application/atomdeleted+xml`],[`atomsvc`,`application/atomsvc+xml`],[`atx`,`application/vnd.antix.game-component`],[`au`,`audio/x-au`],[`avi`,`video/x-msvideo`],[`avif`,`image/avif`],[`aw`,`application/applixware`],[`azf`,`application/vnd.airzip.filesecure.azf`],[`azs`,`application/vnd.airzip.filesecure.azs`],[`azv`,`image/vnd.airzip.accelerator.azv`],[`azw`,`application/vnd.amazon.ebook`],[`b16`,`image/vnd.pco.b16`],[`bat`,`application/x-msdownload`],[`bcpio`,`application/x-bcpio`],[`bdf`,`application/x-font-bdf`],[`bdm`,`application/vnd.syncml.dm+wbxml`],[`bdoc`,`application/x-bdoc`],[`bed`,`application/vnd.realvnc.bed`],[`bh2`,`application/vnd.fujitsu.oasysprs`],[`bin`,`application/octet-stream`],[`blb`,`application/x-blorb`],[`blorb`,`application/x-blorb`],[`bmi`,`application/vnd.bmi`],[`bmml`,`application/vnd.balsamiq.bmml+xml`],[`bmp`,`image/bmp`],[`book`,`application/vnd.framemaker`],[`box`,`application/vnd.previewsystems.box`],[`boz`,`application/x-bzip2`],[`bpk`,`application/octet-stream`],[`bpmn`,`application/octet-stream`],[`bsp`,`model/vnd.valve.source.compiled-map`],[`btif`,`image/prs.btif`],[`buffer`,`application/octet-stream`],[`bz`,`application/x-bzip`],[`bz2`,`application/x-bzip2`],[`c`,`text/x-c`],[`c4d`,`application/vnd.clonk.c4group`],[`c4f`,`application/vnd.clonk.c4group`],[`c4g`,`application/vnd.clonk.c4group`],[`c4p`,`application/vnd.clonk.c4group`],[`c4u`,`application/vnd.clonk.c4group`],[`c11amc`,`application/vnd.cluetrust.cartomobile-config`],[`c11amz`,`application/vnd.cluetrust.cartomobile-config-pkg`],[`cab`,`application/vnd.ms-cab-compressed`],[`caf`,`audio/x-caf`],[`cap`,`application/vnd.tcpdump.pcap`],[`car`,`application/vnd.curl.car`],[`cat`,`application/vnd.ms-pki.seccat`],[`cb7`,`application/x-cbr`],[`cba`,`application/x-cbr`],[`cbr`,`application/x-cbr`],[`cbt`,`application/x-cbr`],[`cbz`,`application/x-cbr`],[`cc`,`text/x-c`],[`cco`,`application/x-cocoa`],[`cct`,`application/x-director`],[`ccxml`,`application/ccxml+xml`],[`cdbcmsg`,`application/vnd.contact.cmsg`],[`cda`,`application/x-cdf`],[`cdf`,`application/x-netcdf`],[`cdfx`,`application/cdfx+xml`],[`cdkey`,`application/vnd.mediastation.cdkey`],[`cdmia`,`application/cdmi-capability`],[`cdmic`,`application/cdmi-container`],[`cdmid`,`application/cdmi-domain`],[`cdmio`,`application/cdmi-object`],[`cdmiq`,`application/cdmi-queue`],[`cdr`,`application/cdr`],[`cdx`,`chemical/x-cdx`],[`cdxml`,`application/vnd.chemdraw+xml`],[`cdy`,`application/vnd.cinderella`],[`cer`,`application/pkix-cert`],[`cfs`,`application/x-cfs-compressed`],[`cgm`,`image/cgm`],[`chat`,`application/x-chat`],[`chm`,`application/vnd.ms-htmlhelp`],[`chrt`,`application/vnd.kde.kchart`],[`cif`,`chemical/x-cif`],[`cii`,`application/vnd.anser-web-certificate-issue-initiation`],[`cil`,`application/vnd.ms-artgalry`],[`cjs`,`application/node`],[`cla`,`application/vnd.claymore`],[`class`,`application/octet-stream`],[`clkk`,`application/vnd.crick.clicker.keyboard`],[`clkp`,`application/vnd.crick.clicker.palette`],[`clkt`,`application/vnd.crick.clicker.template`],[`clkw`,`application/vnd.crick.clicker.wordbank`],[`clkx`,`application/vnd.crick.clicker`],[`clp`,`application/x-msclip`],[`cmc`,`application/vnd.cosmocaller`],[`cmdf`,`chemical/x-cmdf`],[`cml`,`chemical/x-cml`],[`cmp`,`application/vnd.yellowriver-custom-menu`],[`cmx`,`image/x-cmx`],[`cod`,`application/vnd.rim.cod`],[`coffee`,`text/coffeescript`],[`com`,`application/x-msdownload`],[`conf`,`text/plain`],[`cpio`,`application/x-cpio`],[`cpp`,`text/x-c`],[`cpt`,`application/mac-compactpro`],[`crd`,`application/x-mscardfile`],[`crl`,`application/pkix-crl`],[`crt`,`application/x-x509-ca-cert`],[`crx`,`application/x-chrome-extension`],[`cryptonote`,`application/vnd.rig.cryptonote`],[`csh`,`application/x-csh`],[`csl`,`application/vnd.citationstyles.style+xml`],[`csml`,`chemical/x-csml`],[`csp`,`application/vnd.commonspace`],[`csr`,`application/octet-stream`],[`css`,`text/css`],[`cst`,`application/x-director`],[`csv`,`text/csv`],[`cu`,`application/cu-seeme`],[`curl`,`text/vnd.curl`],[`cww`,`application/prs.cww`],[`cxt`,`application/x-director`],[`cxx`,`text/x-c`],[`dae`,`model/vnd.collada+xml`],[`daf`,`application/vnd.mobius.daf`],[`dart`,`application/vnd.dart`],[`dataless`,`application/vnd.fdsn.seed`],[`davmount`,`application/davmount+xml`],[`dbf`,`application/vnd.dbf`],[`dbk`,`application/docbook+xml`],[`dcr`,`application/x-director`],[`dcurl`,`text/vnd.curl.dcurl`],[`dd2`,`application/vnd.oma.dd2+xml`],[`ddd`,`application/vnd.fujixerox.ddd`],[`ddf`,`application/vnd.syncml.dmddf+xml`],[`dds`,`image/vnd.ms-dds`],[`deb`,`application/x-debian-package`],[`def`,`text/plain`],[`deploy`,`application/octet-stream`],[`der`,`application/x-x509-ca-cert`],[`dfac`,`application/vnd.dreamfactory`],[`dgc`,`application/x-dgc-compressed`],[`dic`,`text/x-c`],[`dir`,`application/x-director`],[`dis`,`application/vnd.mobius.dis`],[`disposition-notification`,`message/disposition-notification`],[`dist`,`application/octet-stream`],[`distz`,`application/octet-stream`],[`djv`,`image/vnd.djvu`],[`djvu`,`image/vnd.djvu`],[`dll`,`application/octet-stream`],[`dmg`,`application/x-apple-diskimage`],[`dmn`,`application/octet-stream`],[`dmp`,`application/vnd.tcpdump.pcap`],[`dms`,`application/octet-stream`],[`dna`,`application/vnd.dna`],[`doc`,`application/msword`],[`docm`,`application/vnd.ms-word.template.macroEnabled.12`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`dot`,`application/msword`],[`dotm`,`application/vnd.ms-word.template.macroEnabled.12`],[`dotx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.template`],[`dp`,`application/vnd.osgi.dp`],[`dpg`,`application/vnd.dpgraph`],[`dra`,`audio/vnd.dra`],[`drle`,`image/dicom-rle`],[`dsc`,`text/prs.lines.tag`],[`dssc`,`application/dssc+der`],[`dtb`,`application/x-dtbook+xml`],[`dtd`,`application/xml-dtd`],[`dts`,`audio/vnd.dts`],[`dtshd`,`audio/vnd.dts.hd`],[`dump`,`application/octet-stream`],[`dvb`,`video/vnd.dvb.file`],[`dvi`,`application/x-dvi`],[`dwd`,`application/atsc-dwd+xml`],[`dwf`,`model/vnd.dwf`],[`dwg`,`image/vnd.dwg`],[`dxf`,`image/vnd.dxf`],[`dxp`,`application/vnd.spotfire.dxp`],[`dxr`,`application/x-director`],[`ear`,`application/java-archive`],[`ecelp4800`,`audio/vnd.nuera.ecelp4800`],[`ecelp7470`,`audio/vnd.nuera.ecelp7470`],[`ecelp9600`,`audio/vnd.nuera.ecelp9600`],[`ecma`,`application/ecmascript`],[`edm`,`application/vnd.novadigm.edm`],[`edx`,`application/vnd.novadigm.edx`],[`efif`,`application/vnd.picsel`],[`ei6`,`application/vnd.pg.osasli`],[`elc`,`application/octet-stream`],[`emf`,`image/emf`],[`eml`,`message/rfc822`],[`emma`,`application/emma+xml`],[`emotionml`,`application/emotionml+xml`],[`emz`,`application/x-msmetafile`],[`eol`,`audio/vnd.digital-winds`],[`eot`,`application/vnd.ms-fontobject`],[`eps`,`application/postscript`],[`epub`,`application/epub+zip`],[`es`,`application/ecmascript`],[`es3`,`application/vnd.eszigno3+xml`],[`esa`,`application/vnd.osgi.subsystem`],[`esf`,`application/vnd.epson.esf`],[`et3`,`application/vnd.eszigno3+xml`],[`etx`,`text/x-setext`],[`eva`,`application/x-eva`],[`evy`,`application/x-envoy`],[`exe`,`application/octet-stream`],[`exi`,`application/exi`],[`exp`,`application/express`],[`exr`,`image/aces`],[`ext`,`application/vnd.novadigm.ext`],[`ez`,`application/andrew-inset`],[`ez2`,`application/vnd.ezpix-album`],[`ez3`,`application/vnd.ezpix-package`],[`f`,`text/x-fortran`],[`f4v`,`video/mp4`],[`f77`,`text/x-fortran`],[`f90`,`text/x-fortran`],[`fbs`,`image/vnd.fastbidsheet`],[`fcdt`,`application/vnd.adobe.formscentral.fcdt`],[`fcs`,`application/vnd.isac.fcs`],[`fdf`,`application/vnd.fdf`],[`fdt`,`application/fdt+xml`],[`fe_launch`,`application/vnd.denovo.fcselayout-link`],[`fg5`,`application/vnd.fujitsu.oasysgp`],[`fgd`,`application/x-director`],[`fh`,`image/x-freehand`],[`fh4`,`image/x-freehand`],[`fh5`,`image/x-freehand`],[`fh7`,`image/x-freehand`],[`fhc`,`image/x-freehand`],[`fig`,`application/x-xfig`],[`fits`,`image/fits`],[`flac`,`audio/x-flac`],[`fli`,`video/x-fli`],[`flo`,`application/vnd.micrografx.flo`],[`flv`,`video/x-flv`],[`flw`,`application/vnd.kde.kivio`],[`flx`,`text/vnd.fmi.flexstor`],[`fly`,`text/vnd.fly`],[`fm`,`application/vnd.framemaker`],[`fnc`,`application/vnd.frogans.fnc`],[`fo`,`application/vnd.software602.filler.form+xml`],[`for`,`text/x-fortran`],[`fpx`,`image/vnd.fpx`],[`frame`,`application/vnd.framemaker`],[`fsc`,`application/vnd.fsc.weblaunch`],[`fst`,`image/vnd.fst`],[`ftc`,`application/vnd.fluxtime.clip`],[`fti`,`application/vnd.anser-web-funds-transfer-initiation`],[`fvt`,`video/vnd.fvt`],[`fxp`,`application/vnd.adobe.fxp`],[`fxpl`,`application/vnd.adobe.fxp`],[`fzs`,`application/vnd.fuzzysheet`],[`g2w`,`application/vnd.geoplan`],[`g3`,`image/g3fax`],[`g3w`,`application/vnd.geospace`],[`gac`,`application/vnd.groove-account`],[`gam`,`application/x-tads`],[`gbr`,`application/rpki-ghostbusters`],[`gca`,`application/x-gca-compressed`],[`gdl`,`model/vnd.gdl`],[`gdoc`,`application/vnd.google-apps.document`],[`geo`,`application/vnd.dynageo`],[`geojson`,`application/geo+json`],[`gex`,`application/vnd.geometry-explorer`],[`ggb`,`application/vnd.geogebra.file`],[`ggt`,`application/vnd.geogebra.tool`],[`ghf`,`application/vnd.groove-help`],[`gif`,`image/gif`],[`gim`,`application/vnd.groove-identity-message`],[`glb`,`model/gltf-binary`],[`gltf`,`model/gltf+json`],[`gml`,`application/gml+xml`],[`gmx`,`application/vnd.gmx`],[`gnumeric`,`application/x-gnumeric`],[`gpg`,`application/gpg-keys`],[`gph`,`application/vnd.flographit`],[`gpx`,`application/gpx+xml`],[`gqf`,`application/vnd.grafeq`],[`gqs`,`application/vnd.grafeq`],[`gram`,`application/srgs`],[`gramps`,`application/x-gramps-xml`],[`gre`,`application/vnd.geometry-explorer`],[`grv`,`application/vnd.groove-injector`],[`grxml`,`application/srgs+xml`],[`gsf`,`application/x-font-ghostscript`],[`gsheet`,`application/vnd.google-apps.spreadsheet`],[`gslides`,`application/vnd.google-apps.presentation`],[`gtar`,`application/x-gtar`],[`gtm`,`application/vnd.groove-tool-message`],[`gtw`,`model/vnd.gtw`],[`gv`,`text/vnd.graphviz`],[`gxf`,`application/gxf`],[`gxt`,`application/vnd.geonext`],[`gz`,`application/gzip`],[`gzip`,`application/gzip`],[`h`,`text/x-c`],[`h261`,`video/h261`],[`h263`,`video/h263`],[`h264`,`video/h264`],[`hal`,`application/vnd.hal+xml`],[`hbci`,`application/vnd.hbci`],[`hbs`,`text/x-handlebars-template`],[`hdd`,`application/x-virtualbox-hdd`],[`hdf`,`application/x-hdf`],[`heic`,`image/heic`],[`heics`,`image/heic-sequence`],[`heif`,`image/heif`],[`heifs`,`image/heif-sequence`],[`hej2`,`image/hej2k`],[`held`,`application/atsc-held+xml`],[`hh`,`text/x-c`],[`hjson`,`application/hjson`],[`hlp`,`application/winhlp`],[`hpgl`,`application/vnd.hp-hpgl`],[`hpid`,`application/vnd.hp-hpid`],[`hps`,`application/vnd.hp-hps`],[`hqx`,`application/mac-binhex40`],[`hsj2`,`image/hsj2`],[`htc`,`text/x-component`],[`htke`,`application/vnd.kenameaapp`],[`htm`,`text/html`],[`html`,`text/html`],[`hvd`,`application/vnd.yamaha.hv-dic`],[`hvp`,`application/vnd.yamaha.hv-voice`],[`hvs`,`application/vnd.yamaha.hv-script`],[`i2g`,`application/vnd.intergeo`],[`icc`,`application/vnd.iccprofile`],[`ice`,`x-conference/x-cooltalk`],[`icm`,`application/vnd.iccprofile`],[`ico`,`image/x-icon`],[`ics`,`text/calendar`],[`ief`,`image/ief`],[`ifb`,`text/calendar`],[`ifm`,`application/vnd.shana.informed.formdata`],[`iges`,`model/iges`],[`igl`,`application/vnd.igloader`],[`igm`,`application/vnd.insors.igm`],[`igs`,`model/iges`],[`igx`,`application/vnd.micrografx.igx`],[`iif`,`application/vnd.shana.informed.interchange`],[`img`,`application/octet-stream`],[`imp`,`application/vnd.accpac.simply.imp`],[`ims`,`application/vnd.ms-ims`],[`in`,`text/plain`],[`ini`,`text/plain`],[`ink`,`application/inkml+xml`],[`inkml`,`application/inkml+xml`],[`install`,`application/x-install-instructions`],[`iota`,`application/vnd.astraea-software.iota`],[`ipfix`,`application/ipfix`],[`ipk`,`application/vnd.shana.informed.package`],[`irm`,`application/vnd.ibm.rights-management`],[`irp`,`application/vnd.irepository.package+xml`],[`iso`,`application/x-iso9660-image`],[`itp`,`application/vnd.shana.informed.formtemplate`],[`its`,`application/its+xml`],[`ivp`,`application/vnd.immervision-ivp`],[`ivu`,`application/vnd.immervision-ivu`],[`jad`,`text/vnd.sun.j2me.app-descriptor`],[`jade`,`text/jade`],[`jam`,`application/vnd.jam`],[`jar`,`application/java-archive`],[`jardiff`,`application/x-java-archive-diff`],[`java`,`text/x-java-source`],[`jhc`,`image/jphc`],[`jisp`,`application/vnd.jisp`],[`jls`,`image/jls`],[`jlt`,`application/vnd.hp-jlyt`],[`jng`,`image/x-jng`],[`jnlp`,`application/x-java-jnlp-file`],[`joda`,`application/vnd.joost.joda-archive`],[`jp2`,`image/jp2`],[`jpe`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`jpf`,`image/jpx`],[`jpg`,`image/jpeg`],[`jpg2`,`image/jp2`],[`jpgm`,`video/jpm`],[`jpgv`,`video/jpeg`],[`jph`,`image/jph`],[`jpm`,`video/jpm`],[`jpx`,`image/jpx`],[`js`,`application/javascript`],[`json`,`application/json`],[`json5`,`application/json5`],[`jsonld`,`application/ld+json`],[`jsonl`,`application/jsonl`],[`jsonml`,`application/jsonml+json`],[`jsx`,`text/jsx`],[`jxr`,`image/jxr`],[`jxra`,`image/jxra`],[`jxrs`,`image/jxrs`],[`jxs`,`image/jxs`],[`jxsc`,`image/jxsc`],[`jxsi`,`image/jxsi`],[`jxss`,`image/jxss`],[`kar`,`audio/midi`],[`karbon`,`application/vnd.kde.karbon`],[`kdb`,`application/octet-stream`],[`kdbx`,`application/x-keepass2`],[`key`,`application/x-iwork-keynote-sffkey`],[`kfo`,`application/vnd.kde.kformula`],[`kia`,`application/vnd.kidspiration`],[`kml`,`application/vnd.google-earth.kml+xml`],[`kmz`,`application/vnd.google-earth.kmz`],[`kne`,`application/vnd.kinar`],[`knp`,`application/vnd.kinar`],[`kon`,`application/vnd.kde.kontour`],[`kpr`,`application/vnd.kde.kpresenter`],[`kpt`,`application/vnd.kde.kpresenter`],[`kpxx`,`application/vnd.ds-keypoint`],[`ksp`,`application/vnd.kde.kspread`],[`ktr`,`application/vnd.kahootz`],[`ktx`,`image/ktx`],[`ktx2`,`image/ktx2`],[`ktz`,`application/vnd.kahootz`],[`kwd`,`application/vnd.kde.kword`],[`kwt`,`application/vnd.kde.kword`],[`lasxml`,`application/vnd.las.las+xml`],[`latex`,`application/x-latex`],[`lbd`,`application/vnd.llamagraphics.life-balance.desktop`],[`lbe`,`application/vnd.llamagraphics.life-balance.exchange+xml`],[`les`,`application/vnd.hhe.lesson-player`],[`less`,`text/less`],[`lgr`,`application/lgr+xml`],[`lha`,`application/octet-stream`],[`link66`,`application/vnd.route66.link66+xml`],[`list`,`text/plain`],[`list3820`,`application/vnd.ibm.modcap`],[`listafp`,`application/vnd.ibm.modcap`],[`litcoffee`,`text/coffeescript`],[`lnk`,`application/x-ms-shortcut`],[`log`,`text/plain`],[`lostxml`,`application/lost+xml`],[`lrf`,`application/octet-stream`],[`lrm`,`application/vnd.ms-lrm`],[`ltf`,`application/vnd.frogans.ltf`],[`lua`,`text/x-lua`],[`luac`,`application/x-lua-bytecode`],[`lvp`,`audio/vnd.lucent.voice`],[`lwp`,`application/vnd.lotus-wordpro`],[`lzh`,`application/octet-stream`],[`m1v`,`video/mpeg`],[`m2a`,`audio/mpeg`],[`m2v`,`video/mpeg`],[`m3a`,`audio/mpeg`],[`m3u`,`text/plain`],[`m3u8`,`application/vnd.apple.mpegurl`],[`m4a`,`audio/x-m4a`],[`m4p`,`application/mp4`],[`m4s`,`video/iso.segment`],[`m4u`,`application/vnd.mpegurl`],[`m4v`,`video/x-m4v`],[`m13`,`application/x-msmediaview`],[`m14`,`application/x-msmediaview`],[`m21`,`application/mp21`],[`ma`,`application/mathematica`],[`mads`,`application/mads+xml`],[`maei`,`application/mmt-aei+xml`],[`mag`,`application/vnd.ecowin.chart`],[`maker`,`application/vnd.framemaker`],[`man`,`text/troff`],[`manifest`,`text/cache-manifest`],[`map`,`application/json`],[`mar`,`application/octet-stream`],[`markdown`,`text/markdown`],[`mathml`,`application/mathml+xml`],[`mb`,`application/mathematica`],[`mbk`,`application/vnd.mobius.mbk`],[`mbox`,`application/mbox`],[`mc1`,`application/vnd.medcalcdata`],[`mcd`,`application/vnd.mcd`],[`mcurl`,`text/vnd.curl.mcurl`],[`md`,`text/markdown`],[`mdb`,`application/x-msaccess`],[`mdi`,`image/vnd.ms-modi`],[`mdx`,`text/mdx`],[`me`,`text/troff`],[`mesh`,`model/mesh`],[`meta4`,`application/metalink4+xml`],[`metalink`,`application/metalink+xml`],[`mets`,`application/mets+xml`],[`mfm`,`application/vnd.mfmp`],[`mft`,`application/rpki-manifest`],[`mgp`,`application/vnd.osgeo.mapguide.package`],[`mgz`,`application/vnd.proteus.magazine`],[`mid`,`audio/midi`],[`midi`,`audio/midi`],[`mie`,`application/x-mie`],[`mif`,`application/vnd.mif`],[`mime`,`message/rfc822`],[`mj2`,`video/mj2`],[`mjp2`,`video/mj2`],[`mjs`,`application/javascript`],[`mk3d`,`video/x-matroska`],[`mka`,`audio/x-matroska`],[`mkd`,`text/x-markdown`],[`mks`,`video/x-matroska`],[`mkv`,`video/x-matroska`],[`mlp`,`application/vnd.dolby.mlp`],[`mmd`,`application/vnd.chipnuts.karaoke-mmd`],[`mmf`,`application/vnd.smaf`],[`mml`,`text/mathml`],[`mmr`,`image/vnd.fujixerox.edmics-mmr`],[`mng`,`video/x-mng`],[`mny`,`application/x-msmoney`],[`mobi`,`application/x-mobipocket-ebook`],[`mods`,`application/mods+xml`],[`mov`,`video/quicktime`],[`movie`,`video/x-sgi-movie`],[`mp2`,`audio/mpeg`],[`mp2a`,`audio/mpeg`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`mp4a`,`audio/mp4`],[`mp4s`,`application/mp4`],[`mp4v`,`video/mp4`],[`mp21`,`application/mp21`],[`mpc`,`application/vnd.mophun.certificate`],[`mpd`,`application/dash+xml`],[`mpe`,`video/mpeg`],[`mpeg`,`video/mpeg`],[`mpg`,`video/mpeg`],[`mpg4`,`video/mp4`],[`mpga`,`audio/mpeg`],[`mpkg`,`application/vnd.apple.installer+xml`],[`mpm`,`application/vnd.blueice.multipass`],[`mpn`,`application/vnd.mophun.application`],[`mpp`,`application/vnd.ms-project`],[`mpt`,`application/vnd.ms-project`],[`mpy`,`application/vnd.ibm.minipay`],[`mqy`,`application/vnd.mobius.mqy`],[`mrc`,`application/marc`],[`mrcx`,`application/marcxml+xml`],[`ms`,`text/troff`],[`mscml`,`application/mediaservercontrol+xml`],[`mseed`,`application/vnd.fdsn.mseed`],[`mseq`,`application/vnd.mseq`],[`msf`,`application/vnd.epson.msf`],[`msg`,`application/vnd.ms-outlook`],[`msh`,`model/mesh`],[`msi`,`application/x-msdownload`],[`msl`,`application/vnd.mobius.msl`],[`msm`,`application/octet-stream`],[`msp`,`application/octet-stream`],[`msty`,`application/vnd.muvee.style`],[`mtl`,`model/mtl`],[`mts`,`model/vnd.mts`],[`mus`,`application/vnd.musician`],[`musd`,`application/mmt-usd+xml`],[`musicxml`,`application/vnd.recordare.musicxml+xml`],[`mvb`,`application/x-msmediaview`],[`mvt`,`application/vnd.mapbox-vector-tile`],[`mwf`,`application/vnd.mfer`],[`mxf`,`application/mxf`],[`mxl`,`application/vnd.recordare.musicxml`],[`mxmf`,`audio/mobile-xmf`],[`mxml`,`application/xv+xml`],[`mxs`,`application/vnd.triscape.mxs`],[`mxu`,`video/vnd.mpegurl`],[`n-gage`,`application/vnd.nokia.n-gage.symbian.install`],[`n3`,`text/n3`],[`nb`,`application/mathematica`],[`nbp`,`application/vnd.wolfram.player`],[`nc`,`application/x-netcdf`],[`ncx`,`application/x-dtbncx+xml`],[`nfo`,`text/x-nfo`],[`ngdat`,`application/vnd.nokia.n-gage.data`],[`nitf`,`application/vnd.nitf`],[`nlu`,`application/vnd.neurolanguage.nlu`],[`nml`,`application/vnd.enliven`],[`nnd`,`application/vnd.noblenet-directory`],[`nns`,`application/vnd.noblenet-sealer`],[`nnw`,`application/vnd.noblenet-web`],[`npx`,`image/vnd.net-fpx`],[`nq`,`application/n-quads`],[`nsc`,`application/x-conference`],[`nsf`,`application/vnd.lotus-notes`],[`nt`,`application/n-triples`],[`ntf`,`application/vnd.nitf`],[`numbers`,`application/x-iwork-numbers-sffnumbers`],[`nzb`,`application/x-nzb`],[`oa2`,`application/vnd.fujitsu.oasys2`],[`oa3`,`application/vnd.fujitsu.oasys3`],[`oas`,`application/vnd.fujitsu.oasys`],[`obd`,`application/x-msbinder`],[`obgx`,`application/vnd.openblox.game+xml`],[`obj`,`model/obj`],[`oda`,`application/oda`],[`odb`,`application/vnd.oasis.opendocument.database`],[`odc`,`application/vnd.oasis.opendocument.chart`],[`odf`,`application/vnd.oasis.opendocument.formula`],[`odft`,`application/vnd.oasis.opendocument.formula-template`],[`odg`,`application/vnd.oasis.opendocument.graphics`],[`odi`,`application/vnd.oasis.opendocument.image`],[`odm`,`application/vnd.oasis.opendocument.text-master`],[`odp`,`application/vnd.oasis.opendocument.presentation`],[`ods`,`application/vnd.oasis.opendocument.spreadsheet`],[`odt`,`application/vnd.oasis.opendocument.text`],[`oga`,`audio/ogg`],[`ogex`,`model/vnd.opengex`],[`ogg`,`audio/ogg`],[`ogv`,`video/ogg`],[`ogx`,`application/ogg`],[`omdoc`,`application/omdoc+xml`],[`onepkg`,`application/onenote`],[`onetmp`,`application/onenote`],[`onetoc`,`application/onenote`],[`onetoc2`,`application/onenote`],[`opf`,`application/oebps-package+xml`],[`opml`,`text/x-opml`],[`oprc`,`application/vnd.palm`],[`opus`,`audio/ogg`],[`org`,`text/x-org`],[`osf`,`application/vnd.yamaha.openscoreformat`],[`osfpvg`,`application/vnd.yamaha.openscoreformat.osfpvg+xml`],[`osm`,`application/vnd.openstreetmap.data+xml`],[`otc`,`application/vnd.oasis.opendocument.chart-template`],[`otf`,`font/otf`],[`otg`,`application/vnd.oasis.opendocument.graphics-template`],[`oth`,`application/vnd.oasis.opendocument.text-web`],[`oti`,`application/vnd.oasis.opendocument.image-template`],[`otp`,`application/vnd.oasis.opendocument.presentation-template`],[`ots`,`application/vnd.oasis.opendocument.spreadsheet-template`],[`ott`,`application/vnd.oasis.opendocument.text-template`],[`ova`,`application/x-virtualbox-ova`],[`ovf`,`application/x-virtualbox-ovf`],[`owl`,`application/rdf+xml`],[`oxps`,`application/oxps`],[`oxt`,`application/vnd.openofficeorg.extension`],[`p`,`text/x-pascal`],[`p7a`,`application/x-pkcs7-signature`],[`p7b`,`application/x-pkcs7-certificates`],[`p7c`,`application/pkcs7-mime`],[`p7m`,`application/pkcs7-mime`],[`p7r`,`application/x-pkcs7-certreqresp`],[`p7s`,`application/pkcs7-signature`],[`p8`,`application/pkcs8`],[`p10`,`application/x-pkcs10`],[`p12`,`application/x-pkcs12`],[`pac`,`application/x-ns-proxy-autoconfig`],[`pages`,`application/x-iwork-pages-sffpages`],[`pas`,`text/x-pascal`],[`paw`,`application/vnd.pawaafile`],[`pbd`,`application/vnd.powerbuilder6`],[`pbm`,`image/x-portable-bitmap`],[`pcap`,`application/vnd.tcpdump.pcap`],[`pcf`,`application/x-font-pcf`],[`pcl`,`application/vnd.hp-pcl`],[`pclxl`,`application/vnd.hp-pclxl`],[`pct`,`image/x-pict`],[`pcurl`,`application/vnd.curl.pcurl`],[`pcx`,`image/x-pcx`],[`pdb`,`application/x-pilot`],[`pde`,`text/x-processing`],[`pdf`,`application/pdf`],[`pem`,`application/x-x509-user-cert`],[`pfa`,`application/x-font-type1`],[`pfb`,`application/x-font-type1`],[`pfm`,`application/x-font-type1`],[`pfr`,`application/font-tdpfr`],[`pfx`,`application/x-pkcs12`],[`pgm`,`image/x-portable-graymap`],[`pgn`,`application/x-chess-pgn`],[`pgp`,`application/pgp`],[`php`,`application/x-httpd-php`],[`php3`,`application/x-httpd-php`],[`php4`,`application/x-httpd-php`],[`phps`,`application/x-httpd-php-source`],[`phtml`,`application/x-httpd-php`],[`pic`,`image/x-pict`],[`pkg`,`application/octet-stream`],[`pki`,`application/pkixcmp`],[`pkipath`,`application/pkix-pkipath`],[`pkpass`,`application/vnd.apple.pkpass`],[`pl`,`application/x-perl`],[`plb`,`application/vnd.3gpp.pic-bw-large`],[`plc`,`application/vnd.mobius.plc`],[`plf`,`application/vnd.pocketlearn`],[`pls`,`application/pls+xml`],[`pm`,`application/x-perl`],[`pml`,`application/vnd.ctc-posml`],[`png`,`image/png`],[`pnm`,`image/x-portable-anymap`],[`portpkg`,`application/vnd.macports.portpkg`],[`pot`,`application/vnd.ms-powerpoint`],[`potm`,`application/vnd.ms-powerpoint.presentation.macroEnabled.12`],[`potx`,`application/vnd.openxmlformats-officedocument.presentationml.template`],[`ppa`,`application/vnd.ms-powerpoint`],[`ppam`,`application/vnd.ms-powerpoint.addin.macroEnabled.12`],[`ppd`,`application/vnd.cups-ppd`],[`ppm`,`image/x-portable-pixmap`],[`pps`,`application/vnd.ms-powerpoint`],[`ppsm`,`application/vnd.ms-powerpoint.slideshow.macroEnabled.12`],[`ppsx`,`application/vnd.openxmlformats-officedocument.presentationml.slideshow`],[`ppt`,`application/powerpoint`],[`pptm`,`application/vnd.ms-powerpoint.presentation.macroEnabled.12`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`pqa`,`application/vnd.palm`],[`prc`,`application/x-pilot`],[`pre`,`application/vnd.lotus-freelance`],[`prf`,`application/pics-rules`],[`provx`,`application/provenance+xml`],[`ps`,`application/postscript`],[`psb`,`application/vnd.3gpp.pic-bw-small`],[`psd`,`application/x-photoshop`],[`psf`,`application/x-font-linux-psf`],[`pskcxml`,`application/pskc+xml`],[`pti`,`image/prs.pti`],[`ptid`,`application/vnd.pvi.ptid1`],[`pub`,`application/x-mspublisher`],[`pvb`,`application/vnd.3gpp.pic-bw-var`],[`pwn`,`application/vnd.3m.post-it-notes`],[`pya`,`audio/vnd.ms-playready.media.pya`],[`pyv`,`video/vnd.ms-playready.media.pyv`],[`qam`,`application/vnd.epson.quickanime`],[`qbo`,`application/vnd.intu.qbo`],[`qfx`,`application/vnd.intu.qfx`],[`qps`,`application/vnd.publishare-delta-tree`],[`qt`,`video/quicktime`],[`qwd`,`application/vnd.quark.quarkxpress`],[`qwt`,`application/vnd.quark.quarkxpress`],[`qxb`,`application/vnd.quark.quarkxpress`],[`qxd`,`application/vnd.quark.quarkxpress`],[`qxl`,`application/vnd.quark.quarkxpress`],[`qxt`,`application/vnd.quark.quarkxpress`],[`ra`,`audio/x-realaudio`],[`ram`,`audio/x-pn-realaudio`],[`raml`,`application/raml+yaml`],[`rapd`,`application/route-apd+xml`],[`rar`,`application/x-rar`],[`ras`,`image/x-cmu-raster`],[`rcprofile`,`application/vnd.ipunplugged.rcprofile`],[`rdf`,`application/rdf+xml`],[`rdz`,`application/vnd.data-vision.rdz`],[`relo`,`application/p2p-overlay+xml`],[`rep`,`application/vnd.businessobjects`],[`res`,`application/x-dtbresource+xml`],[`rgb`,`image/x-rgb`],[`rif`,`application/reginfo+xml`],[`rip`,`audio/vnd.rip`],[`ris`,`application/x-research-info-systems`],[`rl`,`application/resource-lists+xml`],[`rlc`,`image/vnd.fujixerox.edmics-rlc`],[`rld`,`application/resource-lists-diff+xml`],[`rm`,`audio/x-pn-realaudio`],[`rmi`,`audio/midi`],[`rmp`,`audio/x-pn-realaudio-plugin`],[`rms`,`application/vnd.jcp.javame.midlet-rms`],[`rmvb`,`application/vnd.rn-realmedia-vbr`],[`rnc`,`application/relax-ng-compact-syntax`],[`rng`,`application/xml`],[`roa`,`application/rpki-roa`],[`roff`,`text/troff`],[`rp9`,`application/vnd.cloanto.rp9`],[`rpm`,`audio/x-pn-realaudio-plugin`],[`rpss`,`application/vnd.nokia.radio-presets`],[`rpst`,`application/vnd.nokia.radio-preset`],[`rq`,`application/sparql-query`],[`rs`,`application/rls-services+xml`],[`rsa`,`application/x-pkcs7`],[`rsat`,`application/atsc-rsat+xml`],[`rsd`,`application/rsd+xml`],[`rsheet`,`application/urc-ressheet+xml`],[`rss`,`application/rss+xml`],[`rtf`,`text/rtf`],[`rtx`,`text/richtext`],[`run`,`application/x-makeself`],[`rusd`,`application/route-usd+xml`],[`rv`,`video/vnd.rn-realvideo`],[`s`,`text/x-asm`],[`s3m`,`audio/s3m`],[`saf`,`application/vnd.yamaha.smaf-audio`],[`sass`,`text/x-sass`],[`sbml`,`application/sbml+xml`],[`sc`,`application/vnd.ibm.secure-container`],[`scd`,`application/x-msschedule`],[`scm`,`application/vnd.lotus-screencam`],[`scq`,`application/scvp-cv-request`],[`scs`,`application/scvp-cv-response`],[`scss`,`text/x-scss`],[`scurl`,`text/vnd.curl.scurl`],[`sda`,`application/vnd.stardivision.draw`],[`sdc`,`application/vnd.stardivision.calc`],[`sdd`,`application/vnd.stardivision.impress`],[`sdkd`,`application/vnd.solent.sdkm+xml`],[`sdkm`,`application/vnd.solent.sdkm+xml`],[`sdp`,`application/sdp`],[`sdw`,`application/vnd.stardivision.writer`],[`sea`,`application/octet-stream`],[`see`,`application/vnd.seemail`],[`seed`,`application/vnd.fdsn.seed`],[`sema`,`application/vnd.sema`],[`semd`,`application/vnd.semd`],[`semf`,`application/vnd.semf`],[`senmlx`,`application/senml+xml`],[`sensmlx`,`application/sensml+xml`],[`ser`,`application/java-serialized-object`],[`setpay`,`application/set-payment-initiation`],[`setreg`,`application/set-registration-initiation`],[`sfd-hdstx`,`application/vnd.hydrostatix.sof-data`],[`sfs`,`application/vnd.spotfire.sfs`],[`sfv`,`text/x-sfv`],[`sgi`,`image/sgi`],[`sgl`,`application/vnd.stardivision.writer-global`],[`sgm`,`text/sgml`],[`sgml`,`text/sgml`],[`sh`,`application/x-sh`],[`shar`,`application/x-shar`],[`shex`,`text/shex`],[`shf`,`application/shf+xml`],[`shtml`,`text/html`],[`sid`,`image/x-mrsid-image`],[`sieve`,`application/sieve`],[`sig`,`application/pgp-signature`],[`sil`,`audio/silk`],[`silo`,`model/mesh`],[`sis`,`application/vnd.symbian.install`],[`sisx`,`application/vnd.symbian.install`],[`sit`,`application/x-stuffit`],[`sitx`,`application/x-stuffitx`],[`siv`,`application/sieve`],[`skd`,`application/vnd.koan`],[`skm`,`application/vnd.koan`],[`skp`,`application/vnd.koan`],[`skt`,`application/vnd.koan`],[`sldm`,`application/vnd.ms-powerpoint.slide.macroenabled.12`],[`sldx`,`application/vnd.openxmlformats-officedocument.presentationml.slide`],[`slim`,`text/slim`],[`slm`,`text/slim`],[`sls`,`application/route-s-tsid+xml`],[`slt`,`application/vnd.epson.salt`],[`sm`,`application/vnd.stepmania.stepchart`],[`smf`,`application/vnd.stardivision.math`],[`smi`,`application/smil`],[`smil`,`application/smil`],[`smv`,`video/x-smv`],[`smzip`,`application/vnd.stepmania.package`],[`snd`,`audio/basic`],[`snf`,`application/x-font-snf`],[`so`,`application/octet-stream`],[`spc`,`application/x-pkcs7-certificates`],[`spdx`,`text/spdx`],[`spf`,`application/vnd.yamaha.smaf-phrase`],[`spl`,`application/x-futuresplash`],[`spot`,`text/vnd.in3d.spot`],[`spp`,`application/scvp-vp-response`],[`spq`,`application/scvp-vp-request`],[`spx`,`audio/ogg`],[`sql`,`application/x-sql`],[`src`,`application/x-wais-source`],[`srt`,`application/x-subrip`],[`sru`,`application/sru+xml`],[`srx`,`application/sparql-results+xml`],[`ssdl`,`application/ssdl+xml`],[`sse`,`application/vnd.kodak-descriptor`],[`ssf`,`application/vnd.epson.ssf`],[`ssml`,`application/ssml+xml`],[`sst`,`application/octet-stream`],[`st`,`application/vnd.sailingtracker.track`],[`stc`,`application/vnd.sun.xml.calc.template`],[`std`,`application/vnd.sun.xml.draw.template`],[`stf`,`application/vnd.wt.stf`],[`sti`,`application/vnd.sun.xml.impress.template`],[`stk`,`application/hyperstudio`],[`stl`,`model/stl`],[`stpx`,`model/step+xml`],[`stpxz`,`model/step-xml+zip`],[`stpz`,`model/step+zip`],[`str`,`application/vnd.pg.format`],[`stw`,`application/vnd.sun.xml.writer.template`],[`styl`,`text/stylus`],[`stylus`,`text/stylus`],[`sub`,`text/vnd.dvb.subtitle`],[`sus`,`application/vnd.sus-calendar`],[`susp`,`application/vnd.sus-calendar`],[`sv4cpio`,`application/x-sv4cpio`],[`sv4crc`,`application/x-sv4crc`],[`svc`,`application/vnd.dvb.service`],[`svd`,`application/vnd.svd`],[`svg`,`image/svg+xml`],[`svgz`,`image/svg+xml`],[`swa`,`application/x-director`],[`swf`,`application/x-shockwave-flash`],[`swi`,`application/vnd.aristanetworks.swi`],[`swidtag`,`application/swid+xml`],[`sxc`,`application/vnd.sun.xml.calc`],[`sxd`,`application/vnd.sun.xml.draw`],[`sxg`,`application/vnd.sun.xml.writer.global`],[`sxi`,`application/vnd.sun.xml.impress`],[`sxm`,`application/vnd.sun.xml.math`],[`sxw`,`application/vnd.sun.xml.writer`],[`t`,`text/troff`],[`t3`,`application/x-t3vm-image`],[`t38`,`image/t38`],[`taglet`,`application/vnd.mynfc`],[`tao`,`application/vnd.tao.intent-module-archive`],[`tap`,`image/vnd.tencent.tap`],[`tar`,`application/x-tar`],[`tcap`,`application/vnd.3gpp2.tcap`],[`tcl`,`application/x-tcl`],[`td`,`application/urc-targetdesc+xml`],[`teacher`,`application/vnd.smart.teacher`],[`tei`,`application/tei+xml`],[`teicorpus`,`application/tei+xml`],[`tex`,`application/x-tex`],[`texi`,`application/x-texinfo`],[`texinfo`,`application/x-texinfo`],[`text`,`text/plain`],[`tfi`,`application/thraud+xml`],[`tfm`,`application/x-tex-tfm`],[`tfx`,`image/tiff-fx`],[`tga`,`image/x-tga`],[`tgz`,`application/x-tar`],[`thmx`,`application/vnd.ms-officetheme`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`tk`,`application/x-tcl`],[`tmo`,`application/vnd.tmobile-livetv`],[`toml`,`application/toml`],[`torrent`,`application/x-bittorrent`],[`tpl`,`application/vnd.groove-tool-template`],[`tpt`,`application/vnd.trid.tpt`],[`tr`,`text/troff`],[`tra`,`application/vnd.trueapp`],[`trig`,`application/trig`],[`trm`,`application/x-msterminal`],[`ts`,`video/mp2t`],[`tsd`,`application/timestamped-data`],[`tsv`,`text/tab-separated-values`],[`ttc`,`font/collection`],[`ttf`,`font/ttf`],[`ttl`,`text/turtle`],[`ttml`,`application/ttml+xml`],[`twd`,`application/vnd.simtech-mindmapper`],[`twds`,`application/vnd.simtech-mindmapper`],[`txd`,`application/vnd.genomatix.tuxedo`],[`txf`,`application/vnd.mobius.txf`],[`txt`,`text/plain`],[`u8dsn`,`message/global-delivery-status`],[`u8hdr`,`message/global-headers`],[`u8mdn`,`message/global-disposition-notification`],[`u8msg`,`message/global`],[`u32`,`application/x-authorware-bin`],[`ubj`,`application/ubjson`],[`udeb`,`application/x-debian-package`],[`ufd`,`application/vnd.ufdl`],[`ufdl`,`application/vnd.ufdl`],[`ulx`,`application/x-glulx`],[`umj`,`application/vnd.umajin`],[`unityweb`,`application/vnd.unity`],[`uoml`,`application/vnd.uoml+xml`],[`uri`,`text/uri-list`],[`uris`,`text/uri-list`],[`urls`,`text/uri-list`],[`usdz`,`model/vnd.usdz+zip`],[`ustar`,`application/x-ustar`],[`utz`,`application/vnd.uiq.theme`],[`uu`,`text/x-uuencode`],[`uva`,`audio/vnd.dece.audio`],[`uvd`,`application/vnd.dece.data`],[`uvf`,`application/vnd.dece.data`],[`uvg`,`image/vnd.dece.graphic`],[`uvh`,`video/vnd.dece.hd`],[`uvi`,`image/vnd.dece.graphic`],[`uvm`,`video/vnd.dece.mobile`],[`uvp`,`video/vnd.dece.pd`],[`uvs`,`video/vnd.dece.sd`],[`uvt`,`application/vnd.dece.ttml+xml`],[`uvu`,`video/vnd.uvvu.mp4`],[`uvv`,`video/vnd.dece.video`],[`uvva`,`audio/vnd.dece.audio`],[`uvvd`,`application/vnd.dece.data`],[`uvvf`,`application/vnd.dece.data`],[`uvvg`,`image/vnd.dece.graphic`],[`uvvh`,`video/vnd.dece.hd`],[`uvvi`,`image/vnd.dece.graphic`],[`uvvm`,`video/vnd.dece.mobile`],[`uvvp`,`video/vnd.dece.pd`],[`uvvs`,`video/vnd.dece.sd`],[`uvvt`,`application/vnd.dece.ttml+xml`],[`uvvu`,`video/vnd.uvvu.mp4`],[`uvvv`,`video/vnd.dece.video`],[`uvvx`,`application/vnd.dece.unspecified`],[`uvvz`,`application/vnd.dece.zip`],[`uvx`,`application/vnd.dece.unspecified`],[`uvz`,`application/vnd.dece.zip`],[`vbox`,`application/x-virtualbox-vbox`],[`vbox-extpack`,`application/x-virtualbox-vbox-extpack`],[`vcard`,`text/vcard`],[`vcd`,`application/x-cdlink`],[`vcf`,`text/x-vcard`],[`vcg`,`application/vnd.groove-vcard`],[`vcs`,`text/x-vcalendar`],[`vcx`,`application/vnd.vcx`],[`vdi`,`application/x-virtualbox-vdi`],[`vds`,`model/vnd.sap.vds`],[`vhd`,`application/x-virtualbox-vhd`],[`vis`,`application/vnd.visionary`],[`viv`,`video/vnd.vivo`],[`vlc`,`application/videolan`],[`vmdk`,`application/x-virtualbox-vmdk`],[`vob`,`video/x-ms-vob`],[`vor`,`application/vnd.stardivision.writer`],[`vox`,`application/x-authorware-bin`],[`vrml`,`model/vrml`],[`vsd`,`application/vnd.visio`],[`vsf`,`application/vnd.vsf`],[`vss`,`application/vnd.visio`],[`vst`,`application/vnd.visio`],[`vsw`,`application/vnd.visio`],[`vtf`,`image/vnd.valve.source.texture`],[`vtt`,`text/vtt`],[`vtu`,`model/vnd.vtu`],[`vxml`,`application/voicexml+xml`],[`w3d`,`application/x-director`],[`wad`,`application/x-doom`],[`wadl`,`application/vnd.sun.wadl+xml`],[`war`,`application/java-archive`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`wax`,`audio/x-ms-wax`],[`wbmp`,`image/vnd.wap.wbmp`],[`wbs`,`application/vnd.criticaltools.wbs+xml`],[`wbxml`,`application/wbxml`],[`wcm`,`application/vnd.ms-works`],[`wdb`,`application/vnd.ms-works`],[`wdp`,`image/vnd.ms-photo`],[`weba`,`audio/webm`],[`webapp`,`application/x-web-app-manifest+json`],[`webm`,`video/webm`],[`webmanifest`,`application/manifest+json`],[`webp`,`image/webp`],[`wg`,`application/vnd.pmi.widget`],[`wgt`,`application/widget`],[`wks`,`application/vnd.ms-works`],[`wm`,`video/x-ms-wm`],[`wma`,`audio/x-ms-wma`],[`wmd`,`application/x-ms-wmd`],[`wmf`,`image/wmf`],[`wml`,`text/vnd.wap.wml`],[`wmlc`,`application/wmlc`],[`wmls`,`text/vnd.wap.wmlscript`],[`wmlsc`,`application/vnd.wap.wmlscriptc`],[`wmv`,`video/x-ms-wmv`],[`wmx`,`video/x-ms-wmx`],[`wmz`,`application/x-msmetafile`],[`woff`,`font/woff`],[`woff2`,`font/woff2`],[`word`,`application/msword`],[`wpd`,`application/vnd.wordperfect`],[`wpl`,`application/vnd.ms-wpl`],[`wps`,`application/vnd.ms-works`],[`wqd`,`application/vnd.wqd`],[`wri`,`application/x-mswrite`],[`wrl`,`model/vrml`],[`wsc`,`message/vnd.wfa.wsc`],[`wsdl`,`application/wsdl+xml`],[`wspolicy`,`application/wspolicy+xml`],[`wtb`,`application/vnd.webturbo`],[`wvx`,`video/x-ms-wvx`],[`x3d`,`model/x3d+xml`],[`x3db`,`model/x3d+fastinfoset`],[`x3dbz`,`model/x3d+binary`],[`x3dv`,`model/x3d-vrml`],[`x3dvz`,`model/x3d+vrml`],[`x3dz`,`model/x3d+xml`],[`x32`,`application/x-authorware-bin`],[`x_b`,`model/vnd.parasolid.transmit.binary`],[`x_t`,`model/vnd.parasolid.transmit.text`],[`xaml`,`application/xaml+xml`],[`xap`,`application/x-silverlight-app`],[`xar`,`application/vnd.xara`],[`xav`,`application/xcap-att+xml`],[`xbap`,`application/x-ms-xbap`],[`xbd`,`application/vnd.fujixerox.docuworks.binder`],[`xbm`,`image/x-xbitmap`],[`xca`,`application/xcap-caps+xml`],[`xcs`,`application/calendar+xml`],[`xdf`,`application/xcap-diff+xml`],[`xdm`,`application/vnd.syncml.dm+xml`],[`xdp`,`application/vnd.adobe.xdp+xml`],[`xdssc`,`application/dssc+xml`],[`xdw`,`application/vnd.fujixerox.docuworks`],[`xel`,`application/xcap-el+xml`],[`xenc`,`application/xenc+xml`],[`xer`,`application/patch-ops-error+xml`],[`xfdf`,`application/vnd.adobe.xfdf`],[`xfdl`,`application/vnd.xfdl`],[`xht`,`application/xhtml+xml`],[`xhtml`,`application/xhtml+xml`],[`xhvml`,`application/xv+xml`],[`xif`,`image/vnd.xiff`],[`xl`,`application/excel`],[`xla`,`application/vnd.ms-excel`],[`xlam`,`application/vnd.ms-excel.addin.macroEnabled.12`],[`xlc`,`application/vnd.ms-excel`],[`xlf`,`application/xliff+xml`],[`xlm`,`application/vnd.ms-excel`],[`xls`,`application/vnd.ms-excel`],[`xlsb`,`application/vnd.ms-excel.sheet.binary.macroEnabled.12`],[`xlsm`,`application/vnd.ms-excel.sheet.macroEnabled.12`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xlt`,`application/vnd.ms-excel`],[`xltm`,`application/vnd.ms-excel.template.macroEnabled.12`],[`xltx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.template`],[`xlw`,`application/vnd.ms-excel`],[`xm`,`audio/xm`],[`xml`,`application/xml`],[`xns`,`application/xcap-ns+xml`],[`xo`,`application/vnd.olpc-sugar`],[`xop`,`application/xop+xml`],[`xpi`,`application/x-xpinstall`],[`xpl`,`application/xproc+xml`],[`xpm`,`image/x-xpixmap`],[`xpr`,`application/vnd.is-xpr`],[`xps`,`application/vnd.ms-xpsdocument`],[`xpw`,`application/vnd.intercon.formnet`],[`xpx`,`application/vnd.intercon.formnet`],[`xsd`,`application/xml`],[`xsl`,`application/xml`],[`xslt`,`application/xslt+xml`],[`xsm`,`application/vnd.syncml+xml`],[`xspf`,`application/xspf+xml`],[`xul`,`application/vnd.mozilla.xul+xml`],[`xvm`,`application/xv+xml`],[`xvml`,`application/xv+xml`],[`xwd`,`image/x-xwindowdump`],[`xyz`,`chemical/x-xyz`],[`xz`,`application/x-xz`],[`yaml`,`text/yaml`],[`yang`,`application/yang`],[`yin`,`application/yin+xml`],[`yml`,`text/yaml`],[`ymp`,`text/x-suse-ymp`],[`z`,`application/x-compress`],[`z1`,`application/x-zmachine`],[`z2`,`application/x-zmachine`],[`z3`,`application/x-zmachine`],[`z4`,`application/x-zmachine`],[`z5`,`application/x-zmachine`],[`z6`,`application/x-zmachine`],[`z7`,`application/x-zmachine`],[`z8`,`application/x-zmachine`],[`zaz`,`application/vnd.zzazz.deck+xml`],[`zip`,`application/zip`],[`zir`,`application/vnd.zul`],[`zirz`,`application/vnd.zul`],[`zmm`,`application/vnd.handheld-entertainment+xml`],[`zsh`,`text/x-scriptzsh`]]);function r4(e,t,n){let r=cle(e),{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&i4(r,`path`,a),n!==void 0&&Object.defineProperty(r,`handle`,{value:n,writable:!1,configurable:!1,enumerable:!0}),i4(r,`relativePath`,a),r}function cle(e){let{name:t}=e;if(t&&t.lastIndexOf(`.`)!==-1&&!e.type){let n=t.split(`.`).pop().toLowerCase(),r=sle.get(n);r&&Object.defineProperty(e,`type`,{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}function i4(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var lle=[`.DS_Store`,`Thumbs.db`];function ule(e){return ar(this,void 0,void 0,function*(){return a4(e)&&dle(e.dataTransfer)?hle(e.dataTransfer,e.type):fle(e)?ple(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?mle(e):[]})}function dle(e){return a4(e)}function fle(e){return a4(e)&&a4(e.target)}function a4(e){return typeof e==`object`&&!!e}function ple(e){return s4(e.target.files).map(e=>r4(e))}function mle(e){return ar(this,void 0,void 0,function*(){return(yield Promise.all(e.map(e=>e.getFile()))).map(e=>r4(e))})}function hle(e,t){return ar(this,void 0,void 0,function*(){if(e.items){let n=s4(e.items).filter(e=>e.kind===`file`);return t===`drop`?o4(c4(yield Promise.all(n.map(gle)))):n}return o4(s4(e.files).map(e=>r4(e)))})}function o4(e){return e.filter(e=>lle.indexOf(e.name)===-1)}function s4(e){if(e===null)return[];let t=[];for(let n=0;n<e.length;n++){let r=e[n];t.push(r)}return t}function gle(e){if(typeof e.webkitGetAsEntry!=`function`)return l4(e);let t=e.webkitGetAsEntry();return t&&t.isDirectory?u4(t):l4(e,t)}function c4(e){return e.reduce((e,t)=>[...e,...Array.isArray(t)?c4(t):[t]],[])}function l4(e,t){return ar(this,void 0,void 0,function*(){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`){let t=yield e.getAsFileSystemHandle();if(t===null)throw Error(`${e} is not a File`);if(t!==void 0){let e=yield t.getFile();return e.handle=t,r4(e)}}let n=e.getAsFile();if(!n)throw Error(`${e} is not a File`);return r4(n,t?.fullPath??void 0)})}function _le(e){return ar(this,void 0,void 0,function*(){return e.isDirectory?u4(e):vle(e)})}function u4(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(t=>ar(this,void 0,void 0,function*(){if(t.length){let e=Promise.all(t.map(_le));r.push(e),i()}else try{e(yield Promise.all(r))}catch(e){n(e)}}),e=>{n(e)})}i()})}function vle(e){return ar(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(n=>{t(r4(n,e.fullPath))},e=>{n(e)})})})}var yle=o((e=>{e.__esModule=!0,e.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(`,`);if(n.length===0)return!0;var r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(function(e){var t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}})),d4=l(ole()),f4=l(yle());function p4(e){return Sle(e)||xle(e)||v4(e)||ble()}function ble(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
181
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xle(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Sle(e){if(Array.isArray(e))return y4(e)}function m4(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 h4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?m4(Object(n),!0).forEach(function(t){g4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function g4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _4(e,t){return Tle(e)||wle(e,t)||v4(e,t)||Cle()}function Cle(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
182
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function v4(e,t){if(e){if(typeof e==`string`)return y4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y4(e,t)}}function y4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wle(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function Tle(e){if(Array.isArray(e))return e}var Ele=typeof f4.default==`function`?f4.default:f4.default.default,Dle=`file-invalid-type`,Ole=`file-too-large`,kle=`file-too-small`,Ale=`too-many-files`,jle=function(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:``).split(`,`);return{code:Dle,message:`File type must be ${e.length>1?`one of ${e.join(`, `)}`:e[0]}`}},b4=function(e){return{code:Ole,message:`File is larger than ${e} ${e===1?`byte`:`bytes`}`}},x4=function(e){return{code:kle,message:`File is smaller than ${e} ${e===1?`byte`:`bytes`}`}},Mle={code:Ale,message:`Too many files`};function Nle(e){return e.type===``&&typeof e.getAsFile==`function`}function S4(e,t){var n=e.type===`application/x-moz-file`||Ele(e,t)||Nle(e);return[n,n?null:jle(t)]}function C4(e,t,n){if(w4(e.size)){if(w4(t)&&w4(n)){if(e.size>n)return[!1,b4(n)];if(e.size<t)return[!1,x4(t)]}else if(w4(t)&&e.size<t)return[!1,x4(t)];else if(w4(n)&&e.size>n)return[!1,b4(n)]}return[!0,null]}function w4(e){return e!=null}function Ple(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,a=e.multiple,o=e.maxFiles,s=e.validator;return!a&&t.length>1||a&&o>=1&&t.length>o?!1:t.every(function(e){var t=_4(S4(e,n),1)[0],a=_4(C4(e,r,i),1)[0],o=s?s(e):null;return t&&a&&!o})}function T4(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble===void 0?!1:e.cancelBubble}function E4(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(e){return e===`Files`||e===`application/x-moz-file`}):!!e.target&&!!e.target.files}function D4(e){e.preventDefault()}function Fle(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function Ile(e){return e.indexOf(`Edge/`)!==-1}function Lle(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Fle(e)||Ile(e)}function O4(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.some(function(t){return!T4(e)&&t&&t.apply(void 0,[e].concat(r)),T4(e)})}}function Rle(){return`showOpenFilePicker`in window}function zle(e){return w4(e)?[{description:`Files`,accept:Object.entries(e).filter(function(e){var t=_4(e,2),n=t[0],r=t[1],i=!0;return k4(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),i=!1),(!Array.isArray(r)||!r.every(A4))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),i=!1),i}).reduce(function(e,t){var n=_4(t,2),r=n[0],i=n[1];return h4(h4({},e),{},g4({},r,i))},{})}]:e}function Ble(e){if(w4(e))return Object.entries(e).reduce(function(e,t){var n=_4(t,2),r=n[0],i=n[1];return[].concat(p4(e),[r],p4(i))},[]).filter(function(e){return k4(e)||A4(e)}).join(`,`)}function Vle(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function Hle(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function k4(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function A4(e){return/^.*\.[\w]+$/.test(e)}var Ule=[`children`],Wle=[`open`],Gle=[`refKey`,`role`,`onKeyDown`,`onFocus`,`onBlur`,`onClick`,`onDragEnter`,`onDragOver`,`onDragLeave`,`onDrop`],Kle=[`refKey`,`onChange`,`onClick`];function j4(e){return Yle(e)||Jle(e)||N4(e)||qle()}function qle(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
183
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jle(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Yle(e){if(Array.isArray(e))return P4(e)}function M4(e,t){return Qle(e)||Zle(e,t)||N4(e,t)||Xle()}function Xle(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
184
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N4(e,t){if(e){if(typeof e==`string`)return P4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P4(e,t)}}function P4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zle(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function Qle(e){if(Array.isArray(e))return e}function F4(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 I4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?F4(Object(n),!0).forEach(function(t){L4(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F4(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function L4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R4(e,t){if(e==null)return{};var n=$le(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 $le(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var z4=(0,d.forwardRef)(function(e,t){var n=e.children,r=H4(R4(e,Ule)),i=r.open,a=R4(r,Wle);return(0,d.useImperativeHandle)(t,function(){return{open:i}},[i]),d.default.createElement(d.Fragment,null,n(I4(I4({},a),{},{open:i})))});z4.displayName=`Dropzone`;var B4={disabled:!1,getFilesFromEvent:ule,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};z4.defaultProps=B4,z4.propTypes={children:d4.default.func,accept:d4.default.objectOf(d4.default.arrayOf(d4.default.string)),multiple:d4.default.bool,preventDropOnDocument:d4.default.bool,noClick:d4.default.bool,noKeyboard:d4.default.bool,noDrag:d4.default.bool,noDragEventsBubbling:d4.default.bool,minSize:d4.default.number,maxSize:d4.default.number,maxFiles:d4.default.number,disabled:d4.default.bool,getFilesFromEvent:d4.default.func,onFileDialogCancel:d4.default.func,onFileDialogOpen:d4.default.func,useFsAccessApi:d4.default.bool,autoFocus:d4.default.bool,onDragEnter:d4.default.func,onDragLeave:d4.default.func,onDragOver:d4.default.func,onDrop:d4.default.func,onDropAccepted:d4.default.func,onDropRejected:d4.default.func,onError:d4.default.func,validator:d4.default.func};var V4={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragGlobal:!1,acceptedFiles:[],fileRejections:[]};function H4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=I4(I4({},B4),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,a=t.maxSize,o=t.minSize,s=t.multiple,c=t.maxFiles,l=t.onDragEnter,u=t.onDragLeave,f=t.onDragOver,p=t.onDrop,m=t.onDropAccepted,h=t.onDropRejected,g=t.onFileDialogCancel,_=t.onFileDialogOpen,v=t.useFsAccessApi,y=t.autoFocus,b=t.preventDropOnDocument,x=t.noClick,S=t.noKeyboard,C=t.noDrag,w=t.noDragEventsBubbling,T=t.onError,E=t.validator,D=(0,d.useMemo)(function(){return Ble(n)},[n]),O=(0,d.useMemo)(function(){return zle(n)},[n]),k=(0,d.useMemo)(function(){return typeof _==`function`?_:U4},[_]),A=(0,d.useMemo)(function(){return typeof g==`function`?g:U4},[g]),j=(0,d.useRef)(null),M=(0,d.useRef)(null),N=M4((0,d.useReducer)(eue,V4),2),ee=N[0],P=N[1],F=ee.isFocused,I=ee.isFileDialogActive,L=(0,d.useRef)(typeof window<`u`&&window.isSecureContext&&v&&Rle()),te=function(){!L.current&&I&&setTimeout(function(){M.current&&(M.current.files.length||(P({type:`closeDialog`}),A()))},300)};(0,d.useEffect)(function(){return window.addEventListener(`focus`,te,!1),function(){window.removeEventListener(`focus`,te,!1)}},[M,I,A,L]);var ne=(0,d.useRef)([]),re=(0,d.useRef)([]),ie=function(e){j.current&&j.current.contains(e.target)||(e.preventDefault(),ne.current=[])};(0,d.useEffect)(function(){return b&&(document.addEventListener(`dragover`,D4,!1),document.addEventListener(`drop`,ie,!1)),function(){b&&(document.removeEventListener(`dragover`,D4),document.removeEventListener(`drop`,ie))}},[j,b]),(0,d.useEffect)(function(){var e=function(e){re.current=[].concat(j4(re.current),[e.target]),E4(e)&&P({isDragGlobal:!0,type:`setDragGlobal`})},t=function(e){re.current=re.current.filter(function(t){return t!==e.target&&t!==null}),!(re.current.length>0)&&P({isDragGlobal:!1,type:`setDragGlobal`})},n=function(){re.current=[],P({isDragGlobal:!1,type:`setDragGlobal`})},r=function(){re.current=[],P({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),function(){document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[j]),(0,d.useEffect)(function(){return!r&&y&&j.current&&j.current.focus(),function(){}},[j,y,r]);var ae=(0,d.useCallback)(function(e){T?T(e):console.error(e)},[T]),oe=(0,d.useCallback)(function(e){e.preventDefault(),e.persist(),ye(e),ne.current=[].concat(j4(ne.current),[e.target]),E4(e)&&Promise.resolve(i(e)).then(function(t){if(!(T4(e)&&!w)){var n=t.length,r=n>0&&Ple({files:t,accept:D,minSize:o,maxSize:a,multiple:s,maxFiles:c,validator:E});P({isDragAccept:r,isDragReject:n>0&&!r,isDragActive:!0,type:`setDraggedFiles`}),l&&l(e)}}).catch(function(e){return ae(e)})},[i,l,ae,w,D,o,a,s,c,E]),se=(0,d.useCallback)(function(e){e.preventDefault(),e.persist(),ye(e);var t=E4(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&f&&f(e),!1},[f,w]),ce=(0,d.useCallback)(function(e){e.preventDefault(),e.persist(),ye(e);var t=ne.current.filter(function(e){return j.current&&j.current.contains(e)}),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),ne.current=t,!(t.length>0)&&(P({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1}),E4(e)&&u&&u(e))},[j,u,w]),le=(0,d.useCallback)(function(e,t){var n=[],r=[];e.forEach(function(e){var t=M4(S4(e,D),2),i=t[0],s=t[1],c=M4(C4(e,o,a),2),l=c[0],u=c[1],d=E?E(e):null;if(i&&l&&!d)n.push(e);else{var f=[s,u];d&&(f=f.concat(d)),r.push({file:e,errors:f.filter(function(e){return e})})}}),(!s&&n.length>1||s&&c>=1&&n.length>c)&&(n.forEach(function(e){r.push({file:e,errors:[Mle]})}),n.splice(0)),P({acceptedFiles:n,fileRejections:r,type:`setFiles`}),p&&p(n,r,t),r.length>0&&h&&h(r,t),n.length>0&&m&&m(n,t)},[P,s,D,o,a,c,p,m,h,E]),ue=(0,d.useCallback)(function(e){e.preventDefault(),e.persist(),ye(e),ne.current=[],E4(e)&&Promise.resolve(i(e)).then(function(t){T4(e)&&!w||le(t,e)}).catch(function(e){return ae(e)}),P({type:`reset`})},[i,le,ae,w]),de=(0,d.useCallback)(function(){if(L.current){P({type:`openDialog`}),k();var e={multiple:s,types:O};window.showOpenFilePicker(e).then(function(e){return i(e)}).then(function(e){le(e,null),P({type:`closeDialog`})}).catch(function(e){Vle(e)?(A(e),P({type:`closeDialog`})):Hle(e)?(L.current=!1,M.current?(M.current.value=null,M.current.click()):ae(Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):ae(e)});return}M.current&&(P({type:`openDialog`}),k(),M.current.value=null,M.current.click())},[P,k,A,v,le,ae,O,s]),fe=(0,d.useCallback)(function(e){!j.current||!j.current.isEqualNode(e.target)||(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),de())},[j,de]),pe=(0,d.useCallback)(function(){P({type:`focus`})},[]),me=(0,d.useCallback)(function(){P({type:`blur`})},[]),he=(0,d.useCallback)(function(){x||(Lle()?setTimeout(de,0):de())},[x,de]),ge=function(e){return r?null:e},_e=function(e){return S?null:ge(e)},ve=function(e){return C?null:ge(e)},ye=function(e){w&&e.stopPropagation()},be=(0,d.useMemo)(function(){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.refKey,n=t===void 0?`ref`:t,i=e.role,a=e.onKeyDown,o=e.onFocus,s=e.onBlur,c=e.onClick,l=e.onDragEnter,u=e.onDragOver,d=e.onDragLeave,f=e.onDrop,p=R4(e,Gle);return I4(I4(L4({onKeyDown:_e(O4(a,fe)),onFocus:_e(O4(o,pe)),onBlur:_e(O4(s,me)),onClick:ge(O4(c,he)),onDragEnter:ve(O4(l,oe)),onDragOver:ve(O4(u,se)),onDragLeave:ve(O4(d,ce)),onDrop:ve(O4(f,ue)),role:typeof i==`string`&&i!==``?i:`presentation`},n,j),!r&&!S?{tabIndex:0}:{}),p)}},[j,fe,pe,me,he,oe,se,ce,ue,S,C,r]),xe=(0,d.useCallback)(function(e){e.stopPropagation()},[]),Se=(0,d.useMemo)(function(){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.refKey,n=t===void 0?`ref`:t,r=e.onChange,i=e.onClick,a=R4(e,Kle);return I4(I4({},L4({accept:D,multiple:s,type:`file`,style:{border:0,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`0 -1px -1px 0`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`},onChange:ge(O4(r,ue)),onClick:ge(O4(i,xe)),tabIndex:-1},n,M)),a)}},[M,n,s,ue,r]);return I4(I4({},ee),{},{isFocused:F&&!r,getRootProps:be,getInputProps:Se,rootRef:j,inputRef:M,open:ge(de)})}function eue(e,t){switch(t.type){case`focus`:return I4(I4({},e),{},{isFocused:!0});case`blur`:return I4(I4({},e),{},{isFocused:!1});case`openDialog`:return I4(I4({},V4),{},{isFileDialogActive:!0});case`closeDialog`:return I4(I4({},e),{},{isFileDialogActive:!1});case`setDraggedFiles`:return I4(I4({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case`setFiles`:return I4(I4({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:!1});case`setDragGlobal`:return I4(I4({},e),{},{isDragGlobal:t.isDragGlobal});case`reset`:return I4({},V4);default:return e}}function U4(){}var tue={upload:`Click to pick file`,drag:`or drag and drop`,active:`Drop files here`,reject:`Some files are not allowed`,rejectInvalidType:`One or more files have an invalid type.`,rejectTooLarge:`One or more files exceed the maximum size.`,rejectTooSmall:`One or more files are below the minimum size.`,rejectTooMany:`Too many files selected.`,selectedCount:`{{count}} files selected`};function nue(e,t){return e.replace(/\{\{\s*count\s*\}\}|\{count\}/g,String(t))}function W4({id:e,name:t,label:n,description:r,error:i,accept:a,multiple:o=!1,disabled:s=!1,required:c=!1,maxFiles:l,maxSize:u,minSize:f,icon:p,className:h,labelClassName:g,contentClassName:_,descriptionClassName:v,errorClassName:y,dropzoneClassName:b,labels:x,onChange:S,onDropRejected:C,...w}){let T={...tue,...x},E=r?`${e}-description`:void 0,D=(0,d.useEffectEvent)(e=>{S?.(e)}),{acceptedFiles:O,fileRejections:k,getRootProps:A,getInputProps:j,isDragActive:M,isDragReject:N,isFocused:ee}=H4({accept:a,multiple:o,disabled:s,maxFiles:l,maxSize:u,minSize:f,onDropRejected:(0,d.useCallback)(e=>{C?.(e)},[C])}),P=(0,d.useMemo)(()=>{if(k.length===0)return[];let e=new Set(k.flatMap(e=>e.errors.map(e=>e.code))),t=[];return e.has(`file-invalid-type`)&&t.push(T.rejectInvalidType),e.has(`file-too-large`)&&t.push(T.rejectTooLarge),e.has(`file-too-small`)&&t.push(T.rejectTooSmall),e.has(`too-many-files`)&&t.push(T.rejectTooMany),t.length===0&&t.push(T.reject),t},[k,T.reject,T.rejectInvalidType,T.rejectTooLarge,T.rejectTooSmall,T.rejectTooMany]),F=!!i||P.length>0,I=F?`${e}-error`:void 0,L=[E,I].filter(Boolean).join(` `)||void 0;(0,d.useEffect)(()=>{D(O)},[O]);let te=nue(T.selectedCount,O.length);return(0,m.jsxs)(ZT,{"data-component":`filepicker-dropzone`,"data-disabled":s?!0:void 0,"data-invalid":F?!0:void 0,className:z(h),...w,children:[n&&(0,m.jsx)($T,{htmlFor:e,className:g,children:n}),(0,m.jsxs)(QT,{className:_,children:[r&&(0,m.jsx)(tE,{id:E,className:v,children:r}),(0,m.jsxs)(`div`,{...A({className:z(`dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 relative rounded-lg border border-dashed bg-transparent p-4 transition-colors outline-none focus-visible:ring-3 aria-invalid:ring-3`,s?`bg-input/50 dark:bg-input/80 pointer-events-none cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-muted/30`,M&&`border-primary bg-primary/5`,N&&`border-destructive/60 bg-destructive/5`,ee&&`border-ring ring-ring/50 ring-3`,b),"aria-invalid":F?!0:void 0}),children:[(0,m.jsx)(`input`,{...j({id:e,name:t,required:c,"aria-describedby":L,"aria-invalid":F?!0:void 0})}),(0,m.jsxs)(`div`,{className:`flex min-h-14 flex-col items-center justify-center gap-2 text-center`,children:[(0,m.jsx)(`span`,{className:z(`text-muted-foreground`,M&&`text-primary`,N&&`text-destructive`),"aria-hidden":`true`,children:p??(0,m.jsx)(Rw,{className:`size-6`})}),(0,m.jsxs)(`p`,{className:`text-sm`,children:[N&&(0,m.jsx)(`span`,{className:`text-destructive font-medium`,children:T.reject}),!N&&M&&(0,m.jsx)(`span`,{className:`text-primary font-medium`,children:T.active}),!N&&!M&&O.length>0&&(0,m.jsx)(`span`,{className:`font-medium`,children:te}),!N&&!M&&O.length===0&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`text-foreground font-medium`,children:T.upload}),` `,(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:T.drag})]})]})]})]}),i?(0,m.jsx)(nE,{id:I,className:y,children:i}):P.length>0?(0,m.jsx)(nE,{id:I,className:y,errors:P.map(e=>({message:e}))}):null]})]})}function G4({...e}){return(0,m.jsx)(wte,{"data-slot":`select`,...e})}function K4({className:e,...t}){return(0,m.jsx)(Hte,{"data-slot":`select-group`,className:z(`scroll-my-1 p-1`,e),...t})}function q4({...e}){return(0,m.jsx)(Ote,{"data-slot":`select-value`,...e})}function J4({className:e,size:t=`default`,children:n,...r}){return(0,m.jsxs)(Ete,{"data-slot":`select-trigger`,"data-size":t,className:z(`flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,m.jsx)(kte,{asChild:!0,children:(0,m.jsx)(vw,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Y4({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,m.jsx)(Mte,{children:(0,m.jsxs)(Nte,{"data-slot":`select-content`,"data-align-trigger":n===`item-aligned`,className:z(`relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,m.jsx)(rue,{}),(0,m.jsx)(zte,{"data-position":n,className:z(`data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)`,n===`popper`&&``),children:t}),(0,m.jsx)(iue,{})]})})}function X4({className:e,children:t,...n}){return(0,m.jsxs)(Wte,{"data-slot":`select-item`,className:z(`relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,m.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`,children:(0,m.jsx)(qte,{children:(0,m.jsx)(_w,{className:`pointer-events-none`})})}),(0,m.jsx)(Gte,{children:t})]})}function rue({className:e,...t}){return(0,m.jsx)(Jte,{"data-slot":`select-scroll-up-button`,className:z(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,m.jsx)(xw,{})})}function iue({className:e,...t}){return(0,m.jsx)(Yte,{"data-slot":`select-scroll-down-button`,className:z(`z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,m.jsx)(vw,{})})}var aue=je(`group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,"icon-sm":`size-[30px] rounded-[min(var(--radius-md),12px)] p-0 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}}),Z4=d.createContext({size:`default`,variant:`default`,spacing:0,orientation:`horizontal`});function Q4({className:e,variant:t,size:n,spacing:r=0,orientation:i=`horizontal`,children:a,...o}){return(0,m.jsx)(em,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:z(`group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch`,e),...o,children:(0,m.jsx)(Z4.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function $4({className:e,children:t,variant:n=`default`,size:r=`default`,...i}){let a=d.useContext(Z4);return(0,m.jsx)(lm,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:z(`shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,aue({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}function e3({className:e,...t}){return(0,m.jsx)(`textarea`,{"data-slot":`textarea`,className:z(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function t3(e){return e>0?`asset`:`url`}function oue(e){return e===`center`?`center`:e===`right`||e===`end`?`right`:`left`}function sue(e){return e}function n3(e){return e?{value:String(e.value),unit:e.unit}:{value:``,unit:`px`}}function r3(e,t){let n=e.trim();if(n.length===0)return;let r=Number(n);if(!(!Number.isFinite(r)||r<0))return{unit:t,value:r}}function cue(e,t,n,r){let i=r3(e,t),a=r3(n,r);if(!(!i&&!a))return{...i?{width:i}:{},...a?{maxWidth:a}:{}}}function lue({editable:e,enabled:t}){let[n]=Y$(),{imageAssets:r=[],registerImageAsset:i,resolveImageAssetUrl:a}=K$(),o=J(`common.actions`),s=J(`defaultEditors.assetManager`),c=J(`defaultEditors.imagePopover`),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(()=>t3(r.length)),[h,g]=(0,d.useState)(``),[_,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)(``),[C,w]=(0,d.useState)(`center`),[T,E]=(0,d.useState)(``),[D,O]=(0,d.useState)(`px`),[k,A]=(0,d.useState)(``),[j,M]=(0,d.useState)(`%`),[N,ee]=(0,d.useState)(null),[P,F]=(0,d.useState)(!1),[I,L]=(0,d.useState)(0),[te,ne]=(0,d.useState)(!1),re=(0,d.useRef)(null),ie=(0,d.useCallback)(()=>{u(null),p(t3(r.length)),g(``),v(``),b(``),S(``),w(`center`),E(``),O(`px`),A(``),M(`%`),ee(null),F(!1),L(e=>e+1),ne(!1)},[r.length]),ae=(0,d.useEffectEvent)(e=>n.read(()=>{let t=oq(e);if(!a1(t))return null;let n=t.getSource(),r=n3(t.getSize()?.width),i=n3(t.getSize()?.maxWidth);return{source:n,alt:t.getAlt()??``,caption:t.getCaption(),align:oue(t.getFormat()),widthValue:r.value,widthUnit:r.unit,maxWidthValue:i.value,maxWidthUnit:i.unit}})),oe=(0,d.useEffectEvent)(e=>{let t=ae(e);if(!t){ie();return}p(t.source.type===`asset`?`asset`:t.source.url.trim().length>0?`url`:t3(r.length)),t.source.type===`asset`?(g(t.source.assetId),v(``)):(v(t.source.url),g(r[0]?.assetId??``)),b(t.alt),S(t.caption),w(t.align),E(t.widthValue),O(t.widthUnit),A(t.maxWidthValue),M(t.maxWidthUnit),ee(null),ne(!1),u(e)}),se=(0,d.useEffectEvent)(()=>{l&&(ae(l)||ie())});(0,d.useEffect)(()=>{if(!(!e||!t))return SX(n.registerCommand(Z$,e=>(window.requestAnimationFrame(()=>{oe(e)}),!0),0),n.registerUpdateListener(()=>{se()}))},[e,n,t]);let ce=()=>{if(f===`url`){let e=_.trim();return e.length===0?null:{type:`external`,url:e}}let e=h.trim();return e.length===0?null:{type:`asset`,assetId:e}},le=()=>{if(!l)return;let e=ce();if(!e)return;let t=cue(T,D,k,j);n.dispatchCommand(Q$,{key:l,source:e,alt:y,caption:x,size:t,format:sue(C)}),ie()},ue=async e=>{let t=e[0];if(!(!t||!i)){F(!0),ee(null);try{g(await i(t)),p(`asset`),ne(!1)}catch{ee(c(`uploadFailed`))}finally{F(!1),L(e=>e+1)}}},de=ce()!==null,fe=e=>c(e===`px`?`unitPx`:`unitPercent`);return(0,m.jsx)(aO,{open:l!==null,onOpenChange:e=>{e||ie()},children:(0,m.jsxs)(uO,{showCloseButton:!0,closeLabel:o(`close`),className:z(`flex max-h-[min(90vh,40rem)] w-[min(26rem,calc(100vw-2rem))] max-w-none flex-col gap-0 overflow-hidden p-0 sm:max-w-none`,te?`z-50`:`z-60`),onOpenAutoFocus:e=>{f===`url`&&(e.preventDefault(),re.current?.focus())},children:[(0,m.jsx)(dO,{className:`shrink-0 border-b border-border/80 px-4 py-3 text-left`,children:(0,m.jsx)(pO,{className:`text-base`,children:c(`dialogTitle`)})}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c(`sourceDescription`)}),(0,m.jsxs)(YE,{value:f,onValueChange:e=>p(e),children:[(0,m.jsx)(`div`,{className:`flex justify-center`,children:(0,m.jsxs)(XE,{className:`w-full rounded-full`,children:[(0,m.jsx)(ZE,{value:`asset`,className:`text-xs rounded-full`,children:c(`tabLocalAsset`)}),(0,m.jsx)(ZE,{value:`url`,className:`text-xs rounded-full`,children:c(`tabExternalUrl`)})]})}),(0,m.jsxs)(`div`,{className:`min-h-26`,children:[(0,m.jsxs)(QE,{value:`asset`,className:`m-0 focus-visible:ring-0`,children:[(0,m.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border/80`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border/80 bg-muted/30 ps-2`,children:[(0,m.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:s(`existingAssets`)}),(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`shrink-0`,disabled:!i,"aria-label":c(`addLocalAsset`),onClick:()=>{ee(null),ne(!0)},children:(0,m.jsx)(yT,{className:`size-4`})})]}),r.length===0?(0,m.jsx)(`p`,{className:`px-3 py-6 text-center text-xs text-muted-foreground`,children:s(`empty`)}):(0,m.jsx)(`ul`,{className:`max-h-46 divide-y divide-border/60 overflow-y-auto`,role:`listbox`,"aria-label":s(`existingAssets`),children:r.map((e,t)=>{let n=h===e.assetId,i=e.previewUrl??a?.(e.assetId),o=t===r.length-1;return(0,m.jsx)(`li`,{role:`presentation`,children:(0,m.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n,className:z(`flex w-full items-center gap-2 px-2 py-2 text-left text-sm transition-colors`,n?`bg-muted/80 ring-1 ring-inset ring-primary/40`:`hover:bg-muted/50`,o&&`rounded-b-lg`),onClick:()=>g(e.assetId),children:[(0,m.jsx)(`div`,{className:`relative size-10 shrink-0 overflow-hidden rounded-md border border-border/80 bg-muted`,children:i?(0,m.jsx)(`img`,{src:i,alt:``,className:`size-full object-cover`}):(0,m.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,m.jsx)(Zw,{className:`size-4`})})}),(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.label}),n?(0,m.jsx)(_w,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}):null]})},e.assetId)})})]}),(0,m.jsx)(aO,{open:te,onOpenChange:ne,children:(0,m.jsxs)(uO,{showCloseButton:!0,closeLabel:o(`close`),className:`z-60 w-[min(22rem,calc(100vw-2rem))] max-w-none sm:max-w-none`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,m.jsx)(dO,{children:(0,m.jsx)(pO,{className:`text-base`,children:c(`uploadAssetDialogTitle`)})}),(0,m.jsx)(W4,{id:`rich-text-image-upload`,accept:{"image/*":[]},multiple:!1,disabled:P,description:P?c(`uploading`):void 0,error:N??void 0,className:`gap-2`,contentClassName:`gap-2 p-0`,dropzoneClassName:`min-h-[5.5rem] py-3`,labels:{upload:s(`uploadLabel`),drag:s(`uploadDescription`),active:s(`uploadActive`)},onChange:e=>{ue(e)}},I)]})})]}),(0,m.jsxs)(QE,{value:`url`,className:`m-0 h-full min-h-0 space-y-2 focus-visible:ring-0`,children:[(0,m.jsx)(Og,{className:`text-xs text-muted-foreground`,children:c(`urlLabel`)}),(0,m.jsx)(Dg,{ref:re,value:_,placeholder:s(`externalPlaceholder`),onChange:e=>v(e.target.value)})]})]})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,m.jsx)(Og,{className:`text-xs text-muted-foreground`,children:c(`widthLabel`)}),(0,m.jsxs)(`div`,{className:`flex gap-1`,children:[(0,m.jsx)(Dg,{className:`min-w-0 flex-1 h-7`,inputMode:`decimal`,value:T,onChange:e=>E(e.target.value)}),(0,m.jsxs)(G4,{value:D,onValueChange:e=>O(e),children:[(0,m.jsx)(J4,{className:`w-fit shrink-0 rounded-lg!`,size:`sm`,children:(0,m.jsx)(q4,{})}),(0,m.jsxs)(Y4,{className:`z-70`,children:[(0,m.jsx)(X4,{value:`px`,children:fe(`px`)}),(0,m.jsx)(X4,{value:`%`,children:fe(`%`)})]})]})]})]}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,m.jsx)(Og,{className:`text-xs text-muted-foreground`,children:c(`maxWidthLabel`)}),(0,m.jsxs)(`div`,{className:`flex gap-1`,children:[(0,m.jsx)(Dg,{className:`min-w-0 flex-1 h-7`,inputMode:`decimal`,value:k,onChange:e=>A(e.target.value)}),(0,m.jsxs)(G4,{value:j,onValueChange:e=>M(e),children:[(0,m.jsx)(J4,{className:`w-fit shrink-0 rounded-lg!`,size:`sm`,children:(0,m.jsx)(q4,{})}),(0,m.jsxs)(Y4,{className:`z-70`,children:[(0,m.jsx)(X4,{value:`px`,children:fe(`px`)}),(0,m.jsx)(X4,{value:`%`,children:fe(`%`)})]})]})]})]}),(0,m.jsxs)(`div`,{className:`space-y-1 sm:w-auto sm:shrink-0`,children:[(0,m.jsx)(Og,{className:`text-xs text-muted-foreground`,children:c(`alignmentLabel`)}),(0,m.jsxs)(Q4,{type:`single`,value:C,variant:`outline`,size:`sm`,spacing:0,className:`w-full sm:w-fit`,onValueChange:e=>{e&&w(e)},children:[(0,m.jsx)($4,{value:`left`,className:`min-w-0 flex-1 sm:flex-none`,"aria-label":c(`alignLeft`),title:c(`alignLeft`),children:(0,m.jsx)(FT,{className:`size-4`})}),(0,m.jsx)($4,{value:`center`,className:`min-w-0 flex-1 sm:flex-none`,"aria-label":c(`alignCenter`),title:c(`alignCenter`),children:(0,m.jsx)(MT,{className:`size-4`})}),(0,m.jsx)($4,{value:`right`,className:`min-w-0 flex-1 sm:flex-none`,"aria-label":c(`alignRight`),title:c(`alignRight`),children:(0,m.jsx)(PT,{className:`size-4`})})]})]})]}),(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(Og,{className:`text-xs text-muted-foreground`,children:c(`altLabel`)}),(0,m.jsx)(Dg,{value:y,placeholder:c(`altPlaceholder`),onChange:e=>b(e.target.value)})]}),(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(Og,{className:`text-xs text-muted-foreground`,children:c(`captionLabel`)}),(0,m.jsx)(e3,{value:x,placeholder:c(`captionPlaceholder`),rows:2,onChange:e=>S(e.target.value)})]})]})}),(0,m.jsxs)(fO,{className:`mx-0 mb-0 mt-0 shrink-0 rounded-b-xl border-t border-border/80 bg-muted/50 px-4 py-3 sm:flex-row sm:justify-end`,children:[(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,onClick:ie,children:o(`cancel`)}),(0,m.jsx)(B,{type:`button`,size:`sm`,disabled:!de,onClick:le,children:c(`apply`)})]})]})})}function uue(){let[e]=Y$(),{imageAssetDeletion:t}=K$(),n=Mg(),r=J(`defaultEditors.imagePopover`);return(0,d.useEffect)(()=>{if(!t)return;let i=t=>e.getEditorState().read(()=>{let e=n=>{if(a1(n)){let e=n.getSource();return e.type===`asset`&&e.assetId===t}return n instanceof oK?n.getChildren().some(e):!1};return pq().getChildren().some(e)});return e.registerMutationListener(r1,(e,{updateTags:a,prevEditorState:o})=>{if(!a.has(`rich-text-editor-sync-from-value`))for(let[a,s]of e){if(s!==`destroyed`)continue;let e=o.read(()=>{let e=oq(a);return a1(e)?e.getSource():null});if(!e||e.type!==`asset`)continue;let{assetId:c}=e;t.getUsageCount(c)===1&&queueMicrotask(()=>{n({title:r(`deleteAssetConfirmTitle`),description:r(`deleteAssetConfirmDescription`),confirmButtonText:r(`deleteAssetConfirmPrimary`),cancelButtonText:r(`deleteAssetKeepFile`),variant:`destructive`}).then(e=>{!e||i(c)||t.removeAsset(c)}).catch(e=>{console.error(`Failed to confirm image asset deletion:`,e)})})}})},[e,t,n,r]),null}function due({editable:e,enabled:t,surfaceRef:n}){let[r]=Y$(),i=J(`common.actions`),a=J(`defaultEditors.infoBoxPopover`),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(`info`),[u,f]=(0,d.useState)(``),[p,h]=(0,d.useState)(``),[g,_]=(0,d.useState)(!0),[v,y]=(0,d.useState)(!0),b=(0,d.useRef)(null),x=(0,d.useCallback)(()=>{s(null),f(``),h(``),_(!0),y(!0),l(`info`)},[]),S=(0,d.useEffectEvent)(e=>r.read(()=>{let t=oq(e),i=n.current,a=r.getElementByKey(e);if(!p1(t)||!i||!a)return null;let o=a.getBoundingClientRect(),s=i.getBoundingClientRect(),c=o.top-s.top>220;return{tone:t.getTone()===`warning`?`warning`:`info`,title:t.getTitle(),content:t.getContent(),collapsible:t.getCollapsible(),defaultOpen:t.getDefaultOpen(),left:o.left-s.left+o.width/2,top:c?o.top-s.top:o.bottom-s.top,side:c?`top`:`bottom`}})),C=(0,d.useEffectEvent)(e=>{let t=S(e);if(!t){x();return}l(t.tone),f(t.title),h(t.content),_(t.collapsible),y(t.defaultOpen),s({key:e,left:t.left,top:t.top,side:t.side})}),w=(0,d.useEffectEvent)(()=>{if(!o)return;let e=S(o.key);if(!e){x();return}o.left===e.left&&o.top===e.top&&o.side===e.side||s({...o,left:e.left,top:e.top,side:e.side})});(0,d.useEffect)(()=>{if(!(!e||!t))return SX(r.registerCommand(s1,e=>(window.requestAnimationFrame(()=>{C(e)}),!0),0),r.registerUpdateListener(()=>{w()}))},[e,r,t]),(0,d.useEffect)(()=>{if(!o)return;let e=()=>{w()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[o]);let T=()=>{o&&(r.dispatchCommand(c1,{key:o.key,tone:c,title:u,content:p,collapsible:g,defaultOpen:v}),x())};return(0,m.jsxs)(zD,{open:o!==null,onOpenChange:e=>{e||x()},children:[o?(0,m.jsx)(HD,{asChild:!0,children:(0,m.jsx)(`div`,{className:`pointer-events-none absolute size-0`,style:{left:o.left,top:o.top}})}):null,(0,m.jsx)(VD,{side:o?.side??`bottom`,align:`center`,sideOffset:12,collisionPadding:12,className:`z-60 w-80 border border-border`,onOpenAutoFocus:e=>{e.preventDefault(),b.current?.focus(),b.current?.select()},onCloseAutoFocus:e=>{e.preventDefault()},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),T()):e.key===`Escape`&&(e.preventDefault(),x())},children:(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`span`,{className:`block text-xs font-medium text-muted-foreground`,children:a(`typeLabel`)}),(0,m.jsxs)(`div`,{className:`flex gap-2`,children:[(0,m.jsx)(B,{type:`button`,size:`sm`,variant:c===`info`?`default`:`outline`,className:`flex-1`,onClick:()=>{l(`info`)},children:a(`toneInfo`)}),(0,m.jsx)(B,{type:`button`,size:`sm`,variant:c===`warning`?`default`:`outline`,className:`flex-1`,onClick:()=>{l(`warning`)},children:a(`toneWarning`)})]})]}),(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(Og,{htmlFor:`info-box-title`,className:`text-xs font-medium text-muted-foreground`,children:a(`titleLabel`)}),(0,m.jsx)(Dg,{id:`info-box-title`,ref:b,value:u,placeholder:a(`titlePlaceholder`),onChange:e=>{f(e.target.value)}})]}),(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(Og,{htmlFor:`info-box-content`,className:`text-xs font-medium text-muted-foreground`,children:a(`contentLabel`)}),(0,m.jsx)(e3,{id:`info-box-content`,value:p,placeholder:a(`contentPlaceholder`),rows:4,className:`min-h-0 text-sm resize-y`,onChange:e=>{h(e.target.value)}})]}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,m.jsx)(Og,{htmlFor:`info-box-collapsible`,className:`text-xs font-normal`,children:a(`collapsibleBody`)}),(0,m.jsx)(rE,{size:`sm`,id:`info-box-collapsible`,checked:g,onCheckedChange:e=>{_(e),e||y(!0)}})]}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,m.jsx)(Og,{htmlFor:`info-box-default-open`,className:z(`text-xs font-normal`,!g&&`text-muted-foreground`),children:a(`openByDefault`)}),(0,m.jsx)(rE,{id:`info-box-default-open`,size:`sm`,disabled:!g,checked:v,onCheckedChange:y})]}),(0,m.jsxs)(`div`,{className:`flex justify-end gap-2 pt-1`,children:[(0,m.jsx)(B,{type:`button`,size:`sm`,variant:`ghost`,onClick:x,children:i(`cancel`)}),(0,m.jsx)(B,{type:`button`,size:`sm`,onClick:T,children:a(`apply`)})]})]})})]})}function fue({editable:e,enabled:t,surfaceRef:n}){let[r]=Y$(),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(``),[c,l]=(0,d.useState)(``),u=(0,d.useRef)(null),f=(0,d.useCallback)(()=>{a(null),s(``),l(``)},[]),p=(0,d.useEffectEvent)(e=>r.read(()=>{let t=oq(e),i=n.current,a=r.getElementByKey(e);if(!f0(t)||!i||!a)return null;let o=a.getBoundingClientRect(),s=i.getBoundingClientRect(),c=o.top-s.top>180;return{text:t.getTextContent(),url:t.getURL()||`https://`,left:o.left-s.left+o.width/2,top:c?o.top-s.top:o.bottom-s.top,side:c?`top`:`bottom`}})),h=(0,d.useEffectEvent)(e=>{let t=p(e);if(!t){f();return}s(t.text),l(t.url),a({key:e,left:t.left,top:t.top,side:t.side})}),g=(0,d.useEffectEvent)(()=>{if(!i)return;let e=p(i.key);if(!e){s(``),l(``),a(null);return}i.left===e.left&&i.top===e.top&&i.side===e.side||a({...i,left:e.left,top:e.top,side:e.side})});(0,d.useEffect)(()=>{if(!e||!t)return;let n=()=>{};return SX(r.registerCommand(a0,e=>(window.requestAnimationFrame(()=>{h(e)}),!0),0),r.registerUpdateListener(()=>{g()}),r.registerRootListener(e=>{if(n(),!e){n=()=>{};return}let t=e=>{let t=e.target;if(!(t instanceof Node))return;let n=r.read(()=>{let e=uq(t);if(f0(e))return e;let n=e?.getParent();return f0(n)?n:null});n&&h(n.getKey())};e.addEventListener(`click`,t),n=()=>{e.removeEventListener(`click`,t)}}),()=>{n()})},[e,r,t]),(0,d.useEffect)(()=>{if(!i)return;let e=()=>{g()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[i]);let _=()=>{i&&(r.dispatchCommand(o0,{key:i.key,text:o,url:c}),f())};return(0,m.jsxs)(zD,{open:i!==null,onOpenChange:e=>{e||f()},children:[i?(0,m.jsx)(HD,{asChild:!0,children:(0,m.jsx)(`div`,{className:`pointer-events-none absolute size-0`,style:{left:i.left,top:i.top}})}):null,(0,m.jsx)(VD,{side:i?.side??`bottom`,align:`center`,sideOffset:12,collisionPadding:12,className:`z-60 w-80 border border-border`,onOpenAutoFocus:e=>{e.preventDefault(),u.current?.focus(),u.current?.select()},onCloseAutoFocus:e=>{e.preventDefault()},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),_()):e.key===`Escape`&&(e.preventDefault(),f())},children:(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:`Display`}),(0,m.jsx)(Dg,{ref:u,value:o,placeholder:`Link`,onChange:e=>{s(e.target.value)}})]}),(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`label`,{className:`block text-xs font-medium text-muted-foreground`,children:`URL`}),(0,m.jsx)(Dg,{value:c,placeholder:`https://example.com`,onChange:e=>{l(e.target.value)}})]}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,className:`px-0 text-muted-foreground hover:text-foreground`,onClick:()=>{i&&(r.dispatchCommand(s0,i.key),f())},children:`Convert to text`}),(0,m.jsx)(B,{type:`button`,size:`sm`,onClick:_,children:`Apply`})]})]})})]})}var pue=208,mue={formatting:`Formatting`,blocks:`Blocks`,insert:`Insert`};function hue(e,t){return[...e].sort((e,n)=>{let r=D1[e.group],i=D1[n.group];return r===i?(t.get(e.key)??0)-(t.get(n.key)??0):r-i})}function gue(e){let t=new Set(e.map(e=>e.group)).size>1,n=[],r=null;return e.forEach((e,i)=>{t&&e.group!==r&&(n.push({type:`groupLabel`,group:e.group,key:`group-${e.group}-${i}`}),r=e.group),n.push({type:`item`,item:e,itemIndex:i})}),n}function i3(e,t,n){t&&e.update(()=>{if(n.kind===`link`){let n=Q();if(!Z(n))return;let r=oq(t.textNodeKey);if(!X(r))return;n.setTextNodeRange(r,t.startOffset,r,t.endOffset),n.removeText();let i=$1({openEditor:!1});i&&window.requestAnimationFrame(()=>{e.dispatchCommand(a0,i)});return}let r=Q();if(!Z(r))return;let i=oq(t.textNodeKey);if(!X(i))return;let a=n.kind===`infoBox`||n.kind===`image`?I1(i)?.getKey():void 0;if(r.setTextNodeRange(i,t.startOffset,i,t.endOffset),r.removeText(),n.kind===`style`){W1(n.control);return}if(n.kind===`bulletList`){R1();return}if(n.kind===`heading`){M1(n.level);return}if(n.kind===`infoBox`){let t=Y1({tone:n.tone,...a===void 0?{}:{replaceIfEmptyParagraphKey:a}});t&&window.requestAnimationFrame(()=>{e.dispatchCommand(s1,t)});return}if(n.kind===`image`){let t=X1(a===void 0?{}:{replaceIfEmptyParagraphKey:a});t&&window.requestAnimationFrame(()=>{e.dispatchCommand(Z$,t)});return}if(n.kind===`separator`){e.dispatchCommand(nQ,void 0);return}q1(n.templateVariable)})}function _ue({editable:e,linksEnabled:t,bulletListsEnabled:n,headingsEnabled:r,infoBoxesEnabled:i,imagesEnabled:a,separatorsEnabled:o,surfaceRef:s,styleControls:c,templateVariables:l,commandMenuClassName:u}){let[f]=Y$(),p=(0,d.useMemo)(()=>j1(c,l,t,n??!1,r??!1,i??!1,a??!1,o??!1),[n,r,a,i,t,o,c,l]),[h,g]=(0,d.useState)(null),_=(0,d.useRef)(null),v=(0,d.useEffectEvent)(()=>{g(null)}),y=(0,d.useEffectEvent)(()=>{let t=f.getRootElement(),n=s.current,r=window.getSelection();if(!e||p.length===0||!t||!n||!r||r.rangeCount===0){g(null);return}let i=r.anchorNode;if(!i||!t.contains(i)){g(null);return}f.getEditorState().read(()=>{let e=Q();if(!Z(e)||!e.isCollapsed()){g(null);return}let t=e.anchor.getNode();if(!X(t)){g(null);return}let i=e.anchor.offset,a=t.getTextContent().slice(0,i).match(/(?:^|\s)\/([a-z0-9_-]*)$/i);if(!a){g(null);return}let o=a[1]?.toLowerCase()??``,s=hue(p.filter(e=>o.length===0||e.keywords.some(e=>e.includes(o))),new Map(p.map((e,t)=>[e.key,t])));if(s.length===0){g(null);return}let c=r.getRangeAt(0).getBoundingClientRect(),l=n.getBoundingClientRect(),u=l.width,d=c.left-l.left,f=Math.max(12,u-pue-12),m=Math.min(Math.max(d,12),f);g(e=>({left:m,top:c.bottom-l.top+8,query:o,startOffset:i-o.length-1,endOffset:i,textNodeKey:t.getKey(),selectedIndex:e?.query===o?Math.min(e.selectedIndex,s.length-1):0,items:s,rows:gue(s)}))})});return(0,d.useEffect)(()=>{if(e)return SX(f.registerCommand(EH,()=>(y(),!1),0),f.registerUpdateListener(()=>{y()}),f.registerCommand(GH,e=>{if(!h)return!1;switch(e.key){case`ArrowDown`:return e.preventDefault(),g(e=>e&&{...e,selectedIndex:(e.selectedIndex+1)%e.items.length}),!0;case`ArrowUp`:return e.preventDefault(),g(e=>e&&{...e,selectedIndex:(e.selectedIndex-1+e.items.length)%e.items.length}),!0;case`Enter`:case`Tab`:{e.preventDefault();let t=h.items[h.selectedIndex];return t&&(i3(f,h,t),g(null)),!0}case`Escape`:return e.preventDefault(),v(),!0;default:return!1}},3))},[e,f,h]),(0,d.useEffect)(()=>{if(!e)return;let t=()=>{};return SX(f.registerRootListener(e=>{if(t(),!e){t=()=>{};return}let n=t=>{let n=t.relatedTarget;n instanceof Node&&e.contains(n)||g(null)};e.addEventListener(`focusout`,n),t=()=>{e.removeEventListener(`focusout`,n)}}),()=>{t()})},[e,f]),(0,d.useEffect)(()=>{if(!h)return;let e=()=>{y()};return window.addEventListener(`resize`,e),window.addEventListener(`scroll`,e,!0),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`scroll`,e,!0)}},[h]),(0,d.useLayoutEffect)(()=>{if(!h)return;let e=_.current;e&&e.querySelector(`[data-slash-item-index="${h.selectedIndex}"]`)?.scrollIntoView({block:`nearest`})},[h]),h?(0,m.jsx)(`div`,{ref:_,className:z(`absolute z-60 min-w-52 max-w-[min(13rem,calc(100%-1.5rem))] max-h-[min(22rem,50vh)] overflow-y-auto overflow-x-hidden rounded-xl border border-border/80 bg-background/96 p-1 shadow-lg backdrop-blur-sm`,u),style:{left:h.left,top:h.top},children:h.rows.map(e=>{if(e.type===`groupLabel`)return(0,m.jsx)(`div`,{className:`px-2 pb-1 pt-2 text-[0.7rem] font-medium uppercase tracking-wide text-muted-foreground first:pt-1`,role:`presentation`,children:mue[e.group]},e.key);let{item:t,itemIndex:n}=e;return(0,m.jsx)(`button`,{type:`button`,"data-slash-item-index":n,className:z(`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm`,n===h.selectedIndex?`bg-muted`:`hover:bg-muted/70`),onMouseDown:e=>{e.preventDefault()},onMouseMove:()=>{g(e=>!e||e.selectedIndex===n?e:{...e,selectedIndex:n})},onClick:()=>{i3(f,h,t),g(null)},children:(0,m.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[t.kind===`style`?(0,m.jsx)(Q2,{control:t.control,variant:`menu`}):t.kind===`link`?(0,m.jsx)(nT,{className:`size-4 shrink-0 text-muted-foreground`}):t.kind===`bulletList`?(0,m.jsx)(aT,{className:`size-4 shrink-0 text-muted-foreground`}):t.kind===`heading`?(0,m.jsx)(Yw,{className:`size-4 shrink-0 text-muted-foreground`}):t.kind===`infoBox`?t.tone===`warning`?(0,m.jsx)(BT,{className:`size-4 shrink-0 text-muted-foreground`}):(0,m.jsx)($w,{className:`size-4 shrink-0 text-muted-foreground`}):t.kind===`image`?(0,m.jsx)(Zw,{className:`size-4 shrink-0 text-muted-foreground`}):t.kind===`separator`?(0,m.jsx)(lT,{className:`size-4 shrink-0 text-muted-foreground`}):(0,m.jsx)(fw,{className:`size-4 shrink-0 text-muted-foreground`}),(0,m.jsx)(`span`,{className:`min-w-0 truncate`,children:t.label})]})},t.key)})}):null}function vue({value:e}){let[t]=Y$(),n=(0,d.useMemo)(()=>V1(``),[]),r=e??n,i=(0,d.useMemo)(()=>JSON.stringify(r),[r]),a=(0,d.useRef)({serialized:i,state:r});return(0,d.useLayoutEffect)(()=>{a.current={serialized:i,state:r};let e=a.current;if(JSON.stringify(t.getEditorState().toJSON())===e.serialized)return;let n=!1;return queueMicrotask(()=>{if(n)return;let e=a.current;JSON.stringify(t.getEditorState().toJSON())!==e.serialized&&t.setEditorState(t.parseEditorState(e.state),{tag:S1})}),()=>{n=!0}},[t,r,i]),null}function a3({id:e,value:t,placeholder:n,autoFocus:r=!1,editable:i=!0,wrapperClassName:a,surfaceClassName:o,contentClassName:s,placeholderClassName:c,toolbarClassName:l,commandMenuClassName:f,styleControls:p=[],templateVariables:h=[],editorVariant:g=`compact`,contentPolicy:_,resolveImageAssetUrl:v,imageAssets:y=[],registerImageAsset:b,imageAssetDeletion:x,linksEnabled:S=!1,"aria-label":C,onChange:w,onFocus:T,onBlur:E,onKeyDown:D,onKeyDownCapture:O}){let k=(0,d.useId)(),A=e??k,j=(0,d.useRef)(null),M=(0,d.useMemo)(()=>V1(``),[]),N=(0,d.useMemo)(()=>h0(g===`block`?m0:p0,_),[_,g]),ee=O0(N)?`block`:`compact`,P=(0,d.useMemo)(()=>p.filter(e=>N.allowedStyleAttributes?.[e.kind]??!0),[N.allowedStyleAttributes,p]),F=N.allowTemplateVariables===!1?[]:h,I=S&&N.allowLinks!==!1,L=ee===`block`&&(N.allowedBlockTypes?.bulletList??!0),te=ee===`block`&&N.allowedBlockTypes?.heading===!0,ne=ee===`block`&&N.allowedBlockTypes?.infoBox===!0,re=ee===`block`&&(N.allowedBlockTypes?.image??!0),ie=ee===`block`&&(N.allowedBlockTypes?.separator??!0),ae=t??M,oe=(0,d.useMemo)(()=>({namespace:`rich-text-editor-${A}`,editorState:JSON.stringify(ae),editable:i,onError(e){throw e},theme:{paragraph:`m-0 [&:not(:last-child)]:mb-2`,text:{bold:`font-extrabold`,italic:`italic`,underline:`underline underline-offset-2`},...ee===`block`?{heading:{h1:`text-xl font-semibold tracking-tight [&:not(:first-child)]:mt-3 [[data-rich-text-heading]+&]:mt-2 [&:not(:last-child)]:mb-2`,h2:`text-lg font-semibold tracking-tight [&:not(:first-child)]:mt-3 [[data-rich-text-heading]+&]:mt-2 [&:not(:last-child)]:mb-2`,h3:`text-base font-semibold tracking-tight [&:not(:first-child)]:mt-3 [[data-rich-text-heading]+&]:mt-2 [&:not(:last-child)]:mb-2`,h4:`text-sm font-semibold tracking-tight [&:not(:first-child)]:mt-3 [[data-rich-text-heading]+&]:mt-2 [&:not(:last-child)]:mb-2`,h5:`text-sm font-semibold tracking-tight [&:not(:first-child)]:mt-3 [[data-rich-text-heading]+&]:mt-2 [&:not(:last-child)]:mb-2`,h6:`text-sm font-semibold tracking-tight [&:not(:first-child)]:mt-3 [[data-rich-text-heading]+&]:mt-2 [&:not(:last-child)]:mb-2`},list:{ul:`my-2 list-disc pl-5`,ol:`my-2 list-decimal pl-5`,listitem:`pl-1`},hr:`my-3 w-full border-0 border-t border-border`}:{}},nodes:[c0,l0,M$,E$,rQ,r1,EX,d1]}),[A,i,ae,ee]);return(0,m.jsx)(G$,{value:{editorVariant:ee,contentPolicy:N,editable:i,resolveImageAssetUrl:v,imageAssets:y,registerImageAsset:b,imageAssetDeletion:x},children:(0,m.jsx)(`div`,{className:z(`relative w-full`,a),children:(0,m.jsx)(`div`,{ref:j,className:z(`relative w-full overflow-visible`,o),children:(0,m.jsxs)(o2,{initialConfig:oe,children:[(0,m.jsx)(Zce,{editable:i}),i&&r?(0,m.jsx)(r2,{defaultSelection:`rootStart`}):null,(0,m.jsx)(vue,{value:t}),(0,m.jsx)(Xce,{horizontalRuleCommandEnabled:ie}),ee===`block`?(0,m.jsx)(hce,{}):null,(0,m.jsx)(Jce,{contentEditable:(0,m.jsx)(ace,{id:A,"aria-label":C??n,className:z(`relative z-10 min-h-[1.5em] whitespace-pre-wrap wrap-break-word outline-none`,s),onFocus:T,onBlur:E,onKeyDownCapture:O,onKeyDown:D}),placeholder:i&&n?(0,m.jsx)(`span`,{className:z(`pointer-events-none absolute inset-0 z-0 select-none text-muted-foreground/60`,`min-h-[1.5em] whitespace-pre-wrap wrap-break-word`,s,c),"aria-hidden":!0,children:n}):null,ErrorBoundary:lce}),i?(0,m.jsx)(mce,{}):null,(0,m.jsx)(_ce,{ignoreHistoryMergeTagChange:!0,ignoreSelectionChange:!0,onChange:(e,t,n)=>{if(n.has(`rich-text-editor-sync-from-value`))return;let r=e.read(()=>pq().getTextContent()),i=e2(e,N),a=ee===`block`?u.wt(i):r.trim().length===0;w?.({editorState:e,value:e.toJSON(),plainText:r,isEmpty:a})}}),(0,m.jsx)($ce,{editable:i,linksEnabled:I,blockAlignmentEnabled:N.allowBlockAlignment===!0,surfaceRef:j,toolbarClassName:l,styleControls:P,templateVariables:F}),(0,m.jsx)(_ue,{editable:i,linksEnabled:I,bulletListsEnabled:L,headingsEnabled:te,infoBoxesEnabled:ne,imagesEnabled:re,separatorsEnabled:ie,surfaceRef:j,styleControls:P,templateVariables:F,commandMenuClassName:f}),(0,m.jsx)(fue,{editable:i,enabled:I,surfaceRef:j}),(0,m.jsx)(due,{editable:i,enabled:ne,surfaceRef:j}),(0,m.jsx)(lue,{editable:i,enabled:re}),i&&re&&x?(0,m.jsx)(uue,{}):null]})})})})}function o3({wrapperClassName:e,surfaceClassName:t,contentClassName:n,placeholderClassName:r,...i}){return(0,m.jsx)(a3,{...i,editorVariant:`block`,wrapperClassName:z(`w-full`,e),surfaceClassName:z(`w-full`,t),contentClassName:z(`w-full min-h-[1.5em] text-sm leading-6 focus-visible:outline-none focus-visible:ring-0`,n),placeholderClassName:z(`text-sm leading-6`,r)})}function s3({...e}){return(0,m.jsx)(sn,{"data-slot":`collapsible`,...e})}function c3({...e}){return(0,m.jsx)(ln,{"data-slot":`collapsible-trigger`,...e})}function l3({...e}){return(0,m.jsx)(dn,{"data-slot":`collapsible-content`,...e})}function u3({char:e}){return(0,m.jsx)(`span`,{className:`text-muted-foreground/90 shrink-0 px-0.5 font-mono text-[0.85em] select-none`,"aria-hidden":!0,children:e})}var yue=`var(--rich-text-editor-primary-color, var(--primary))`,bue=`var(--rich-text-editor-accent-color, var(--accent))`,xue=`var(--rich-text-editor-font-weight-strong, 600)`,Sue=`var(--rich-text-editor-font-weight-normal, 400)`;function d3(e){if(!e)return;let t={};return e.weight===`strong`?t.fontWeight=xue:e.weight===`normal`&&(t.fontWeight=Sue),e.italic===`italic`?t.fontStyle=`italic`:e.italic===`normal`&&(t.fontStyle=`normal`),e.underline===`underline`?t.textDecorationLine=`underline`:e.underline===`none`&&(t.textDecorationLine=`none`),e.color===`primary`?t.color=yue:e.color===`accent`?t.color=bue:e.color===`default`&&(t.color=`inherit`),Object.keys(t).length>0?t:void 0}function f3(e){if(e)return`${e.value}${e.unit}`}function Cue(e){return{width:f3(e?.width),height:f3(e?.height),maxWidth:e?.maxWidth?f3(e.maxWidth):`100%`,maxHeight:f3(e?.maxHeight)}}function wue(e){return z(`my-3 space-y-2`,e===`center`&&`flex flex-col items-center`,e===`right`&&`flex flex-col items-end`)}function p3(e,t,n){return e.map((e,r)=>e.type===`lineBreak`?n?.singleLine?n.singleLineNewlineIndicator?(0,m.jsx)(u3,{char:n.singleLineNewlineIndicator},`${t}-linebreak-${r}`):(0,m.jsx)(`span`,{children:` `},`${t}-linebreak-${r}`):(0,m.jsx)(`br`,{},`${t}-linebreak-${r}`):e.type===`template`?(0,m.jsx)(`span`,{style:d3(e.style),className:`inline-flex rounded-md border border-border/70 bg-muted px-1.5 py-0.5 align-baseline text-[0.92em] font-medium text-foreground`,children:`{${e.key}}`},`${t}-template-${r}`):e.type===`link`?(0,m.jsxs)(`a`,{href:x1(e.href),target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 underline decoration-current underline-offset-3`,children:[(0,m.jsx)(`span`,{children:p3(e.children,`${t}-link-${r}-child`,n)}),(0,m.jsx)(lw,{className:`size-3.5 shrink-0`})]},`${t}-link-${r}`):e.type===`text`?(0,m.jsx)(`span`,{style:d3(e.style),children:e.text},`${t}-text-${r}`):null)}var Tue={1:`h1`,2:`h2`,3:`h3`,4:`h4`,5:`h5`,6:`h6`},Eue=(e,t)=>t?Math.min(Math.max(e,t),6):e,Due=(e,t)=>t?Math.min(Math.max(e+t,1),6):e;function m3({paragraphs:e,paragraphClassName:t,lastParagraphClassName:n,singleLine:r,singleLineNewlineIndicator:i}){let a=(e,t)=>e.children.length>0?p3(e.children,t):(0,m.jsx)(`br`,{"aria-hidden":!0});return r?(0,m.jsx)(m.Fragment,{children:e.map((n,r)=>(0,m.jsxs)(`span`,{className:t,children:[p3(n.children,`paragraph-${r}`,{singleLine:!0,singleLineNewlineIndicator:i}),r<e.length-1?i?(0,m.jsx)(u3,{char:i}):` `:null]},`paragraph-${r}`))}):(0,m.jsx)(m.Fragment,{children:e.map((r,i)=>{let o=r.alignment===`center`?`text-center`:r.alignment===`right`?`text-right`:r.alignment===`justify`?`text-justify`:void 0;return(0,m.jsx)(`p`,{className:z(`m-0`,t,i===e.length-1&&n,i<e.length-1&&`mb-2`,o),children:a(r,`paragraph-${i}`)},`paragraph-${i}`)})})}function Oue({block:e,blockIndex:t,paragraphClassName:n,resolveImageAssetUrl:r,singleLine:i,singleLineNewlineIndicator:a,minHeadingLevel:o,headingLevelOffset:s,hasPreviousBlock:c,previousBlockIsHeading:l,hasFollowingBlock:u}){switch(e.type){case`paragraph`:return(0,m.jsx)(m3,{paragraphs:[e],paragraphClassName:n,lastParagraphClassName:u?`mb-2`:void 0,singleLine:i,singleLineNewlineIndicator:a});case`heading`:{if(i)return(0,m.jsx)(`span`,{className:n,children:p3(e.children,`heading-${t}`,{singleLine:!0,singleLineNewlineIndicator:a})},`heading-${t}`);let r=Tue[Eue(Due(e.level,s),o)];return(0,m.jsx)(r,{className:z(z(`m-0 font-semibold tracking-tight text-foreground`,n,c&&(l?`mt-2`:`mt-3`),u&&`mb-2`,e.level===1&&`text-xl`,e.level===2&&`text-lg`,e.level===3&&`text-base`,e.level>=4&&`text-sm`),e.alignment===`center`?`text-center`:e.alignment===`right`?`text-right`:e.alignment===`justify`?`text-justify`:void 0),children:p3(e.children,`heading-${t}`)},`heading-${t}`)}case`bulletList`:return i?(0,m.jsx)(`span`,{children:e.items.map((r,i)=>(0,m.jsxs)(`span`,{children:[`• `,(0,m.jsx)(m3,{paragraphs:r.children,paragraphClassName:n,lastParagraphClassName:i<e.items.length-1?`mb-2`:void 0,singleLine:!0,singleLineNewlineIndicator:a}),i<e.items.length-1?a?(0,m.jsx)(u3,{char:a}):` `:null]},`bullet-item-${t}-${i}`))},`bullet-list-${t}`):(0,m.jsx)(`ul`,{className:`my-2 list-disc pl-5`,children:e.items.map((r,i)=>(0,m.jsx)(`li`,{className:`pl-1`,children:(0,m.jsx)(m3,{paragraphs:r.children,paragraphClassName:n,lastParagraphClassName:i<e.items.length-1?`mb-2`:void 0})},`bullet-item-${t}-${i}`))},`bullet-list-${t}`);case`image`:{let i=e.source.type===`external`?e.source.url:r?.(e.source.assetId),a=Cue(e.size);return(0,m.jsxs)(`figure`,{className:wue(e.alignment),children:[i?(0,m.jsx)(`img`,{src:i,alt:e.alt??``,style:a,className:`rounded-lg border border-border/70 object-contain`}):(0,m.jsx)(`div`,{className:`rounded-lg border border-dashed border-border/80 bg-muted/40 px-3 py-4 text-sm text-muted-foreground`,children:e.source.type===`asset`?`Image asset: ${e.source.assetId}`:`Image`}),e.caption&&e.caption.length>0?(0,m.jsx)(`figcaption`,{className:`text-sm text-muted-foreground`,children:(0,m.jsx)(m3,{paragraphs:e.caption,paragraphClassName:n})}):null]},`image-${t}`)}case`infoBox`:{let r=(e.tone??`info`)===`warning`,o=r?BT:$w,s=z(`my-2 rounded-lg border px-3 py-2.5`,r&&`border-amber-300/80 bg-amber-50/80 dark:bg-amber-950/25`,!r&&`border-sky-300/80 bg-sky-50/80 dark:bg-sky-950/25`),c=e.collapsible!==!1,l=e.defaultOpen!==!1;if(i)return(0,m.jsxs)(`span`,{className:n,children:[e.title?p3(e.title,`info-box-title-${t}`,{singleLine:!0,singleLineNewlineIndicator:a}):null,e.title&&e.children.some(e=>e.children.length>0)?a?(0,m.jsx)(u3,{char:a}):` `:null,(0,m.jsx)(m3,{paragraphs:e.children,paragraphClassName:n,singleLine:!0,singleLineNewlineIndicator:a})]},`info-box-${t}`);let u=e.title&&e.title.length>0?(0,m.jsx)(`div`,{className:`min-w-0 flex-1 text-sm font-medium text-foreground`,children:p3(e.title,`info-box-title-${t}`)}):(0,m.jsx)(`div`,{className:`min-w-0 flex-1 text-sm font-medium text-muted-foreground`,children:`Notice`}),d=(0,m.jsx)(`div`,{className:`pt-2 text-sm text-foreground/90`,children:(0,m.jsx)(m3,{paragraphs:e.children,paragraphClassName:n})});return(0,m.jsx)(`div`,{className:s,children:(0,m.jsxs)(`div`,{className:`flex gap-2.5`,children:[(0,m.jsx)(`span`,{className:`mt-0.5 shrink-0 text-foreground/80`,"aria-hidden":!0,children:(0,m.jsx)(o,{className:`size-4`})}),(0,m.jsx)(`div`,{className:`min-w-0 flex-1`,children:c?(0,m.jsxs)(s3,{defaultOpen:l,children:[(0,m.jsxs)(c3,{className:`flex w-full items-start gap-2 rounded-sm text-left outline-none hover:opacity-90 [&[data-state=open]_svg]:rotate-180`,children:[u,(0,m.jsx)(vw,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground transition-transform`})]}),(0,m.jsx)(l3,{children:d})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`flex w-full items-start gap-2 text-left`,children:u}),d]})})]})},`info-box-${t}`)}case`separator`:return(0,m.jsx)(`hr`,{className:`my-3 w-full border-0 border-t border-border`},`separator-${t}`);case`blockExtension`:return e.name===`separator`?(0,m.jsx)(`hr`,{className:`my-3 w-full border-0 border-t border-border`},`separator-${t}`):null}}function h3({content:e,className:t,paragraphClassName:n,resolveImageAssetUrl:r,singleLine:i,singleLineNewlineIndicator:a,minHeadingLevel:o,headingLevelOffset:s}){if(!e)return null;if(e.type!==u.tt.richText){if(e.content.trim().length===0)return null;if(i&&a)return(0,m.jsx)(`div`,{className:t,children:(0,m.jsx)(`span`,{className:n,children:e.content.split(/\r?\n/).map((e,t)=>(0,m.jsxs)(d.Fragment,{children:[t>0?(0,m.jsx)(u3,{char:a}):null,e]},`md-line-${t}`))})});let r=i?e.content.replace(/\s*[\r\n]+\s*/g,` `):e.content;return(0,m.jsx)(`div`,{className:z(!i&&`space-y-1`,t),children:i?(0,m.jsx)(`span`,{className:n,children:r}):(0,m.jsx)(`p`,{className:z(`m-0 whitespace-pre-line`,n),children:r})})}if(!e.doc.blocks.some(e=>u.Ct(e)))return null;let c=e.doc.blocks.filter(e=>u.Ct(e)||e.type===`paragraph`);return(0,m.jsx)(`div`,{className:t,children:c.map((e,t)=>(0,m.jsxs)(d.Fragment,{children:[i&&a&&t>0?(0,m.jsx)(u3,{char:a}):null,(0,m.jsx)(Oue,{block:e,blockIndex:t,paragraphClassName:n,resolveImageAssetUrl:r,singleLine:i,singleLineNewlineIndicator:a,minHeadingLevel:o,headingLevelOffset:s,hasPreviousBlock:t>0,previousBlockIsHeading:c[t-1]?.type===`heading`,hasFollowingBlock:t<c.length-1})]},`block-${t}`))})}function g3(){let e=J(`defaultEditors.richTextToolbar`),t=tD();return{templateVariables:(0,d.useMemo)(()=>t?.getTemplateValueKeys().map(e=>({key:e,label:e}))??[],[t]),defaultStyleControls:(0,d.useMemo)(()=>[{kind:`weight`,value:`strong`,title:e(`bold`)},{kind:`italic`,value:`italic`,title:e(`italic`)},{kind:`underline`,value:`underline`,title:e(`underline`)},{kind:`color`,value:`primary`,title:e(`primaryColor`)},{kind:`color`,value:`accent`,title:e(`accentColor`)}],[e]),subtitleStyleControls:(0,d.useMemo)(()=>[{kind:`weight`,value:`strong`,title:e(`bold`)},{kind:`underline`,value:`underline`,title:e(`underline`)},{kind:`color`,value:`primary`,title:e(`primaryColor`)},{kind:`color`,value:`accent`,title:e(`accentColor`)}],[e])}}var _3=({draftKey:e,draftLabelEditorValue:t,keyValidationMessage:n,labelEditorInstanceKey:r,labelAutoFocus:i=!1,keyAutoFocus:a=!1,keyRowTrailing:o,onDraftKeyChange:s,onDraftLabelChange:c,onSubmitShortcut:l})=>{let u=J(`defaultEditors.choiceEditor`),{templateVariables:d,defaultStyleControls:f}=g3();return(0,m.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,m.jsx)(`div`,{children:(0,m.jsx)(a3,{value:t,placeholder:u(`createOptionLabelPlaceholder`),"aria-label":u(`createOptionLabelAriaLabel`),autoFocus:i,onChange:c,contentClassName:`w-full text-sm focus-visible:outline-none focus-visible:ring-0`,styleControls:f,templateVariables:d,linksEnabled:!0,onKeyDownCapture:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),l?.())}},r)}),(0,m.jsxs)(`div`,{children:[n?(0,m.jsx)(`p`,{className:`mb-1 text-xs text-destructive`,children:n}):null,(0,m.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(Dg,{value:e,autoFocus:a,onChange:e=>s(e.target.value),placeholder:u(`createOptionKeyPlaceholder`),"aria-label":u(`createOptionKeyAriaLabel`),className:`h-auto bg-muted px-2 font-mono text-xs! shadow-none sm:w-48`,onKeyDown:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),l?.())}}),o?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`flex-1`}),o]}):null]})]})]})};function v3(e){return u.s(e).key??``}var kue=({isOpen:e,open:t,existingOptions:n,onCancel:r,onSubmit:i})=>{let a=J(`defaultEditors.choiceEditor`),[o,s]=(0,d.useState)(()=>v3(n)),[c,l]=(0,d.useState)(void 0),[f,p]=(0,d.useState)(()=>V1(``)),[h,g]=(0,d.useState)(0),_=(0,d.useCallback)(e=>{s(v3(e)),l(void 0),p(V1(``)),g(e=>e+1)},[]),v=u.p(o),y=n.some(e=>u.p(e.key??``)===v),b=v.length===0?a(`createOptionKeyRequired`):y?a(`createOptionKeyDuplicate`):null,x=b!==null,S=()=>{if(x)return;let e={...u.s(n),key:v};i(e,c),_([...n,e])},C=()=>{_(n),r()};return $E(e=>{e.defaultPrevented||e.key!==`Escape`||(e.preventDefault(),C())},{enabled:e,ignoreEditableTargets:!1}),(0,m.jsx)(`div`,{className:`space-y-3`,children:e?(0,m.jsx)(`div`,{className:`rounded-xl border border-border bg-card p-3 shadow-sm`,children:(0,m.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,m.jsx)(_3,{draftKey:o,draftLabelEditorValue:f,keyValidationMessage:b,labelEditorInstanceKey:h,labelAutoFocus:!0,keyRowTrailing:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(B,{type:`button`,size:`sm`,className:`rounded-full`,variant:`ghost`,onClick:C,children:a(`createOptionCancel`)}),(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full`,disabled:x,onClick:S,children:a(`createOptionSubmit`)})}),(0,m.jsx)(IE,{side:`bottom`,align:`center`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,m.jsx)(`span`,{children:a(`createOptionSubmit`)}),(0,m.jsx)(FD,{children:`Enter`})]})})]})]}),onDraftKeyChange:s,onDraftLabelChange:e=>{p(e.value),l(e.isEmpty?void 0:e2(e.editorState))},onSubmitShortcut:S})})}):(0,m.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,className:`rounded-full text-muted-foreground min-w-44 flex justify-start gap-1 items-center`,onClick:t,children:[(0,m.jsx)(yT,{className:`size-3`}),a(`addOptionPlaceholder`)]})})};function y3({className:e,size:t=`default`,...n}){return(0,m.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:z(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function Aue({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`card-header`,className:z(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function jue({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`card-title`,className:z(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function Mue({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`card-description`,className:z(`text-sm text-muted-foreground`,e),...t})}function b3({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`card-content`,className:z(`px-4 group-data-[size=sm]/card:px-3`,e),...t})}var Nue=Object.defineProperty,Pue=Object.defineProperties,Fue=Object.getOwnPropertyDescriptors,x3=Object.getOwnPropertySymbols,Iue=Object.prototype.hasOwnProperty,Lue=Object.prototype.propertyIsEnumerable,S3=(e,t,n)=>t in e?Nue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C3=(e,t)=>{for(var n in t||={})Iue.call(t,n)&&S3(e,n,t[n]);if(x3)for(var n of x3(t))Lue.call(t,n)&&S3(e,n,t[n]);return e},w3=(e,t)=>Pue(e,Fue(t)),T3=class extends lN{apply({transform:e}){if(!this.options)return e;let{axis:t,value:n}=this.options;return w3(C3({},e),{[t]:n})}};T3.configure=Hj(T3);var E3=T3;E3.configure({axis:`x`,value:0}),E3.configure({axis:`y`,value:0});function D3(e,t,n){let r=C3({},t);return e.boundingRectangle.top+t.y<=n.top?r.y=n.top-e.boundingRectangle.top:e.boundingRectangle.bottom+t.y>=n.top+n.height&&(r.y=n.top+n.height-e.boundingRectangle.bottom),e.boundingRectangle.left+t.x<=n.left?r.x=n.left-e.boundingRectangle.left:e.boundingRectangle.right+t.x>=n.left+n.width&&(r.x=n.left+n.width-e.boundingRectangle.right),r}var O3=class extends lN{apply({transform:e}){let{size:t=20}=this.options??{},n=typeof t==`number`?t:t.x,r=typeof t==`number`?t:t.y;return w3(C3({},e),{x:Math.ceil(e.x/n)*n,y:Math.ceil(e.y/r)*r})}};O3.configure=Hj(O3);var k3=class extends lN{constructor(e){super(e);let{dragOperation:t}=e,n=()=>ak(()=>{let{source:e}=t;this.windowBoundingRectangle=XN(e?.element??document.documentElement)});this.destroy=Ek(()=>{if(!t.status.idle)return n(),window.addEventListener(`resize`,n),()=>{window.removeEventListener(`resize`,n)}})}apply({shape:e,transform:t}){if(!this.windowBoundingRectangle||!e)return t;let{initial:n,current:r}=e,{height:i,width:a}=r.boundingRectangle;return D3(new nj(n.center.x-a/2,n.center.y-i/2,a,i),t,this.windowBoundingRectangle)}},A3=class extends lN{constructor(e,t){super(e,t),this.boundingRectangle=gk(null),this.destroy=Ek(()=>{if(!this.options)return;let{dragOperation:t}=e,{status:n}=t;if(n.initialized){let{element:e}=this.options,n=typeof e==`function`?e(t):e;if(!n)return;let r,i=()=>{this.boundingRectangle.value=HN(n)},a=()=>{r||=setTimeout(()=>{i(),r=void 0},25)},o=new ResizeObserver(i);return o.observe(n),document.addEventListener(`scroll`,a,{passive:!0,capture:!0}),()=>{document.removeEventListener(`scroll`,a,{capture:!0}),o.disconnect(),this.boundingRectangle.value=null}}})}apply(e){let{shape:t,transform:n}=e;if(!t)return n;let r=this.boundingRectangle.value;if(!r)return n;let{initial:i,current:a}=t,{height:o,width:s}=a.boundingRectangle;return D3(new nj(i.center.x-s/2,i.center.y-o/2,s,o),n,r)}};A3.configure=Hj(A3);var Rue=[`input`,`textarea`,`number`,`datepicker`,`switch`,`select`,`slider`],j3={input:IT,textarea:LT,number:Jw,datepicker:hw,switch:RT,select:Sw,slider:DT};function M3(e,t){return e(`fieldTypes.${t}`)}var zue=`[data-select-option-drag-handle="true"]`,Bue=`
|
|
185
|
-
input:not([disabled]),
|
|
186
|
-
select:not([disabled]),
|
|
187
|
-
textarea:not([disabled]),
|
|
188
|
-
button:not([disabled]),
|
|
189
|
-
a[href],
|
|
190
|
-
[contenteditable]:not([contenteditable="false"])
|
|
191
|
-
`,Vue=[`name`,`given-name`,`family-name`,`nickname`,`email`,`username`,`organization`,`organization-title`,`street-address`,`address-line1`,`address-line2`,`address-level2`,`address-level1`,`postal-code`,`country-name`,`tel`,`url`,`one-time-code`];function N3(e){return e.trim()||void 0}function P3(e){return e===``?void 0:e}function F3(e){if(!e.trim())return;let t=Number(e);return Number.isFinite(t)?t:void 0}function Hue(e){let t=new Set(e.map(e=>e.value.trim().toLowerCase()).filter(Boolean)),n=1;for(;t.has(`opt-${n}`);)n+=1;return`OPT-${n}`}function Uue(e){let{target:t}=e;return!(t instanceof Element)||t.closest(zue)?!1:!!t.closest(Bue)}function Wue(e){return new Map(e.map(e=>[e.type,e]))}function Gue(e){switch(e.type){case`textarea`:return{...e,placeholder:N3(e.placeholder??``)};case`number`:return{...e,placeholder:N3(e.placeholder??``),unit:N3(e.unit??``)};case`datepicker`:return{...e,placeholder:N3(e.placeholder??``)};case`switch`:return{...e,checkedLabel:N3(e.checkedLabel??``),uncheckedLabel:N3(e.uncheckedLabel??``)};case`select`:return{...e,placeholder:N3(e.placeholder??``)};case`slider`:return e;default:return{...e,placeholder:N3(e.placeholder??``),autocomplete:N3(e.autocomplete??``)}}}function Kue(e,t,n){let r=new Set,i=e.key.trim();i||r.add(n(`fieldKeyRequired`));let a=t.some(t=>t.id!==e.id&&t.key.trim().toLowerCase()===i.toLowerCase());i&&a&&r.add(n(`fieldKeyDuplicate`));let o=new Set;for(let t of e.validations){if(o.has(t.type)){r.add(n(`fieldValidationDuplicate`));break}o.add(t.type)}for(let t of e.validations)(t.type===`minLength`||t.type===`maxLength`||t.type===`min`||t.type===`max`)&&typeof t.value!=`number`&&r.add(n(`fieldValidationInvalid`)),(t.type===`pattern`||t.type===`minDate`||t.type===`maxDate`)&&typeof t.value!=`string`&&r.add(n(`fieldValidationInvalid`));if(e.type===`number`){let t=e.controller;t.step!==void 0&&t.step<=0&&r.add(n(`fieldNumberStepInvalid`))}if(e.type===`select`){let t=e.controller;t.options.length===0&&r.add(n(`fieldSelectOptionsRequired`)),t.options.some(e=>!e.value.trim())&&r.add(n(`fieldSelectOptionIncomplete`));let i=new Set;for(let e of t.options){let t=e.value.trim().toLowerCase();if(t){if(i.has(t)){r.add(n(`fieldSelectOptionDuplicate`));break}i.add(t)}}}if(e.type===`slider`){let t=e.controller;(t.min===void 0||t.max===void 0||t.min>=t.max)&&r.add(n(`fieldSliderRangeInvalid`)),(t.step===void 0||t.step<=0)&&r.add(n(`fieldSliderStepInvalid`)),(t.defaultValue===void 0||t.min===void 0||t.max===void 0||t.defaultValue<t.min||t.defaultValue>t.max)&&r.add(n(`fieldSliderDefaultInvalid`))}if(e.type===`datepicker`){let t=e.validations.find(e=>e.type===`minDate`)?.value,i=e.validations.find(e=>e.type===`maxDate`)?.value;typeof t==`string`&&typeof i==`string`&&t>i&&r.add(n(`fieldDateRangeInvalid`))}return[...r]}function que({controlId:e,suggestion:t,validation:n,onChange:r}){return t.valueKind===`none`?null:t.valueKind===`number`?(0,m.jsx)(Dg,{id:e,type:`number`,value:typeof n.value==`number`?String(n.value):``,onChange:e=>r(F3(e.target.value))}):(0,m.jsx)(Dg,{id:e,type:t.valueKind===`date`?`date`:`text`,value:typeof n.value==`string`?n.value:``,onChange:e=>r(N3(e.target.value))})}function Jue({groupId:e,option:t,index:n,onChange:r,onRemove:i}){let a=J(`defaultEditors.formEditor`),{ref:o,isDragging:s}=Cz({id:t.id,index:n,group:e});return(0,m.jsx)(`li`,{ref:o,className:z(`list-none touch-none rounded-lg border border-border/70 px-2 py-1 bg-muted`,s&&`opacity-90`),children:(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`button`,{type:`button`,className:`inline-flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted`,"aria-label":a(`fieldReorderOption`),"data-select-option-drag-handle":`true`,children:(0,m.jsx)(qw,{className:`size-4`})}),(0,m.jsxs)(ZT,{className:`w-28 shrink-0`,children:[(0,m.jsx)($T,{className:`sr-only`,htmlFor:`field-option-value-${t.id}`,children:a(`fieldOptionValueLabel`)}),(0,m.jsx)(Dg,{id:`field-option-value-${t.id}`,className:`bg-background font-mono text-xs`,value:t.value,placeholder:`OPT-${n+1}`,onChange:e=>r(t.id,t=>({...t,value:e.target.value}))})]}),(0,m.jsxs)(ZT,{className:`min-w-0 flex-1`,children:[(0,m.jsx)($T,{className:`sr-only`,htmlFor:`field-option-label-${t.id}`,children:a(`fieldOptionLabel`,{index:n+1})}),(0,m.jsx)(Dg,{id:`field-option-label-${t.id}`,className:`bg-background`,value:t.label,placeholder:a(`fieldOptionLabel`,{index:n+1}),onChange:e=>r(t.id,t=>({...t,label:e.target.value}))})]}),(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`shrink-0 text-muted-foreground`,"aria-label":a(`fieldRemoveOption`),onClick:()=>i(t.id),children:(0,m.jsx)(GT,{})})]})})}var Yue=({open:e,field:t,allFields:n,onOpenChange:r,onSave:i})=>{let a=J(`defaultEditors.formEditor`),o=J(`common.actions`),s=t??n[0]??null,[c,l]=(0,d.useState)(()=>s??{id:u.bt(),key:``,type:`input`,controller:{type:`input`,inputMode:`text`},validations:[]}),f=e&&t!==null,p=u.S(c.type),h=(0,d.useMemo)(()=>Wue(p),[p]),g=p.filter(e=>c.validations.every(t=>t.type!==e.type)),_=Kue(c,n,a),v=e=>{l(t=>e(t))},y=(e,t)=>{v(n=>({...n,validations:n.validations.map(n=>n.id===e?t(n):n)}))},b=e=>{v(t=>({...t,validations:[...t.validations,{id:u.bt(),type:e.type,value:e.defaultValue}]}))},x=e=>{v(t=>({...t,validations:t.validations.filter(t=>t.id!==e)}))},S=()=>{v(e=>{if(e.type!==`select`)return e;let t=e.controller;return{...e,controller:{...t,options:[...t.options,{id:u.bt(),label:``,value:Hue(t.options)}]}}})},C=(e,t)=>{v(n=>{if(n.type!==`select`)return n;let r=n.controller;return{...n,controller:{...r,options:r.options.map(n=>n.id===e?t(n):n)}}})},w=e=>{v(t=>{if(t.type!==`select`)return t;let n=t.controller;return{...t,controller:{...n,options:n.options.filter(t=>t.id!==e)}}})},T=()=>t?(i({...c,key:c.key.trim(),label:N3(c.label??``),description:N3(c.description??``),errorMessage:N3(c.errorMessage??``),controller:Gue(c.controller),required:void 0,validations:c.validations.map(e=>({...e,message:N3(e.message??``)}))}),!0):!1;return(0,m.jsx)(aO,{open:f,onOpenChange:e=>{if(e){r(!0);return}if(!t){r(!1);return}T()},children:(0,m.jsxs)(uO,{closeLabel:o(`close`),className:`max-h-svh sm:max-w-4xl overflow-y-auto`,children:[(0,m.jsxs)(dO,{children:[(0,m.jsx)(pO,{children:a(`fieldDialogTitle`)}),(0,m.jsx)(mO,{children:a(`fieldDialogDescription`,{fieldType:M3(a,c.type)})})]}),(0,m.jsxs)(`div`,{className:`space-y-4`,children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-label`,children:a(`fieldLabelLabel`)}),(0,m.jsx)(Dg,{id:`field-label`,value:c.label??``,placeholder:a(`fieldLabelPlaceholder`),onChange:e=>v(t=>({...t,label:e.target.value}))})]}),(0,m.jsx)(`div`,{className:`min-w-0`,children:(0,m.jsx)(YT,{className:`gap-4`,children:(0,m.jsx)(y3,{size:`sm`,children:(0,m.jsx)(b3,{children:(()=>{switch(c.type){case`textarea`:{let e=c.controller;return(0,m.jsxs)(YT,{className:`md:flex-row`,children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-placeholder`,children:a(`fieldPlaceholderLabel`)}),(0,m.jsx)(Dg,{id:`field-placeholder`,value:e.placeholder??``,placeholder:a(`fieldPlaceholderPlaceholder`),onChange:t=>v(n=>({...n,controller:{...e,placeholder:P3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-rows`,children:a(`fieldRowsLabel`)}),(0,m.jsx)(Dg,{id:`field-rows`,type:`number`,min:2,max:12,value:e.rows??3,onChange:t=>v(n=>({...n,controller:{...e,rows:F3(t.target.value)??3}}))})]})]})}case`number`:{let e=c.controller;return(0,m.jsx)(YT,{children:(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-placeholder`,children:a(`fieldPlaceholderLabel`)}),(0,m.jsx)(Dg,{id:`field-placeholder`,value:e.placeholder??``,placeholder:a(`fieldPlaceholderPlaceholder`),onChange:t=>v(n=>({...n,controller:{...e,placeholder:P3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-step`,children:a(`fieldStepLabel`)}),(0,m.jsx)(Dg,{id:`field-step`,type:`number`,min:.01,step:`any`,value:e.step??``,onChange:t=>v(n=>({...n,controller:{...e,step:F3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-unit`,children:a(`fieldUnitLabel`)}),(0,m.jsx)(Dg,{id:`field-unit`,value:e.unit??``,placeholder:a(`fieldUnitPlaceholder`),onChange:t=>v(n=>({...n,controller:{...e,unit:P3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-default-value`,children:a(`fieldDefaultValueLabel`)}),(0,m.jsx)(Dg,{id:`field-default-value`,type:`number`,step:`any`,value:e.defaultValue??``,onChange:t=>v(n=>({...n,controller:{...e,defaultValue:F3(t.target.value)}}))})]})]})})}case`datepicker`:{let e=c.controller;return(0,m.jsxs)(YT,{children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-date-mode`,children:a(`fieldDateModeLabel`)}),(0,m.jsxs)(G4,{value:e.mode,onValueChange:t=>v(n=>({...n,controller:{...e,mode:t}})),children:[(0,m.jsx)(J4,{id:`field-date-mode`,className:`w-full`,children:(0,m.jsx)(q4,{placeholder:a(`fieldDateModePlaceholder`)})}),(0,m.jsx)(Y4,{children:(0,m.jsx)(K4,{children:u.m.map(e=>(0,m.jsx)(X4,{value:e,children:a(`fieldDateModes.${e}`)},e))})})]})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-placeholder`,children:a(`fieldPlaceholderLabel`)}),(0,m.jsx)(Dg,{id:`field-placeholder`,value:e.placeholder??``,placeholder:e.mode===`year`?a(`fieldDatePlaceholders.year`):e.mode===`year-month`?a(`fieldDatePlaceholders.year-month`):a(`fieldDatePlaceholders.year-month-day`),onChange:t=>v(n=>({...n,controller:{...e,placeholder:P3(t.target.value)}}))})]})]})}case`switch`:{let e=c.controller;return(0,m.jsxs)(YT,{children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-checked-label`,children:a(`fieldCheckedLabelLabel`)}),(0,m.jsx)(Dg,{id:`field-checked-label`,value:e.checkedLabel??``,placeholder:a(`fieldCheckedLabelPlaceholder`),onChange:t=>v(n=>({...n,controller:{...e,checkedLabel:P3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-unchecked-label`,children:a(`fieldUncheckedLabelLabel`)}),(0,m.jsx)(Dg,{id:`field-unchecked-label`,value:e.uncheckedLabel??``,placeholder:a(`fieldUncheckedLabelPlaceholder`),onChange:t=>v(n=>({...n,controller:{...e,uncheckedLabel:P3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{orientation:`horizontal`,children:[(0,m.jsx)($T,{htmlFor:`field-default-checked`,children:a(`fieldDefaultCheckedLabel`)}),(0,m.jsx)(rE,{id:`field-default-checked`,checked:e.defaultChecked===!0,onCheckedChange:t=>v(n=>({...n,controller:{...e,defaultChecked:t}}))})]})]})}case`select`:{let e=c.controller,t=`select-options-${c.id}`,n=e.options.some(e=>!e.label?.trim());return(0,m.jsxs)(YT,{children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-placeholder`,children:a(`fieldPlaceholderLabel`)}),(0,m.jsx)(Dg,{id:`field-placeholder`,value:e.placeholder??``,placeholder:a(`fieldSelectPlaceholder`),onChange:t=>v(n=>({...n,controller:{...e,placeholder:P3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{orientation:`horizontal`,children:[(0,m.jsx)($T,{htmlFor:`field-allow-clear`,children:a(`fieldAllowClearLabel`)}),(0,m.jsx)(rE,{id:`field-allow-clear`,checked:e.allowClear===!0,onCheckedChange:t=>v(n=>({...n,controller:{...e,allowClear:t?!0:void 0}}))})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:a(`fieldOptionsLabel`)}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`fieldOptionsDescription`)})]}),(0,m.jsxs)(B,{type:`button`,variant:`outline`,size:`sm`,onClick:S,children:[(0,m.jsx)(yT,{"data-icon":`inline-start`}),a(`fieldAddOption`)]})]}),(0,m.jsx)(FL,{sensors:[$I.configure({activationConstraints:[new YI.Distance({value:5})],preventActivation:Uue})],onDragEnd:(e=>{if(e.canceled||!MR(e.operation)||!e.operation.source)return;let{source:t}=e.operation,{initialIndex:n,index:r}=t;n!==r&&v(e=>{if(e.type!==`select`)return e;let t=e.controller,i=[...t.options],[a]=i.splice(n,1);return a?(i.splice(r,0,a),{...e,controller:{...t,options:i}}):e})}),modifiers:e=>[...e,k3],children:(0,m.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.options.map((e,n)=>(0,m.jsx)(Jue,{groupId:t,option:e,index:n,onChange:C,onRemove:w},e.id))})}),n?(0,m.jsx)(nE,{children:a(`fieldSelectOptionLabelMissing`)}):null,(0,m.jsx)(`div`,{className:`flex justify-start`,children:(0,m.jsxs)(B,{type:`button`,variant:`outline`,size:`sm`,onClick:S,children:[(0,m.jsx)(yT,{"data-icon":`inline-start`}),a(`fieldAddOption`)]})})]})]})}case`slider`:{let e=c.controller;return(0,m.jsxs)(YT,{children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-slider-min`,children:a(`fieldMinLabel`)}),(0,m.jsx)(Dg,{id:`field-slider-min`,type:`number`,step:`any`,value:e.min??``,onChange:t=>v(n=>({...n,controller:{...e,min:F3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-slider-max`,children:a(`fieldMaxLabel`)}),(0,m.jsx)(Dg,{id:`field-slider-max`,type:`number`,step:`any`,value:e.max??``,onChange:t=>v(n=>({...n,controller:{...e,max:F3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-slider-step`,children:a(`fieldStepLabel`)}),(0,m.jsx)(Dg,{id:`field-slider-step`,type:`number`,step:`any`,value:e.step??``,onChange:t=>v(n=>({...n,controller:{...e,step:F3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-slider-default`,children:a(`fieldDefaultValueLabel`)}),(0,m.jsx)(Dg,{id:`field-slider-default`,type:`number`,step:`any`,value:e.defaultValue??``,onChange:t=>v(n=>({...n,controller:{...e,defaultValue:F3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{orientation:`horizontal`,children:[(0,m.jsx)($T,{htmlFor:`field-slider-show-value`,children:a(`fieldShowValueLabel`)}),(0,m.jsx)(rE,{id:`field-slider-show-value`,checked:e.showValue!==!1,onCheckedChange:t=>v(n=>({...n,controller:{...e,showValue:t}}))})]})]})}default:{let e=c.controller;return(0,m.jsxs)(YT,{className:`md:flex-row`,children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-placeholder`,children:a(`fieldPlaceholderLabel`)}),(0,m.jsx)(Dg,{id:`field-placeholder`,value:e.placeholder??``,placeholder:a(`fieldPlaceholderPlaceholder`),onChange:t=>v(n=>({...n,controller:{...e,placeholder:P3(t.target.value)}}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-input-mode`,children:a(`fieldInputModeLabel`)}),(0,m.jsxs)(G4,{value:e.inputMode??`text`,onValueChange:t=>v(n=>({...n,controller:{...e,inputMode:t}})),children:[(0,m.jsx)(J4,{id:`field-input-mode`,className:`w-full`,children:(0,m.jsx)(q4,{})}),(0,m.jsx)(Y4,{children:(0,m.jsxs)(K4,{children:[(0,m.jsx)(X4,{value:`text`,children:a(`fieldInputModes.text`)}),(0,m.jsx)(X4,{value:`email`,children:a(`fieldInputModes.email`)}),(0,m.jsx)(X4,{value:`tel`,children:a(`fieldInputModes.tel`)}),(0,m.jsx)(X4,{value:`url`,children:a(`fieldInputModes.url`)}),(0,m.jsx)(X4,{value:`password`,children:a(`fieldInputModes.password`)})]})})]})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-autocomplete`,children:a(`fieldAutocompleteLabel`)}),(0,m.jsx)(Dg,{id:`field-autocomplete`,list:`field-autocomplete-options`,value:e.autocomplete??``,placeholder:a(`fieldAutocompletePlaceholder`),onChange:t=>v(n=>({...n,controller:{...e,autocomplete:P3(t.target.value)}}))}),(0,m.jsx)(`datalist`,{id:`field-autocomplete-options`,children:Vue.map(e=>(0,m.jsx)(`option`,{value:e},e))})]})]})}}})()})})})}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`field-description`,children:a(`fieldDescriptionLabel`)}),(0,m.jsx)(Dg,{id:`field-description`,value:c.description??``,placeholder:a(`fieldDescriptionPlaceholder`),onChange:e=>v(t=>({...t,description:e.target.value}))})]})]}),(0,m.jsx)(KT,{}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(`h3`,{className:`font-medium text-base`,children:a(`fieldValidationSettingsTitle`)}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`fieldValidationSettingsDescription`)})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,m.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:g.length>0?g.map(e=>(0,m.jsxs)(B,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>b(e),children:[(0,m.jsx)(yT,{"data-icon":`inline-start`}),e.label]},e.type)):(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`fieldNoAdditionalValidations`)})}),(0,m.jsx)(YT,{className:`gap-3`,children:c.validations.map(e=>{let t=h.get(e.type),n=`validation-value-${e.id}`,r=`validation-message-${e.id}`;return t?(0,m.jsxs)(`div`,{className:`rounded-lg border border-border/70 p-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.label}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.description})]}),(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":a(`fieldRemoveValidation`),onClick:()=>x(e.id),children:(0,m.jsx)(GT,{})})]}),(0,m.jsxs)(YT,{className:`mt-3 gap-3`,children:[t.valueKind===`none`?null:(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:n,children:a(`fieldValidationValueLabel`)}),(0,m.jsx)(que,{controlId:n,suggestion:t,validation:e,onChange:t=>y(e.id,e=>({...e,value:t}))})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:r,children:a(`fieldValidationMessageLabel`)}),(0,m.jsx)(Dg,{id:r,value:e.message??``,placeholder:a(`fieldValidationMessagePlaceholder`),onChange:t=>y(e.id,e=>({...e,message:t.target.value}))})]})]})]},e.id):null})})]})]}),(0,m.jsx)(`div`,{className:`min-w-0`,children:(0,m.jsx)(YT,{className:`gap-4`,children:_.length>0?(0,m.jsxs)(y3,{size:`sm`,className:z(`border-destructive/40`),children:[(0,m.jsxs)(Aue,{children:[(0,m.jsx)(jue,{children:a(`fieldIssuesTitle`)}),(0,m.jsx)(Mue,{children:a(`fieldIssuesDescription`)})]}),(0,m.jsx)(b3,{children:(0,m.jsx)(nE,{children:(0,m.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:_.map(e=>(0,m.jsx)(`li`,{children:e},e))})})})]}):null})})]})})},Xue=({open:e,field:t,allFields:n,onOpenChange:r,onSave:i})=>{let a=J(`defaultEditors.formEditor`),o=J(`common.actions`),[s,c]=(0,d.useState)(t?.key??``),l=e&&t!==null,u=s.trim(),f=u?n.some(e=>e.id!==t?.id&&e.key.trim().toLowerCase()===u.toLowerCase())?a(`fieldKeyDuplicate`):null:a(`fieldKeyRequired`);return(0,m.jsx)(aO,{open:l,onOpenChange:r,children:(0,m.jsxs)(uO,{className:`sm:max-w-md`,children:[(0,m.jsxs)(dO,{children:[(0,m.jsx)(pO,{children:a(`fieldKeyDialogTitle`)}),(0,m.jsx)(mO,{children:a(`fieldKeyDialogDescription`)})]}),(0,m.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),!(!t||f)&&i(u)},children:[(0,m.jsxs)(ZT,{"data-invalid":f?!0:void 0,children:[(0,m.jsx)($T,{htmlFor:`field-key-dialog-input`,children:a(`fieldKeyLabel`)}),(0,m.jsx)(Dg,{id:`field-key-dialog-input`,autoFocus:!0,value:s,"aria-invalid":f?!0:void 0,placeholder:a(`fieldKeyPlaceholder`),onChange:e=>c(e.target.value)}),(0,m.jsx)(tE,{children:a(`fieldKeyDescription`)}),(0,m.jsx)(nE,{children:f})]}),(0,m.jsxs)(fO,{children:[(0,m.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>r(!1),children:o(`cancel`)}),(0,m.jsx)(B,{type:`submit`,disabled:f!==null,children:o(`save`)})]})]})]})})},Zue=({open:e,initialTitle:t,initialDescription:n,onOpenChange:r,onSave:i})=>{let a=J(`defaultEditors.formEditor`),o=J(`common.actions`),s=(0,d.useId)(),c=(0,d.useId)(),l=(0,d.useRef)(null),[u,f]=(0,d.useState)(t??``),[p,h]=(0,d.useState)(n??``),g=()=>{i({title:u.trim()||void 0,description:p.trim()||void 0})};return(0,m.jsx)(aO,{open:e,onOpenChange:e=>{if(e){r(!0);return}g()},children:(0,m.jsxs)(uO,{closeLabel:o(`close`),className:`sm:max-w-lg`,children:[(0,m.jsxs)(dO,{children:[(0,m.jsx)(pO,{children:a(`groupHeaderDialogTitle`)}),(0,m.jsx)(mO,{children:a(`groupHeaderDialogDescription`)})]}),(0,m.jsxs)(YT,{children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:s,children:a(`groupHeaderTitleLabel`)}),(0,m.jsx)(Dg,{id:s,value:u,placeholder:a(`groupHeaderTitlePlaceholder`),onChange:e=>f(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.nativeEvent.isComposing||(e.preventDefault(),l.current?.focus())}})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:c,children:a(`groupHeaderDescriptionLabel`)}),(0,m.jsx)(e3,{id:c,ref:l,value:p,placeholder:a(`groupHeaderDescriptionPlaceholder`),onChange:e=>h(e.target.value)})]})]})]})})},Que=[{key:`base`,labelKey:`layoutBreakpointCompact`},{key:`xs`,labelKey:`layoutBreakpointAtXs`},{key:`sm`,labelKey:`layoutBreakpointAtSm`},{key:`md`,labelKey:`layoutBreakpointAtMd`},{key:`xl`,labelKey:`layoutBreakpointAtXl`}];function $ue({columns:e}){return(0,m.jsx)(`div`,{className:`flex w-full gap-1.5`,children:Array.from({length:e},(e,t)=>(0,m.jsx)(`div`,{className:`flex min-h-9 min-w-0 flex-1 items-center justify-center rounded-md border border-border bg-muted/60 text-xs font-medium tabular-nums text-muted-foreground`,children:t+1},t))})}var ede=({open:e,initialLayout:t,onOpenChange:n,onSave:r})=>{let i=J(`defaultEditors.formEditor`),a=J(`common.actions`),[o,s]=(0,d.useState)(()=>({base:t.base,xs:t.xs,sm:t.sm,md:t.md,xl:t.xl})),c=(e,t)=>{s(n=>{let r=Math.min(4,Math.max(1,n[e]+t));return{...n,[e]:r}})};return(0,m.jsx)(aO,{open:e,onOpenChange:n,children:(0,m.jsxs)(uO,{showCloseButton:!1,className:`gap-0 max-h-screen overflow-y-auto sm:max-w-lg`,children:[(0,m.jsxs)(dO,{className:`px-1`,children:[(0,m.jsx)(pO,{children:i(`layoutDialogTitle`)}),(0,m.jsx)(mO,{children:i(`layoutDialogDescription`)})]}),(0,m.jsx)(`div`,{className:`py-4 space-y-4`,children:Que.map(({key:e,labelKey:t})=>(0,m.jsxs)(`section`,{className:``,children:[(0,m.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:i(t)}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-3 mt-2`,children:[(0,m.jsx)($ue,{columns:o[e]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`size-8 shrink-0 rounded-md`,"aria-label":i(`layoutDecreaseColumns`),disabled:o[e]<=1,onClick:()=>c(e,-1),children:(0,m.jsx)(lT,{className:`size-4`})}),(0,m.jsx)(`span`,{className:`min-w-8 text-center text-sm font-semibold tabular-nums`,children:o[e]}),(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`size-8 shrink-0 rounded-md`,"aria-label":i(`layoutIncreaseColumns`),disabled:o[e]>=4,onClick:()=>c(e,1),children:(0,m.jsx)(yT,{className:`size-4`})})]})]})]},e))}),(0,m.jsxs)(fO,{children:[(0,m.jsx)(B,{type:`button`,variant:`outline`,onClick:()=>n(!1),children:a(`cancel`)}),(0,m.jsx)(B,{type:`button`,onClick:()=>{r(o)},children:a(`save`)})]})]})})};function I3({label:e,children:t,destructive:n=!1}){return(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(`span`,{className:z(`inline-flex size-6 shrink-0 items-center justify-center rounded-md`,n?`text-destructive`:`text-muted-foreground`),"aria-label":e,children:t})}),(0,m.jsx)(IE,{side:`top`,children:e})]})}function L3({codingKey:e,fieldType:t,label:n,required:r=!1,hasValidations:i=!1,isInvalid:a=!1,variant:o=`bordered`,className:s,onClick:c,onEditKey:l,onDelete:u}){let d=J(`defaultEditors.formEditor`),f=j3[t],p=n?.trim()||M3(d,t),h=typeof c==`function`,g=(0,m.jsxs)(`div`,{role:h?`button`:void 0,tabIndex:h?0:void 0,onClick:c,onKeyDown:e=>{c&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c())},className:z(`group/field-row flex min-w-0 items-center gap-2 rounded-lg px-2.5 py-1 text-sm transition-colors`,o===`bordered`?`border border-border/70 bg-background shadow-xs`:`border border-transparent bg-transparent`,(h||u)&&`hover:bg-muted/60`,h&&`cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,s),children:[(0,m.jsx)(`span`,{className:`text-muted-foreground`,children:(0,m.jsx)(f,{className:`size-4`})}),(0,m.jsx)(`span`,{className:`inline-flex shrink-0 rounded-md bg-muted px-2 py-1 font-mono text-[0.7rem] font-semibold uppercase tracking-[0.12em] text-muted-foreground`,children:e}),(0,m.jsx)(`span`,{className:z(`min-w-0 flex-1 truncate font-medium`,n?.trim()?`text-foreground`:`text-muted-foreground`),children:p}),(0,m.jsxs)(`span`,{className:`flex shrink-0 items-center gap-0.5`,children:[r?(0,m.jsx)(I3,{label:d(`fieldRequired`),children:(0,m.jsx)(uw,{className:`size-3.5`})}):null,a?(0,m.jsx)(I3,{label:d(`fieldInvalid`),destructive:!0,children:(0,m.jsx)(Cw,{className:`size-4`})}):i?(0,m.jsx)(I3,{label:d(`fieldHasValidations`),children:(0,m.jsx)(ET,{className:`size-4`})}):null,h?(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`opacity-0 transition-opacity group-hover/field-row:opacity-100 group-focus-within/field-row:opacity-100`,"aria-label":d(`openFieldEditor`),onClick:e=>{e.stopPropagation(),c()},children:(0,m.jsx)(hT,{className:`size-3.5`})}):null]})]});return!u&&!l?g:(0,m.jsxs)(yD,{children:[(0,m.jsx)(bD,{asChild:!0,children:g}),(0,m.jsxs)(CD,{className:`border-border`,children:[l?(0,m.jsxs)(wD,{onSelect:l,children:[(0,m.jsx)(`span`,{className:`size-4 shrink-0`,"aria-hidden":!0}),d(`editFieldKey`)]}):null,l&&u?(0,m.jsx)(OD,{}):null,(0,m.jsxs)(wD,{variant:`destructive`,onSelect:e=>{e.preventDefault(),u?.()},children:[(0,m.jsx)(zT,{className:`size-4`}),d(`deleteField`)]})]})]})}function tde({groupId:e,field:t,index:n}){let r=J(`defaultEditors.formEditor`),{ref:i,isDragging:a}=Cz({id:t.id,index:n,group:e});return(0,m.jsx)(`li`,{ref:i,className:z(`list-none touch-none`,a&&`opacity-90`),"aria-label":r(`dragHandle`),children:(0,m.jsxs)(`div`,{className:z(`group flex items-center`),children:[(0,m.jsx)(`span`,{className:`group-hover:opacity-100 opacity-0 transition-opacity inline-flex size-8 shrink-0 items-center justify-center rounded-lg text-muted-foreground`,children:(0,m.jsx)(qw,{className:`size-4`})}),(0,m.jsx)(L3,{codingKey:t.key,fieldType:t.type,label:t.label,required:t.required,hasValidations:t.hasValidations,isInvalid:t.isInvalid,className:`min-w-0 flex-1`})]})})}var nde=({open:e,groupId:t,groupTitle:n,fields:r,onOpenChange:i,onFieldsReorder:a})=>{let o=J(`defaultEditors.formEditor`),s=e&&t!==null;return(0,m.jsx)(aO,{open:s,onOpenChange:i,children:(0,m.jsxs)(uO,{showCloseButton:!1,className:`gap-0 overflow-hidden sm:max-w-2xl`,children:[(0,m.jsxs)(dO,{children:[(0,m.jsx)(pO,{children:o(`sortDialogTitle`)}),(0,m.jsx)(mO,{children:o(`sortDialogDescription`,{groupTitle:n?.trim()||o(`sortDialogUntitledGroup`)})})]}),(0,m.jsx)(FL,{sensors:[$I.configure({activationConstraints:[new YI.Distance({value:5})]})],onDragEnd:(e=>{if(e.canceled||!MR(e.operation)||!e.operation.source)return;let{source:t}=e.operation,{initialIndex:n,index:i}=t;if(n===i)return;let o=[...r],[s]=o.splice(n,1);s&&(o.splice(i,0,s),a(o))}),modifiers:e=>[...e,k3],children:(0,m.jsx)(`div`,{className:`max-h-[min(28rem,65svh)] overflow-y-auto py-4`,children:r.length>0?(0,m.jsx)(`ol`,{className:`space-y-2`,children:r.map((e,n)=>(0,m.jsx)(tde,{groupId:t??`form-field-sort`,field:e,index:n},e.id))}):(0,m.jsx)(`div`,{className:`rounded-xl border border-dashed border-border/80 bg-muted/20 px-4 py-8 text-center text-sm text-muted-foreground`,children:o(`sortDialogEmpty`)})})}),(0,m.jsx)(fO,{showCloseButton:!0,closeLabel:o(`sortDialogClose`)})]})})},rde=`[data-field-group-header-trigger="true"]`,ide=`
|
|
192
|
-
input:not([disabled]),
|
|
193
|
-
select:not([disabled]),
|
|
194
|
-
textarea:not([disabled]),
|
|
195
|
-
button:not([disabled]),
|
|
196
|
-
a[href],
|
|
197
|
-
[contenteditable]:not([contenteditable="false"])
|
|
198
|
-
`;function ade(e,t){let{target:n}=e;return!(n instanceof Element)||n.closest(rde)||n===t.element||n===t.handle||t.handle?.contains(n)?!1:!!n.closest(ide)}var ode=({onSelectChangeTitle:e,onSelectEditBranching:t,onSelectEditLayout:n,onSelectDeleteGroup:r,onSelectSortFields:i})=>{let a=J(`defaultEditors.formEditor`);return(0,m.jsxs)(iE,{children:[(0,m.jsx)(aE,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,variant:`outline`,size:`icon-sm`,className:`rounded-full text-muted-foreground shadow-sm`,"aria-label":a(`fieldGroupMenuButton`),children:(0,m.jsx)(DT,{className:`size-3.5`})})}),(0,m.jsxs)(oE,{align:`end`,className:`min-w-48`,children:[(0,m.jsxs)(cE,{onSelect:e,children:[(0,m.jsx)(`span`,{className:`size-4 shrink-0`,"aria-hidden":!0}),a(`fieldGroupMenu.changeTitle`)]}),(0,m.jsxs)(cE,{disabled:!0,onSelect:t,children:[(0,m.jsx)(Gw,{className:`size-4`}),a(`fieldGroupMenu.editBranching`)]}),(0,m.jsxs)(cE,{onSelect:n,children:[(0,m.jsx)(`span`,{className:`size-4 shrink-0`,"aria-hidden":!0}),a(`fieldGroupMenu.editLayout`)]}),(0,m.jsxs)(cE,{onSelect:i,children:[(0,m.jsx)(pw,{className:`size-4`}),a(`fieldGroupMenu.sortFields`)]}),(0,m.jsx)(pE,{}),(0,m.jsxs)(cE,{variant:`destructive`,onSelect:r,children:[(0,m.jsx)(zT,{className:`size-4`}),a(`fieldGroupMenu.deleteGroup`)]})]})]})};function sde({field:e,onEdit:t,onEditKey:n,onDelete:r}){return(0,m.jsx)(`li`,{children:(0,m.jsx)(L3,{codingKey:e.key,fieldType:e.type,label:e.label,required:e.required,hasValidations:e.hasValidations,isInvalid:e.isInvalid,onClick:t,onEditKey:n,onDelete:r})})}function cde({ariaLabel:e,buttonClassName:t,buttonSize:n=`sm`,buttonVariant:r=`ghost`,children:i,onSelectType:a}){let o=J(`defaultEditors.formEditor`);return(0,m.jsxs)(iE,{children:[(0,m.jsx)(aE,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,variant:r,size:n,className:t,"aria-label":e,children:i})}),(0,m.jsx)(oE,{align:`start`,className:`min-w-52`,children:Rue.map(e=>{let t=j3[e];return(0,m.jsxs)(cE,{onSelect:()=>a(e),children:[(0,m.jsx)(t,{className:`size-4`}),M3(o,e)]},e)})})]})}function lde({groupId:e,item:t,displayCondition:n,index:r,onAddField:i,onChangeGroupHeader:a,onEditLayout:o,onDeleteGroup:s,onDeleteField:c,onEditField:l,onEditFieldKey:d,onSortFields:f}){let p=J(`defaultEditors.formEditor`),h=J(`itemLabelEditor`),{ref:g,isDragging:_}=Cz({id:t.id,index:r,group:e}),v=t.title?.trim(),y=t.description?.trim();return(0,m.jsx)(`li`,{ref:g,className:`list-none touch-none `,children:(0,m.jsxs)(`div`,{className:z(`form-field-group-layout-scope rounded-xl border border-border bg-card p-3 shadow-sm transition-colors`,`hover:border-border/90 hover:bg-muted/40`,_&&`bg-muted/70 backdrop-blur-sm`),style:u._(t.layout),children:[(0,m.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`min-w-0 flex-1 flex items-start gap-2 rounded-md text-left outline-none transition-colors hover:text-foreground hover:underline focus-visible:ring-2 focus-visible:ring-ring/60`,onClick:()=>a(t.id),"aria-label":p(`fieldGroupMenu.changeTitle`),"data-field-group-header-trigger":`true`,children:[(0,m.jsx)(Mw,{className:`mt-1 size-4 shrink-0 text-muted-foreground`}),v?(0,m.jsx)(`span`,{className:`min-w-0 flex-1 wrap-break-word text-base font-semibold text-foreground`,children:v}):(0,m.jsx)(`span`,{className:`min-w-0 flex-1 wrap-break-word text-base font-semibold text-muted-foreground`,children:h(`emptyLabel`)})]}),n?(0,m.jsx)(HO,{expression:n,title:p(`fieldGroupBranching`)}):t.hasDisplayCondition?(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(`span`,{className:`inline-flex shrink-0 rounded p-1 text-muted-foreground hover:bg-muted/80`,"aria-label":p(`fieldGroupBranching`),children:(0,m.jsx)(Gw,{className:`size-4`,"aria-hidden":!0})})}),(0,m.jsx)(IE,{side:`top`,children:p(`fieldGroupBranching`)})]}):null,(0,m.jsx)(ode,{onSelectChangeTitle:()=>a(t.id),onSelectEditBranching:()=>void 0,onSelectEditLayout:()=>o(t.id),onSelectDeleteGroup:()=>s(t.id),onSelectSortFields:()=>f(t.id)})]}),(0,m.jsx)(`div`,{children:y?(0,m.jsx)(`button`,{type:`button`,className:`mt-1 block w-full rounded-md text-left text-sm leading-5 text-muted-foreground outline-none transition-colors hover:text-foreground hover:underline focus-visible:ring-2 focus-visible:ring-ring/60`,onClick:()=>a(t.id),"aria-label":p(`fieldGroupMenu.changeTitle`),"data-field-group-header-trigger":`true`,children:y}):null}),(0,m.jsxs)(`div`,{className:`mt-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,m.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:p(`fieldsLabel`)}),(0,m.jsx)(B,{type:`button`,variant:`outline`,size:`icon-sm`,className:`rounded-full text-muted-foreground shadow-sm`,"aria-label":p(`fieldGroupMenu.sortFields`),onClick:()=>f(t.id),children:(0,m.jsx)(pw,{className:`size-4`})})]}),(0,m.jsxs)(`div`,{className:`mt-2 space-y-2`,children:[t.fields.length>0&&(0,m.jsx)(`ol`,{className:`space-y-1`,children:t.fields.map(e=>(0,m.jsx)(sde,{field:e,onEdit:()=>l(t.id,e.id),onEditKey:()=>d(t.id,e.id),onDelete:()=>c(t.id,e.id)},e.id))}),(0,m.jsxs)(cde,{ariaLabel:p(`addField`),buttonClassName:`min-w-36 justify-start gap-2 rounded-full text-muted-foreground`,onSelectType:e=>i(t.id,e),children:[(0,m.jsx)(yT,{className:`size-4`}),p(`addField`)]})]})]})]})})}var ude=({itemId:e,items:t,onAddField:n,onChangeGroupHeader:r,onEditLayout:i,onDeleteGroup:a,onDeleteField:o,onEditField:s,onEditFieldKey:c,onSortFields:l,onItemsReorder:u})=>{let d=tD()?.surveyItems.get(e)?.displayConditions?.components;return(0,m.jsx)(FL,{sensors:[$I.configure({activationConstraints:[new YI.Distance({value:5})],preventActivation:ade})],onDragEnd:(e=>{if(e.canceled||!MR(e.operation)||!e.operation.source)return;let{source:n}=e.operation,{initialIndex:r,index:i}=n;if(r===i)return;let a=[...t],[o]=a.splice(r,1);o&&(a.splice(i,0,o),u(a))}),modifiers:e=>[...e,k3],children:(0,m.jsx)(`div`,{className:`min-h-0 max-h-[min(40rem,70svh)] overflow-y-auto`,children:(0,m.jsx)(`ol`,{className:`space-y-3 p-px`,children:t.map((t,u)=>(0,m.jsx)(lde,{groupId:e,item:t,displayCondition:d?.[t.id],index:u,onAddField:n,onChangeGroupHeader:r,onEditLayout:i,onDeleteGroup:a,onDeleteField:o,onEditField:s,onEditFieldKey:c,onSortFields:l},t.id))})})})},R3=({itemId:e,config:t,editingConfig:n,selectedLocale:r,translationNamespace:i,onPersist:a})=>{let o=J(`defaultEditors.formEditor`),s=t.fieldGroups.length,[c,l]=(0,d.useState)(null),[f,p]=(0,d.useState)(null),[h,g]=(0,d.useState)(null),[_,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(null),x=t.fieldGroups.find(e=>e.id===c)??null,S=n.fieldGroups.find(e=>e.id===f)??null,C=t.fieldGroups.find(e=>e.id===h)??null,w=(_?n.fieldGroups.find(e=>e.id===_.groupId)??null:null)?.fields.find(e=>e.id===_?.fieldId)??null,T=(y?n.fieldGroups.find(e=>e.id===y.groupId)??null:null)?.fields.find(e=>e.id===y?.fieldId)??null,E=(0,d.useMemo)(()=>t.fieldGroups.flatMap(e=>e.fields),[t.fieldGroups]),D=()=>{a(e=>{e.fieldGroups=[...e.fieldGroups,u.g()]})},O=e=>{a(t=>{t.fieldGroups=e})},k=(e,t)=>{a(n=>{let r=n.fieldGroups.find(t=>t.id===e);if(!r)return;let i=u.C(n.fieldGroups.flatMap(e=>e.fields));r.fields=[...r.fields,u.h(t,i)]})},A=(e,t)=>{a((n,r)=>{let a=n.fieldGroups.find(t=>t.id===e);a&&(a.fields=a.fields.filter(e=>e.id!==t),r.removeContentKeysWithPrefix(u.x(t,i)))}),v(n=>n?.groupId===e&&n.fieldId===t?null:n),b(n=>n?.groupId===e&&n.fieldId===t?null:n)},j=e=>{a((t,n)=>{let r=t.fieldGroups.findIndex(t=>t.id===e);if(!(r<0)){n.removeContentKeysWithPrefix(u.y(e,i));for(let e of t.fieldGroups[r].fields)n.removeContentKeysWithPrefix(u.x(e.id,i));t.fieldGroups.splice(r,1)}}),l(t=>t===e?null:t),p(t=>t===e?null:t),g(t=>t===e?null:t),v(t=>t?.groupId===e?null:t),b(t=>t?.groupId===e?null:t)},M=e=>{l(e)},N=e=>{p(e)},ee=e=>{g(e)},P=(e,t)=>{v({groupId:e,fieldId:t})},F=(e,t)=>{b({groupId:e,fieldId:t})},I=e=>{e||g(null)},L=e=>{if(h){if(JSON.stringify(C?.layout)===JSON.stringify(e)){g(null);return}a(t=>{let n=t.fieldGroups.find(e=>e.id===h);n&&(n.layout=e)}),g(null)}},te=e=>{e||l(null)},ne=e=>{e||p(null)},re=e=>{e||v(null)},ie=e=>{e||b(null)},ae=(e,t)=>{a(n=>{let r=n.fieldGroups.find(t=>t.id===e);r&&(r.fields=t)})};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`section`,{className:`min-h-24`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,m.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-2 text-sm font-semibold uppercase tracking-wider text-gray-600`,children:[(0,m.jsx)(`span`,{children:o(`responseConfig`)}),(0,m.jsxs)(`span`,{className:`font-normal normal-case tracking-normal text-muted-foreground`,children:[`(`,(0,m.jsx)(`span`,{className:`tabular-nums`,children:s}),`)`]})]}),(0,m.jsx)(B,{type:`button`,variant:`outline`,size:`icon-sm`,className:`rounded-full text-muted-foreground shadow-sm`,"aria-label":o(`addFieldGroup`),onClick:D,children:(0,m.jsx)(yT,{className:`size-4`})})]}),(0,m.jsxs)(`div`,{className:`mt-2`,children:[s>0&&(0,m.jsx)(ude,{itemId:e,items:t.fieldGroups,onAddField:k,onChangeGroupHeader:N,onEditLayout:ee,onDeleteGroup:j,onDeleteField:A,onEditField:P,onEditFieldKey:F,onSortFields:M,onItemsReorder:O}),(0,m.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,className:z(`mt-2 min-w-44 justify-start gap-2 rounded-full text-muted-foreground`),onClick:D,children:[(0,m.jsx)(yT,{className:`size-4`}),o(`addFieldGroup`)]})]})]}),(0,m.jsx)(nde,{open:x!==null,groupId:x?.id??null,groupTitle:x?.title,fields:x?.fields??[],onOpenChange:te,onFieldsReorder:e=>{x&&ae(x.id,e)}}),(0,m.jsx)(Zue,{open:S!==null,initialTitle:S?.title,initialDescription:S?.description,onOpenChange:ne,onSave:e=>{if(!(!f||!S)){if(S.title===e.title&&S.description===e.description){p(null);return}a((t,n)=>{let a=t.fieldGroups.find(e=>e.id===f);a&&(a.title=e.title,a.description=e.description,u.D(n,r,a,i))}),p(null)}}},`header-${S?.id??`closed`}-${r}-${S===null?`closed`:`open`}`),(0,m.jsx)(ede,{open:C!==null,initialLayout:C?.layout??{base:1,xs:1,sm:1,md:1,xl:1},onOpenChange:I,onSave:L},`layout-${C?.id??`closed`}`),(0,m.jsx)(Yue,{open:w!==null,field:w,allFields:E,onOpenChange:re,onSave:e=>{if(!(!_||!w)){if(JSON.stringify(w)===JSON.stringify(e)){v(null);return}a((t,n)=>{let a=t.fieldGroups.find(e=>e.id===_.groupId);if(!a)return;let o=a.fields.findIndex(e=>e.id===_.fieldId);if(o<0)return;let s=a.fields[o],c=new Set(u.b(s,i)),l=new Set(u.b(e,i));for(let e of c)l.has(e)||n.removeContentKey(e);u.O(n,r,e,i),a.fields[o]=e}),v(null)}}},`field-${w?.id??`closed`}`),(0,m.jsx)(Xue,{open:T!==null,field:T,allFields:E,onOpenChange:ie,onSave:e=>{if(!(!y||!T)){if(T.key.trim()===e){b(null);return}a(t=>{let n=t.fieldGroups.find(e=>e.id===y.groupId);if(!n)return;let r=n.fields.findIndex(e=>e.id===y.fieldId);r<0||(n.fields[r]={...n.fields[r],key:e})}),b(null)}}},`field-key-${T?.id??`closed`}`)]})},dde=({open:e,option:t,existingOptions:n,initialLabelContent:r,initialFocusField:i=`label`,initialAdvancedOpen:a=!1,itemId:o,embeddedFormConfig:s,embeddedFormEditingConfig:c,selectedLocale:l,translationNamespace:f,onSave:p,onPersistEmbeddedForm:h})=>{let g=J(`defaultEditors.choiceEditor`),_=J(`defaultEditors.choiceEditor.advancedSettings`),v=J(`defaultEditors.choiceEditor.embeddedFormDialog`),y=J(`common.actions`),[b,x]=(0,d.useState)(a),[S,C]=(0,d.useState)(!1),[w,T]=(0,d.useState)(t?.key??``),[E,D]=(0,d.useState)(r),[O,k]=(0,d.useState)(()=>t2(r)),[A]=(0,d.useState)(0),j=e&&t!==null,M=u.p(w),N=n.some(e=>e.id!==t?.id&&u.p(e.key??``)===M),ee=M.length===0?g(`createOptionKeyRequired`):N?g(`createOptionKeyDuplicate`):null,P=ee!==null||t===null,F=t?u.a(t):!1,I=+!!F,L=u.s(n).key??`opt_1`,te=e=>{t&&p({...t,key:e},E)},ne=()=>{P||te(M)};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(aO,{open:j,onOpenChange:e=>{if(!e){if(ee){C(!0);return}ne()}},children:(0,m.jsxs)(uO,{closeLabel:y(`close`),className:z(`survey-editor overflow-visible border-0 bg-transparent p-0 shadow-none ring-0 transition-[max-width] duration-200`,b?`sm:max-w-5xl`:`sm:max-w-xl`),children:[(0,m.jsx)(pO,{className:`sr-only`,children:g(`editOptionDialogTitle`)}),(0,m.jsx)(`div`,{className:`max-h-[min(88svh,56rem)] overflow-y-auto rounded-xl border border-border bg-card p-3 shadow-sm`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,m.jsx)(`div`,{className:`pr-9`,children:(0,m.jsx)(_3,{draftKey:w,draftLabelEditorValue:O,keyValidationMessage:ee,labelEditorInstanceKey:A,labelAutoFocus:i===`label`,keyAutoFocus:i===`key`,onDraftKeyChange:T,onDraftLabelChange:e=>{k(e.value),D(e.isEmpty?void 0:e2(e.editorState))},onSubmitShortcut:ne})}),(0,m.jsxs)(s3,{open:b,onOpenChange:x,children:[(0,m.jsx)(c3,{asChild:!0,children:(0,m.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,className:`-ml-2 w-fit aria-expanded:bg-transparent aria-expanded:hover:bg-muted`,children:[(0,m.jsx)(`span`,{children:_(`title`)}),I>0?(0,m.jsx)(PD,{variant:`secondary`,children:_(`configuredCount`,{count:I})}):null,(0,m.jsx)(vw,{"data-icon":`inline-end`,className:`transition-transform duration-200 group-data-[state=open]/button:rotate-180`,"aria-hidden":!0})]})}),(0,m.jsx)(l3,{children:(0,m.jsxs)(`div`,{className:`pt-2`,children:[(0,m.jsx)(KT,{}),(0,m.jsxs)(`section`,{className:`py-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,m.jsx)(Ww,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,m.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:v(`title`)}),(0,m.jsxs)(zD,{children:[(0,m.jsx)(BD,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":v(`helpLabel`),children:(0,m.jsx)(Ew,{})})}),(0,m.jsx)(VD,{align:`start`,children:(0,m.jsxs)(UD,{children:[(0,m.jsx)(WD,{children:v(`title`)}),(0,m.jsx)(GD,{children:v(`description`)})]})})]}),F?(0,m.jsx)(PD,{variant:`outline`,children:_(`configured`)}):null]})})]}),(0,m.jsx)(`div`,{className:`mt-3`,children:(0,m.jsx)(R3,{itemId:o,config:s,editingConfig:c,selectedLocale:l,translationNamespace:f,onPersist:h})})]})]})})]})]})})]})}),(0,m.jsx)(_g,{open:S,onOpenChange:C,children:(0,m.jsxs)(bg,{className:`survey-editor`,children:[(0,m.jsxs)(xg,{children:[(0,m.jsx)(Cg,{children:g(`invalidKeyDialogTitle`)}),(0,m.jsx)(wg,{children:g(`invalidKeyDialogDescription`,{validationMessage:ee??``})})]}),(0,m.jsxs)(Sg,{children:[(0,m.jsx)(Eg,{children:g(`invalidKeyDialogKeepEditing`)}),(0,m.jsx)(Tg,{onClick:()=>{T(L),te(L)},children:g(`invalidKeyDialogUseGenerated`,{key:L})})]})]})})]})};function fde({sessionId:e,editor:t,changeTick:n,persistDebounceMs:r,onEditorStateChange:i}){let a=(0,d.useRef)(null),o=(0,d.useRef)({sessionId:e,editor:t,changeTick:n}),s=(0,d.useEffectEvent)(e=>{i?.(e)});(0,d.useEffect)(()=>{o.current={sessionId:e,editor:t,changeTick:n}},[e,t,n]),(0,d.useEffect)(()=>{if(a.current&&=(clearTimeout(a.current),null),!(!t||n===0)){if(r<=0){s({sessionId:e,state:t.toJson(),revision:n,hasUncommittedChanges:t.hasUncommittedChanges,commitsSinceInitial:t.getCommitsSinceInitial(),at:Date.now()});return}return a.current=setTimeout(()=>{s({sessionId:e,state:t.toJson(),revision:n,hasUncommittedChanges:t.hasUncommittedChanges,commitsSinceInitial:t.getCommitsSinceInitial(),at:Date.now()})},r),()=>{a.current&&=(clearTimeout(a.current),null)}}},[e,t,n,r]),(0,d.useEffect)(()=>()=>{let e=o.current;e.editor&&e.changeTick>0&&s({sessionId:e.sessionId,state:e.editor.toJson(),revision:e.changeTick,hasUncommittedChanges:e.editor.hasUncommittedChanges,commitsSinceInitial:e.editor.getCommitsSinceInitial(),at:Date.now()})},[])}function pde({className:e,children:t,...n}){return(0,m.jsxs)(Id,{"data-slot":`scroll-area`,className:z(`relative`,e),...n,children:[(0,m.jsx)(Rd,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,m.jsx)(mde,{}),(0,m.jsx)(pte,{})]})}function mde({className:e,orientation:t=`vertical`,...n}){return(0,m.jsx)(Vd,{"data-slot":`scroll-area-scrollbar`,"data-orientation":t,orientation:t,className:z(`flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent`,e),...n,children:(0,m.jsx)(Qd,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}var hde=()=>{let e=J(`routes.historyStack`),t=qE(),[n,r]=(0,d.useState)(!1),i=q(e=>e.getUndoRedoHistory),a=q(e=>e.jumpToIndexInHistory),o=q(e=>e.userMutationsLocked),s=i(),c=s.at(s.length-1);return(0,m.jsxs)(zD,{open:n,onOpenChange:r,children:[(0,m.jsx)(BD,{asChild:!0,children:(0,m.jsxs)(B,{variant:`ghost`,size:`xs`,className:`backdrop-blur-md gap-1 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/50 focus-visible:border-transparent`,disabled:o,children:[(0,m.jsx)(Xw,{className:`size-3.5`}),(0,m.jsxs)(`span`,{className:`space-x-1`,children:[(0,m.jsx)(`span`,{className:`text-xs font-light hidden @sm/main:inline`,children:e(`lastModified`)}),(0,m.jsx)(`span`,{className:`text-xs font-medium`,children:ne(new Date(c?.timestamp??0),{addSuffix:!0,locale:t})})]})]})}),(0,m.jsxs)(VD,{className:`min-w-96 p-0 gap-0 border-border`,align:`start`,side:`top`,children:[(0,m.jsxs)(`div`,{className:`p-3 border-b border-border shadow-xs drop-shadow-xs bg-muted/50`,children:[(0,m.jsx)(`h4`,{className:`font-medium text-sm`,children:e(`recentChangesTitle`)}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`recentChangesDescription`)})]}),(0,m.jsx)(pde,{className:`h-64`,children:(0,m.jsx)(`ol`,{className:`divide-y divide-border pt-1`,children:s.toSorted((e,t)=>t.timestamp-e.timestamp).map(e=>(0,m.jsx)(`li`,{children:(0,m.jsxs)(`button`,{disabled:e.isCurrent,className:z(`text-sm px-3 py-1 flex items-center justify-between w-full`,`hover:bg-accent transition-colors focus:bg-accent focus:outline-none`,e.isCurrent&&`bg-primary text-primary-foreground hover:bg-primary focus:bg-primary`),onClick:()=>a(e.index),children:[(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(`p`,{className:`truncate text-xs font-medium`,children:e.meta.label})}),(0,m.jsx)(IE,{children:e.meta.label})]}),(0,m.jsx)(`p`,{className:z(`text-xs text-muted-foreground`,e.isCurrent&&`text-primary-foreground/80`),children:ne(new Date(e.timestamp),{addSuffix:!0,locale:t})})]})},e.index))})})]})]})};function z3(){let e=q(e=>e.changeTick),t=q(e=>e.getAssets);return(0,d.useMemo)(()=>t(),[e,t])}function B3(){let e=z3();return(0,d.useMemo)(()=>Array.from(e.entries()).filter(([,e])=>e.kind===`image`),[e])}function V3(){let e=z3(),t=tD();return(0,d.useMemo)(()=>{if(e.size===0)return 0;let n=new Set((t?.getAssetUsages()??[]).map(e=>e.assetId)),r=0;for(let t of e.keys())n.has(t)||(r+=1);return r},[e,t])}async function H3(e){return await new Promise((t,n)=>{let r=new FileReader;r.onerror=()=>n(r.error??Error(`Failed to read file`)),r.onload=()=>{let e=r.result;if(typeof e!=`string`){n(Error(`Unexpected file reader result`));return}let[,i=``]=e.split(`,`,2);t(i)},r.readAsDataURL(e)})}function U3(e){if(!(!e||e.kind!==`image`))return`data:${e.source.mediaType};base64,${e.source.data}`}function gde(e,t){let n=e.metadata;return n?.name?.trim()||n?.filename?.trim()||n?.alt?.trim()||t}function W3(e,t){let n={...e.metadata,...t};if(!(!n?.name&&!n?.filename&&!n?.alt&&n?.width===void 0&&n?.height===void 0))return n}var _de=`group/card flex h-full min-h-0 flex-col overflow-hidden rounded-xl border border-border bg-card shadow-sm transition-shadow`;function vde({assetId:e,asset:t,usages:n,getUsageItemLabel:r,onNavigateToUsage:i,onSaveAsset:a,onRemoveAsset:o}){let s=J(`defaultEditors.assetManager`),[c,l]=(0,d.useState)(t.metadata?.name??``),[u,f]=(0,d.useState)(!1),[p,h]=(0,d.useState)(!1),g=(0,d.useRef)(null),_=`data:${t.source.mediaType};base64,${t.source.data}`,v=t.metadata?.filename?.trim()??e,y=t.metadata?.alt??t.metadata?.name??t.metadata?.filename??e,b=n.length===0,x=(0,d.useMemo)(()=>{let e=new Map;for(let t of n){let n=`${t.itemId??`survey`}:${t.usageScope}`;e.has(n)||e.set(n,t)}return[...e.values()]},[n]),S=()=>{let n=c.trim();n!==(t.metadata?.name?.trim()??``)&&a(e,{...t,metadata:W3(t,{name:n||void 0})})},C=async n=>{if(!n)return;let r=c.trim();f(!0);try{let i=await H3(n);a(e,{...t,source:{type:`embedded`,mediaType:n.type||`application/octet-stream`,encoding:`base64`,data:i},metadata:W3(t,{name:r||void 0,filename:n.name,width:void 0,height:void 0})})}finally{f(!1),g.current&&(g.current.value=``)}};return(0,m.jsxs)(`article`,{className:_de,children:[(0,m.jsxs)(`div`,{className:`relative aspect-4/3 shrink-0 overflow-hidden bg-muted/30`,children:[(0,m.jsx)(`img`,{src:_,alt:``,className:`pointer-events-none size-full object-cover`,"aria-hidden":!0}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>{h(!0)},className:z(`absolute inset-0 z-1 flex cursor-zoom-in items-start justify-end p-2`,`bg-black/0 transition-colors hover:bg-black/10`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background`),"aria-label":s(`expandPreview`),title:s(`expandPreview`),children:(0,m.jsx)(`span`,{className:`inline-flex size-8 shrink-0 items-center justify-center rounded-md border border-border/80 bg-background/90 text-foreground shadow-sm backdrop-blur-sm`,"aria-hidden":!0,children:(0,m.jsx)(sT,{className:`size-4`})})})]}),(0,m.jsx)(aO,{open:p,onOpenChange:h,children:(0,m.jsxs)(uO,{className:`max-h-[min(90vh,calc(100vh-2rem))] w-[min(96vw,56rem)] max-w-[min(96vw,56rem)] gap-0 overflow-hidden p-2 sm:max-w-[min(96vw,56rem)]`,closeLabel:s(`closePreview`),children:[(0,m.jsx)(pO,{className:`sr-only`,children:s(`previewTitle`)}),(0,m.jsx)(`div`,{className:`flex max-h-[min(85vh,calc(100vh-4rem))] min-h-0 w-full items-center justify-center overflow-auto p-1`,children:(0,m.jsx)(`img`,{src:_,alt:y,className:`max-h-[min(85vh,calc(100vh-4rem))] w-auto max-w-full object-contain`})})]})}),(0,m.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col space-y-2 p-4`,children:[(0,m.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,m.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,m.jsx)(`p`,{className:`truncate text-sm font-semibold tracking-tight`,title:v,children:v})}),(0,m.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,m.jsx)(`input`,{ref:g,type:`file`,accept:`image/*`,className:`hidden`,onChange:e=>{C(e.target.files?.[0])}}),(0,m.jsx)(B,{type:`button`,size:`icon-sm`,variant:`ghost`,onClick:()=>g.current?.click(),disabled:u,className:`text-muted-foreground hover:text-foreground`,"aria-label":s(`replaceAsset`),title:s(`replaceAsset`),children:(0,m.jsx)(bT,{className:`size-4`})}),(0,m.jsx)(B,{type:`button`,size:`icon-sm`,variant:`ghost`,onClick:()=>{o(e)},disabled:!b,className:`text-muted-foreground hover:text-foreground`,"aria-label":s(b?`removeAsset`:`deleteBlocked`),title:s(b?`removeAsset`:`deleteBlocked`),children:(0,m.jsx)(zT,{className:`size-4`})})]})]}),(0,m.jsxs)(`div`,{className:`space-y-1 mb-4`,children:[(0,m.jsx)(Og,{className:`sr-only text-xs font-medium text-muted-foreground`,htmlFor:`asset-name-${e}`,children:s(`nameLabel`)}),(0,m.jsx)(Dg,{className:`bg-neutral-50 text-sm`,id:`asset-name-${e}`,value:c,onChange:e=>{l(e.target.value)},onBlur:S,onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},placeholder:s(`namePlaceholder`)})]}),b?(0,m.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg border border-amber-200/70 bg-amber-50/80 px-3 py-2.5 text-[13px] leading-snug text-amber-950`,children:[(0,m.jsx)(BT,{className:`mt-0.5 size-4 shrink-0 text-amber-600`,"aria-hidden":!0}),(0,m.jsx)(`span`,{children:s(`unusedAssetWarning`)})]}):(0,m.jsxs)(`div`,{className:`border-t border-slate-100 pt-4`,children:[(0,m.jsx)(`p`,{className:`mb-2 text-[10px] font-semibold uppercase tracking-[0.16em] text-slate-400`,children:s(`usedByLabel`,{count:x.length})}),(0,m.jsx)(`ul`,{className:`divide-y divide-slate-100`,children:x.map((e,t)=>(0,m.jsx)(`li`,{children:(0,m.jsxs)(`button`,{type:`button`,onClick:()=>{i(e)},className:`group/row flex w-full items-center gap-2 py-2.5 text-left text-sm text-slate-700 transition-colors hover:text-slate-950`,children:[(0,m.jsx)(`span`,{className:`min-w-0 flex-1 leading-snug`,children:r(e)}),(0,m.jsx)(lw,{className:`size-3.5 shrink-0 text-slate-400 transition-colors group-hover/row:text-slate-600`,"aria-hidden":!0})]})},`${e.itemId??`survey`}-${e.usageScope}-${t}`))})]})]})]})}function yde({dropzoneKey:e,onFilesAccepted:t}){let n=J(`defaultEditors.assetManager`);return(0,m.jsx)(`article`,{className:z(`flex h-full min-h-0`),children:(0,m.jsx)(W4,{id:`survey-image-asset-upload`,accept:{"image/*":[]},multiple:!0,className:`flex min-h-0 flex-1 flex-col gap-0`,contentClassName:`flex min-h-0 flex-1 flex-col gap-0 p-0`,dropzoneClassName:`flex min-h-0 flex-1 flex-col items-center justify-center rounded-xl p-4 bg-card shadow-sm`,labels:{upload:n(`uploadLabel`),drag:n(`uploadDescription`),active:n(`uploadActive`)},onChange:t},e)})}function G3({className:e}){let t=J(`defaultEditors.assetManager`),n=tD(),r=B3(),i=q(e=>e.setAsset),a=q(e=>e.removeAsset),o=rD(e=>e.navigate),[s,c]=(0,d.useState)(0),l=(0,d.useMemo)(()=>[...r],[r]),f=(0,d.useMemo)(()=>n?.getAssetUsages()??[],[n]),p=(0,d.useMemo)(()=>{let e=new Map;for(let t of f){let n=e.get(t.assetId)??[];n.push(t),e.set(t.assetId,n)}return e},[f]),h=(e,t)=>{i(e,t)},g=e=>{(p.get(e)??[]).length>0||a(e)},_=e=>{if(!n||!e.itemId)return t(`surveyRootItem`);let r=n.surveyItems.get(e.itemId);return!r||e.itemId===n.rootItem?.id&&e.usageScope!==`itemTranslation`?t(`surveyRootItem`):n.getItemKey(e.itemId)?.fullKey??r.key??e.itemId},v=e=>{if(e.itemId){o({view:`item-editor`,itemId:e.itemId});return}o({view:`item-editor`})};return(0,m.jsx)(`div`,{className:z(e),children:(0,m.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3 *:min-h-72`,children:[l.map(([e,t])=>(0,m.jsx)(vde,{assetId:e,asset:t,usages:p.get(e)??[],getUsageItemLabel:_,onNavigateToUsage:v,onSaveAsset:h,onRemoveAsset:g},`${e}:${t.metadata?.name??``}`)),(0,m.jsx)(yde,{dropzoneKey:s,onFilesAccepted:async e=>{if(e.length!==0){for(let t of e){let e=u.bt(),n=await H3(t);i(e,{kind:`image`,source:{type:`embedded`,mediaType:t.type||`application/octet-stream`,encoding:`base64`,data:n},metadata:{filename:t.name}})}c(e=>e+1)}}})]})})}var bde=()=>{let e=J(`routes.footer`),{helpLink:t}=GE(),n=z3(),r=V3(),i=rD(e=>e.navigate),a=rD(e=>e.location),o=n.size,s=r>0,c=a.view===`asset-manager`;return(0,m.jsx)(`footer`,{className:`h-6 mt-0.5`,children:(0,m.jsxs)(`div`,{className:`flex items-center justify-between h-full text-muted-foreground`,children:[(0,m.jsxs)(`div`,{className:`flex items-center h-full gap-1`,children:[(0,m.jsx)(hde,{}),(0,m.jsxs)(B,{variant:`ghost`,size:`xs`,onClick:()=>i({view:`asset-manager`}),disabled:c,className:`backdrop-blur-md focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/50 focus-visible:border-transparent`,children:[(0,m.jsx)(Qw,{className:`size-3`}),(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs`,title:s?e(`unusedAssetsWarning`,{count:r}):void 0,children:[e(`assets`,{count:o}),s?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(BT,{className:`size-3 text-amber-600`,"aria-hidden":!0}),(0,m.jsx)(`span`,{className:`sr-only`,children:e(`unusedAssetsWarning`,{count:r})})]}):null]})]})]}),(0,m.jsx)(`div`,{className:``,children:(0,m.jsx)(B,{variant:`ghost`,size:`xs`,asChild:!0,className:`backdrop-blur-md focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/50 focus-visible:border-transparent`,children:(0,m.jsxs)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,children:[(0,m.jsx)(Ew,{className:`size-3`}),(0,m.jsx)(`span`,{className:`text-xs`,children:e(`help`)})]})})})]})})};function K3({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`skeleton`,className:z(`animate-pulse rounded-md bg-muted`,e),...t})}var q3=()=>(0,m.jsxs)(`div`,{className:`w-full flex flex-col md:flex-row gap-3 items-start relative`,children:[(0,m.jsxs)(`div`,{className:`w-full md:w-auto flex-1 order-2 md:order-1 bg-background rounded-xl border border-border`,children:[(0,m.jsx)(`div`,{className:`py-2 border-b border-border h-[37px] flex items-center`,children:(0,m.jsxs)(`div`,{className:`flex items-center justify-between relative w-full`,children:[(0,m.jsxs)(`div`,{className:`absolute px-4 rounded-s-lg left-0 top-0 bottom-0 flex items-center gap-2 justify-center bg-white`,children:[(0,m.jsx)(K3,{className:`size-5 rounded-full`}),(0,m.jsx)(K3,{className:`h-6 w-16 rounded-lg`})]}),(0,m.jsx)(`div`,{className:`text-center grow px-20`,children:(0,m.jsx)(K3,{className:`h-4 w-32 mx-auto`})})]})}),(0,m.jsx)(b3,{className:`p-0 m-0`,children:(0,m.jsx)(`div`,{className:`w-full`,children:(0,m.jsxs)(`div`,{className:`min-h-[400px] p-6 space-y-6`,children:[(0,m.jsxs)(`div`,{className:`space-y-4`,children:[(0,m.jsx)(K3,{className:`h-6 w-48`}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(K3,{className:`h-4 w-full`}),(0,m.jsx)(K3,{className:`h-4 w-3/4`}),(0,m.jsx)(K3,{className:`h-4 w-1/2`})]})]}),(0,m.jsxs)(`div`,{className:`space-y-4`,children:[(0,m.jsx)(K3,{className:`h-6 w-36`}),(0,m.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,m.jsx)(K3,{className:`h-20 w-full rounded-lg`}),(0,m.jsx)(K3,{className:`h-20 w-full rounded-lg`})]})]}),(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsx)(K3,{className:`h-6 w-24`}),(0,m.jsx)(K3,{className:`h-32 w-full rounded-lg`})]})]})})})]}),(0,m.jsx)(`div`,{className:`relative md:sticky top-0 order-1 md:order-2 w-full md:w-fit flex justify-end`,children:(0,m.jsx)(y3,{className:`shadow-none w-fit border-border p-0`,children:(0,m.jsxs)(b3,{className:`p-0 flex flex-row md:flex-col`,children:[(0,m.jsx)(`div`,{className:`border-r border-border md:border-b md:border-r-0`,children:(0,m.jsx)(K3,{className:`size-9 rounded-s-xl md:rounded-s-none md:rounded-t-xl`})}),(0,m.jsx)(`div`,{className:`flex flex-row md:flex-col`,children:Array.from({length:6}).map((e,t)=>(0,m.jsx)(K3,{className:z(`size-9`,t===5?`rounded-e-xl md:rounded-e-none md:rounded-b-xl`:`rounded-none`)},t))})]})})})]}),xde=(e,t,n)=>{if(!e||!t||!n||t===n)return`right`;let r=e.surveyItems.get(t),i=e.surveyItems.get(n);if(!r||!i)return`right`;let a=e.getParentItem(t),o=e.getParentItem(n);if(a?.id===o?.id&&o){let e=o.items.indexOf(t),r=o.items.indexOf(n);if(e>=0&&r>=0&&e!==r)return r>e?`down`:`up`}return o?.id===t?`right`:a?.id===n?`left`:`right`},Sde=()=>{let{selectedItemId:e}=oD(),t=q(e=>e.getRootItem),n=q(e=>e.editorItemRegistry),r=t(),[i,a]=(0,d.useState)({itemId:void 0,direction:`right`}),o=e||r?.id,s=eD(),c=s?.survey;if((0,d.useLayoutEffect)(()=>{a(e=>e.itemId===o?e:{itemId:o,direction:xde(c,e.itemId,o)})},[o,c]),!s||!o)return(0,m.jsx)(q3,{});let l=s.survey.surveyItems.get(o);if(!l)return(0,m.jsx)(q3,{});let u=YC(n,l)?.editorComponent,f=u?(0,m.jsx)(u,{item:l}):(0,m.jsxs)(`div`,{children:[`Editor for `,l.type,` is not implemented yet.`]});return(0,m.jsx)(`div`,{className:`survey-editor-opening-item`,"data-opening-direction":i.direction,children:f},o)},J3=`case.survey-editor.last-used-item-type`,Y3=`case.survey-editor.recent-item-types`;new Set([u.lt.Group,u.lt.PageBreak]);var Cde=e=>e.trim().toLowerCase().replace(/[.\s]+/g,`_`).replace(/[^a-z0-9_]+/g,`_`).replace(/_+/g,`_`).replace(/^_+|_+$/g,``),wde=(e,t)=>Cde(t.definitions[e.itemType]?.defaultItemKeyPrefix||e.label||e.itemType||`item`)||`item`,Tde=(e,t,n)=>{let r=new Set((e?.items??[]).map(e=>t?.get(e)).filter(e=>!!e).map(e=>e.key)),i=1;for(;r.has(`${n}_${i}`);)i+=1;return`${n}_${i}`};function X3(e,t,n,r,i,a){let o=n.coreRegistry[e.rawItem.itemType];if(!o)throw Error(`Item type "${e.rawItem.itemType}" is not available in this editor registry.`);let s=new o({...e.rawItem,key:i??e.rawItem.key});if(r({parentId:t,...a===void 0?{}:{index:a}},s,e.translations),e.children?.length){if(!(s instanceof u.st))throw Error(`Item type "${s.type}" cannot include child items in getInitialItem().`);e.children.forEach(e=>{X3(e,s.id,n,r)})}return s}function Ede({editorItemRegistry:e,addItem:t,pasteItem:n,commitByUser:r,setPreferredPreviewItemId:i,closeDialog:a,targetGroupId:o,targetIndex:s,rootItemId:c,clipboardValue:l,recordRecentItemType:f}){let p=J(`history`),m=J(`addItemDialog`),{navigateToItem:h}=oD(),g=rD(e=>e.navigate),_=tD();return{handleSelectOption:(0,d.useCallback)(n=>{if(!o){OE.error(m(`noValidGroupSelected`));return}let c=e.definitions[n.itemType],l=e.coreRegistry[n.itemType];if(!c||!l){OE.error(m(`registryItemTypeUnavailable`,{itemType:n.itemType}));return}try{let d,v,y=_?.surveyItems.get(o),b=s,x=(e,n,r)=>{if(e&&e.parentId===o&&e.index===void 0&&b!==void 0){t({...e,index:b},n,r),b+=1;return}t(e,n,r)},S=Tde(y instanceof u.st?y:void 0,_?.surveyItems,wde(n,e));if(c.createItem)d=c.createItem({editor:{addItem:x},targetParentId:o,targetIndex:s,defaultItemKey:S,constructor:l});else{let r=c.getInitialItem?.();if(r){let n=X3(r,o,e,t,S,s);d=n.id,v=n.key}else{let e=new l({id:u.bt(),key:S,itemType:n.itemType});d=e.id,v=e.key,x({parentId:o},e)}}r({label:p(`addItem`,{itemLabel:n.label})}),f(n.itemType),OE.success(m(`itemAdded`,{itemKey:v??d})),a(),n.itemType===u.lt.PageBreak?i(d):n.itemType===u.lt.Group?(i(null),g({view:`item-editor`,itemId:d})):(i(null),h(d))}catch(e){console.error(`Failed to add item:`,e),OE.error(m(`itemAddFailed`))}},[t,a,r,e,p,g,h,f,i,_,m,o,s]),pasteFromClipboard:(0,d.useCallback)(()=>{if(!l)return;let e;try{e=JSON.parse(l)}catch{return}if(!Iz.isValidClipboardData(e))return;let t=o??c;if(!t)return;let u=n(e,{parentId:t,...s===void 0?{}:{index:s}});u&&(r({label:p(`pasteItem`)}),i(u),a())},[l,a,r,p,n,c,i,o,s])}}var Z3=(e,t)=>({id:t.id,itemKey:t.isRoot()?e.survey.surveyKey:t.key,itemLabel:t.metadata?.itemLabel,isRoot:t.isRoot(),itemCount:t.items?.length??0});function Dde({editor:e,selectedItemId:t,targetParentId:n}){return(0,d.useMemo)(()=>{if(!e)return null;let r=t=>{let n=e.survey.surveyItems.get(t);return n instanceof u.st?n:null};if(n){let t=r(n);return t?Z3(e,t):null}if(!t){let t=e.survey.rootItem;return t?Z3(e,t):null}let i=e.survey.surveyItems.get(t);if(!i)return null;if(i instanceof u.st&&(i.isRoot()||i.type===u.lt.Group))return Z3(e,i);let a=e.survey.getParentItem(i.id);return a instanceof u.st?Z3(e,a):null},[e,t,n])}function Ode({options:e,onSelect:t,rowSize:n=1,enableTabNavigation:r=!1}){let i=(0,d.useRef)(null),[a,o]=(0,d.useState)(0),[s,c]=(0,d.useState)(!1);return{groupRef:i,activeIndex:a,isFocused:s,setActiveIndex:o,focusGroup:(0,d.useCallback)(()=>{requestAnimationFrame(()=>{i.current?.focus(),c(!0)})},[]),reset:(0,d.useCallback)((e=0)=>{o(e),c(!1)},[]),handleGroupFocus:(0,d.useCallback)(()=>{c(!0)},[]),handleGroupBlur:(0,d.useCallback)(e=>{let t=e.relatedTarget;e.currentTarget.contains(t)||c(!1)},[]),handleGroupKeyDown:(0,d.useCallback)(i=>{let s=e.length;if(s<1)return;let c=i.metaKey||i.ctrlKey||i.altKey||i.shiftKey;if(i.key===`Enter`&&c)return;if(i.key===`Enter`||i.key===` `){i.preventDefault();let n=e[a];n&&t(n);return}let l=a;if(i.key===`Tab`&&r){i.preventDefault(),l=i.shiftKey?(a-1+s)%s:(a+1)%s,o(l);return}switch(i.key){case`ArrowRight`:l=(a+1)%s;break;case`ArrowLeft`:l=(a-1+s)%s;break;case`ArrowDown`:l=(a+n)%s;break;case`ArrowUp`:l=(a-n+s)%s;break;default:return}i.preventDefault(),o(l)},[a,r,t,e,n])}}function kde({search:e,searchInputRef:t,searchPlaceholder:n,recentLabel:r,recentOptions:i,sections:a,optionGroupRef:o,activeIndex:s,isFocused:c,setActiveIndex:l,onSearchChange:u,onMoveFocusToGrid:d,onGroupFocus:f,onGroupBlur:p,onGroupKeyDown:h,onSelectOption:g,emptyMessage:_,gridLabel:v,fullScreen:y}){let b=0;return(0,m.jsxs)(`div`,{className:z(`flex flex-col gap-4 pb-4`,y&&`min-h-0 flex-1`),children:[(0,m.jsx)(Dg,{ref:t,type:`search`,value:e,placeholder:n,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),d())}}),i.length>0?(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:r}),i.map(e=>{let t=e.icon;return(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsxs)(`button`,{type:`button`,onClick:()=>g(e),className:`inline-flex h-6 items-center gap-1 rounded-full border border-border bg-muted/40 px-2 text-xs font-medium transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:[(0,m.jsx)(t,{className:z(`size-3.5 text-muted-foreground`,e.defaultItemClassName)}),e.label]})}),(0,m.jsx)(IE,{children:e.description})]},e.key)})]}):null,a.length===0?(0,m.jsx)(`p`,{className:`py-8 text-center text-sm text-muted-foreground`,children:_}):(0,m.jsx)(`div`,{ref:o,role:`grid`,"aria-label":v,"aria-activedescendant":`item-type-option-${s}`,tabIndex:0,onFocus:f,onBlur:p,onKeyDown:h,className:z(`flex flex-col gap-5 overflow-y-auto px-1 py-1 outline-none`,y?`min-h-0 max-h-none flex-1`:`max-h-96`),children:a.map(e=>(0,m.jsxs)(`section`,{"aria-labelledby":`item-type-section-${e.id}`,children:[(0,m.jsx)(`h3`,{id:`item-type-section-${e.id}`,className:`mb-2 text-xs font-semibold tracking-wide text-muted-foreground uppercase`,children:e.label}),(0,m.jsx)(`div`,{role:`row`,className:`grid grid-cols-4 gap-2`,children:e.options.map(e=>{let t=b++,n=e.icon;return(0,m.jsx)(`div`,{id:`item-type-option-${t}`,role:`gridcell`,"aria-selected":t===s,children:(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsxs)(`button`,{type:`button`,tabIndex:-1,onClick:()=>g(e),onMouseEnter:()=>l(t),className:z(`flex w-full flex-col items-center gap-2 rounded-xl border border-border bg-background px-2 py-3 text-center text-xs font-medium outline-none transition-colors hover:bg-accent/50`,t===s&&c&&`border-ring bg-accent/30 ring-3 ring-inset ring-ring/50`),children:[(0,m.jsx)(n,{className:z(`size-5 text-muted-foreground`,e.defaultItemClassName)}),(0,m.jsx)(`span`,{className:`line-clamp-2 leading-tight`,children:e.label})]})}),(0,m.jsx)(IE,{children:e.description})]})},e.key)})})]},e.id))})]})}var Ade=()=>{let e=J(`addItemDialog`),{language:t}=GE(),{addItemDialogOpen:n,setAddItemDialogOpen:r,targetParentId:i,targetIndex:a,pendingItemType:o,clearPendingItemType:s,setPreferredPreviewItemId:c}=Pz(),l=eD(),u=q(e=>e.editorItemRegistry),f=q(e=>e.addItem),p=q(e=>e.pasteItem),h=q(e=>e.commitByUser),g=q(e=>e.userMutationsLocked),{selectedItemId:_}=oD(),[v,y]=(0,d.useState)(``),[b,x]=(0,d.useState)(!1),S=(0,d.useRef)(null),[C,w]=(0,d.useState)(()=>{if(typeof window>`u`)return[];let e=localStorage.getItem(Y3);if(e)try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`).slice(0,5)}catch{}let t=localStorage.getItem(J3);return t?[t]:[]}),[T,E]=yE();(0,d.useEffect)(()=>{!g||!n||(r(!1),s())},[n,s,r,g]);let D=(0,d.useCallback)(e=>s_(e,u.categoryLabels,t),[u.categoryLabels,t]),O=(0,d.useMemo)(()=>Object.values(u.definitions).filter(e=>!e.isRootOnly).filter(e=>e.itemType!==`root`).filter(e=>!!u.coreRegistry[e.itemType]).map(e=>({itemType:e.itemType,key:e.itemType,label:o_(e.infos.labelByLocale,t),description:o_(e.infos.descriptionByLocale,t),defaultItemClassName:e.infos.defaultItemClassName,icon:e.infos.icon,categories:e.infos.categories})),[u,t]),k=(0,d.useMemo)(()=>{let e=v.trim().toLocaleLowerCase();return e?O.filter(t=>[t.itemType,t.label,t.description,...t.categories.map(D)].some(t=>t.toLocaleLowerCase().includes(e))):O},[D,O,v]),A=(0,d.useMemo)(()=>{let e=new Map;for(let t of k)for(let n of t.categories){let r=e.get(n)??[];r.push(t),e.set(n,r)}return[...e.entries()].sort(([e],[t])=>D(e).localeCompare(D(t))).map(([e,t])=>({id:e,label:D(e),options:t.sort((e,t)=>e.label.localeCompare(t.label))}))},[D,k]),j=(0,d.useMemo)(()=>C.map(e=>O.find(t=>t.itemType===e)).filter(e=>!!e),[O,C]),M=(0,d.useMemo)(()=>A.flatMap(e=>e.options),[A]),N=Dde({editor:l,selectedItemId:_??null,targetParentId:i}),ee=(0,d.useMemo)(()=>N?N.itemLabel?`${N.itemKey} - ${N.itemLabel}`:N.itemKey:null,[N]),P=(0,d.useMemo)(()=>{if(!T)return!1;try{return Iz.isValidClipboardData(JSON.parse(T))}catch{return!1}},[T]),{handleSelectOption:F,pasteFromClipboard:I}=Ede({editorItemRegistry:u,addItem:f,pasteItem:p,commitByUser:h,setPreferredPreviewItemId:c,closeDialog:()=>{r(!1),y(``),x(!1)},targetGroupId:N?.id,targetIndex:a,rootItemId:l?.survey.rootItem?.id,clipboardValue:T,recordRecentItemType:e=>{let t=[e,...C.filter(t=>t!==e)].slice(0,5);w(t),typeof window<`u`&&(localStorage.setItem(Y3,JSON.stringify(t)),localStorage.setItem(J3,e))}});(0,d.useEffect)(()=>{if(!n||!o)return;s();let e=O.find(e=>e.itemType===o);e&&F(e)},[n,s,F,O,o]);let L=Ode({options:M,onSelect:F,rowSize:4,enableTabNavigation:!0});return(0,m.jsx)(aO,{open:n&&!g,onOpenChange:e=>{if(r(e),e){y(``),L.reset(0),E();return}y(``),x(!1),L.reset(0)},children:(0,m.jsxs)(uO,{showCloseButton:!1,className:z(`max-h-dvh overflow-y-auto`,b?`top-0! left-0! flex! h-dvh! w-screen! max-w-none! translate-x-0! translate-y-0! flex-col! rounded-none!`:`sm:max-w-2xl`),onOpenAutoFocus:e=>{e.preventDefault(),L.focusGroup()},children:[(0,m.jsxs)(`div`,{className:`absolute top-2 right-2 flex items-center gap-1`,children:[(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":e(b?`exitFullscreen`:`enterFullscreen`),onClick:()=>x(e=>!e),children:b?(0,m.jsx)(cT,{}):(0,m.jsx)(sT,{})}),(0,m.jsx)(cO,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":e(`close`),children:(0,m.jsx)(GT,{})})})]}),(0,m.jsxs)(dO,{children:[(0,m.jsx)(pO,{children:e(`title`)}),(0,m.jsx)(mO,{children:N?(0,m.jsxs)(`span`,{className:`flex items-center gap-2 p-2 mt-1 bg-muted/50 rounded-lg border border-border`,children:[(0,m.jsx)(Uw,{className:`w-4 h-4 text-muted-foreground`}),(0,m.jsxs)(`span`,{className:`text-xs`,children:[e(`addingTo`),` `,(0,m.jsx)(`span`,{className:`font-medium`,children:ee}),N.itemCount>0&&(0,m.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,e(`itemCount`,{count:N.itemCount})]})]})]}):e(`chooseHowToExpand`)})]}),P&&(0,m.jsx)(`button`,{type:`button`,onClick:I,className:`self-start text-sm font-medium text-primary underline-offset-4 hover:underline`,children:e(`blankItem.pasteFromClipboard`)}),(0,m.jsx)(kde,{search:v,searchInputRef:S,searchPlaceholder:e(`blankItem.searchPlaceholder`),recentLabel:e(`blankItem.recent`),recentOptions:j,sections:A,optionGroupRef:L.groupRef,activeIndex:L.activeIndex,isFocused:L.isFocused,setActiveIndex:L.setActiveIndex,onSearchChange:e=>{y(e),L.reset(0)},onMoveFocusToGrid:L.focusGroup,onGroupFocus:L.handleGroupFocus,onGroupBlur:L.handleGroupBlur,onGroupKeyDown:e=>{if(e.key.length===1&&e.key.trim().length>0&&!e.metaKey&&!e.ctrlKey&&!e.altKey){e.preventDefault(),y(e.key),L.reset(0),requestAnimationFrame(()=>{S.current?.focus()});return}L.handleGroupKeyDown(e)},onSelectOption:F,emptyMessage:e(`blankItem.noItemTypesFound`),gridLabel:e(`blankItem.gridLabel`),fullScreen:b}),(0,m.jsx)(fO,{className:`-mt-4 shrink-0`,children:(0,m.jsx)(`span`,{className:`text-muted-foreground text-xs items-center gap-1 font-medium`,children:e(`footer.grid`)})})]})})};function jde(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function Mde(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function Nde(e){return e/100*window.innerHeight}function Pde(e){return e/100*window.innerWidth}function Fde(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Q3({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=Fde(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=Mde(t,i);break;case`em`:r=jde(t,i);break;case`vh`:r=Nde(i);break;case`vw`:r=Pde(i);break}return r}function $3(e){return parseFloat(e.toFixed(3))}function e6({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function t6(e){let{panels:t}=e,n=e6({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=$3(Q3({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=$3(Q3({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=$3(Q3({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=$3(Q3({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function n6(e,t=`Assertion error`){if(!e)throw Error(t)}function r6(e,t){return Array.from(t).sort(e===`horizontal`?Ide:Lde)}function Ide(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Lde(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function i6(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function a6(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Rde({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=a6(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return n6(i,`No rect found`),i}var o6;function zde(){return o6===void 0&&(o6=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),o6}function s6(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=r6(n,Array.from(t.children).filter(i6).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,Rde({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=zde()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:e6({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var c6=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},l6={cursorFlags:0,state:`inactive`},u6=new c6;function d6(){return l6}function Bde(e){return u6.addListener(`change`,e)}function Vde(e){let t=l6,n={...l6};n.cursorFlags=e,l6=n,u6.emit(`change`,{prev:t,next:n})}function f6(e){let t=l6;l6=e,u6.emit(`change`,{prev:t,next:e})}var Hde=e=>e,p6=()=>{},m6=1,h6=2,g6=4,_6=8,v6=3,y6=12,b6;function x6(){return b6===void 0&&(b6=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(b6=!0)),b6}function Ude({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&x6()){let t=(e&m6)!==0,n=(e&h6)!==0,r=(e&g6)!==0,i=(e&_6)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return x6()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var S6=new WeakMap;function C6(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=S6.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=d6();switch(r.state){case`active`:case`hover`:{let e=Ude({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}S6.set(e,{prevStyle:t,styleSheet:n})}var w6=new Map,T6=new c6;function Wde(e){w6=new Map(w6),w6.delete(e)}function E6(e,t){for(let[t]of w6)if(t.id===e)return t}function D6(e,t){for(let[t,n]of w6)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function O6(){return w6}function k6(e,t){return T6.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function A6(e,t,n){let r=w6.get(e);w6=new Map(w6),w6.set(e,t),T6.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function j6(e){let t=d6(),n=!1;switch(t.state){case`active`:f6({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(C6(e),n=!0,t.hitRegions.forEach(e=>{let t=D6(e.group.id,!0);A6(e.group,t,{isUserInteraction:!0})}))}return n}function M6(e){e.defaultPrevented||j6(e.currentTarget)}function Gde(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=a6(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function Kde(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function qde(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:F6(e),b:F6(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();n6(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:P6(N6(n.a)),b:P6(N6(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Jde=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Yde(e){let t=getComputedStyle(I6(e)??e).display;return t===`flex`||t===`inline-flex`}function Xde(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Yde(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Jde.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function N6(e){let t=e.length;for(;t--;){let n=e[t];if(n6(n,`Missing node`),Xde(n))return n}return null}function P6(e){return e&&Number(getComputedStyle(e).zIndex)||0}function F6(e){let t=[];for(;e;)t.push(e),e=I6(e);return t}function I6(e){let{parentNode:t}=e;return Kde(t)?t.host:t}function Zde(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Qde({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!i6(n)||n.contains(e)||e.contains(n))return!0;if(qde(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Zde(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function L6(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=s6(r),a=Gde(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Qde({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function $de(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function R6(e,t,n=0){return Math.abs($3(e)-$3(t))<=n}function z6(e,t){return R6(e,t)?0:e>t?1:-1}function B6({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(z6(r,c)<0)if(a){let e=(i+c)/2;r=z6(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=$3(r),r}function V6({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(R6(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;n6(u!=null,`Invalid first pivot index`),n6(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];n6(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(n6(n!=null,`Previous layout not found for panel index ${t}`),R6(n,i)){let t=o-n;z6(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];n6(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(n6(n!=null,`Previous layout not found for panel index ${t}`),R6(n,o)){let t=n-i;z6(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];n6(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&z6(i,c)<0)if(e>0){let t=c-o,n=t/2;z6(i+e,c)<0&&(e=z6(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;z6(i-e,c)<0&&(e=z6(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];n6(e!=null,`Previous layout not found for panel index ${r}`);let a=B6({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];n6(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=B6({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!R6(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if($de(c,l))return i;{let t=e<0?d:u,r=s[t];n6(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=B6({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!R6(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];n6(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=B6({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(R6(i,s)||(t-=s-i,l[r]=s),R6(t,0))break;e>0?r--:r++}}}if(!R6(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function H6(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||z6(e[n],t[n])!==0)return!1;return!0}function U6({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!R6(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];n6(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];n6(i!=null,`No layout data found for index ${e}`);let o=r[e];n6(o!=null,`No layout data found for index ${e}`);let s=B6({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!R6(a,0))for(let e=0;e<t.length;e++){let n=r[e];n6(n!=null,`No layout data found for index ${e}`);let i=n+a,o=B6({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,R6(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function W6({groupId:e,panelId:t}){let n=()=>{let t=O6();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&R6(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:$3(100-e)}}return V6({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=U6({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});H6(c,u)||A6(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&R6(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=e6({group:t});s($3(Q3({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function G6(e){e.defaultPrevented||L6(e,O6()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=W6({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function K6(e){let t=O6();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function q6({groupId:e}){let t=()=>{let t=O6();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=U6({layout:e,panelConstraints:r});return n?o:(H6(o,c)||A6(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function J6(e,t){let n=K6(e),r=D6(n.id,!0),i=n.separators.find(t=>t.element===e);n6(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);n6(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=q6({groupId:n.id}).getLayout(),c=U6({layout:V6({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});H6(s,c)||A6(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function Y6(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=K6(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&J6(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&J6(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&J6(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&J6(t,-5);break;case`End`:e.preventDefault(),J6(t,100);break;case`Enter`:{e.preventDefault();let n=K6(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=D6(n.id,!0),o=n.separators.find(e=>e.element===t);n6(o,`Matching separator not found`);let s=a.get(o);n6(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(n6(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];J6(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=K6(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);n6(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),J6(t,-100);break}}function X6(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=O6(),n=L6(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),f6({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}function Z6({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=V6({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(H6(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?m6:h6;break;case`vertical`:s|=d<0?g6:_6;break}}else A6(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&v6:c|=s&v6,t.movementY===0?c|=o&y6:c|=s&y6,Vde(c),C6(e)}function Q6(e){let t=O6(),n=d6();switch(n.state){case`active`:Z6({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function $6(e){if(e.defaultPrevented)return;let t=d6(),n=O6();switch(t.state){case`active`:if(e.buttons===0){f6({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=D6(e.group.id,!0);A6(e.group,t,{isUserInteraction:!0})});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Z6({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=L6(e,n);r.length===0?t.state!==`inactive`&&f6({cursorFlags:0,state:`inactive`}):f6({cursorFlags:0,hitRegions:r,state:`hover`}),C6(e.currentTarget);break}}}function e8(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(d6().state){case`hover`:f6({cursorFlags:0,state:`inactive`})}}function t8(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||j6(e.currentTarget)&&e.preventDefault()}function n8(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=$3(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=$3((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function efe(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=e6({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:$3(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function tfe(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function nfe({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=$3(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=$3((r[e]??0)/a*l);else{let e=$3(l/c.length);for(let t of c)u[t]=e}return u}function rfe(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var r8=new Map;function ife(e){let t=!0;n6(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=e6({group:e});if(t===0)return;let n=D6(e.id);if(!n)return;let r=t6(e),i=n.defaultLayoutDeferred?n8(r):n.layout,a=U6({layout:nfe({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&H6(n.layout,a)&&tfe(n.derivedPanelConstraints,r)&&n.groupSize===t)return;A6(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else efe(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{n6(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=e6({group:e}),s=t6(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(rfe(e.panels,l)||(l=void 0));let u=U6({layout:e.mutableState.layouts[c]??l??n8(s),panelConstraints:s}),d=e.element.ownerDocument;r8.set(d,(r8.get(d)??0)+1);let f=new Map;return s6(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),A6(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{n6(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Y6)}),r8.get(d)===1&&(d.addEventListener(`contextmenu`,M6,!0),d.addEventListener(`dblclick`,G6,!0),d.addEventListener(`pointerdown`,X6,!0),d.addEventListener(`pointerleave`,Q6),d.addEventListener(`pointermove`,$6),d.addEventListener(`pointerout`,e8),d.addEventListener(`pointerup`,t8,!0)),function(){t=!1,r8.set(d,Math.max(0,(r8.get(d)??0)-1)),Wde(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Y6)}),r8.get(d)||(d.removeEventListener(`contextmenu`,M6,!0),d.removeEventListener(`dblclick`,G6,!0),d.removeEventListener(`pointerdown`,X6,!0),d.removeEventListener(`pointerleave`,Q6),d.removeEventListener(`pointermove`,$6),d.removeEventListener(`pointerout`,e8),d.removeEventListener(`pointerup`,t8,!0)),a.disconnect()}}function afe(){let[e,t]=(0,f.useState)({});return[e,(0,f.useCallback)(()=>t({}),[])]}function i8(e){let t=(0,f.useId)();return`${e??t}`}var a8=typeof window<`u`?f.useLayoutEffect:f.useEffect;function o8(e){let t=(0,f.useRef)(e);return a8(()=>{t.current=e},[e]),(0,f.useCallback)((...e)=>t.current?.(...e),[t])}function s8(...e){return o8(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function c8(e){let t=(0,f.useRef)({...e});return a8(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var l8=(0,f.createContext)(null);function ofe(e,t){let n=(0,f.useRef)({getLayout:()=>({}),setLayout:Hde});(0,f.useImperativeHandle)(t,()=>n.current,[]),a8(()=>{Object.assign(n.current,q6({groupId:e}))})}function u8({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:p,...h}){let g=(0,f.useRef)({onLayoutChange:{},onLayoutChanged:{}}),_=o8(e=>{H6(g.current.onLayoutChange,e)||(g.current.onLayoutChange=e,c?.(e))}),v=o8((e,t)=>{H6(g.current.onLayoutChanged,e)||(g.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),y=i8(s),b=(0,f.useRef)(null),[x,S]=afe(),C=(0,f.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),w=s8(b,a);ofe(y,o);let T=o8((e,t)=>{let r=d6(),i=E6(e),a=D6(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),E=c8({defaultLayout:n,disableCursor:r}),D=(0,f.useMemo)(()=>({get disableCursor(){return!!E.disableCursor},getPanelStyles:T,id:y,orientation:u,registerPanel:e=>{let t=C.current;return t.panels=r6(u,[...t.panels,e]),S(),()=>{t.panels=t.panels.filter(t=>t!==e),S()}},registerSeparator:e=>{let t=C.current;return t.separators=r6(u,[...t.separators,e]),S(),()=>{t.separators=t.separators.filter(t=>t!==e),S()}},updatePanelProps:(e,{disabled:t})=>{let n=C.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=E6(y),i=D6(y);r&&i&&A6(r,{...i,derivedPanelConstraints:t6(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=C.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[T,y,S,u,E]),O=(0,f.useRef)(null);return a8(()=>{let e=b.current;if(e===null)return;let t=C.current,n;if(E.defaultLayout!==void 0&&Object.keys(E.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=E.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:y,mutableState:{defaultLayout:n,disableCursor:!!E.disableCursor,expandedPanelSizes:C.current.lastExpandedPanelSizes,layouts:C.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};O.current=r;let a=ife(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=D6(r.id,!0);!o&&s.length>0&&(_(c),v(c,!1));let l=k6(y,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=R6(t.collapsedSize,i[t.panelId]),a=R6(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=d6().state!==`active`;_(i),o&&v(i,e.isUserInteraction)});return()=>{O.current=null,a(),l()}},[i,y,v,_,u,x,E]),(0,f.useEffect)(()=>{let e=O.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,m.jsx)(l8.Provider,{value:D,children:(0,m.jsx)(`div`,{...h,className:t,"data-group":!0,"data-testid":y,id:y,ref:w,style:{height:`100%`,width:`100%`,overflow:`hidden`,...p,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}u8.displayName=`Group`;function d8(){let e=(0,f.useContext)(l8);return n6(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function sfe(e,t){let{id:n}=d8(),r=(0,f.useRef)({collapse:p6,expand:p6,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:p6});(0,f.useImperativeHandle)(t,()=>r.current,[]),a8(()=>{Object.assign(r.current,W6({groupId:n,panelId:e}))})}function f8({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:p,style:h,...g}){let _=!!c,v=i8(c),y=c8({disabled:a}),b=(0,f.useRef)(null),x=s8(b,o),{getPanelStyles:S,id:C,orientation:w,registerPanel:T,updatePanelProps:E}=d8(),D=d!==null,O=o8((e,t,n)=>{d?.(e,c,n)});a8(()=>{let e=b.current;if(e!==null)return T({element:e,id:v,idIsStable:_,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:D?O:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:y.disabled,maxSize:l,minSize:u}})},[s,n,r,i,D,v,_,l,u,O,T,y]),(0,f.useEffect)(()=>{E(v,{disabled:a})},[a,v,E]),sfe(v,p);let k=()=>{let e=S(C,v);if(e)return JSON.stringify(e)},A=(0,f.useSyncExternalStore)(e=>k6(C,e),k,k),j;return j=A?JSON.parse(A):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,m.jsx)(`div`,{...g,"data-disabled":a||void 0,"data-panel":!0,"data-testid":v,id:v,ref:x,style:{...cfe,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...j},children:(0,m.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...h,touchAction:w===`horizontal`?`pan-y`:`pan-x`},children:e})})}f8.displayName=`Panel`;var cfe={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function p8(){return(0,f.useRef)(null)}function lfe({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=U6({layout:V6({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=U6({layout:V6({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function m8({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=i8(a),l=c8({disabled:n,disableDoubleClick:r}),[u,d]=(0,f.useState)({}),[p,h]=(0,f.useState)(`inactive`),[g,_]=(0,f.useState)(!1),v=(0,f.useRef)(null),y=s8(v,i),{disableCursor:b,id:x,orientation:S,registerSeparator:C,updateSeparatorProps:w}=d8(),T=S===`horizontal`?`vertical`:`horizontal`;a8(()=>{let e=v.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=C(t),r=Bde(e=>{h(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=k6(x,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(lfe({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[x,c,C,l]),(0,f.useEffect)(()=>{w(c,{disabled:n,disableDoubleClick:r})},[n,r,c,w]);let E;n&&!b&&(E=`not-allowed`);let D;if(n)D=`disabled`;else switch(p){case`active`:D=`active`;break;default:D=g?`focus`:p}return(0,m.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":T,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":D,"data-testid":c,id:c,onBlur:()=>_(!1),onFocus:()=>_(!0),ref:y,role:`separator`,style:{flexBasis:`auto`,cursor:E,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}m8.displayName=`Separator`;function ufe({className:e,...t}){return(0,m.jsx)(u8,{"data-slot":`resizable-panel-group`,className:z(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function h8({...e}){return(0,m.jsx)(f8,{"data-slot":`resizable-panel`,...e})}function g8({withHandle:e,className:t,...n}){return(0,m.jsx)(m8,{"data-slot":`resizable-handle`,className:z(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-2 after:-translate-x-1/2 focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-2 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,m.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`})})}var _8=`case-survey-editor:workspace:v2`,dfe=e=>{if(typeof window>`u`)return{};try{let t=window.localStorage.getItem(`${_8}:${e}`);return t?JSON.parse(t):{}}catch{return{}}},ffe=(e,t)=>{if(!(typeof window>`u`))try{window.localStorage.setItem(`${_8}:${e}`,JSON.stringify(t))}catch{}},pfe=({leftLabel:e,leftOpen:t,onLeftToggle:n,rightLabel:r,rightOpen:i,onRightToggle:a})=>{let o=J(`workspace`);return!e&&!r?null:(0,m.jsxs)(Q4,{type:`multiple`,value:[t&&e?`left`:null,i&&r?`right`:null].filter(e=>e!==null),variant:`outline`,size:`icon-sm`,spacing:0,className:`shrink-0`,"aria-label":o(`layoutControls`),onValueChange:o=>{e&&o.includes(`left`)!==t&&n(),r&&o.includes(`right`)!==i&&a()},children:[e?(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)($4,{value:`left`,"aria-label":o(`toggleLeftPanel`),children:(0,m.jsx)(pT,{})})}),(0,m.jsx)(IE,{children:o(`toggleLeftPanel`)})]}):null,r?(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)($4,{value:`right`,"aria-label":o(`toggleRightPanel`),children:(0,m.jsx)(mT,{})})}),(0,m.jsx)(IE,{children:o(`toggleRightPanel`)})]}):null]})},v8=(e,t)=>e===void 0?t?t.defaultOpenAtViewportWidth!==void 0&&typeof window<`u`&&window.matchMedia(`(min-width: ${t.defaultOpenAtViewportWidth}px)`).matches?!0:t.defaultOpen??!1:!1:e,y8=(e,t)=>{let n=Math.max(t.minSize,e??t.defaultSize);return t.maxSize===void 0?n:Math.min(t.maxSize,n)},b8=(e,t,n)=>{t?e.current?.resize(n):e.current?.collapse()},x8=({id:e,toolbar:t,main:n,mainLabel:r,primaryMinSize:i=480,left:a,right:o})=>{let s=J(`workspace`),[c]=(0,d.useState)(()=>dfe(e)),[l,u]=(0,d.useState)(()=>v8(c.leftOpen,a)),[f,p]=(0,d.useState)(()=>v8(c.rightOpen,o)),[h]=(0,d.useState)(()=>a?y8(c.leftSize,a):0),[g]=(0,d.useState)(()=>o?y8(c.rightSize,o):0),_=(0,d.useRef)(l),v=(0,d.useRef)(f),y=p8(),b=p8(),x=(0,d.useRef)(h),S=(0,d.useRef)(g),C=(0,d.useCallback)(e=>{_.current!==e&&(_.current=e,u(e),a?.onOpenChange?.(e))},[a]),w=(0,d.useCallback)(e=>{v.current!==e&&(v.current=e,p(e),o?.onOpenChange?.(e))},[o]),T=(0,d.useCallback)((t={})=>{ffe(e,{leftOpen:_.current,leftSize:x.current||void 0,rightOpen:v.current,rightSize:S.current||void 0,...t})},[e]),E=(0,d.useCallback)(e=>{a&&(b8(y,e,x.current||a.defaultSize),C(e),T({leftOpen:e}))},[a,y,T,C]),D=(0,d.useCallback)(e=>{o&&(b8(b,e,S.current||o.defaultSize),w(e),T({rightOpen:e}))},[T,o,b,w]),O=(0,d.useCallback)(()=>{E(!_.current)},[E]),k=(0,d.useCallback)(()=>{D(!v.current)},[D]),A={isOpen:l,open:()=>E(!0),close:()=>E(!1),toggle:O},j={isOpen:f,open:()=>D(!0),close:()=>D(!1),toggle:k},M=typeof a?.content==`function`?a.content(A):a?.content,N=typeof o?.content==`function`?o.content(j):o?.content;return(0,m.jsxs)(`section`,{className:`@container/workspace flex h-full min-h-0 flex-col gap-3`,children:[(0,m.jsxs)(`header`,{className:`flex min-w-0 items-start gap-2`,children:[(0,m.jsx)(`div`,{className:`min-w-0 flex-1`,children:t}),(0,m.jsx)(pfe,{leftLabel:a?.label,leftOpen:l,onLeftToggle:O,rightLabel:o?.label,rightOpen:f,onRightToggle:k})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-xl border border-border bg-(--surface-bg-color) shadow-sm`,children:(0,m.jsxs)(ufe,{id:`survey-editor-workspace-${e}`,orientation:`horizontal`,className:`min-h-0`,resizeTargetMinimumSize:{coarse:24,fine:8},onLayoutChanged:(e,t)=>{t.isUserInteraction&&T()},children:[a?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(h8,{id:a.id,panelRef:y,defaultSize:l?h:0,minSize:a.minSize,maxSize:a.maxSize,collapsedSize:0,collapsible:!0,groupResizeBehavior:`preserve-pixel-size`,onResize:e=>{let t=e.inPixels>0;t&&(x.current=e.inPixels),C(t)},children:(0,m.jsx)(`aside`,{className:`h-full min-h-0 overflow-hidden bg-muted/20`,"aria-label":a.label,"aria-hidden":!l,inert:!l,children:M})}),(0,m.jsx)(g8,{"aria-label":s(`resizePanel`,{panel:a.label}),className:z(`transition-colors hover:bg-ring/60 focus-visible:bg-ring/60`,!l&&`opacity-0`)})]}):null,(0,m.jsx)(h8,{id:`primary`,minSize:i,groupResizeBehavior:`preserve-relative-size`,children:(0,m.jsxs)(`main`,{className:`relative h-full min-h-0 min-w-0 overflow-hidden`,"aria-label":r,children:[n,(0,m.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-3 z-30 flex justify-center`,children:(0,m.jsx)(foe,{})})]})}),o?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(g8,{"aria-label":s(`resizePanel`,{panel:o.label}),className:z(`transition-colors hover:bg-ring/60 focus-visible:bg-ring/60`,!f&&`opacity-0`)}),(0,m.jsx)(h8,{id:o.id,panelRef:b,"data-panel-overflow-visible":o.allowContentOverflow?``:void 0,defaultSize:f?g:0,minSize:o.minSize,maxSize:o.maxSize,collapsedSize:0,collapsible:!0,groupResizeBehavior:`preserve-pixel-size`,onResize:e=>{let t=e.inPixels>0;t&&(S.current=e.inPixels),w(t)},children:(0,m.jsx)(`aside`,{className:`h-full min-h-0 overflow-visible bg-muted/20`,"aria-label":o.label,"aria-hidden":!f,inert:!f,children:N})})]}):null]})})]})},mfe=1280,S8={id:`outline`,defaultOpen:!0,defaultSize:240,minSize:160,maxSize:720},C8={id:`assistant`,defaultOpen:!1,defaultOpenAtViewportWidth:mfe,defaultSize:360,minSize:280,maxSize:520,allowContentOverflow:!0},w8={editing:{id:`editing`,primaryMinSize:480,left:S8,right:C8},preview:{id:`editing`,primaryMinSize:480,left:S8,right:C8},translation:{id:`translation`,primaryMinSize:480,left:S8,right:C8},assets:{id:`assets`,primaryMinSize:320,right:C8}},T8=(0,d.createContext)({available:!1,setTarget:()=>{}}),E8=()=>(0,d.useContext)(T8).available,hfe=({children:e,panel:t})=>{let[n]=(0,d.useState)(()=>{if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.className=`h-full min-h-0 w-full overflow-visible`,e}),r=(0,d.useRef)(null),i=t!=null;(0,d.useEffect)(()=>()=>n?.remove(),[n]),(0,d.useEffect)(()=>{n&&i&&r.current?r.current.appendChild(n):n?.remove()},[i,n]);let a=(0,d.useCallback)(e=>{r.current=e,e&&n&&i?e.appendChild(n):e||n?.remove()},[i,n]),o=(0,d.useMemo)(()=>({available:i,setTarget:a}),[i,a]);return(0,m.jsxs)(T8.Provider,{value:o,children:[e,n&&t?(0,p.createPortal)(t,n):null]})},D8=()=>{let{setTarget:e}=(0,d.useContext)(T8);return(0,m.jsx)(`div`,{ref:e,className:`h-full min-h-0 w-full overflow-visible`})},O8=e=>{(0,d.useEffect)(()=>{let t=t=>{let n=t.target;if(!(n instanceof HTMLElement&&(n.isContentEditable||n.closest(`[contenteditable="true"]`)||n.closest(`input, textarea, select`)))&&(t.metaKey||t.ctrlKey))switch(t.key.toLowerCase()){case`s`:t.preventDefault(),e.onSave?.();break;case`z`:t.preventDefault(),t.shiftKey?e.onRedo?.():e.onUndo?.();break;case`y`:!t.metaKey&&t.ctrlKey&&(t.preventDefault(),e.onRedo?.());break;case`k`:if(t.shiftKey||t.altKey)break;t.preventDefault(),e.onSearch?.();break;default:break}};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e])},k8=20,gfe=({isOpen:e,onOpenChange:t})=>{let n=J(`toolbar.search`),r=tD(),i=q(e=>e.editorItemRegistry),{navigateToItem:a}=oD(),[o,s]=(0,d.useState)(``),[c,l]=(0,d.useState)(0),u=(0,d.useRef)(null),f=(0,d.useRef)([]),p=(0,d.useMemo)(()=>{if(!r?.surveyItems||!o.trim())return[];let e=[],t=new Set,n=o.toLowerCase().trim();return Array.from(r.surveyItems.entries()).forEach(([a,o])=>{if(!o||!a||t.has(a))return;let s=o.itemType??o.type;if(e.length>=k8)return;let c=i.definitions[s]?.searchAdapters??[],l=dD(o,i),u=cD(o),d=r.getItemKey(o.id)?.fullKey??a;for(let i of c){let s=i({itemId:o.id,survey:r,searchTerm:n})?.[0];if(s){e.push({itemId:a,fullKey:d,item:o,itemTypeInfos:l,itemColor:u,matchType:s.matchType===`key`?`key`:s.matchType===`label`?`label`:s.matchType===`itemType`?`itemType`:`content`,matchText:s.matchText}),t.add(a);return}}}),e.slice(0,k8)},[i,o,r]),h=(0,d.useCallback)(e=>{a(e.itemId),t(!1),s(``),l(0)},[a,t]),g=(0,d.useCallback)(e=>{e.key===`ArrowDown`?(e.preventDefault(),l(e=>Math.min(e+1,p.length-1))):e.key===`ArrowUp`?(e.preventDefault(),l(e=>Math.max(e-1,0))):e.key===`Enter`?(e.preventDefault(),p[c]&&h(p[c])):e.key===`Escape`&&t(!1)},[p,c,h,t]),_=(0,d.useCallback)(e=>{t(e),e||(s(``),l(0))},[t]);(0,d.useEffect)(()=>{f.current=f.current.slice(0,p.length)},[p.length]),(0,d.useEffect)(()=>{let e=f.current[c];e&&u.current&&e.scrollIntoView({behavior:`smooth`,block:`nearest`})},[c,p.length]);let v=e=>{switch(e){case`key`:return(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-0.5`,children:[(0,m.jsx)(Jw,{className:`size-3`}),n(`key`)]});case`content`:return(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-0.5`,children:[(0,m.jsx)(Lw,{className:`size-3`}),n(`content`)]});case`label`:return(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-0.5`,children:[(0,m.jsx)(jT,{className:`size-3`}),n(`label`)]});case`itemType`:return(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-0.5`,children:[(0,m.jsx)(HT,{className:`size-3`}),n(`itemType`)]});default:return null}},y=(e,t)=>{if(!t.trim())return e;let n=RegExp(`(${t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)})`,`gi`);return e.split(n).map((e,t)=>n.test(e)?(0,m.jsx)(`mark`,{className:`bg-yellow-200 rounded px-0.5`,children:e},t):e)};return(0,m.jsx)(aO,{open:e,onOpenChange:_,children:(0,m.jsxs)(uO,{className:`sm:max-w-2xl p-0 border-border overflow-hidden`,children:[(0,m.jsx)(pO,{className:`sr-only`,children:n(`title`)}),(0,m.jsxs)(`div`,{className:`flex flex-col`,children:[(0,m.jsxs)(`div`,{className:`flex items-center px-4 py-3 pe-12 border-b border-border`,children:[(0,m.jsx)(TT,{className:`size-5 text-muted-foreground mr-2`}),(0,m.jsx)(Dg,{placeholder:n(`placeholder`),value:o,onChange:e=>{s(e.target.value),l(0)},onKeyDown:g,className:`focus-visible:ring-0 text-sm`,autoFocus:!0}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground ml-2`,children:[(0,m.jsx)(`kbd`,{className:`px-1.5 py-0.5 text-xs bg-muted rounded`,children:`↑↓`}),n(`navigate`),(0,m.jsx)(`kbd`,{className:`px-1.5 py-0.5 text-xs bg-muted rounded ml-1`,children:`↵`}),n(`select`)]})]}),(0,m.jsx)(`div`,{ref:u,className:`max-h-96 overflow-y-auto divide-y divide-border`,children:p.length>0?p.map((e,t)=>(0,m.jsxs)(`div`,{ref:e=>{f.current[t]=e},className:`px-4 py-3 cursor-pointer space-y-2 ${t===c?`bg-muted`:`hover:bg-muted/50`}`,onClick:()=>h(e),children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,m.jsx)(qO,{typeInfos:e.itemTypeInfos,color:e.itemColor,iconClassName:`size-5`}),(0,m.jsx)(`span`,{className:`text-sm font-mono grow text-ellipsis font-medium`,style:{color:e.itemColor},children:e.fullKey}),(0,m.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.item.metadata?.itemLabel})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[v(e.matchType),(0,m.jsx)(`div`,{className:`text-xs text-foreground truncate`,children:y(e.matchText,o)})]})]},e.itemId)):o.trim()?(0,m.jsx)(`div`,{className:`px-4 py-6 text-center text-sm text-muted-foreground`,children:n(`noItemsFound`,{searchTerm:o})}):(0,m.jsx)(`div`,{className:`px-4 py-6 text-center text-sm text-muted-foreground`,children:n(`startTyping`)})})]})]})})},_fe=typeof navigator<`u`&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent||``),vfe=()=>{let e=J(`toolbar.searchTrigger`),[t,n]=(0,d.useState)(!1);O8({onSearch:()=>n(!0)});let r=_fe?`⌘K`:`Ctrl+K`;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsxs)(B,{variant:`outline`,size:`sm`,"aria-label":e(`searchSurveyItems`),onClick:()=>n(!0),className:`px-3 h-[30px] rounded-xl gap-2 bg-(--surface-bg-color) backdrop-blur-xs border border-border hover:bg-(--surface-bg-color)/60`,children:[(0,m.jsx)(TT,{className:`size-4 text-muted-foreground`}),(0,m.jsx)(`span`,{className:`hidden text-xs text-muted-foreground sm:inline`,children:e(`search`)}),(0,m.jsx)(`kbd`,{className:`pointer-events-none hidden h-5 select-none items-center gap-1 bg-muted rounded-md px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100 sm:inline-flex`,children:(0,m.jsx)(`span`,{className:`text-xs tracking-widest`,children:r})})]})}),(0,m.jsxs)(IE,{children:[(0,m.jsx)(`p`,{children:e(`searchSurveyItems`)}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r})]})]}),(0,m.jsx)(gfe,{isOpen:t,onOpenChange:n})]})},yfe=()=>{let e=J(`toolbar.languagePicker`),t=tD(),n=q(e=>e.selectedLocale),r=q(e=>e.setSelectedLocale),i=rD(e=>e.navigate),{selectedItemId:a}=oD(),{fallbackLocale:o}=GE(),s=t?.locales??[],c=s.length>0?s:[o],l=c.includes(n)?n:c[0],u=(0,d.useEffectEvent)(e=>{r(e)});return(0,d.useEffect)(()=>{n!==l&&u(l)},[l,n]),(0,m.jsxs)(iE,{children:[(0,m.jsx)(aE,{asChild:!0,children:(0,m.jsxs)(B,{variant:`outline`,size:`sm`,className:`gap-2 border-border rounded-xl h-[30px] text-muted-foreground text-xs bg-(--surface-bg-color) hover:bg-(--surface-bg-color)/60`,children:[(0,m.jsx)(Kw,{className:`hidden size-3.5 sm:block`}),l,(0,m.jsx)(vw,{className:`size-4`})]})}),(0,m.jsxs)(oE,{align:`end`,className:`w-fit`,sideOffset:8,children:[(0,m.jsx)(fE,{children:e(`languages`)}),(0,m.jsx)(uE,{value:l,onValueChange:r,children:c.map(e=>(0,m.jsx)(dE,{value:e,children:e},e))}),(0,m.jsx)(pE,{}),(0,m.jsxs)(cE,{onClick:()=>{i(a?{view:`translation-mode`,itemId:a}:{view:`translation-mode`})},children:[(0,m.jsx)(hT,{className:`size-4 mr-2`}),(0,m.jsx)(`span`,{className:`text-nowrap`,children:e(`editLanguages`)})]})]})]})},bfe=`px-2 h-[30px] rounded-xl gap-2`,xfe=`h-[30px] rounded-xl gap-2 px-3 has-data-[icon=inline-start]:pl-3`,Sfe=({onBackRequested:e,onSaveRequested:t})=>{let n=J(`common.actions`),r=q(e=>e.editor),i=q(e=>e.userMutationsLocked),a=q(e=>e.getCommitsSinceInitial);q(e=>e.changeTick);let o=!!(r&&(r.hasUncommittedChanges||a().length>0));return(0,m.jsx)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:(0,m.jsxs)(`div`,{className:z(`flex flex-wrap items-center gap-2 justify-between`),children:[(0,m.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsxs)(B,{variant:`ghost`,size:`sm`,"aria-label":n(`back`),onClick:()=>{if(!i){if(e){e();return}typeof window<`u`&&window.history.back()}},disabled:i,className:bfe,children:[(0,m.jsx)(cw,{"data-icon":`inline-start`}),(0,m.jsx)(`span`,{className:`hidden text-xs text-muted-foreground sm:inline`,children:n(`back`)})]})}),(0,m.jsx)(IE,{children:n(`back`)})]})}),(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center justify-end gap-3`,children:[(0,m.jsx)(vfe,{}),(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsxs)(B,{variant:`default`,size:`sm`,"aria-label":n(`save`),onClick:t,disabled:!o,className:xfe,children:[(0,m.jsx)(wT,{"data-icon":`inline-start`}),(0,m.jsx)(`span`,{className:`hidden text-xs sm:inline`,children:n(`save`)})]})}),(0,m.jsx)(IE,{children:n(`save`)})]}),(0,m.jsx)(yfe,{})]})]})})},Cfe={sort:{duration:180,easing:`cubic-bezier(0.645, 0.045, 0.355, 1)`}},wfe=$I.configure({preventActivation:e=>e.target instanceof Element&&e.target.closest(`[data-tree-drag-disabled='true']`)!==null,activationConstraints(e){return e.pointerType===`touch`?[new YI.Delay({value:220,tolerance:6})]:[new YI.Distance({value:5})]}}),Tfe=4,Efe=.25,Dfe=.5,Ofe=.25,kfe=.5,A8=e=>typeof e==`object`&&!!e&&`kind`in e&&e.kind===`sortable-tree-node`,j8=e=>typeof e==`object`&&!!e&&`kind`in e&&e.kind===`sortable-tree-drop-zone`;function Afe(e,t,n){let r=new Set,i=e;for(;!r.has(i)&&n(i);){r.add(i);let e=t.childIdsByParentId.get(i)?.at(-1);if(!e)break;i=e}return i}function M8(e,t,n,r){let i=n.childIdsByParentId.get(t.parentId)??[],a=i.at(-1),o=t.index<i.length?i[t.index]:a?Afe(a,n,r):t.parentId,s=i.length===0?`inside`:t.index<i.length?`before`:`after`,c=t.index;return e.parentId===t.parentId&&c>e.index&&--c,{targetId:o,position:s,depth:(n.depthById.get(t.parentId)??-1)+1,to:{parentId:t.parentId,index:c}}}function N8(e,t,n,r){let i=n.childrenCountByParentId.get(t.parentId)??0;if(t.index<i||r<=0)return t;let a=e.transform.x,o=Math.max(0,-a),s=r*Ofe;if(o<s)return t;let c=r*kfe,l=1+Math.floor((o-s)/c),u=t;for(;l>0;){let e=u.parentId,t=n.parentById.get(e);if(!t)break;let r=n.childIdsByParentId.get(t)?.indexOf(e);if(r===void 0||r<0)break;u={parentId:t,index:r+1},--l}return u}function P8(e,t,n,r,i){let a=e.source?.data,o=e.target?.data;if(!A8(a)||a.treeId!==t)return null;if(j8(o)&&o.treeId===t)return M8(a,N8(e,{parentId:o.parentId,index:o.index},n,i),n,r);if(!MR(e)||!A8(o)||o.treeId!==t)return null;let s=e.shape?.current.center.y,c=e.target?.shape?.center.y,l=s??e.position.current.y,u=e.target?.shape?.boundingRectangle,d=u&&u.height>0?(l-u.top)/u.height:void 0;if(o.isBranch&&d!==void 0&&d>=Efe)return M8(a,{parentId:o.id,index:0},n,r);let f=o.isBranch?!1:d===void 0?s!==void 0&&c!==void 0&&s>c:d>=Dfe,p={parentId:o.parentId,index:o.index+ +!!f};return M8(a,f?N8(e,p,n,i):p,n,r)}function jfe(e,t,n,r){let i=new Map,a=new Map,o=new Map,s=new Map,c=new Map,l=new Set,u=(e,t,d)=>{o.set(t,e.length),s.set(t,e.map(n)),e.forEach(e=>{let o=n(e);l.has(o)||(l.add(o),i.set(o,e),a.set(o,t),c.set(o,d),u(r(e),o,d+1))})};return u(e,t,0),{itemById:i,parentById:a,childrenCountByParentId:o,childIdsByParentId:s,depthById:c}}function F8({runtime:e,parent:t,parentId:n,depth:r,index:i,isEmpty:a}){let o=!a&&n===e.rootId,s=r*e.indent+6,c={kind:`sortable-tree-drop-zone`,treeId:e.treeId,parent:t,parentId:n,index:i},{ref:l,isDropTarget:u}=aR({id:`${e.treeId}:drop:${n}`,type:e.dndType,data:c,collisionPriority:Tfe+r,accept:t=>{let r=t.data;return A8(r)&&r.treeId===e.treeId&&e.acceptsDrop(r,{parentId:n,index:i})}}),d=u&&e.dropProjection===null,f=a&&e.dropProjection?.to.parentId===n,p=a&&e.dropProjection?.targetId===n&&e.dropProjection.position===`after`&&e.dropProjection.to.parentId!==n,h=f||u&&e.dropProjection===null,g=a&&!h?e.renderEmptyGroup?.({parent:t,parentId:n,depth:r,indent:e.indent}):null;return(0,m.jsx)(`li`,{role:`none`,className:z(`relative`,!a&&(o?`-mt-0.5 h-0`:`h-0`)),children:(0,m.jsxs)(`div`,{ref:l,"data-tree-drop-zone":n,"data-tree-drop-target":u?`true`:void 0,className:z(`relative flex items-center rounded-md`,a?`min-h-7`:`absolute -top-2.5 right-0 z-10 h-5`,e.activeId===null&&!a&&`pointer-events-none`),style:a?{marginLeft:`${s}px`}:{left:`${s}px`},children:[g??(0,m.jsx)(`span`,{"aria-hidden":`true`,className:z(`relative h-0.5 flex-1 origin-left scale-x-95 rounded-full bg-primary opacity-0`,`transition-[transform,opacity] duration-150 ease-out motion-reduce:transition-none`,(d||f)&&`scale-x-100 opacity-100 shadow-[0_0_0_3px_color-mix(in_oklab,var(--primary)_14%,transparent)]`),children:f?(0,m.jsx)(`span`,{className:`absolute -left-1 -top-0.75 size-2 rounded-full border-2 border-background bg-primary`}):null}),p?(0,m.jsx)(`span`,{"aria-hidden":`true`,className:`absolute -bottom-px right-0 h-0.5 rounded-full bg-primary shadow-[0_0_0_2px_color-mix(in_oklab,var(--primary)_16%,transparent)]`,style:{left:`${(e.dropProjection?.depth??r)*e.indent+6-s}px`},children:(0,m.jsx)(`span`,{className:`absolute -left-1 -top-0.75 size-2 rounded-full border-2 border-background bg-primary`})}):null]})})}function I8({item:e,parentId:t,index:n,depth:r,runtime:i}){let a=i.getId(e),o=i.getChildren(e),s=i.isBranch?.(e)??o.length>0,c=s&&i.isExpanded(a),l=i.canDrag?!i.canDrag(e):!1,u={kind:`sortable-tree-node`,treeId:i.treeId,id:a,item:e,parentId:t,index:n,depth:r,isBranch:s},{sourceRef:f,targetRef:p,handleRef:h,isDragging:g}=Cz({id:a,index:n,group:t,type:i.dndType,data:u,disabled:l,transition:Cfe.sort,plugins:e=>e.filter(e=>e!==XR),accept:e=>{let r=e.data;return A8(r)&&r.treeId===i.treeId&&(i.acceptsDrop(r,{parentId:t,index:n})||s&&i.acceptsDrop(r,{parentId:a,index:0}))}}),_=c||i.activeId!==null&&s,v=i.dropProjection?.targetId===a?i.dropProjection.position:null,y=i.dropProjection?.targetId===a?i.dropProjection.depth:null,b=s&&o.length===0&&v===`after`,x=b?null:v,S=b?null:y,C=i.dropProjection?.to.parentId===a,w=(0,d.useCallback)(e=>{f(e),p(e)},[f,p]);return(0,m.jsxs)(`li`,{role:`treeitem`,"aria-expanded":s?c:void 0,"data-tree-node":a,"data-dragging":g?`true`:void 0,className:z(`list-none outline-none`,g&&`opacity-30`),children:[(0,m.jsx)(`div`,{ref:w,"data-tree-row":a,"data-tree-drop-position":x??void 0,"data-tree-drop-parent":C?`true`:void 0,children:i.renderItem({item:e,id:a,parentId:t,index:n,depth:r,indent:i.indent,isBranch:s,isExpanded:c,isDragging:g,isDropTarget:x!==null,isDropParent:C,dropPosition:x,dropDepth:S,isOverlay:!1,dragHandleRef:h,toggleExpanded:()=>i.setExpanded(a,!c)})}),_?(0,m.jsxs)(`ul`,{role:c?`group`:`none`,className:z(`list-none`,i.levelClassName),children:[c?o.map((e,t)=>(0,m.jsx)(I8,{item:e,parentId:a,index:t,depth:r+1,runtime:i},i.getId(e))):null,(0,m.jsx)(F8,{runtime:i,parent:e,parentId:a,depth:r+1,index:o.length,isEmpty:o.length===0})]}):null]})}function L8({items:e,rootId:t,getId:n,getChildren:r,renderItem:i,onMove:a,isBranch:o,canDrag:s,canDrop:c,expandedIds:l,defaultExpandedIds:u,onExpandedChange:f,renderEmptyGroup:p,ariaLabel:h,indent:g=18,className:_,levelClassName:v}){let y=(0,d.useId)(),b=(0,d.useMemo)(()=>`sortable-tree-${y.replace(/:/g,``)}`,[y]),x=`${b}:node`,[S,C]=(0,d.useState)(null),[w,T]=(0,d.useState)(null),[E,D]=(0,d.useState)(()=>new Set(u)),O=(0,d.useMemo)(()=>jfe(e,t,n,r),[r,n,e,t]),k=(0,d.useCallback)(e=>(l??E).has(e),[l,E]),A=(0,d.useCallback)((e,t)=>{l===void 0&&D(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r}),f?.(e,t)},[l,f]),j=(0,d.useCallback)((e,n)=>{let r=n.parentId;for(;r&&r!==t;){if(r===e.id)return!1;r=O.parentById.get(r)}return c?.({id:e.id,item:e.item,from:{parentId:e.parentId,index:e.index},to:n,parent:O.itemById.get(n.parentId)??null})??!0},[c,O.itemById,O.parentById,t]),M={items:e,rootId:t,getId:n,getChildren:r,renderItem:i,onMove:a,isBranch:o,canDrag:s,canDrop:c,expandedIds:l,defaultExpandedIds:u,onExpandedChange:f,renderEmptyGroup:p,ariaLabel:h,indent:g,className:_,levelClassName:v,activeId:S,dropProjection:w,dndType:x,treeId:b,index:O,isExpanded:k,setExpanded:A,acceptsDrop:j},N=e=>{let t=e.operation.source?.data;T(null),C(A8(t)&&t.treeId===b?t.id:null)},ee=e=>{let t=P8(e,b,O,k,g),n=e.source?.data,r=t&&A8(n)&&n.treeId===b&&j(n,t.to)?t:null;T(e=>e?.targetId===r?.targetId&&e?.position===r?.position&&e?.depth===r?.depth&&e?.to.parentId===r?.to.parentId&&e?.to.index===r?.to.index?e:r)};return(0,m.jsxs)(FL,{sensors:e=>[...e.filter(e=>e!==$I),wfe],onDragStart:N,onDragMove:e=>{ee(e.operation)},onDragOver:e=>{ee(e.operation)},onDragEnd:e=>{if(C(null),T(null),e.canceled)return;let{source:t,target:n}=e.operation,r=t?.data;if(!t||!A8(r)||r.treeId!==b)return;let i=P8(e.operation,b,O,k,g)?.to??null;if(!i&&n){let t=n.data;if(j8(t)&&t.treeId===b)i={parentId:t.parentId,index:t.index};else{let t=`${b}:drop:`,r=String(n.id);if(r.startsWith(t)){let n=r.slice(t.length);i=N8(e.operation,{parentId:n,index:O.childrenCountByParentId.get(n)??0},O,g)}}}if(!i||!j(r,i))return;let o=O.childrenCountByParentId.get(i.parentId)??0,s=r.parentId===i.parentId?Math.max(0,o-1):o,c={parentId:i.parentId,index:Math.max(0,Math.min(i.index,s))};r.parentId===c.parentId&&r.index===c.index||a({id:r.id,item:r.item,from:{parentId:r.parentId,index:r.index},to:c})},children:[(0,m.jsxs)(`ul`,{role:`tree`,"aria-label":h,className:z(`list-none`,v,_),children:[e.map((e,r)=>(0,m.jsx)(I8,{item:e,parentId:t,index:r,depth:0,runtime:M},n(e))),(0,m.jsx)(F8,{runtime:M,parent:null,parentId:t,depth:0,index:e.length,isEmpty:e.length===0})]}),(0,m.jsx)(qse,{dropAnimation:null,children:e=>{let t=e.data;return!A8(t)||t.treeId!==b?null:(0,m.jsx)(`div`,{className:`pointer-events-none min-w-32 w-[calc(100%-3rem)] max-w-full translate-x-3 -translate-y-2 opacity-60 drop-shadow-lg`,children:i({item:t.item,id:t.id,parentId:t.parentId,index:t.index,depth:t.depth,indent:g,isBranch:o?.(t.item)??r(t.item).length>0,isExpanded:k(t.id),isDragging:!0,isDropTarget:!1,isDropParent:!1,dropPosition:null,dropDepth:null,isOverlay:!0,dragHandleRef:()=>void 0,toggleExpanded:()=>void 0})})}})]})}var Mfe=24,R8=({children:e,onOpen:t,onOpenInEditor:n,onOpenParent:r,onCopy:i,copyLabel:a,onCopyReference:o,onPaste:s,onPasteBefore:c,onPasteInto:l,onPasteAfter:u,pasteDisabled:d,onOpenChange:f,onAddItem:p,onAddItemBefore:h,onAddItemInto:g,onAddItemAfter:_,deleteItemId:v,openDisabled:y=!1,openParentDisabled:b=!1})=>{let x=J(`common.actions`),S=J(`routes.itemEditor.outline`),C=!!(c||l||u),w=!!(h||g||_);return(0,m.jsxs)(yD,{onOpenChange:f,children:[(0,m.jsx)(bD,{asChild:!0,children:e}),(0,m.jsxs)(CD,{children:[(0,m.jsxs)(xD,{children:[(0,m.jsxs)(wD,{onSelect:t,disabled:y,children:[(0,m.jsx)(Bw,{}),S(`focus`)]}),n?(0,m.jsxs)(wD,{onSelect:n,children:[(0,m.jsx)(hT,{}),S(`openInEditor`)]}):null,r?(0,m.jsxs)(wD,{onSelect:r,disabled:b,children:[(0,m.jsx)(Hw,{}),S(`openParentGroup`)]}):null]}),i||o||s||C?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(OD,{}),(0,m.jsxs)(xD,{children:[i?(0,m.jsxs)(wD,{onSelect:i,children:[(0,m.jsx)(Ow,{}),a??x(`copy`)]}):null,o?(0,m.jsxs)(SD,{children:[(0,m.jsxs)(TD,{children:[(0,m.jsx)(`span`,{className:`size-4 shrink-0`,"aria-hidden":`true`}),S(`copyItemReference`)]}),(0,m.jsxs)(ED,{className:`border-border`,children:[(0,m.jsx)(wD,{onSelect:()=>o(`key`),children:S(`copyItemKey`)}),(0,m.jsx)(wD,{onSelect:()=>o(`fullKey`),children:S(`copyItemFullKey`)}),(0,m.jsx)(wD,{onSelect:()=>o(`id`),children:S(`copyItemId`)})]})]}):null,s?(0,m.jsxs)(wD,{onSelect:s,disabled:d,children:[(0,m.jsx)(jw,{}),S(`pasteItem`)]}):null,C?(0,m.jsxs)(SD,{children:[(0,m.jsxs)(TD,{disabled:d,children:[(0,m.jsx)(jw,{}),S(`pasteItem`)]}),(0,m.jsxs)(ED,{className:`border-border`,children:[l?(0,m.jsx)(wD,{onSelect:l,disabled:d,children:S(`intoGroup`)}):null,c?(0,m.jsx)(wD,{onSelect:c,disabled:d,children:S(`before`)}):null,u?(0,m.jsx)(wD,{onSelect:u,disabled:d,children:S(`after`)}):null]})]}):null]})]}):null,p||w?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(OD,{}),(0,m.jsxs)(xD,{children:[p?(0,m.jsxs)(wD,{onSelect:p,children:[(0,m.jsx)(yT,{}),S(`addItem`)]}):null,w?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(DD,{children:S(`addItem`)}),h?(0,m.jsx)(wD,{inset:!0,onSelect:h,children:S(`before`)}):null,_?(0,m.jsx)(wD,{inset:!0,onSelect:_,children:S(`after`)}):null,g?(0,m.jsx)(wD,{inset:!0,onSelect:g,children:S(`intoGroup`)}):null]}):null]})]}):null,v?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(OD,{}),(0,m.jsx)(jz,{itemId:v})]}):null]})]})},Nfe=({children:e,itemId:t,onOpen:n,onOpenInEditor:r,onOpenParent:i,onCopy:a,onPasteBefore:o,onPasteInto:s,onPasteAfter:c,pasteDisabled:l,openDisabled:u,openParentDisabled:d,readOnly:f,onOpenChange:p})=>{let h=J(`common.actions`),g=J(`routes.itemEditor.outline`),{canDelete:_,deleteItem:v}=_D({itemId:t});return(0,m.jsxs)(iE,{onOpenChange:p,children:[(0,m.jsx)(aE,{asChild:!0,children:e}),(0,m.jsxs)(oE,{align:`end`,className:`w-48 border-border`,children:[(0,m.jsxs)(sE,{children:[(0,m.jsxs)(cE,{onSelect:n,disabled:u,children:[(0,m.jsx)(Bw,{}),g(`focus`)]}),(0,m.jsxs)(cE,{onSelect:r,children:[(0,m.jsx)(hT,{}),g(`openInEditor`)]}),i?(0,m.jsxs)(cE,{onSelect:i,disabled:d,children:[(0,m.jsx)(Hw,{}),g(`openParentGroup`)]}):null]}),f?null:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(pE,{}),(0,m.jsxs)(sE,{children:[(0,m.jsxs)(cE,{onSelect:a,children:[(0,m.jsx)(Ow,{}),h(`copy`)]}),(0,m.jsxs)(mE,{children:[(0,m.jsxs)(hE,{disabled:l,children:[(0,m.jsx)(jw,{}),g(`pasteItem`)]}),(0,m.jsxs)(gE,{className:`border-border`,children:[s?(0,m.jsx)(cE,{onSelect:s,disabled:l,children:g(`intoGroup`)}):null,(0,m.jsx)(cE,{onSelect:o,disabled:l,children:g(`before`)}),(0,m.jsx)(cE,{onSelect:c,disabled:l,children:g(`after`)})]})]})]}),(0,m.jsx)(pE,{}),(0,m.jsxs)(cE,{variant:`destructive`,disabled:!_,onSelect:e=>{e.preventDefault(),v()},children:[(0,m.jsx)(zT,{}),h(`delete`)]})]})]})]})},Pfe=({item:e,depth:t,indent:n,isBranch:r,isExpanded:i,isDragging:a,isDropParent:o,dropPosition:s,dropDepth:c,isOverlay:l,dragHandleRef:d,toggleExpanded:f,onCopyItem:p,onCopyItemReference:h,onPasteItem:g,onOpenInEditor:_,hasValidClipboardItem:v,onContextMenuOpen:y,selectedPath:b,readOnly:x,onAddItemRequest:S})=>{let C=J(`routes.itemEditor.outline`),w=J(`common.actions`),T=tD(),E=q(e=>e.editorItemRegistry),{selectedItemId:D,navigateToItem:O}=oD(),k=r&&e instanceof u.st,A=D===e.id,j=k&&b.includes(e.id),M=dD(e,E),N=M.icon,ee=cD(e),P=e.type===u.lt.PageBreak?M.label:T?.getItemKey(e.id)?.itemKey??e.key,F=e.metadata?.itemLabel?.trim(),I=F?`${P}, ${F}`:P;if(!T)return null;let L=T.getParentItem(e.id),te=L instanceof u.st?L:void 0,ne=L?.isRoot()?!D:L?.id===D,re=L?()=>O(L.isRoot()?void 0:L.id):void 0,ie=te?.items.indexOf(e.id)??-1,ae=S&&te&&ie>=0?()=>S(te.id,ie):void 0,oe=S&&te&&ie>=0?()=>S(te.id,ie+1):void 0,se=(0,m.jsxs)(`div`,{"data-group":k?`true`:void 0,"data-selected-group":A&&k?`true`:void 0,className:z(`group/outline-row relative flex min-h-9 w-full items-center gap-1 rounded-lg pr-1`,`transition-[background-color,box-shadow,color] duration-150 ease-out motion-reduce:transition-none`,!l&&!x&&`cursor-grab touch-none active:cursor-grabbing`,!l&&x&&`cursor-pointer`,!l&&!A&&`hover:bg-muted-foreground/10`,A&&`bg-primary/10 text-foreground shadow-sm ring-1 ring-primary/30 hover:bg-primary/20`,o&&!l&&`bg-primary/10 text-foreground shadow-sm ring-1 ring-inset ring-primary/50`,l&&`border border-border bg-popover text-popover-foreground shadow-lg`,a&&!l&&`pointer-events-none`),style:{paddingLeft:`${t*n+6}px`},children:[l?null:(0,m.jsx)(`button`,{ref:x?void 0:d,type:`button`,"aria-selected":A,className:`absolute inset-0 z-0 rounded-lg outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>O(e.id),"aria-label":C(x?`openItem`:`dragItem`,{item:I})}),x&&!l?(0,m.jsx)(`span`,{ref:d,className:`hidden`,"aria-hidden":!0}):null,s===`before`||s===`after`?(0,m.jsx)(`span`,{"aria-hidden":`true`,className:z(`pointer-events-none absolute right-1 z-30 h-0.5 rounded-full bg-primary shadow-[0_0_0_2px_color-mix(in_oklab,var(--primary)_16%,transparent)]`,s===`before`?`-top-px`:`-bottom-px`),style:{left:`${(c??t)*n+6}px`},children:(0,m.jsx)(`span`,{className:`absolute -left-1 -top-0.75 size-2 rounded-full border-2 border-background bg-primary`})}):null,(0,m.jsxs)(`div`,{className:`pointer-events-none relative z-10 flex min-w-0 flex-1 items-center gap-2 rounded-md py-1 text-left`,children:[(0,m.jsx)(`span`,{className:`shrink-0`,style:{color:ee},"aria-hidden":!0,children:(0,m.jsx)(N,{className:`size-4`})}),(0,m.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,m.jsx)(`span`,{className:z(`block truncate font-mono text-xs font-medium`,(A||j)&&`font-semibold`),children:P}),F?(0,m.jsx)(`span`,{className:`block max-w-full wrap-break-word text-[11px] leading-4 text-muted-foreground`,children:F}):null]})]}),l?null:(0,m.jsxs)(`div`,{className:z(`relative z-20 flex min-w-max shrink-0 items-center gap-0.5 transition-opacity`,x?`opacity-100`:`opacity-0 focus-within:opacity-100 group-hover/outline-row:opacity-100`,k&&`flex-row-reverse`),children:[!a&&!o&&s===null&&ae&&oe?k?(0,m.jsxs)(iE,{children:[(0,m.jsx)(aE,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,"data-tree-drag-disabled":`true`,variant:`ghost`,size:`icon-xs`,"aria-label":C(`addItem`),children:(0,m.jsx)(yT,{})})}),(0,m.jsxs)(oE,{align:`end`,className:`w-40 border-border`,children:[k?(0,m.jsx)(fE,{children:C(`addItem`)}):null,(0,m.jsx)(cE,{onSelect:ae,children:C(`before`)}),k&&S?(0,m.jsx)(cE,{onSelect:()=>S(e.id),children:C(`intoGroup`)}):null,(0,m.jsx)(cE,{onSelect:oe,children:C(`after`)})]})]}):(0,m.jsx)(B,{type:`button`,"data-tree-drag-disabled":`true`,variant:`ghost`,size:`icon-xs`,onClick:oe,"aria-label":`${C(`addItem`)}: ${C(`after`)}`,children:(0,m.jsx)(yT,{})}):null,(0,m.jsx)(Nfe,{itemId:e.id,onOpen:()=>O(e.id),onOpenInEditor:()=>_(e.id),onOpenParent:re,onCopy:()=>p(e.id),onPasteBefore:()=>g(e.id,`before`),onPasteInto:k?()=>g(e.id,`into`):void 0,onPasteAfter:()=>g(e.id,`after`),pasteDisabled:!v,openDisabled:A,openParentDisabled:ne,readOnly:x,onOpenChange:e=>{e&&y()},children:(0,m.jsx)(B,{type:`button`,"data-tree-drag-disabled":`true`,variant:`ghost`,size:`icon-xs`,"aria-label":w(`more`),children:(0,m.jsx)(Fw,{})})})]}),k?(0,m.jsx)(`button`,{type:`button`,"data-tree-drag-disabled":`true`,className:`relative z-20 flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none hover:bg-background focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:f,"aria-label":C(i?`collapseGroup`:`expandGroup`,{group:I}),tabIndex:l?-1:void 0,children:(0,m.jsx)(bw,{className:z(`size-3.5 transition-transform duration-150 ease-in-out motion-reduce:transition-none`,i&&`rotate-90`)})}):null]});return l?se:(0,m.jsx)(R8,{onOpen:()=>O(e.id),onOpenInEditor:()=>_(e.id),onOpenParent:re,onCopy:x?void 0:()=>p(e.id),onCopyReference:x?void 0:t=>h(e.id,t),onPasteBefore:x?void 0:()=>g(e.id,`before`),onPasteInto:x||!k?void 0:()=>g(e.id,`into`),onPasteAfter:x?void 0:()=>g(e.id,`after`),pasteDisabled:x||!v,onOpenChange:e=>{e&&y()},onAddItemInto:x||!k||!S?void 0:()=>S(e.id),onAddItemBefore:x?void 0:ae,onAddItemAfter:x?void 0:oe,deleteItemId:x?void 0:e.id,openDisabled:A,openParentDisabled:ne,children:se})},z8=({readOnly:e,onAddItemRequest:t})=>{let n=J(`routes.itemEditor.outline`),r=J(`copyItem`),i=J(`groupItems`),a=J(`history`),o=tD(),s=q(e=>e.editorItemRegistry),c=q(e=>e.copyItem),l=q(e=>e.pasteItem),f=q(e=>e.moveItem),p=q(e=>e.updateItem),h=q(e=>e.commitByUser),{selectedItemId:g,navigateToItem:_}=oD(),v=rD(e=>e.navigate),[y,b]=yE(),x=o?.rootItem,S=!g||g===x?.id,[C,w]=(0,d.useState)(()=>new Set),T=(0,d.useCallback)(e=>{v(e?{view:`item-editor`,itemId:e}:{view:`item-editor`})},[v]),E=(0,d.useMemo)(()=>{if(!y)return null;try{let e=JSON.parse(y);return Iz.isValidClipboardData(e)?e:null}catch{return null}},[y]),D=E!==null,O=(0,d.useMemo)(()=>!o||!g||!o.surveyItems.has(g)?[]:o.getItemPath(g),[g,o]),k=(0,d.useMemo)(()=>{let e=new Set;return o?.surveyItems.forEach(t=>{t instanceof u.st&&!C.has(t.id)&&e.add(t.id)}),e},[C,o]),A=(0,d.useCallback)((e,t)=>{try{let n=c(e);t?.(n),navigator.clipboard.writeText(JSON.stringify(n,null,2)).then(()=>{b(),OE.success(r(`copied`))}).catch(()=>{OE.error(r(`failedToClipboard`))})}catch(e){console.error(`Error copying item:`,e),OE.error(r(`failed`))}},[c,r,b]),j=(0,d.useCallback)((e,t)=>{let r=o?.surveyItems.get(e);if(!r||!o)return;let i=o.getItemKey(e),a=t===`id`?r.id:t===`fullKey`?i?.fullKey??r.key:i?.itemKey??r.key;navigator.clipboard.writeText(a).then(()=>{OE.success(n(`itemReferenceCopied`))}).catch(()=>{OE.error(n(`itemReferenceCopyFailed`))})},[o,n]),M=(0,d.useCallback)((e,t)=>{if(!(!E||!o))try{let n=l(E,{parentId:e,...t===void 0?{}:{index:t}});if(!n)return;h({label:a(`pasteItem`)}),w(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n}),_(n),OE.success(i(`itemPasted`))}catch(e){console.error(`Error pasting item:`,e),OE.error(i(`pasteFailed`))}},[E,h,i,a,_,l,o]),N=(0,d.useCallback)((e,t)=>{if(!E||!o)return;let n=o.surveyItems.get(e),r=o.getParentItem(e);if(!n||!(r instanceof u.st))return;if(t===`into`){if(!(n instanceof u.st))return;M(n.id,0);return}let i=r.items.indexOf(e);if(i<0)return;let a=t===`before`?i:i+1;M(r.id,a)},[E,M,o]),ee=(0,d.useCallback)(()=>{x&&M(x.id,x.items.length)},[M,x]),P=(0,d.useMemo)(()=>x?.items.flatMap(e=>{let t=o?.surveyItems.get(e);return t?[t]:[]})??[],[x,o]),F=(0,d.useCallback)(e=>!(e instanceof u.st)||!o?[]:e.items.flatMap(e=>{let t=o.surveyItems.get(e);return t?[t]:[]}),[o]),I=(0,d.useCallback)(({id:e,from:t,to:r})=>{if(!o)return;let i=o.surveyItems.get(t.parentId),s=o.surveyItems.get(r.parentId);if(!(!(i instanceof u.st)||!(s instanceof u.st)))try{i.id===s.id?(i.moveItemToIndex(e,r.index),p(i.id,i.rawItem)):f(e,{parentId:s.id,index:r.index}),w(e=>{if(!e.has(s.id))return e;let t=new Set(e);return t.delete(s.id),t}),h({label:a(`moveItem`)})}catch(e){console.error(`Error moving outline item:`,e),OE.error(n(`moveFailed`))}},[h,a,f,o,n,p]),L=(0,d.useCallback)(n=>(0,m.jsx)(Pfe,{...n,onCopyItem:A,onCopyItemReference:j,onPasteItem:N,onOpenInEditor:T,hasValidClipboardItem:D,onContextMenuOpen:b,selectedPath:O,readOnly:e,onAddItemRequest:t}),[A,j,D,T,N,O,b,e,t]);if(!o||!x)return null;let te=r=>(0,m.jsx)(R8,{onOpen:()=>_(),onOpenInEditor:()=>T(),onCopy:e?void 0:()=>A(x.id,e=>{let t=e.items.find(t=>t.itemId===e.rootItemId);if(!t)throw Error(`Copied survey root item was not found in clipboard data`);let n=t.itemData.config&&typeof t.itemData.config==`object`&&!Array.isArray(t.itemData.config)?t.itemData.config:{};t.itemData={...t.itemData,config:{...n,isRoot:!1}}}),copyLabel:n(`copySurveyAsGroup`),onPaste:e?void 0:ee,pasteDisabled:e||!D,onOpenChange:t=>{t&&!e&&b()},onAddItem:e||!t?void 0:()=>t(x.id),openDisabled:S,children:r}),ne=dD(x,s).icon,re=cD(x);return(0,m.jsxs)(`div`,{className:`flex h-full w-full min-h-0 flex-col overflow-hidden bg-(--surface-bg-color)`,children:[(0,m.jsxs)(`div`,{className:`flex min-h-9 shrink-0 items-center gap-1 border-b border-border/80 px-4`,children:[te((0,m.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 items-center gap-2 rounded-md py-1 text-left outline-none hover:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>_(),children:[(0,m.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md text-white`,style:{backgroundColor:re},"aria-hidden":!0,children:(0,m.jsx)(ne,{className:`size-3.5`})}),(0,m.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,m.jsx)(`span`,{className:`truncate text-[9px] font-semibold uppercase leading-3 tracking-[0.14em] text-muted-foreground`,children:n(`title`)}),(0,m.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold leading-4`,children:o.surveyKey})]})]})),t?(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,className:z(`-me-3 ms-auto`,e&&`invisible pointer-events-none`),onClick:()=>t(x.id,0),disabled:e,"aria-label":n(`addToSurvey`),children:(0,m.jsx)(yT,{"data-icon":`inline-start`})})}),(0,m.jsx)(IE,{children:n(`addToSurvey`)})]}):null]}),(0,m.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-auto px-2.5 py-2`,children:x.items.length===0?(0,m.jsx)(`div`,{className:`flex min-h-48 flex-1 flex-col items-start justify-center px-1.5 py-8 text-balance`,children:(0,m.jsxs)(`div`,{className:`flex w-full flex-col items-start gap-2`,children:[(0,m.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:n(`emptyDescription`)}),(0,m.jsx)(`p`,{className:`text-[11px] leading-4 text-muted-foreground/80`,children:n(`emptyPanelControlsHint`)})]})}):(0,m.jsxs)(`div`,{className:`flex min-h-0 min-w-55 w-full flex-1 flex-col`,children:[(0,m.jsx)(L8,{items:P,rootId:x.id,getId:e=>e.id,getChildren:F,isBranch:e=>e instanceof u.st,canDrag:e?void 0:()=>!0,expandedIds:k,onExpandedChange:(e,t)=>{w(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r})},onMove:I,renderItem:L,renderEmptyGroup:({parentId:r,indent:i})=>(0,m.jsxs)(`div`,{className:`group/empty-outline-group relative flex h-9 w-full items-center`,style:{marginInlineStart:`${Mfe-i}px`},children:[(0,m.jsx)(`span`,{className:`text-xs font-light text-muted-foreground transition-opacity group-hover/empty-outline-group:opacity-0 group-focus-within/empty-outline-group:opacity-0`,children:n(`noItems`)}),t?(0,m.jsxs)(B,{type:`button`,"data-tree-drag-disabled":`true`,variant:`ghost`,size:`sm`,className:z(`pointer-events-none absolute inset-0 h-full w-full justify-start opacity-0 transition-opacity group-hover/empty-outline-group:pointer-events-auto group-hover/empty-outline-group:opacity-100 group-focus-within/empty-outline-group:pointer-events-auto group-focus-within/empty-outline-group:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100`,e&&`invisible pointer-events-none`),onClick:()=>t(r,0),disabled:e,"aria-label":n(`addItem`),children:[(0,m.jsx)(yT,{"data-icon":`inline-start`}),n(`addItem`)]}):null]}),ariaLabel:n(`title`),levelClassName:`flex flex-col gap-0.5`,className:`min-w-55 w-full [&_[role=treeitem]:has(>_[data-tree-row]_[data-selected-group])_>_ul]:rounded-lg [&_[role=treeitem]:has(>_[data-tree-row]_[data-selected-group])_>_ul]:bg-primary/5`}),te((0,m.jsx)(`div`,{"aria-label":n(`rootContextMenuTarget`),className:`group/root-outline-tail relative min-h-24 w-full flex-1 rounded-lg outline-none transition-colors hover:bg-muted/55 focus-visible:ring-2 focus-visible:ring-ring/50`,children:!e&&t?(0,m.jsxs)(B,{type:`button`,"data-tree-drag-disabled":`true`,variant:`ghost`,size:`sm`,className:`absolute inset-x-0 top-0 h-9 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/root-outline-tail:opacity-100`,onClick:()=>t(x.id,x.items.length),"aria-label":n(`addToSurvey`),children:[(0,m.jsx)(yT,{"data-icon":`inline-start`}),n(`addItem`)]}):null}))]})})]})},Ffe=()=>(0,m.jsx)(z8,{readOnly:!0}),Ife=()=>{let{openAddItemDialog:e}=Pz();return(0,m.jsx)(z8,{readOnly:q(e=>e.userMutationsLocked),onAddItemRequest:e})},B8=({mode:e,main:t,overlay:n,mainLabel:r,onBackRequested:i,onSaveRequested:a})=>{let o=J(`routes.itemEditor.outline`),s=J(`workspace.assistant`),c=E8(),{workspace:l}=GE(),u=w8[e];return(0,m.jsxs)(Nz,{children:[(0,m.jsx)(x8,{id:u.id,primaryMinSize:u.primaryMinSize,toolbar:(0,m.jsx)(Sfe,{onBackRequested:i,onSaveRequested:a}),main:t,mainLabel:r,left:{...u.left,defaultOpen:l?.panels?.outline?.defaultOpen??u.left.defaultOpen,label:o(`title`),content:(0,m.jsx)(Ife,{})},right:c?{...u.right,defaultOpen:l?.panels?.assistant?.defaultOpen??u.right.defaultOpen,label:s(`title`),content:(0,m.jsx)(D8,{})}:void 0}),(0,m.jsx)(Ade,{}),n]})},Lfe=({onBackRequested:e,onSaveRequested:t})=>{let n=J(`routes.itemEditor`);return q(e=>e.editor)?(0,m.jsx)(B8,{mode:`editing`,main:(0,m.jsx)(Sde,{}),mainLabel:n(`editor`),onBackRequested:e,onSaveRequested:t}):(0,m.jsx)(`div`,{className:`relative flex h-full min-h-0 items-center justify-center`,children:(0,m.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(oT,{className:`size-4 animate-spin`}),n(`loading`)]})})},Rfe=()=>{let e=J(`routes.translationMode`),t=J(`routes.itemEditor.outline`),n=J(`workspace.assistant`),r=E8(),i=rD(e=>e.navigate),{selectedItemId:a}=oD(),o=w8.translation;return(0,m.jsx)(x8,{id:o.id,primaryMinSize:o.primaryMinSize,mainLabel:e(`title`),toolbar:(0,m.jsxs)(B,{variant:`ghost`,size:`sm`,onClick:()=>i(a?{view:`item-editor`,itemId:a}:{view:`item-editor`}),children:[(0,m.jsx)(cw,{"data-icon":`inline-start`}),e(`backToItemEditor`)]}),main:(0,m.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center overflow-auto p-8`,children:(0,m.jsx)(`div`,{className:`text-center text-muted-foreground`,children:e(`comingSoon`)})}),left:{...o.left,label:t(`title`),content:(0,m.jsx)(Ffe,{})},right:r?{...o.right,label:n(`title`),content:(0,m.jsx)(D8,{})}:void 0})},zfe=()=>{let e=J(`routes.assetManager`),t=J(`workspace.assistant`),n=E8(),r=rD(e=>e.navigate),i=B3().length,a=w8.assets;return(0,m.jsx)(x8,{id:a.id,primaryMinSize:a.primaryMinSize,mainLabel:e(`title`),toolbar:(0,m.jsxs)(B,{variant:`ghost`,size:`sm`,onClick:()=>r({view:`item-editor`}),className:`text-muted-foreground hover:text-foreground`,children:[(0,m.jsx)(cw,{"data-icon":`inline-start`}),e(`backToItemEditor`)]}),main:(0,m.jsxs)(`div`,{className:`h-full min-h-0 overflow-y-auto px-4 py-4`,children:[(0,m.jsxs)(`div`,{className:`mb-4`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-3`,children:[(0,m.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight text-foreground`,children:e(`title`)}),(0,m.jsx)(`span`,{className:`rounded-full bg-muted px-2.5 py-0.5 text-xs font-medium tabular-nums text-muted-foreground`,children:i})]}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`description`)})]}),(0,m.jsx)(hD,{children:(0,m.jsx)(G3,{})})]}),right:n?{...a.right,label:t(`title`),content:(0,m.jsx)(D8,{})}:void 0})},V8={mobile:OT,tablet:AT,desktop:uT,wide:VT},H8=[`mobile`,`tablet`,`desktop`,`wide`],U8=({preferences:e,onPreferencesChange:t,canLocate:n,onLocate:r,canReset:i,onReset:a,onSimulatorRequested:o,fullscreen:s,onFullscreenChange:c,expanded:l=!1})=>{let u=J(`routes.previewMode`),d=e=>{(e===`single`||e===`paginated`)&&t({layout:e})},f=e=>{H8.includes(e)&&t({viewport:e})};return(0,m.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,"aria-label":u(`controlsLabel`),children:[(0,m.jsx)(Q4,{type:`single`,value:e.viewport,onValueChange:f,variant:`outline`,size:`icon-sm`,spacing:0,className:z(`hidden`,l&&`flex`),"aria-label":u(`viewportLabel`),children:H8.map(e=>{let t=V8[e];return(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)($4,{value:e,className:`focus-visible:ring-inset aria-checked:bg-muted aria-checked:text-foreground`,"aria-label":u(`viewport.${e}`),children:(0,m.jsx)(t,{})})}),(0,m.jsx)(IE,{children:u(`viewport.${e}`)})]},e)})}),(0,m.jsxs)(iE,{children:[(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(aE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon-sm`,className:`focus-visible:ring-inset`,"aria-label":u(`previewSettings`),children:(0,m.jsx)(Fw,{})})})}),(0,m.jsx)(IE,{children:u(`previewSettings`)})]}),(0,m.jsxs)(oE,{align:`center`,className:`w-56`,children:[(0,m.jsxs)(sE,{children:[(0,m.jsx)(fE,{children:u(`layoutLabel`)}),(0,m.jsxs)(uE,{value:e.layout,onValueChange:d,children:[(0,m.jsxs)(dE,{value:`single`,children:[(0,m.jsx)(Lw,{}),u(`singlePage`)]}),(0,m.jsxs)(dE,{value:`paginated`,children:[(0,m.jsx)(zw,{}),u(`paginated`)]})]})]}),(0,m.jsx)(pE,{}),(0,m.jsxs)(sE,{children:[(0,m.jsx)(fE,{children:u(`viewportLabel`)}),(0,m.jsx)(uE,{value:e.viewport,onValueChange:f,children:H8.map(e=>{let t=V8[e];return(0,m.jsxs)(dE,{value:e,children:[(0,m.jsx)(t,{}),u(`viewport.${e}`)]},e)})})]}),(0,m.jsx)(pE,{}),(0,m.jsxs)(sE,{children:[(0,m.jsx)(fE,{children:u(`displayLabel`)}),(0,m.jsxs)(lE,{checked:e.showKeys,onCheckedChange:e=>t({showKeys:e}),children:[(0,m.jsx)(tT,{}),u(`showKeys`)]}),(0,m.jsxs)(lE,{checked:e.showFullKeys,onCheckedChange:e=>t({showFullKeys:e}),disabled:!e.showKeys,children:[(0,m.jsx)(tT,{}),u(`showFullKeys`)]}),(0,m.jsxs)(lE,{checked:e.showMetadata,onCheckedChange:e=>t({showMetadata:e}),children:[(0,m.jsx)(mw,{}),u(`showMetadata`)]}),(0,m.jsxs)(lE,{checked:e.showConditions,onCheckedChange:e=>t({showConditions:e}),children:[(0,m.jsx)(Gw,{}),u(`showConditions`)]}),(0,m.jsxs)(lE,{checked:e.showPageIndicator,onCheckedChange:e=>t({showPageIndicator:e}),children:[(0,m.jsx)(iT,{}),u(`showPageIndicator`)]})]})]})]}),(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon-sm`,className:`focus-visible:ring-inset`,onClick:()=>c(!s),"aria-label":u(s?`exitFullscreen`:`enterFullscreen`),children:s?(0,m.jsx)(cT,{}):(0,m.jsx)(sT,{})})}),(0,m.jsx)(IE,{children:u(s?`exitFullscreen`:`enterFullscreen`)})]}),(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon-sm`,className:`focus-visible:ring-inset`,onClick:r,disabled:!n,"aria-label":u(`locateFocusedItem`),children:(0,m.jsx)(Bw,{})})}),(0,m.jsx)(IE,{children:u(n?`locateFocusedItem`:`noFocusedItem`)})]}),(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon-sm`,className:`focus-visible:ring-inset`,onClick:a,disabled:!i,"aria-label":u(`resetSurvey`),children:(0,m.jsx)(CT,{})})}),(0,m.jsx)(IE,{children:u(`resetSurvey`)})]}),o?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(KT,{orientation:`vertical`,className:`mx-0.5 data-vertical:h-5 data-vertical:self-center`}),(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon-sm`,className:`focus-visible:ring-inset w-10`,onClick:o,"aria-label":u(`startSimulator`),children:(0,m.jsx)(vT,{})})}),(0,m.jsx)(IE,{children:u(`startSimulator`)})]})]}):null]})},Bfe={mobile:390,tablet:768,desktop:960,wide:1280},W8=(e,t,n,r)=>{for(let i of t){if(n.has(i))continue;n.add(i);let t=e.surveyItems.get(i);if(t){if(t instanceof u.st){W8(e,t.items,n,r);continue}r.push(t)}}},G8=e=>{let t=e.rootItem;if(!t)return[];let n=[];return W8(e,t.items,new Set([t.id]),n),n},Vfe=e=>{let t=new Map,n=(r,i)=>{for(let a=0;a<i.length;a+=1){let o=i[a];t.set(o,{parentId:r,index:a+1});let s=e.surveyItems.get(o);s instanceof u.st&&n(s.id,s.items)}},r=e.rootItem;return r&&n(r.id,r.items),t},K8=(e,t)=>{let n=[],r=[],i=()=>{r.length!==0&&(n.push(r),r=[])};for(let n of e){if(n.type===u.lt.PageBreak){i();continue}r.push(n),t&&t>0&&r.length>=t&&i()}return i(),n},q8=(e,t)=>{let n=e.maxItemsPerPage;if(n)return t===`mobile`?n.small:n.large},J8=(e,t)=>e.findIndex(e=>e.some(e=>e.id===t)),Y8=(e,t)=>{let n=e.findIndex(e=>e.id===t);if(!(n<0)){if(e[n].type!==u.lt.PageBreak)return t;for(let t=n+1;t<e.length;t+=1)if(e[t].type!==u.lt.PageBreak)return e[t].id;for(let t=n-1;t>=0;--t)if(e[t].type!==u.lt.PageBreak)return e[t].id}},X8=(e,t,n)=>{if(!t)return;if(n.some(e=>e.id===t))return t;let r=e.surveyItems.get(t);if(!(r instanceof u.st))return;let i=[];return W8(e,r.items,new Set([r.id]),i),i[0]?.id},Hfe=e=>{let t=Object.values(e.displayConditions?.components??{}),n=Object.values(e.disabledConditions?.components??{});return!!(e.displayConditions?.root||t.some(Boolean)||n.some(Boolean))};function Z8({className:e,value:t,...n}){return(0,m.jsx)(Hu,{"data-slot":`progress`,className:z(`relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted`,e),...n,children:(0,m.jsx)(Wu,{"data-slot":`progress-indicator`,className:`size-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})})}var Ufe=({itemId:e,highlighted:t})=>{let n=J(`routes.previewMode`);return(0,m.jsxs)(`div`,{"data-preview-item-id":e,"data-highlighted":t||void 0,className:`flex scroll-mt-24 items-center gap-3 rounded-lg px-2 py-5 transition-[background-color,box-shadow] data-highlighted:bg-destructive/10 data-highlighted:ring-2 data-highlighted:ring-destructive/30`,role:`separator`,"aria-label":n(`pageBreak`),children:[(0,m.jsx)(KT,{className:`flex-1 bg-destructive/50`}),(0,m.jsx)(`span`,{className:`shrink-0 text-xs font-medium uppercase tracking-[0.16em] text-destructive`,children:n(`pageBreak`)}),(0,m.jsx)(KT,{className:`flex-1 bg-destructive/50`})]})},Q8=(e,t)=>{if(!e)return null;let n=new Date(e);return Number.isNaN(n.getTime())?null:u.N(n,`PP p`,{locale:t})},Wfe=({item:e,renderedItem:t,preferences:n,focused:r,highlighted:i,onFocus:a,afterDeleteItemId:o})=>{let s=J(`routes.previewMode`),c=J(`common.actions`),l=J(`copyItem`),u=J(`itemPreview`),d=qE(),f=eD(),p=tD(),h=q(e=>e.selectedLocale),g=q(e=>e.editorItemRegistry),_=q(e=>e.userMutationsLocked),v=rD(e=>e.navigate),y=YC(g,e),b=p?.getItemTranslations(e.id),x=ZC({item:e,definition:y,itemContent:b,locales:p?.locales??[],locale:h}),S=dD(e,g),C=cD(e),w=Hfe(e),T=p?.getItemKey(e.id),E=T?.fullKey??e.key,D=n.showFullKeys?E:T?[...T.path.slice(1),T.itemKey].join(T.keySeparator):e.key,O=`survey-preview-item-${e.id}`,k=[{label:u(`created`),value:Q8(e.editorMetadata.createdAt,d)},{label:u(`modified`),value:Q8(e.editorMetadata.updatedAt,d)}].filter(e=>!!e.value),A=n.showMetadata&&k.length>0?(0,m.jsx)(`dl`,{className:`flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-muted-foreground`,children:k.map(e=>(0,m.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,m.jsx)(`dt`,{children:e.label}),(0,m.jsx)(`dd`,{className:`truncate font-medium text-foreground`,children:e.value})]},e.label))}):null;return(0,m.jsxs)(`div`,{"data-preview-item-id":e.id,"data-highlighted":i||void 0,className:z(`scroll-mt-24 overflow-visible transition-shadow duration-300 ease-in-out`,`data-highlighted:ring-4 data-highlighted:ring-offset-4 rounded-xl data-highlighted:ring-offset-background data-highlighted:ring-ring/50`),role:`group`,"aria-labelledby":n.showKeys?O:void 0,children:[(0,m.jsx)(`div`,{className:z(`group/preview-focus-header mb-2 cursor-pointer overflow-visible`,!n.showKeys&&!n.showMetadata&&`min-h-7`),onClick:e=>{e.target instanceof Element&&e.target.closest(`button, a, input, textarea, select, [role='button'], [role='menuitem']`)||a()},children:(0,m.jsxs)(`div`,{className:`flex min-w-0 items-end justify-between gap-3`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[n.showKeys?(0,m.jsxs)(`div`,{id:O,className:`flex min-w-0 items-center gap-2 text-sm font-medium leading-snug`,children:[(0,m.jsx)(`span`,{className:`shrink-0`,style:{color:C},children:(0,m.jsx)(S.icon,{className:`size-4`,"aria-hidden":!0})}),(0,m.jsx)(`button`,{type:`button`,className:`min-w-0 truncate rounded-sm font-mono text-xs outline-none hover:underline group-hover/preview-focus-header:underline focus-visible:ring-2 focus-visible:ring-ring/50`,style:{color:C},onClick:a,"aria-label":s(`focusItem`,{item:E}),"aria-pressed":r,children:D}),e.metadata?.itemLabel?(0,m.jsx)(`span`,{className:`min-w-0 truncate text-xs font-normal text-muted-foreground`,children:e.metadata.itemLabel}):null]}):null,A]}),(0,m.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[n.showConditions&&w?(0,m.jsx)(UO,{item:e,title:s(`hasConditions`)}):null,(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground`,"aria-label":s(`openInEditor`,{item:E}),onClick:()=>v({view:`item-editor`,itemId:e.id}),children:(0,m.jsx)(hT,{})})}),(0,m.jsx)(IE,{children:s(`openInEditor`,{item:E})})]}),(0,m.jsxs)(iE,{children:[(0,m.jsx)(aE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground`,"aria-label":c(`more`),children:(0,m.jsx)(Tw,{})})}),(0,m.jsxs)(oE,{align:`end`,className:`w-44`,children:[(0,m.jsx)(sE,{children:(0,m.jsxs)(cE,{onSelect:a,disabled:r,children:[(0,m.jsx)(Bw,{}),s(`setFocus`)]})}),(0,m.jsx)(pE,{}),(0,m.jsx)(sE,{children:(0,m.jsxs)(cE,{onSelect:()=>{if(!f)return;let t=f.copyItem(e.id);navigator.clipboard.writeText(JSON.stringify(t,null,2)).then(()=>{vE(),OE.success(l(`copied`))}).catch(()=>OE.error(l(`failed`)))},children:[(0,m.jsx)(Nw,{}),c(`copy`)]})}),(0,m.jsx)(pE,{}),(0,m.jsx)(sE,{children:(0,m.jsx)(vD,{overrideItemId:e.id,afterDeleteItemId:o,disabled:_})})]})]})]})]})}),(0,m.jsx)(`div`,{className:`@container/preview-content`,children:(0,m.jsx)(`div`,{className:`w-full`,children:(()=>{if(x===i_.blank)return(0,m.jsx)(Ez,{state:x,itemTypeLabel:S.label,onEdit:()=>v({view:`item-editor`,itemId:e.id})});let n=t=>x===i_.incomplete?(0,m.jsx)(Dz,{onEdit:()=>v({view:`item-editor`,itemId:e.id}),children:t}):t;if(y?.renderComponent&&t)return n((0,m.jsx)(Q9,{item:t}));if(y?.previewComponent){let t=y.previewComponent;return n((0,m.jsx)(t,{item:e,itemConfig:e.config,itemContent:b,locale:h,mode:`interactive`}))}return(0,m.jsx)(`p`,{className:`py-10 text-center text-sm text-muted-foreground`,children:u(`noPreviewRenderer`,{itemType:e.type})})})()})})]})},Gfe=(e,t)=>e[t+1]?.id??e[t-1]?.id??null,Kfe=96,qfe=3e3,Jfe=12,Yfe=({survey:e,surveyEngine:t,preferences:n,focusedItemId:r,locateRequestKey:i,initialLocateReady:a,currentPageIndex:o,onCurrentPageIndexChange:s,onResponseChanged:c,className:l})=>{let f=J(`routes.previewMode`),{openAddItemDialog:p}=Fz(),{navigateToItem:h}=oD(),g=(0,d.useRef)(null),_=(0,d.useRef)(n.layout),v=(0,d.useRef)(null),y=(0,d.useRef)({single:0,paginated:0}),b=(0,d.useRef)(null),[x,S]=(0,d.useState)(),C=rD(e=>e.setAssistantHighlight),[w,T]=(0,d.useState)(0);(0,d.useEffect)(()=>(C(`preview-locate`,x?{kind:`highlighted-item`,itemId:x,details:`Temporarily highlighted in the survey preview.`}:void 0),()=>C(`preview-locate`)),[x,C]);let E=q(e=>e.selectedLocale),D=q(e=>e.editorItemRegistry),O=q(e=>e.userMutationsLocked),k=(0,d.useMemo)(()=>Object.values(D.definitions).filter(e=>!!e.infos.gettingStarted).filter(e=>!e.isRootOnly).filter(e=>!!D.coreRegistry[e.itemType]).sort((e,t)=>(e.infos.gettingStarted?.rank??2**53-1)-(t.infos.gettingStarted?.rank??2**53-1)).slice(0,4).map(e=>({itemType:e.itemType,icon:e.infos.icon,label:o_(e.infos.labelByLocale,E),description:o_(e.infos.gettingStarted?.descriptionByLocale??e.infos.descriptionByLocale,E)})),[D,E]),A=(0,d.useMemo)(()=>G8(e),[e]),j=(0,d.useMemo)(()=>({coreRegistry:D.coreRegistry,getRenderer:e=>D.definitions[e]?.renderComponent,localizations:D.playerLocalizations}),[D]),M=(0,d.useMemo)(()=>{let e=new Map;for(let n of A)n.type!==u.lt.PageBreak&&e.set(n.id,t.getRenderedSurveyItem(n.id)??{id:n.id,type:n.type});return e},[A,w,t]),N=(0,d.useMemo)(()=>A.filter(e=>e.type!==u.lt.PageBreak),[A]),ee=(0,d.useMemo)(()=>new Map(N.map((e,t)=>[e.id,t])),[N]),P=(0,d.useMemo)(()=>Vfe(e),[e]),F=q8(e,n.viewport),I=(0,d.useMemo)(()=>K8(A,F),[A,F]),L=(0,d.useMemo)(()=>X8(e,r,A),[r,A,e]),te=Bfe[n.viewport],ne=Math.min(o,Math.max(I.length-1,0)),re=I[ne]??[],ie=I.length>0?(ne+1)/I.length*100:0;(0,d.useEffect)(()=>{o!==ne&&s(ne)},[o,s,ne]),(0,d.useLayoutEffect)(()=>{if(n.layout!==`paginated`||!L)return;let e=Y8(A,L);if(!e)return;let t=J8(I,e);t>=0&&t!==ne&&s(t)},[A,s,I,n.layout,L,ne]),(0,d.useLayoutEffect)(()=>{let e=g.current;!e||_.current===n.layout||(y.current[_.current]=e.scrollTop,_.current=n.layout,e.scrollTop=y.current[n.layout])},[n.layout]),(0,d.useEffect)(()=>{if(!a&&i===0)return;if(!L){v.current=null;return}let e=v.current;if(!(!e||e.locateRequestKey!==i||e.focusedItemId!==L||e.layout!==n.layout||e.viewport!==n.viewport))return;let t=n.layout===`paginated`?Y8(A,L):L;if(!t||n.layout===`paginated`&&J8(I,t)!==ne)return;let r=typeof CSS<`u`&&typeof CSS.escape==`function`?CSS.escape(t):t.replace(/["\\]/g,`\\$&`),o=0,s=0,c=requestAnimationFrame(()=>{A.length>1?(S(t),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>S(void 0),qfe)):(b.current&&clearTimeout(b.current),b.current=null,S(void 0));let a=()=>{let t=g.current;if(!t)return;let c=t.querySelector(`[data-preview-item-id="${r}"]`);if(!c){s<Jfe&&(s+=1,o=requestAnimationFrame(a));return}v.current={locateRequestKey:i,focusedItemId:L,layout:n.layout,viewport:n.viewport};let l=t.getBoundingClientRect(),u=c.getBoundingClientRect(),d=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,f=!(e===null&&i===0)&&!d;t.scrollTo({top:t.scrollTop+u.top-l.top-Kfe,behavior:f?`smooth`:`auto`})};o=requestAnimationFrame(a)});return()=>{cancelAnimationFrame(c),cancelAnimationFrame(o)}},[A,a,i,s,I,n.layout,n.viewport,L,ne]),(0,d.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);let ae=e=>{y.current.paginated=0,s(e),g.current?.scrollTo({top:0,behavior:`auto`})},oe=e=>{if(e.type===u.lt.PageBreak)return(0,m.jsx)(Ufe,{itemId:e.id,highlighted:x===e.id},e.id);let t=ee.get(e.id)??-1;return(0,m.jsx)(Wfe,{item:e,renderedItem:M.get(e.id),preferences:n,focused:r===e.id,highlighted:x===e.id,onFocus:()=>h(e.id),afterDeleteItemId:Gfe(N,t)},e.id)},se=e=>{let t=P.get(e.id);return t?O?(0,m.jsx)(`div`,{className:`-my-0.5 h-10 w-full`,"aria-hidden":!0}):(0,m.jsxs)(`button`,{type:`button`,className:`group -my-0.5 flex h-10 w-full cursor-pointer items-center gap-2 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 motion-reduce:transition-none`,onClick:()=>p(t.parentId,t.index),"aria-label":f(`addItemHere`),children:[(0,m.jsx)(`span`,{className:`h-px rounded-full flex-1 bg-primary/70 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),(0,m.jsxs)(`span`,{className:`flex h-6 items-center gap-1 rounded-full px-2 text-xs font-normal text-muted-foreground opacity-0 transition-opacity duration-150 group-hover:bg-muted group-hover:text-foreground group-hover:opacity-100 group-focus-within:bg-muted group-focus-within:text-foreground group-focus-within:opacity-100 motion-reduce:transition-none`,children:[(0,m.jsx)(yT,{className:`size-3`,"aria-hidden":!0}),f(`addItemHere`)]}),(0,m.jsx)(`span`,{className:`h-px rounded-full flex-1 bg-primary/70 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0})]}):null},ce=n.layout===`single`?A:re,le=ce.length===0;return(0,m.jsx)(`div`,{ref:g,className:z(`h-full min-h-0 overflow-auto bg-muted/45 bg-[radial-gradient(circle_at_center,color-mix(in_oklab,var(--border)_55%,transparent)_1px,transparent_1px)] bg-size-[18px_18px]`,l),children:(0,m.jsx)(Xg,{survey:e,locale:E,surveyEngine:t,surveyPlayerRegistry:j,onResponseChanged:()=>{T(e=>e+1),c()},children:(0,m.jsx)(`div`,{className:`mx-auto flex min-h-full w-full justify-center p-4 sm:p-6`,children:(0,m.jsxs)(`div`,{className:`flex w-full flex-col gap-4 transition-[max-width] duration-300 ease-out`,style:{maxWidth:le?void 0:te},children:[n.layout===`paginated`&&n.showPageIndicator&&I.length>1?(0,m.jsxs)(`div`,{className:`sticky top-3 z-10 w-60 max-w-full self-center rounded-xl border border-border bg-background/95 px-4 py-3 shadow-sm backdrop-blur-sm`,children:[(0,m.jsxs)(`nav`,{className:`mb-2 flex items-center justify-between gap-2 text-xs text-muted-foreground`,"aria-label":f(`pageNavigation`),children:[(0,m.jsxs)(`div`,{className:`-ml-3 flex min-w-0 items-center gap-1`,"aria-live":`polite`,children:[(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon-xs`,className:`focus-visible:ring-inset`,onClick:()=>ae(Math.max(ne-1,0)),disabled:ne===0,"aria-label":f(`previousPage`),children:(0,m.jsx)(yw,{})})}),(0,m.jsx)(IE,{children:f(`previousPage`)})]}),(0,m.jsx)(`p`,{className:`whitespace-nowrap font-medium text-foreground`,children:f(`pageIndicator`,{current:ne+1,total:I.length})}),(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(B,{variant:`ghost`,size:`icon-xs`,className:`focus-visible:ring-inset`,onClick:()=>ae(Math.min(ne+1,I.length-1)),disabled:ne>=I.length-1,"aria-label":f(`nextPage`),children:(0,m.jsx)(bw,{})})}),(0,m.jsx)(IE,{children:f(`nextPage`)})]})]}),(0,m.jsx)(`p`,{className:`shrink-0 text-[11px]`,children:f(re.length===1?`itemCountOne`:`itemCount`,{count:re.length})})]}),(0,m.jsx)(Z8,{value:ie})]}):null,le?(0,m.jsx)(`section`,{className:`my-auto w-full py-4`,"aria-labelledby":`preview-empty-title`,children:(0,m.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[(0,m.jsxs)(`div`,{className:`flex items-start gap-3 border-b border-border pb-5`,children:[(0,m.jsxs)(`span`,{className:`relative flex size-10 shrink-0 items-center justify-center rounded-xl border border-primary/15 bg-primary/10 text-primary`,children:[(0,m.jsx)(Aw,{className:`size-4.5`,"aria-hidden":!0}),(0,m.jsx)(kT,{className:`absolute -right-2 -top-2 size-3.5 text-primary`,"aria-hidden":!0})]}),(0,m.jsxs)(`div`,{className:`min-w-0 pt-0.5`,children:[(0,m.jsx)(`h2`,{id:`preview-empty-title`,className:`text-xl font-semibold tracking-tight`,children:f(`emptyTitle`)}),(0,m.jsx)(`p`,{className:`mt-1.5 max-w-xl text-sm leading-6 text-muted-foreground`,children:f(`emptyDescription`)})]})]}),e.rootItem?(0,m.jsxs)(`div`,{className:`pt-5`,children:[(0,m.jsxs)(`div`,{className:`mb-2 flex items-baseline justify-between gap-3`,children:[(0,m.jsx)(`h3`,{className:`text-sm font-medium`,children:f(`gettingStartedTitle`)}),(0,m.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto px-1.5 py-1 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>p(e.rootItem.id,0),disabled:O,children:[(0,m.jsx)(yT,{className:`size-3.5`,"aria-hidden":!0}),f(`browseAllItems`)]})]}),(0,m.jsx)(`div`,{className:`grid gap-1.5 sm:grid-cols-2`,children:k.map(t=>{let n=t.icon;return(0,m.jsxs)(`button`,{type:`button`,className:`group flex items-center gap-2.5 rounded-lg border border-border bg-background/70 px-2.5 py-2 text-left shadow-xs transition-colors hover:border-primary/35 hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-border disabled:hover:bg-background/70`,onClick:()=>p(e.rootItem.id,0,t.itemType),disabled:O,"aria-disabled":O,children:[(0,m.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground transition-colors group-hover:bg-primary/10 group-hover:text-primary`,children:(0,m.jsx)(n,{className:`size-3.5`,"aria-hidden":!0})}),(0,m.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,m.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:t.label}),(0,m.jsx)(`span`,{className:`mt-0.5 block text-xs leading-4 text-muted-foreground`,children:t.description})]}),(0,m.jsx)(`span`,{className:`shrink-0 self-center text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100`,children:(0,m.jsx)(yT,{className:`size-3.5`,"aria-hidden":!0})})]},t.itemType)})}),(0,m.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:f(`emptyReassurance`)})]}):null]})}):(0,m.jsx)(`div`,{className:`flex flex-col`,children:ce.map(e=>(0,m.jsxs)(`div`,{className:`flex flex-col`,children:[oe(e),se(e)]},e.id))}),n.layout===`paginated`&&I.length>1?(0,m.jsxs)(`nav`,{className:`flex items-center justify-between gap-3 pb-2`,"aria-label":f(`pageNavigation`),children:[(0,m.jsxs)(B,{variant:`outline`,onClick:()=>ae(Math.max(ne-1,0)),disabled:ne===0,children:[(0,m.jsx)(yw,{"data-icon":`inline-start`}),f(`previousPage`)]}),(0,m.jsxs)(B,{variant:`outline`,onClick:()=>ae(Math.min(ne+1,I.length-1)),disabled:ne>=I.length-1,children:[f(`nextPage`),(0,m.jsx)(bw,{"data-icon":`inline-end`})]})]}):null]})})})})},$8=`case-survey-editor:preview:v1`,e5={layout:`single`,viewport:`desktop`,showKeys:!0,showFullKeys:!1,showMetadata:!0,showConditions:!0,showPageIndicator:!0},Xfe=e=>e===`single`||e===`paginated`,Zfe=e=>e===`mobile`||e===`tablet`||e===`desktop`||e===`wide`,Qfe=()=>{if(typeof window>`u`)return e5;try{let e=window.localStorage.getItem($8);if(!e)return e5;let t=JSON.parse(e);return{layout:Xfe(t.layout)?t.layout:e5.layout,viewport:Zfe(t.viewport)?t.viewport:e5.viewport,showKeys:typeof t.showKeys==`boolean`?t.showKeys:e5.showKeys,showFullKeys:typeof t.showFullKeys==`boolean`?t.showFullKeys:e5.showFullKeys,showMetadata:typeof t.showMetadata==`boolean`?t.showMetadata:e5.showMetadata,showConditions:typeof t.showConditions==`boolean`?t.showConditions:e5.showConditions,showPageIndicator:typeof t.showPageIndicator==`boolean`?t.showPageIndicator:e5.showPageIndicator}}catch{return e5}},$fe=()=>{let[e,t]=(0,d.useState)(Qfe);return(0,d.useEffect)(()=>{try{window.localStorage.setItem($8,JSON.stringify(e))}catch{}},[e]),{preferences:e,updatePreferences:(0,d.useCallback)(e=>{t(t=>({...t,...e}))},[])}},epe=({onBackRequested:e,onSaveRequested:t,onSimulatorRequested:n})=>{let r=J(`routes.previewMode`),i=tD(),{selectedItemId:a}=oD(),o=q(e=>e.selectedLocale),s=rD(e=>e.navigate),{preferences:c,updatePreferences:l}=$fe(),[f,p]=(0,d.useState)(!1),[h,g]=(0,d.useState)(0),[_,v]=(0,d.useState)(()=>typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),[y,b]=(0,d.useState)(()=>{if(!i||c.layout!==`paginated`||!a)return 0;let e=G8(i),t=X8(i,a,e);if(!t)return 0;let n=Y8(e,t);if(!n)return 0;let r=K8(e,q8(i,c.viewport));return Math.max(J8(r,n),0)}),[x,S]=(0,d.useState)(0),[C,w]=(0,d.useState)(),[T,E]=(0,d.useState)(!1),D=(a?i?.surveyItems.get(a):void 0)??i?.rootItem,O=D?i?.getItemKey(D.id)?.itemKey??D.key:void 0,k=D?.metadata?.itemLabel,A=D?cD(D)??`#404040`:`#404040`,j=pD(D?lD(D):void 0);(0,d.useEffect)(()=>{let e=requestAnimationFrame(()=>E(!0));return()=>cancelAnimationFrame(e)},[]);let M=(0,d.useMemo)(()=>T&&i?new u.A(i,{locale:o}):null,[T,x,o,i]),N=M!==null&&C===M.sessionSeed,ee=(0,d.useMemo)(()=>i?!!X8(i,a,G8(i)):!1,[a,i]),P=()=>g(e=>e+1),F=()=>{w(void 0),S(e=>e+1)},I=()=>s(a?{view:`item-editor`,itemId:a}:{view:`item-editor`}),L=i&&M?(0,m.jsx)(Yfe,{survey:i,surveyEngine:M,preferences:c,focusedItemId:a,locateRequestKey:h,initialLocateReady:_,currentPageIndex:y,onCurrentPageIndexChange:b,onResponseChanged:()=>w(M.sessionSeed)},`${x}:${o}`):(0,m.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:r(`loading`)}),te=(0,m.jsxs)(`div`,{className:`survey-editor-opening-preview flex h-full min-h-0 flex-col overflow-hidden bg-(--surface-bg-color)`,onAnimationEnd:e=>{e.target===e.currentTarget&&e.animationName===`survey-editor-open-item`&&v(!0)},children:[(0,m.jsx)(`header`,{className:`sticky top-0 z-20 shrink-0 border-b border-border bg-(--surface-bg-color)`,children:(0,m.jsxs)(`div`,{className:`flex min-h-9 w-full shrink-0 flex-wrap items-center gap-1.5 ps-4 pe-2 py-0.5`,children:[(0,m.jsx)(gD,{label:r(`switchToEditor`),onClick:I}),(0,m.jsx)(`div`,{className:`mx-1 h-4 w-px shrink-0 bg-border`,"aria-hidden":!0}),j?(0,m.jsx)(`div`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md text-white`,style:{backgroundColor:A},children:(0,m.jsx)(qO,{typeInfos:j,color:`#ffffff`,iconClassName:`size-3.5`})}):null,O?(0,m.jsx)(`span`,{className:`shrink-0 font-mono text-xs font-medium`,children:O}):null,k?(0,m.jsx)(`span`,{className:`hidden min-w-0 max-w-64 truncate text-xs text-muted-foreground sm:inline`,children:k}):null,(0,m.jsx)(`div`,{className:`min-w-0 flex-1 overflow-x-auto @container/preview-actions`,children:(0,m.jsx)(`div`,{className:`flex min-w-max justify-end`,children:(0,m.jsx)(U8,{preferences:c,onPreferencesChange:l,canLocate:ee,onLocate:P,canReset:N,onReset:F,onSimulatorRequested:n,fullscreen:f,onFullscreenChange:p})})})]})}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:f?null:L})]}),ne=(0,m.jsx)(aO,{modal:!1,open:f,onOpenChange:p,children:(0,m.jsxs)(uO,{dismissOnInteractOutside:!1,showCloseButton:!1,onEscapeKeyDown:()=>p(!1),onFocusOutside:e=>e.preventDefault(),className:`flex size-full max-w-none flex-col gap-0 overflow-hidden rounded-none p-0 sm:max-w-none`,children:[(0,m.jsxs)(dO,{className:`flex-row items-center justify-between gap-3 border-b border-border bg-background px-4 py-3`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(pO,{children:r(`title`)}),(0,m.jsx)(mO,{className:`truncate`,children:r(`fullscreenDescription`)})]}),(0,m.jsx)(U8,{preferences:c,onPreferencesChange:l,canLocate:ee,onLocate:P,canReset:N,onReset:F,onSimulatorRequested:n,fullscreen:!0,onFullscreenChange:p,expanded:!0})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1`,children:f?L:null})]})});return(0,m.jsx)(`div`,{className:`h-full min-h-0`,inert:f?!0:void 0,"aria-hidden":f||void 0,children:(0,m.jsx)(B8,{mode:`preview`,mainLabel:r(`title`),onBackRequested:e,onSaveRequested:t,main:te,overlay:ne})})},tpe=({onBackRequested:e,onSaveRequested:t,onSimulatorRequested:n})=>{let r=rD(e=>e.location);return(0,m.jsx)(`div`,{className:`flex h-full min-h-0 grow flex-col`,children:(0,m.jsx)(`div`,{className:`flex-1 min-h-0`,children:(()=>{switch(r.view){case`item-editor`:return(0,m.jsx)(Lfe,{onBackRequested:e,onSaveRequested:t});case`preview-mode`:return(0,m.jsx)(epe,{onBackRequested:e,onSaveRequested:t,onSimulatorRequested:n});case`translation-mode`:return(0,m.jsx)(Rfe,{});case`asset-manager`:return(0,m.jsx)(zfe,{})}})()})})},npe=({onBackRequested:e,onSaveRequested:t,onSimulatorRequested:n})=>{let r=J(`routes.editor`),{undo:i,redo:a,canUndo:o,canRedo:s}=q(e=>e),c=(0,d.useCallback)(()=>{if(t){t();return}OE.info(r(`noSaveHandler`))},[t,r]);return O8({onSave:c,onUndo:(0,d.useCallback)(()=>{o()&&i()?OE.success(r(`undoTriggered`)):OE.error(r(`noMoreUndo`))},[i,o,r]),onRedo:(0,d.useCallback)(()=>{s()&&a()?OE.success(r(`redoTriggered`)):OE.error(r(`noMoreRedo`))},[a,s,r])}),(0,m.jsxs)(`div`,{className:`flex h-full w-full min-h-0 flex-col @container/main`,children:[(0,m.jsx)(`div`,{className:`flex flex-1 min-h-0`,children:(0,m.jsx)(tpe,{onBackRequested:e,onSaveRequested:c,onSimulatorRequested:n})}),(0,m.jsx)(bde,{})]})},rpe=(e,t)=>{let n=new Set,r=[];for(let i of[...e].reverse())if(!(!iD(i)||!i.itemId)&&!(i.itemId===t||n.has(i.itemId))&&(n.add(i.itemId),r.push(i.itemId),r.length>=5))break;return r.length>0?r:void 0},t5=({itemRegistry:e})=>e.assistantCapabilities.manifest,n5=({sessionId:e,revision:t,editor:n,location:r,navigationHistory:i,selectedLocale:a,itemRegistry:o,historyIndex:s,options:c})=>{let l=n.toJson(),u=uoe(r),d=u,f=t5({itemRegistry:o}),p=l_(c_(l.survey)),m=n.undoRedo.getHistory(),h=m.find(e=>e.isCurrent)?.index??s;return{protocolVersion:1,version:{sessionId:e,revision:t,historyIndex:s,contentHash:p,capabilityDigest:f.digest},survey:l.survey,ui:{view:r.view,selectedItemId:u,selectedLocale:a,focusItemId:d,recentItemIds:rpe(i,u),activeSurface:c?.uiContext?.activeSurface??r.view,openPanels:c?.uiContext?.openPanels,highlights:c?.uiContext?.highlights,history:{currentIndex:h,totalEntries:m.length,canUndo:n.canUndo(),canRedo:n.canRedo(),recent:m.slice(Math.max(0,h-7),h+5).map(e=>({index:e.index,kind:e.kind,label:e.meta.label,source:e.meta.source,timestamp:e.timestamp,isCurrent:e.isCurrent}))}},capabilities:f,createdAt:c?.createdAt??new Date().toISOString()}},r5=(e,t)=>Wz.fromJson(u.Et(e.toJson()),t.coreRegistry),i5=e=>{let t=new Map;for(let{assetId:n}of e.survey.getAssetUsages())e.getAsset(n)===void 0&&t.set(n,(t.get(n)??0)+1);return t},a5=(e,t)=>{let n=[...i5(e)].filter(([e,n])=>n>(t.get(e)??0)).map(([e])=>e);if(n.length===0)return;let r=n.map(e=>`"${e}"`).join(`, `);throw Error(`No assistant changes were applied because referenced image ${n.length===1?`asset`:`assets`} ${r} ${n.length===1?`was`:`were`} not found. Import the image and its references in the same authorized batch.`)},o5=({change:e,status:t,message:n,appliedOperations:r=0,editor:i})=>({status:t,changeId:e.id,summary:e.summary,message:n,appliedOperations:r,issues:t===`rejected`?e.validation.issues:void 0,editor:i}),s5=({currentPrecondition:e,expectedPrecondition:t})=>{if(e.sessionId!==t.sessionId)return`The survey session changed before this edit could be applied.`;if(e.contentHash!==t.contentHash)return`The survey changed before this edit could be applied.`;if(e.capabilityDigest!==t.capabilityDigest)return`The survey editor capabilities changed before this edit could be applied. Retry the request.`},ipe=(e,t)=>{let n=t?.clone()??new u.ft;for(let t of e??[])n.setContent(t.locale,t.contentKey,c5(t));return n.compact()},c5=({content:e,plainText:t})=>e?u.Et(e):{type:u.tt.md,content:t??``},ape=({config:e,itemId:t,usesInitialConfig:n})=>{if(!n||typeof e!=`object`||!e||Array.isArray(e))return e;let r=u.Et(e);return`id`in r?{...r,id:t}:r},ope=({itemRegistry:e,operation:t})=>{let n=e.definitions[t.item.itemType]?.getInitialItem?.(),r=n?.rawItem,i=t.item.id&&t.item.id.length>0?t.item.id:r?.id??u.bt(),a=t.item.config===void 0,o=a?r?.config:t.item.config;return{rawItem:{...r,...t.item,id:i,key:t.item.key,itemType:t.item.itemType,config:ape({config:o,itemId:i,usesInitialConfig:a})},translations:ipe(t.translations,n?.translations)}},spe=e=>`options.${e}.label`,l5=e=>{let t=(e.config&&typeof e.config==`object`&&!Array.isArray(e.config)?e.config:{}).options;return Array.isArray(t)?t.filter(e=>typeof e==`object`&&!!e&&!Array.isArray(e)):[]},u5=(e,t,n)=>{let r=e.getItemDataCopy(t),i=r.config&&typeof r.config==`object`&&!Array.isArray(r.config)?r.config:{};e.updateItem(t,{config:{id:t,maxSelection:1,shuffleOptions:!1,...i,options:n}})},d5=(e,t,n,r,i)=>{let a=r??e.survey.locales[0]??`en`,o=e.survey.getItemTranslations(t)?.clone()??new u.ft;o.setContent(a,spe(n),{type:u.tt.md,content:i}),e.updateItemTranslations(t,o)},cpe=({editor:e,itemRegistry:t,operation:n,deterministicCreateItemTypes:r})=>{if(!r.has(n.item.itemType))throw Error(`Item type "${n.item.itemType}" is not available for assistant create.`);let{rawItem:i,translations:a}=ope({itemRegistry:t,operation:n}),o=e.survey.createItemFromRaw(i);e.addItem({parentId:n.target.parentItemId,index:n.target.index},o,a)},lpe=(e,t)=>{let n={...e.getItemDataCopy(t.itemId).metadata??{}};t.itemLabel.length>0?n.itemLabel=t.itemLabel:delete n.itemLabel,e.updateItem(t.itemId,{metadata:Object.keys(n).length>0?n:void 0})},upe=(e,t)=>{let n=e.getItemDataCopy(t.itemId);e.updateItem(t.itemId,{metadata:{...n.metadata??{},editorItemColor:t.color}})},dpe=(e,t)=>{let n=e.survey.getItemTranslations(t.itemId)?.clone()??new u.ft;n.setContent(t.locale,t.contentKey,c5(t)),e.updateItemTranslations(t.itemId,n)},f5=(e,t,n)=>{n!==void 0&&(n===null?delete e[t]:e[t]=n)},fpe=(e,t)=>{let n=e.survey.getItemTranslations(t.itemId)?.clone()??new u.ft,r=n.getContent(t.locale,t.contentKey);if(r?.type!==u.tt.richText)throw Error(`Content "${t.locale}:${t.contentKey}" is not rich text and has no placed image to update.`);let i=-1,a=!1,o=r.doc.blocks.map(e=>{if(e.type!==`image`||(i+=1,i!==t.imageIndex))return e;let n=t.changes,r=u.Et(e);n.source!==void 0&&(r.source=n.source),n.alt!==void 0&&(n.alt===null?delete r.alt:r.alt=n.alt),n.caption!==void 0&&(n.caption===null||n.caption.length===0?delete r.caption:r.caption=[{type:`paragraph`,children:[{type:`text`,text:n.caption}]}]);let o={...r.size??{}};return f5(o,`width`,n.width),f5(o,`height`,n.height),f5(o,`maxWidth`,n.maxWidth),f5(o,`maxHeight`,n.maxHeight),(n.width!==void 0||n.height!==void 0||n.maxWidth!==void 0||n.maxHeight!==void 0)&&(Object.keys(o).length===0?delete r.size:r.size=o),n.alignment!==void 0&&(n.alignment===null?delete r.alignment:r.alignment=n.alignment),a=!0,r});if(!a)throw Error(`No image exists at imageIndex ${t.imageIndex}.`);n.setContent(t.locale,t.contentKey,{...r,doc:{...r.doc,blocks:o}}),e.updateItemTranslations(t.itemId,n)},ppe=(e,t)=>{let n=e.getItemDataCopy(t.itemId);e.updateItem(t.itemId,{config:u.j(n.config??{},t.patches)})},mpe=(e,t)=>{if(!t.option.id)throw Error(`The choice option change is missing a normalized option id.`);let n=l5(e.getItemDataCopy(t.itemId)),r=t.index===void 0?n.length:Math.min(n.length,Math.max(0,t.index)),i={id:t.option.id,...t.option.key?{key:t.option.key}:{}};n.splice(r,0,i),u5(e,t.itemId,n),d5(e,t.itemId,t.option.id,t.locale,t.option.label)},hpe=(e,t)=>{d5(e,t.itemId,t.optionId,t.locale,t.label)},gpe=(e,t)=>{let n=l5(e.getItemDataCopy(t.itemId)).filter(e=>e.id!==t.optionId),r=e.survey.getItemTranslations(t.itemId)?.clone()??new u.ft;u5(e,t.itemId,n),r.removeContentKeysWithPrefix(`options.${t.optionId}`),r.removeContentKeysWithPrefix(`embeddedForms.${t.optionId}`),e.updateItemTranslations(t.itemId,r)},_pe=(e,t)=>{let n=e.getItemDataCopy(t.itemId),r=new Map(l5(n).filter(e=>typeof e.id==`string`).map(e=>[e.id,e])),i=t.optionIds.map(e=>r.get(e)).filter(e=>!!e);u5(e,t.itemId,i)},p5=e=>typeof e==`object`&&!!e&&!Array.isArray(e),m5=e=>p5(e)&&Array.isArray(e.fieldGroups)?e.fieldGroups.filter(p5).flatMap(e=>typeof e.id==`string`?[{...e,id:e.id,fields:Array.isArray(e.fields)?e.fields.filter(p5):[]}]:[]):[],vpe=(e,t)=>{if(!t){if(e.itemType!==`formItem`)throw Error(`Form operation target is not a formItem.`);let t=p5(e.config)?e.config:{};return{groups:m5(t),update:n=>({...e,config:{id:e.id,...t,fieldGroups:n}})}}if(e.itemType!==`choiceItem`)throw Error(`Embedded-form operation target is not a choiceItem.`);let n=p5(e.config)?e.config:{},r=Array.isArray(n.options)?n.options.filter(p5):[],i=r.findIndex(e=>e.id===t);if(i<0)throw Error(`Choice option "${t}" was not found.`);let a=r[i],o=p5(a.embeddedForm)?a.embeddedForm:{};return{groups:m5(o),update:s=>{let c=[...r];return c[i]={...a,embeddedForm:{id:t,...o,fieldGroups:s}},{...e,config:{...n,options:c}}}}},h5=(e,t,n=[])=>{if(n.length===0)return;let r=e.survey.getItemTranslations(t)?.clone()??new u.ft;for(let e of n)r.setContent(e.locale,e.contentKey,c5(e));e.updateItemTranslations(t,r)},ype=(e,t)=>{let n=vpe(e.getItemDataCopy(t.target.itemId),t.target.optionId),r=n.groups.map(e=>({...e,fields:[...e.fields]}));switch(t.kind){case`upsert-form-field-group`:{let i=r.findIndex(e=>e.id===t.group.id),a=i>=0?r[i]:void 0,o={...a,...t.group,id:t.group.id,layout:t.group.layout??a?.layout??{base:1,xs:1,sm:1,md:1,xl:1},fields:Array.isArray(t.group.fields)?t.group.fields.filter(p5):a?.fields??[]};i>=0?r[i]=o:r.splice(Math.min(t.index??r.length,r.length),0,o),e.updateItem(t.target.itemId,n.update(r)),h5(e,t.target.itemId,t.translations);return}case`remove-form-field-group`:{let i=r.find(e=>e.id===t.groupId);e.updateItem(t.target.itemId,n.update(r.filter(e=>e.id!==t.groupId)));let a=`${t.target.optionId?`embeddedForms.${t.target.optionId}.`:``}fieldGroups.${t.groupId}`,o=e.survey.getItemTranslations(t.target.itemId)?.clone()??new u.ft;o.removeContentKeysWithPrefix(a);for(let e of i?.fields??[])if(typeof e.id==`string`){let n=`${t.target.optionId?`embeddedForms.${t.target.optionId}.`:``}fields.${e.id}`;o.removeContentKeysWithPrefix(n)}e.updateItemTranslations(t.target.itemId,o);return}case`reorder-form-field-groups`:{let i=new Map(r.map(e=>[e.id,e]));e.updateItem(t.target.itemId,n.update(t.groupIds.map(e=>i.get(e))));return}case`upsert-form-field`:{let i;for(let e of r){let n=e.fields.findIndex(e=>e.id===t.field.id);n>=0&&([i]=e.fields.splice(n,1))}let a=r.find(e=>e.id===t.groupId);if(!a)throw Error(`Form field group "${t.groupId}" was not found.`);a.fields.splice(Math.min(t.index??a.fields.length,a.fields.length),0,{...i,...t.field}),e.updateItem(t.target.itemId,n.update(r)),h5(e,t.target.itemId,t.translations);return}case`remove-form-field`:case`move-form-field`:{let i;for(let e of r){let n=e.fields.findIndex(e=>e.id===t.fieldId);n>=0&&([i]=e.fields.splice(n,1))}if(!i)throw Error(`Form field "${t.fieldId}" was not found.`);if(t.kind===`move-form-field`){let e=r.find(e=>e.id===t.targetGroupId);if(!e)throw Error(`Form field group "${t.targetGroupId}" was not found.`);e.fields.splice(Math.min(t.index??e.fields.length,e.fields.length),0,i)}if(e.updateItem(t.target.itemId,n.update(r)),t.kind===`remove-form-field`){let n=`${t.target.optionId?`embeddedForms.${t.target.optionId}.`:``}fields.${t.fieldId}`,r=e.survey.getItemTranslations(t.target.itemId)?.clone()??new u.ft;r.removeContentKeysWithPrefix(n),e.updateItemTranslations(t.target.itemId,r)}return}}},bpe=(e,t)=>{let n=e.getItemDataCopy(t.itemId),r=p5(n.config)?n.config:{},i=Array.isArray(r.options)?r.options.filter(p5):[],a=i.findIndex(e=>e.id===t.optionId);if(a<0)throw Error(`Choice option "${t.optionId}" was not found.`);let o=[...i],s={...o[a]};if(t.kind===`set-embedded-form`?s.embeddedForm=t.form:(delete s.embeddedForm,delete s.embeddedFormItemId),o[a]=s,e.updateItem(t.itemId,{config:{...r,options:o}}),t.kind===`set-embedded-form`)h5(e,t.itemId,t.translations);else{let n=e.survey.getItemTranslations(t.itemId)?.clone()??new u.ft;n.removeContentKeysWithPrefix(`embeddedForms.${t.optionId}`),e.updateItemTranslations(t.itemId,n)}},g5=(e,t,n)=>{let r=e.toJson();return Wz.fromJson({...r,survey:n(u.Et(r.survey))},t.coreRegistry)},_5=e=>{let t=u.M(e);if(t[0]!==`surveyItems`||t[1]===void 0)return;let n=Number.parseInt(t[1],10);return Number.isInteger(n)&&n>=0&&String(n)===t[1]?{index:n,replacesWholeItem:t.length===2}:void 0},xpe=e=>{let t=new Set;for(let n of e.patches){let e=_5(n.path);if(e&&(n.op!==`remove`||!e.replacesWholeItem)&&t.add(e.index),`from`in n){let e=_5(n.from);e&&!e.replacesWholeItem&&t.add(e.index)}}return t},Spe=(e,t)=>{if(t.size===0||!Array.isArray(e.surveyItems))return e;let n=new Date().toISOString();return{...e,surveyItems:e.surveyItems.map((e,r)=>{if(!t.has(r))return e;let i=e;return{...i,editorMetadata:{...i.editorMetadata,createdAt:i.editorMetadata?.createdAt??n,updatedAt:n}}})}},Cpe=({editor:e,itemRegistry:t,operation:n})=>{let r=e.toJson(),i=Spe(u.j(r.survey,n.patches),xpe(n));return Wz.fromJson({...r,survey:i},t.coreRegistry)},v5=({editor:e,itemRegistry:t,operation:n,deterministicCreateItemTypes:r})=>{switch(n.kind){case`create-item`:return cpe({editor:e,itemRegistry:t,operation:n,deterministicCreateItemTypes:r}),e;case`update-item-key`:return e.updateItem(n.itemId,{key:n.key}),e;case`update-item-label`:return lpe(e,n),e;case`update-item-color`:return upe(e,n),e;case`update-item-translation`:return dpe(e,n),e;case`update-placed-image`:return fpe(e,n),e;case`patch-item-config`:return ppe(e,n),e;case`upsert-form-field-group`:case`remove-form-field-group`:case`reorder-form-field-groups`:case`upsert-form-field`:case`remove-form-field`:case`move-form-field`:return ype(e,n),e;case`set-embedded-form`:case`remove-embedded-form`:return bpe(e,n),e;case`add-choice-option`:return mpe(e,n),e;case`update-choice-option-label`:return hpe(e,n),e;case`remove-choice-option`:return gpe(e,n),e;case`reorder-choice-options`:return _pe(e,n),e;case`remove-item`:if(!e.removeItem(n.itemId))throw Error(`Item "${n.itemId}" could not be removed.`);return e;case`move-item`:if(!e.moveItem(n.itemId,{parentId:n.target.parentItemId,index:n.target.index}))throw Error(`Item "${n.itemId}" could not be moved.`);return e;case`reorder-items`:{let t=e.getItemDataCopy(n.parentItemId);return e.updateItem(n.parentItemId,{config:{...p5(t.config)?t.config:{},items:n.itemIds}}),e}case`update-survey-metadata`:{let t={...e.getMetadata()??{}};for(let[e,r]of Object.entries(n.values))r===null?delete t[e]:t[e]=r;return e.updateMetadata(Object.keys(t).length>0?t:void 0),e}case`update-survey-pagination`:return e.updateMaxItemsPerPage(n.value??void 0),e;case`update-survey-translation`:return g5(e,t,e=>{let t=e.translations?.[n.locale]??{itemTranslations:{},surveyCardContent:{},navigationContent:{},validationMessages:{}},r={...t[n.surface]??{}};return r[n.contentKey]=c5(n),{...e,translations:{...e.translations??{},[n.locale]:{...t,[n.surface]:r}}}});case`remove-survey-locale`:return g5(e,t,e=>{let t={...e.translations??{}};return delete t[n.locale],{...e,translations:Object.keys(t).length>0?t:void 0}});case`set-image-asset`:return e.setAsset(n.assetId,n.asset),e;case`update-image-asset-metadata`:{let t=e.getAsset(n.assetId);if(!t)throw Error(`Image asset "${n.assetId}" was not found.`);let r={...t.metadata??{}};for(let[e,t]of Object.entries(n.metadata))t===null?delete r[e]:t!==void 0&&Object.assign(r,{[e]:t});return e.setAsset(n.assetId,{...t,metadata:Object.keys(r).length>0?r:void 0}),e}case`remove-image-asset`:return e.removeAsset(n.assetId),e;case`survey-json-patch`:return Cpe({editor:e,itemRegistry:t,operation:n})}},y5=e=>{let t=e.trim();return t.length>0?`Assistant: ${t}`:`Assistant survey change`},wpe=e=>e.length===1?y5(e[0]?.summary??``):`Assistant: ${e.length} survey changes`,b5=(e,t)=>o5({change:e,status:`failed`,message:t}),Tpe=({changes:e,currentPrecondition:t,editor:n,itemRegistry:r})=>{if(e.length===0)return{results:[]};for(let n of e){if(n.status!==`validated`||!n.validation.valid)return{results:e.map(e=>e.id===n.id?o5({change:e,status:`rejected`,message:`The assistant change did not pass validation.`}):b5(e,`No assistant changes were applied because one change failed validation.`))};if(!n.precondition)return{results:e.map(e=>e.id===n.id?o5({change:e,status:`failed`,message:`The assistant change is missing editor state information.`}):b5(e,`No assistant changes were applied because one change is missing editor state information.`))};if(n.operations.length===0)return{results:e.map(e=>e.id===n.id?o5({change:e,status:`rejected`,message:`The assistant change did not contain any operations to apply.`}):b5(e,`No assistant changes were applied because one change was empty.`))};let r=s5({currentPrecondition:t,expectedPrecondition:n.precondition});if(r)return{results:e.map(e=>o5({change:e,status:`stale`,message:r}))}}try{let i=r5(n,r),a=i5(i),o=t5({itemRegistry:r});if(o.digest!==t.capabilityDigest)return{results:e.map(e=>o5({change:e,status:`stale`,message:`The live survey editor capabilities changed before these edits could be applied. Retry the request.`}))};let s=new Set(dC(o));i.hasUncommittedChanges&&i.commit({label:`Pending manual changes`,source:Lz.USER});for(let t of e)for(let e of t.operations)i=v5({editor:i,itemRegistry:r,operation:e,deterministicCreateItemTypes:s});return a5(i,a),i.commit({label:wpe(e),source:Lz.ASSISTANT}),{results:e.map(e=>o5({change:e,status:`applied`,message:e.summary,appliedOperations:e.operations.length})),editor:i}}catch(t){let n=t instanceof Error?t.message:`The assistant changes could not be applied.`;return{results:e.map(e=>o5({change:e,status:`failed`,message:n}))}}},Epe=({change:e,currentPrecondition:t,editor:n,itemRegistry:r})=>{if(e.status!==`validated`||!e.validation.valid)return o5({change:e,status:`rejected`,message:`The assistant change did not pass validation.`});if(!e.precondition)return o5({change:e,status:`failed`,message:`The assistant change is missing editor state information.`});if(e.operations.length===0)return o5({change:e,status:`rejected`,message:`The assistant change did not contain any operations to apply.`});let i=s5({currentPrecondition:t,expectedPrecondition:e.precondition});if(i)return o5({change:e,status:`stale`,message:i});try{let i=r5(n,r),a=i5(i),o=t5({itemRegistry:r});if(o.digest!==t.capabilityDigest)return o5({change:e,status:`stale`,message:`The live survey editor capabilities changed before this edit could be applied. Retry the request.`});let s=new Set(dC(o));i.hasUncommittedChanges&&i.commit({label:`Pending manual changes`,source:Lz.USER});for(let t of e.operations)i=v5({editor:i,itemRegistry:r,operation:t,deterministicCreateItemTypes:s});return a5(i,a),i.commit({label:y5(e.summary),source:Lz.ASSISTANT}),o5({change:e,status:`applied`,message:e.summary,appliedOperations:e.operations.length,editor:i})}catch(t){return o5({change:e,status:`failed`,message:t instanceof Error?t.message:`The assistant change could not be applied.`})}};function Dpe(){let e=0,t=()=>(e+=1,e);return xE((e,n)=>({sessionId:null,editor:null,changeTick:0,editorItemRegistry:{coreRegistry:{},definitions:{},assistantCapabilities:uC([]),playerLocalizations:Gg(),categoryLabels:{...a_}},selectedLocale:`en`,userMutationsLocked:!1,setEditor:(n,r)=>{e({sessionId:n,editor:r,selectedLocale:r?.survey.locales[0]??`en`,changeTick:t()})},clearEditor:()=>{e({sessionId:null,editor:null,selectedLocale:`en`,changeTick:t()})},startNewSession:({surveyKey:r,itemRegistryEntries:i,categoryLabels:a})=>{if(n().userMutationsLocked)return;let o=i,s=n().editorItemRegistry,c=Object.keys(s.definitions).length>0,l=o?JC(o,{categoryLabels:a}):c?s:X9(),d=l.coreRegistry,f=u.dt.createBlankSurvey(d,r),p=new Wz(f,{pluginRegistry:d});e({sessionId:u.bt(),editor:p,editorItemRegistry:l,selectedLocale:f.locales[0]??`en`,changeTick:t()})},setEditorItemRegistry:n=>{e({editorItemRegistry:n,changeTick:t()})},setSelectedLocale:t=>{e({selectedLocale:t})},setUserMutationsLocked:t=>{e({userMutationsLocked:t})},undo:()=>{if(n().userMutationsLocked)return!1;let{editor:r}=n();if(!r)return!1;let i=r.undo();return i&&e({changeTick:t()}),i},redo:()=>{if(n().userMutationsLocked)return!1;let{editor:r}=n();if(!r)return!1;let i=r.redo();return i&&e({changeTick:t()}),i},canUndo:()=>!n().userMutationsLocked&&(n().editor?.canUndo()??!1),canRedo:()=>!n().userMutationsLocked&&(n().editor?.canRedo()??!1),commit:r=>{n().userMutationsLocked||(n().editor?.commit(r),e({changeTick:t()}))},commitByUser:r=>{n().userMutationsLocked||(n().editor?.commit({...r,source:Lz.USER}),e({changeTick:t()}))},commitIfNeeded:()=>{if(n().userMutationsLocked)return;let{editor:r}=n();r&&(r.commitIfNeeded(),e({changeTick:t()}))},jumpToIndexInHistory:r=>{if(n().userMutationsLocked)return!1;let{editor:i}=n();if(!i)return!1;let a=i.jumpToIndex(r);return a&&e({changeTick:t()}),a},getUndoMeta:()=>n().editor?.getUndoMeta()??null,getRedoMeta:()=>n().editor?.getRedoMeta()??null,getUndoRedoHistory:()=>n().editor?.undoRedo.getHistory()??[],getCommitsSinceInitial:()=>n().editor?.getCommitsSinceInitial()??[],addItem:(r,i,a)=>{if(n().userMutationsLocked)return;let{editor:o}=n();if(!o)throw Error(`No editor loaded`);o.addItem(r,i,a),e({changeTick:t()})},removeItem:(r,i=!1)=>{if(n().userMutationsLocked)return!1;let{editor:a}=n();if(!a)return!1;let o=a.survey.getItemKey(r)?.fullKey??r,s=a.removeItem(r,i);return s&&!i&&a.commit({label:`Delete item: ${o}`,source:Lz.USER}),s&&e({changeTick:t()}),s},moveItem:(r,i)=>{if(n().userMutationsLocked)return!1;let{editor:a}=n();if(!a)return!1;let o=a.moveItem(r,i);return o&&e({changeTick:t()}),o},updateItemTranslations:(r,i)=>{if(n().userMutationsLocked)return!1;let{editor:a}=n();if(!a)return!1;let o=a.updateItemTranslations(r,i);return o&&e({changeTick:t()}),o},copyItem:e=>{let{editor:t}=n();if(!t)throw Error(`No editor loaded`);return t.copyItem(e)},pasteItem:(r,i)=>{if(n().userMutationsLocked)return null;let{editor:a}=n();if(!a)throw Error(`No editor loaded`);let o=a.pasteItem(r,i);return e({changeTick:t()}),o},getItemDataCopy:e=>{let{editor:t}=n();if(!t)throw Error(`No editor loaded`);return t.getItemDataCopy(e)},getRootItem:()=>n().editor?.survey.rootItem,updateItem:(r,i)=>{if(n().userMutationsLocked)return;let{editor:a}=n();if(!a)throw Error(`No editor loaded`);a.updateItem(r,i),e({changeTick:t()})},updateSurveyTranslations:r=>{if(n().userMutationsLocked)return;let{editor:i}=n();if(!i)throw Error(`No editor loaded`);i.updateSurveyTranslations(r),e({changeTick:t()})},getMaxItemsPerPage:()=>n().editor?.getMaxItemsPerPage(),updateMaxItemsPerPage:r=>{if(n().userMutationsLocked)return;let{editor:i}=n();if(!i)throw Error(`No editor loaded`);i.updateMaxItemsPerPage(r),e({changeTick:t()})},getMetadata:()=>n().editor?.getMetadata(),updateMetadata:r=>{if(n().userMutationsLocked)return;let{editor:i}=n();if(!i)throw Error(`No editor loaded`);i.updateMetadata(r),e({changeTick:t()})},applyAssistantChange:(r,i)=>{let{editor:a,editorItemRegistry:o}=n();if(!a)return{status:`failed`,changeId:r.id,summary:r.summary,message:`The survey editor is not ready.`,appliedOperations:0};let{editor:s,...c}=Epe({change:r,currentPrecondition:i,editor:a,itemRegistry:o});return s&&e({editor:s,changeTick:t()}),c},applyAssistantChanges:(r,i)=>{let{editor:a,editorItemRegistry:o}=n();if(!a)return{results:r.map(e=>({status:`failed`,changeId:e.id,summary:e.summary,message:`The survey editor is not ready.`,appliedOperations:0}))};let{editor:s,...c}=Tpe({changes:r,currentPrecondition:i,editor:a,itemRegistry:o});return s&&e({editor:s,changeTick:t()}),c},getTemplateValue:e=>n().editor?.getTemplateValue(e),getTemplateValues:()=>n().editor?.getTemplateValues()??new Map,setTemplateValue:(r,i)=>{if(n().userMutationsLocked)return;let{editor:a}=n();if(!a)throw Error(`No editor loaded`);a.setTemplateValue(r,i),e({changeTick:t()})},removeTemplateValue:r=>{if(n().userMutationsLocked)return;let{editor:i}=n();if(!i)throw Error(`No editor loaded`);i.removeTemplateValue(r),e({changeTick:t()})},getAsset:e=>n().editor?.getAsset(e),getAssets:()=>n().editor?.getAssets()??new Map,setAsset:(r,i)=>{if(n().userMutationsLocked)return;let{editor:a}=n();if(!a)throw Error(`No editor loaded`);a.setAsset(r,i),e({changeTick:t()})},removeAsset:r=>{if(n().userMutationsLocked)return;let{editor:i}=n();if(!i)throw Error(`No editor loaded`);i.removeAsset(r),e({changeTick:t()})},getMemoryUsage:()=>n().editor?.getMemoryUsage()??{totalMB:0,entries:0},getUndoRedoConfig:()=>n().editor?.getUndoRedoConfig()??{}}))}var Ope=({children:e})=>{let[t]=(0,d.useState)(()=>Dpe());return(0,m.jsx)(wE.Provider,{value:t,children:e})},kpe=({children:e,navigationAdapter:t=null,workspace:n})=>(0,m.jsx)(Ope,{children:(0,m.jsx)(coe,{adapter:t,initialLocation:n?.initialLocation,children:e})});function Ape(e,t,n){if(e)return JC(GC(e,t),{categoryLabels:n});let r=GC(Y9(),t);return n&&Object.keys(n).length>0?JC(r,{categoryLabels:n}):JC(r)}var jpe=({initialEditorState:e,initialSessionId:t,fallbackLocale:n=`en`,language:r,localizations:i,dateLocales:a,itemRegistryEntries:o,categoryLabels:s,onEditorStateChange:c,readOnly:l=!1,assistantControllerRef:f,assistantPanel:p,persistDebounceMs:h=500,helpLink:g=`https://case-framework.github.io/case-docs/`,aiProvider:_=null,onBackRequested:v,onSimulatorRequested:y,onSaveRequested:b,workspace:x})=>{let S=(0,d.useMemo)(()=>BE(i),[i]),C=(0,d.useMemo)(()=>HE(a),[a]),w=(0,d.useMemo)(()=>KC(S),[S]),T=(0,d.useMemo)(()=>zC(w,s),[s,w]),E=q(e=>e.sessionId),D=q(e=>e.editor),O=q(e=>e.changeTick),k=q(e=>e.setEditor),A=q(e=>e.setEditorItemRegistry),j=q(e=>e.clearEditor),M=q(e=>e.setUserMutationsLocked),N=TE(),ee=loe(),P=(0,d.useRef)(!1),F=(0,d.useMemo)(()=>Ape(o,S,T),[o,T,S]),I=F.coreRegistry,L=(0,d.useEffectEvent)((e,t)=>{k(e,Wz.fromJson(t,I))});(0,d.useEffect)(()=>{if(!e)return;let n=t!==void 0&&E!==null&&E!==t;if(P.current&&!n&&D)return;n&&(P.current=!1);let r=Wz.fromJson(e,I);L(t??u.bt(),r.toJson()),P.current=!0},[I,D,e,t,E]),(0,d.useEffect)(()=>()=>{j()},[j]),(0,d.useEffect)(()=>{A(F)},[F,A]),(0,d.useEffect)(()=>(M(l),()=>M(!1)),[l,M]),fde({sessionId:E,editor:D,changeTick:O,persistDebounceMs:h,onEditorStateChange:c});let te=(0,d.useCallback)(e=>{let t=N.getState(),n=ee.getState(),r=t.editor;if(!r)throw Error(`Cannot build assistant snapshot before the editor is ready.`);let i=Object.values(n.assistantHighlights);return n5({sessionId:t.sessionId,revision:t.changeTick,editor:r,location:n.location,navigationHistory:n.history,selectedLocale:t.selectedLocale,itemRegistry:t.editorItemRegistry,historyIndex:t.getUndoRedoHistory().find(e=>e.isCurrent)?.index??-1,options:{...e,uiContext:{...e?.uiContext,highlights:e?.uiContext?.highlights??(i.length>0?i:void 0)}}})},[N,ee]);return(0,d.useImperativeHandle)(f,()=>D?{getSnapshot:e=>te(e),applyAssistantChange:e=>{let t=te().version;return N.getState().applyAssistantChange(e,t)},applyAssistantChanges:e=>{let t=te().version;return N.getState().applyAssistantChanges(e,t)}}:null,[D,N,te]),(0,m.jsx)(`div`,{className:`survey-editor absolute inset-0 overflow-hidden`,children:(0,m.jsx)(ioe,{helpLink:g,aiProvider:_,fallbackLocale:n,language:r,localizations:S,dateLocales:C,workspace:x,children:(0,m.jsx)(hfe,{panel:p,children:(0,m.jsx)(npe,{onBackRequested:v,onSaveRequested:b,onSimulatorRequested:y})})})})},Mpe=e=>(0,m.jsx)(kpe,{navigationAdapter:e.navigationAdapter,workspace:e.workspace,children:(0,m.jsx)(jpe,{...e})}),x5=e=>{let t=e();if(!t)throw Error(`The Survey Editor is not ready for an AI task.`);return t},S5=({getSnapshot:e,tasks:t,cache:n={}})=>{let r=n===!1?void 0:new MC({ttlMs:n.ttlMs,maxEntries:n.maxEntries}),i=async({task:t,request:i,options:a,buildContext:o,execute:s})=>{let c=x5(e),l=n===!1?void 0:n.getScope?.(),u=JSON.stringify([t,l??``,c.version.contentHash,c.version.capabilityDigest,c.ui.selectedLocale,i]);if(r&&a?.cache!==`refresh`){let e=r.get(u);if(e!==void 0)return e}let d=await s(o(c),{cacheScope:l});return r?.set(u,d),d};return{suggestItemKey:(e,n)=>i({task:`suggest-item-key`,request:e,options:n,buildContext:t=>kC(t,{purpose:`suggest-item-key`,focusItemId:e.itemId}),execute:(r,i)=>t.suggestItemKey(e,r,n,i)}),suggestItemLabel:(e,n)=>i({task:`suggest-item-label`,request:e,options:n,buildContext:t=>kC(t,{purpose:`suggest-item-label`,focusItemId:e.itemId}),execute:(r,i)=>t.suggestItemLabel(e,r,n,i)}),translateContent:(r,i)=>{let a=x5(e),o=n===!1?void 0:n.getScope?.();return t.translateContent(r,kC(a,{purpose:`translate-content`,sourceLocale:r.sourceLocale,targetLocales:r.targetLocales,sourceTexts:r.entries.map(e=>e.text)}),i,{cacheScope:o})}}},Npe=class extends Error{code;constructor(e,t){super(t),this.name=`SurveyAssistantClientError`,this.code=e}},Ppe=async(e,t=`The assistant request could not be completed.`)=>{let n=await e.json().catch(()=>({}));if(!e.ok){let e=typeof n?.error==`string`?n.error:t,r=Gie(typeof n?.code==`string`?{code:n.code,detail:e}:e);throw new Npe(r.code,r.detail??e)}return n},Fpe=({api:e=`/api/survey-assistant/tasks`,getModelId:t}={})=>{let n=async(n,r,i,a)=>{let o=a?.modelId??t?.();return Ppe(await fetch(e,{body:JSON.stringify({taskId:n,input:r,context:i,...a?.mode?{mode:a.mode}:{},...o?{modelId:o}:{}}),headers:{"content-type":`application/json`},method:`POST`,signal:a?.signal}),`The survey assistant task could not be completed.`)};return{async suggestItemKey(e,t,r){return $S.parse(await n(`suggest-item-key`,e,t,r))},async suggestItemLabel(e,t,r){return tC.parse(await n(`suggest-item-label`,e,t,r))},async translateContent(e,t,r){return iC.parse(await n(`translate-content`,e,t,r))}}},Ipe=(e={})=>{let t=Fpe(e),n=(e,t)=>({mode:e?.mode,modelId:t?.cacheScope,signal:e?.signal});return{suggestItemKey:(e,r,i,a)=>t.suggestItemKey(e,r,n(i,a)),suggestItemLabel:(e,r,i,a)=>t.suggestItemLabel(e,r,n(i,a)),translateContent:(e,r,i,a)=>t.translateContent(e,r,n(i,a))}},C5=(e,t)=>({status:`failed`,changeId:e.id,summary:e.summary,message:t,appliedOperations:0}),Lpe=(e,{notReadyMessage:t=`The survey editor is not ready.`}={})=>({getSnapshot:()=>e()?.getSnapshot()??null,applyAssistantChange:n=>e()?.applyAssistantChange?.(n)??C5(n,t),applyAssistantChanges:n=>e()?.applyAssistantChanges?.(n)??{results:n.map(e=>C5(e,t))}}),Rpe=e=>{let t;return{controller:Lpe(()=>t,e),setController(e){t=e}}},zpe=class{#e;constructor(e){this.#e=e}getModelId=()=>this.#e;setModelId=e=>{this.#e=e}},Bpe=({initialModelId:e,onModelChange:t,taskApi:n}={})=>{let r=(0,d.useMemo)(()=>Rpe(),[]),[i]=(0,d.useState)(()=>new zpe(e)),[a,o]=(0,d.useState)(e),s=(0,d.useMemo)(()=>S5({getSnapshot:r.controller.getSnapshot,cache:{getScope:i.getModelId},tasks:Ipe({api:n,getModelId:i.getModelId})}),[r,i,n]),c=(0,d.useCallback)(e=>{i.setModelId(e),o(e),t?.(e)},[i,t]);return{aiProvider:s,controller:r.controller,controllerRef:r.setController,modelId:a,selectModel:c}};function Vpe(e,t){return new Wz(u.dt.createBlankSurvey(e,t),{pluginRegistry:e}).toJson()}function w5(e,t){return new Wz(u.dt.fromJson(e,t),{pluginRegistry:t}).toJson()}function Hpe(e,t){let n=JSON.parse(e);if(qpe(n)){let e=Wz.fromJson(n,t);return{format:`serialized-editor`,sessionId:u.bt(),state:e.toJson()}}return{format:`raw-survey`,sessionId:u.bt(),state:w5(n,t)}}function Upe(e){return JSON.stringify(e.survey,null,2)}function Wpe(e,t=`survey`){let n=Kpe(e)?.trim();return n?Gpe(n):t}function Gpe(e){return e.replace(/[^a-zA-Z0-9._-]+/g,`-`).replace(/-{2,}/g,`-`).replace(/^-+|-+$/g,``)||`survey`}function Kpe(e){let t=e.survey.surveyItems.find(e=>!e||typeof e.key!=`string`||!e.config||typeof e.config!=`object`?!1:e.config.isRoot===!0);return t?.key?t.key:e.survey.surveyItems[0]?.key}function qpe(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.version==`string`&&typeof t.hasUncommittedChanges==`boolean`&&typeof t.undoRedo==`object`&&t.undoRedo!==null&&typeof t.survey==`object`&&t.survey!==null}var T5=`↵`;function Jpe({text:e}){let t=e.split(/\r?\n/);return t.length<=1?e:(0,m.jsx)(m.Fragment,{children:t.map((e,t)=>(0,m.jsxs)(d.Fragment,{children:[t>0?(0,m.jsx)(`span`,{className:`text-muted-foreground/90 shrink-0 px-0.5 font-mono text-[0.85em] select-none`,"aria-hidden":!0,children:T5}):null,e]},`opt-label-line-${t}`))})}function Ype({item:e,displayConditionLabel:t,displayCondition:n,embeddedFormLabel:r,className:i,isOverlay:a,isSourceWhileDragging:o,surfaceOnParent:s}){let c=e.labelContent?u.xt(e.labelContent).trim().length>0:!1,l=n?(0,m.jsx)(HO,{expression:n,title:t}):e.option.hasDisplayCondition?(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(`span`,{className:`inline-flex rounded p-1 hover:bg-muted/80`,"aria-label":t,children:(0,m.jsx)(Gw,{className:`size-4`,"aria-hidden":!0})})}),(0,m.jsx)(IE,{side:`left`,children:t})]}):null,d=u.a(e.option)?(0,m.jsxs)(PE,{children:[(0,m.jsx)(FE,{asChild:!0,children:(0,m.jsx)(`span`,{className:`inline-flex rounded p-1 hover:bg-muted/80`,"aria-label":r,children:(0,m.jsx)(Ww,{className:`size-4`,"aria-hidden":!0})})}),(0,m.jsx)(IE,{side:`left`,children:r})]}):null;return(0,m.jsxs)(`div`,{className:z(`flex w-full min-w-0 items-center gap-2 rounded-lg ps-3 py-2 text-sm transition-colors`,!a&&!s&&`hover:bg-muted/70`,a&&`border border-border bg-background shadow-md`,o&&`opacity-90 bg-muted/70 backdrop-blur-sm`,i),children:[(0,m.jsx)(`span`,{className:`inline-flex shrink-0 rounded-md bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground`,children:e.option.key??`OPTION`}),c?(0,m.jsx)(h3,{content:e.labelContent,className:`min-w-0 flex-1 truncate text-foreground`,paragraphClassName:`text-foreground/90`,singleLine:!0,singleLineNewlineIndicator:T5}):(0,m.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-foreground/90`,children:(0,m.jsx)(Jpe,{text:e.label})}),(0,m.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-muted-foreground`,children:[l,d]})]})}function Xpe({groupId:e,item:t,index:n,displayConditionLabel:r,displayCondition:i,embeddedFormLabel:a,onEditLabel:o,onEditKey:s,onEditEmbeddedForm:c,onDuplicate:l,onDelete:u,t:f}){let[p,h]=(0,d.useState)(!1),{ref:g,isDragging:_}=Cz({id:t.option.id,index:n,group:e});return(0,m.jsx)(`li`,{ref:g,className:z(`group relative touch-none`),"aria-label":f(`dragHandle`),children:(0,m.jsxs)(yD,{onOpenChange:h,children:[(0,m.jsx)(bD,{asChild:!0,children:(0,m.jsx)(`div`,{tabIndex:0,onClick:e=>{e.target instanceof Element&&e.target.closest(`[data-expression-trigger="true"]`)||o(t.option.id)},className:z(`w-full rounded-lg text-start transition-colors`,`focus-visible:ring-2 focus-visible:ring-ring`,`hover:bg-muted/70`,p&&`bg-muted/70`),children:(0,m.jsx)(Ype,{item:t,displayConditionLabel:r,displayCondition:i,embeddedFormLabel:a,isSourceWhileDragging:_,revealHandleOnHover:!0,surfaceOnParent:!0})})}),(0,m.jsxs)(CD,{className:`border-border`,children:[(0,m.jsxs)(wD,{onSelect:()=>o(t.option.id),children:[(0,m.jsx)(hT,{className:`size-4`}),f(`optionContext.editLabel`)]}),(0,m.jsxs)(wD,{onSelect:()=>s(t.option.id),children:[(0,m.jsx)(`span`,{className:`size-4 shrink-0`,"aria-hidden":!0}),f(`optionContext.editKey`)]}),(0,m.jsxs)(wD,{disabled:!0,children:[(0,m.jsx)(Gw,{className:`size-4`}),f(`optionContext.editBranching`)]}),(0,m.jsxs)(wD,{onSelect:()=>c(t.option.id),children:[(0,m.jsx)(Ww,{className:`size-4`}),f(`optionContext.editEmbeddedForm`)]}),(0,m.jsx)(OD,{}),(0,m.jsxs)(wD,{onSelect:()=>{l(t.option.id)},children:[(0,m.jsx)(Nw,{className:`size-4`}),f(`optionContext.duplicate`)]}),(0,m.jsxs)(wD,{variant:`destructive`,onSelect:e=>{e.preventDefault(),u(t.option.id)},children:[(0,m.jsx)(zT,{className:`size-4`}),f(`optionContext.delete`)]})]})]})})}var Zpe=({itemId:e,items:t,onItemEditLabel:n,onItemEditKey:r,onItemEditEmbeddedForm:i,onItemDuplicate:a,onItemDelete:o,onItemsReorder:s})=>{let c=J(`defaultEditors.choiceEditor`),l=J(`defaultEditors.choiceEditor.optionIndicators`),u=l(`displayCondition`),d=l(`embeddedForm`),f=tD()?.surveyItems.get(e)?.displayConditions?.components;return(0,m.jsx)(FL,{sensors:[$I.configure({activationConstraints:[new YI.Distance({value:5})]})],onDragEnd:(e=>{if(e.canceled||!MR(e.operation)||!e.operation.source)return;let{source:n}=e.operation,{initialIndex:r,index:i}=n;if(r===i)return;let a=t.map(e=>e.option),[o]=a.splice(r,1);o&&(a.splice(i,0,o),s(a))}),modifiers:e=>[...e,k3],children:(0,m.jsx)(`div`,{className:`min-h-0 max-h-[min(22rem,50svh)] overflow-y-auto`,children:(0,m.jsx)(`ol`,{className:`space-y-0.5 p-px`,children:t.map((t,s)=>(0,m.jsx)(Xpe,{groupId:e,item:t,index:s,displayConditionLabel:u,displayCondition:f?.[t.option.id],embeddedFormLabel:d,onEditLabel:n,onEditKey:r,onEditEmbeddedForm:i,onDuplicate:a,onDelete:o,t:c},t.option.id))})})})},E5=({itemId:e,locale:t,contentKey:n,label:r,placeholder:i,description:a,bare:o=!1,contentPolicy:s,wrapperClassName:c,surfaceClassName:l,contentClassName:f,placeholderClassName:p,styleControls:h,templateVariables:g,resolveImageAssetUrl:_,imageAssets:v})=>{let y=J(`history`),b=tD(),x=TE(),S=q(e=>e.updateItemTranslations),C=q(e=>e.commitByUser),w=q(e=>e.removeAsset),T=q(e=>e.setAsset),E=(0,d.useCallback)(async e=>{let t=u.bt(),n=await H3(e);return T(t,{kind:`image`,source:{type:`embedded`,mediaType:e.type||`application/octet-stream`,encoding:`base64`,data:n},metadata:{filename:e.name}}),t},[T]),D=(0,d.useMemo)(()=>{if(b)return{getUsageCount:e=>b.getAssetUsages(e).length,removeAsset:e=>{w(e),C({label:y(`removeSurveyAsset`)})}}},[b,w,C,y]),O=(0,d.useMemo)(()=>b?.getItemTranslations(e)?.getContent(t,n),[n,e,t,b]),k=(0,d.useMemo)(()=>u.xt(O),[O]),A=(0,d.useMemo)(()=>t2(O,s),[s,O]),[j,M]=(0,d.useState)(k),[N,ee]=(0,d.useState)(O),[P,F]=(0,d.useState)(()=>t2(O,s)),[I,L]=(0,d.useState)(!1),te=(0,d.useCallback)(r=>{let i=x.getState().editor?.survey??null,a=i?.surveyItems.get(e);if(!i||!a)return;let o=i.getItemTranslations(e),s=o?.getContent(t,n),c=r?.value??j,l=r?.content??N??u.vt(c),d=u.wt(l)?void 0:l;if(JSON.stringify(s)===JSON.stringify(d))return;let f=o?.clone()??new u.ft;f.setContent(t,n,d),S(e,f)&&C({label:y(`updateItemContent`)})},[C,n,N,j,x,y,e,t,S]),ne=(0,d.useEffectEvent)(()=>{I&&te({content:N,value:j})});(0,d.useEffect)(()=>()=>{ne()},[]);let re=()=>{M(k),ee(O),F(t2(O,s)),L(!0)},ie=()=>{L(!1),te()},ae=e=>{e.key===`Escape`&&(e.preventDefault(),e.currentTarget.blur())},oe=`${e}-${t}-${n}`,se=I?P:A,ce=(0,m.jsx)(s?.variant===`block`?o3:a3,{id:oe,value:se,placeholder:i,onChange:e=>{let t=e2(e.editorState,s);M(e.plainText),ee(t),F(e.value),I||te({content:t,value:e.plainText})},onFocus:re,onBlur:ie,onKeyDown:ae,wrapperClassName:c,surfaceClassName:l,contentClassName:f,placeholderClassName:p,styleControls:h,templateVariables:g,contentPolicy:s,resolveImageAssetUrl:_,imageAssets:v,registerImageAsset:E,imageAssetDeletion:D,linksEnabled:!0});return o?ce:(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:oe,children:r}),a&&(0,m.jsx)(tE,{children:a}),ce]})},Qpe={...p0,variant:`compact`,allowedBlockTypes:{paragraph:!0},allowedStyleAttributes:{weight:!0,italic:!0,underline:!0,color:!0}},$pe={...p0,variant:`compact`,allowedBlockTypes:{paragraph:!0},allowedStyleAttributes:{weight:!0,underline:!0,color:!0}},D5={...m0,variant:`block`,allowedBlockTypes:{paragraph:!0,bulletList:!0,image:!0,separator:!0}},O5={...D5,allowedBlockTypes:{...D5.allowedBlockTypes,heading:!0,infoBox:!0}},eme=O5,tme={...p0,variant:`compact`,allowedBlockTypes:{paragraph:!0},allowedStyleAttributes:{weight:!0,italic:!0,underline:!0,color:!0}};function k5(){let e=tD(),t=B3();return{imageAssets:(0,d.useMemo)(()=>t.map(([e,t])=>({assetId:e,alt:t.metadata?.alt,label:gde(t,e),previewUrl:U3(t)})),[t]),resolveImageAssetUrl:(0,d.useCallback)(t=>U3(e?.getAsset(t)),[e])}}var nme=({itemId:e,locale:t})=>{let n=J(`defaultEditors.questionHeader`),{templateVariables:r,defaultStyleControls:i}=g3();return(0,m.jsx)(E5,{itemId:e,locale:t,contentKey:`cardFooter`,label:``,placeholder:n(`cardFooterPlaceholder`),bare:!0,contentPolicy:tme,contentClassName:`w-full py-1 text-sm focus-visible:outline-none focus-visible:ring-0`,styleControls:i,templateVariables:r})},A5=({itemId:e,locale:t,contentKey:n,placeholder:r,allowAdvancedBlocks:i=!1})=>{let{imageAssets:a,resolveImageAssetUrl:o}=k5(),{templateVariables:s,defaultStyleControls:c}=g3();return(0,m.jsx)(E5,{itemId:e,locale:t,contentKey:n,label:``,placeholder:r,bare:!0,contentPolicy:i?O5:D5,styleControls:c,templateVariables:s,resolveImageAssetUrl:o,imageAssets:a})},rme=({itemId:e,locale:t,placeholder:n})=>{let{imageAssets:r,resolveImageAssetUrl:i}=k5(),{templateVariables:a,defaultStyleControls:o}=g3();return(0,m.jsx)(E5,{itemId:e,locale:t,contentKey:`content`,label:``,placeholder:n,bare:!0,contentClassName:`min-h-56`,contentPolicy:eme,styleControls:o,templateVariables:a,resolveImageAssetUrl:i,imageAssets:r})},ime=({itemId:e,locale:t})=>{let n=J(`defaultEditors.questionHeader`),{templateVariables:r,defaultStyleControls:i,subtitleStyleControls:a}=g3();return(0,m.jsx)(`div`,{className:`space-y-4`,children:(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsx)(E5,{itemId:e,locale:t,contentKey:`title`,label:``,placeholder:n(`titlePlaceholder`),bare:!0,contentPolicy:Qpe,contentClassName:`w-full py-1 text-lg font-medium focus-visible:outline-none focus-visible:ring-0`,styleControls:i,templateVariables:r}),(0,m.jsx)(E5,{itemId:e,locale:t,contentKey:`subtitle`,label:``,placeholder:n(`subtitlePlaceholder`),bare:!0,contentPolicy:$pe,contentClassName:`w-full text-sm italic focus-visible:outline-none focus-visible:ring-0`,styleControls:a,templateVariables:r})]})})},j5=({itemId:e,locale:t,responseSection:n})=>{let r=J(`defaultEditors.questionBody`);return(0,m.jsxs)(`div`,{className:`mx-auto flex w-full flex-col gap-4 px-4 py-3 text-base`,children:[(0,m.jsx)(ime,{itemId:e,locale:t}),(0,m.jsx)(A5,{itemId:e,locale:t,contentKey:`topContent`,placeholder:r(`topContentPlaceholder`),allowAdvancedBlocks:!0}),n,(0,m.jsx)(KT,{}),(0,m.jsx)(A5,{itemId:e,locale:t,contentKey:`bottomContent`,placeholder:r(`bottomContentPlaceholder`),allowAdvancedBlocks:!0}),(0,m.jsx)(nme,{itemId:e,locale:t})]})},M5=[1,2,3,4,5,10],N5=`grow cursor-pointer font-normal hover:bg-muted/70 rounded-md px-1.5 -mx-1.5 py-1 transition-colors`;function P5(e){return e===null||M5.includes(e)}function ame(e,t){return e===null?t:String(e)}function F5(e){return e===null?`unlimited`:M5.includes(e)?String(e):`custom`}var ome=({maxSelection:e,shuffleOptions:t,onMaxSelectionChange:n,onShuffleOptionsChange:r})=>{let i=J(`defaultEditors.choiceEditor`),a=(0,d.useId)(),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(()=>F5(e)),[u,f]=(0,d.useState)(``),p=(0,d.useEffectEvent)(e=>{l(F5(e)),typeof e==`number`&&!P5(e)?f(String(e)):f(``)});(0,d.useEffect)(()=>{o&&p(e)},[o]);let h=()=>{if(c!==`custom`)return;let e=Number.parseInt(u.trim(),10);!Number.isFinite(e)||e<1||(n(e),s(!1))};return(0,m.jsxs)(zD,{children:[(0,m.jsx)(BD,{asChild:!0,children:(0,m.jsx)(B,{type:`button`,variant:`outline`,size:`icon-sm`,className:`rounded-full text-muted-foreground shadow-sm`,"aria-label":i(`responseSettings`),children:(0,m.jsx)(DT,{className:`size-3.5`})})}),(0,m.jsxs)(VD,{align:`end`,className:`p-0`,children:[(0,m.jsxs)(UD,{className:`sr-only`,children:[(0,m.jsx)(WD,{children:i(`responseSettings`)}),(0,m.jsx)(GD,{children:i(`responseSettingsDescription`)})]}),(0,m.jsxs)(ZT,{className:`flex gap-1 p-2 pb-0`,children:[(0,m.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,m.jsx)(Jw,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,m.jsx)(eE,{className:`grow text-xs`,children:i(`maxSelectionLabel`)})]}),(0,m.jsxs)(zD,{modal:!1,open:o,onOpenChange:s,children:[(0,m.jsx)(BD,{asChild:!0,children:(0,m.jsxs)(B,{type:`button`,variant:`outline`,className:`h-8 w-full min-w-0 justify-between gap-2 px-2 font-normal active:scale-100`,"aria-label":i(`maxSelectionPlaceholder`),children:[(0,m.jsx)(`span`,{className:`truncate`,children:ame(e,i(`maxSelectionUnlimited`))}),(0,m.jsx)(vw,{className:`size-4 shrink-0 opacity-60`,"aria-hidden":!0})]})}),(0,m.jsxs)(VD,{align:`start`,sideOffset:6,className:`z-60 w-56 gap-0 p-2`,children:[(0,m.jsx)(`p`,{className:`mb-2 text-xs font-medium text-muted-foreground`,children:i(`maxSelectionLabel`)}),(0,m.jsxs)(oB,{className:`gap-0`,value:c,onValueChange:t=>{if(l(t),t===`unlimited`){n(null),s(!1);return}if(t===`custom`){typeof e==`number`&&!P5(e)?f(String(e)):f(``);return}let r=Number.parseInt(t,10);Number.isFinite(r)&&r>=1&&(n(r),s(!1))},children:[(0,m.jsxs)(Og,{htmlFor:`${a}-unlimited`,className:N5,children:[(0,m.jsx)(sB,{value:`unlimited`,id:`${a}-unlimited`}),i(`maxSelectionUnlimited`)]}),M5.map(e=>(0,m.jsxs)(Og,{htmlFor:`${a}-n-${e}`,className:N5,children:[(0,m.jsx)(sB,{value:String(e),id:`${a}-n-${e}`}),String(e)]},e)),(0,m.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,m.jsxs)(Og,{htmlFor:`${a}-custom`,className:z(N5,`grow-0 shrink-0`),children:[(0,m.jsx)(sB,{value:`custom`,id:`${a}-custom`}),i(`maxSelectionCustomPlaceholder`)]}),(0,m.jsx)(Dg,{inputMode:`numeric`,className:`h-7 min-w-0 flex-1 text-sm`,placeholder:i(`maxSelectionCustomPlaceholder`),disabled:c!==`custom`,value:u,onChange:e=>f(e.target.value),onClick:()=>l(`custom`),onFocus:()=>l(`custom`),onBlur:()=>{c===`custom`&&u.trim()&&h()},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),h())}})]})]})]})]})]}),(0,m.jsx)(tE,{className:`text-xs`,children:i(`maxSelectionDescription`)})]}),(0,m.jsx)(KT,{}),(0,m.jsxs)(ZT,{orientation:`horizontal`,className:`p-2 pt-0`,children:[(0,m.jsxs)(QT,{children:[(0,m.jsx)(eE,{className:`text-xs`,children:i(`shuffleOptionsLabel`)}),(0,m.jsx)(tE,{className:`text-xs`,children:i(`shuffleOptionsDescription`)})]}),(0,m.jsx)(rE,{checked:t,onCheckedChange:r,"aria-label":i(`shuffleOptionsLabel`)})]})]})]})},sme=({itemId:e})=>{let t=J(`defaultEditors.choiceEditor`),n=J(`history`),r=tD(),i=q(e=>e.selectedLocale),a=q(e=>e.getItemDataCopy),o=q(e=>e.updateItem),s=q(e=>e.updateItemTranslations),c=q(e=>e.commitByUser),[l,f]=(0,d.useState)(!1),[p,h]=(0,d.useState)(null),g=(0,d.useRef)(null),_=r?.surveyItems.get(e),v=u.f(_?.rawItem.config,e);(0,d.useEffect)(()=>{f(!1),h(null)},[e]);let y=(0,d.useMemo)(()=>{let n=r?.getItemTranslations(e);return v.options.map((e,r)=>{let a=n?.getContent(i,u.d(e.id),`en`);return{option:e,labelContent:a,label:(a?u.xt(a).trim():``)||e.key?.trim()||t(`optionLabelFallback`,{index:r+1})}})},[v.options,e,i,r,t]),b=(0,d.useMemo)(()=>p?v.options.find(e=>e.id===p.optionId)??null:null,[v.options,p]),x=(0,d.useMemo)(()=>b?r?.getItemTranslations(e)?.getContent(i,u.d(b.id)):void 0,[b,e,i,r]),S=b?u.u(b.id):void 0,C=(0,d.useMemo)(()=>b?u.T(u.w(b.embeddedForm,b.id),r?.getItemTranslations(e),i,{fallbackLocale:`en`,translationNamespace:S}):null,[b,S,e,i,r]),w=(0,d.useMemo)(()=>b?u.T(u.w(b.embeddedForm,b.id),r?.getItemTranslations(e),i,{translationNamespace:S}):null,[b,S,e,i,r]),T=v.options.length,E=(e,t,n)=>{for(let r of e.locales){let i=e.getAllForLocale(r);if(i)for(let[a,o]of Object.entries(i)){if(a!==t&&!a.startsWith(`${t}.`))continue;let i=`${n}${a.slice(t.length)}`;e.setContent(r,i,u.Et(o))}}},D=t=>{let r=u.f(a(e).config,e);t(r),o(e,{config:r}),c({label:n(`updateItemResponseConfig`)})},O=e=>{D(t=>{t.options=e})},k=e=>{e!==v.maxSelection&&D(t=>{t.maxSelection=e})},A=e=>{e!==v.shuffleOptions&&D(t=>{t.shuffleOptions=e})},j=(t,l)=>{let d=u.f(a(e).config,e);d.options=[...d.options,t];let f=r?.getItemTranslations(e)?.clone()??new u.ft;f.setContent(i,u.d(t.id),l),o(e,{config:d}),s(e,f),c({label:n(`updateItemResponseConfig`)})},M=t=>{let i=u.f(a(e).config,e),l=i.options.filter(e=>e.id!==t);if(l.length===i.options.length)return;i.options=l;let d=r?.getItemTranslations(e)?.clone()??new u.ft;d.removeContentKey(u.d(t)),d.removeContentKeysWithPrefix(u.u(t)),o(e,{config:i}),s(e,d),c({label:n(`updateItemResponseConfig`)})},N=t=>{let i=u.f(a(e).config,e),l=i.options.findIndex(e=>e.id===t);if(l===-1)return;let d=i.options[l],f=u.c(d,i.options),p=[...i.options];p.splice(l+1,0,f),i.options=p;let m=r?.getItemTranslations(e),h=m?.clone()??new u.ft,g=u.d(t),_=u.d(f.id),v=u.u(t),y=u.u(f.id);m?.locales.forEach(e=>{let t=m.getContent(e,g);t&&h.setContent(e,_,u.Et(t))}),E(h,v,y),o(e,{config:i}),s(e,h),c({label:n(`updateItemResponseConfig`)})},ee=(t,l)=>{let d=u.f(a(e).config,e),f=d.options.findIndex(e=>e.id===t.id);if(h(null),f===-1)return;let p=d.options[f],m={...p,key:u.p(t.key??``)},g=u.d(t.id),_=r?.getItemTranslations(e),v=_?.getContent(i,g),y=p.key===m.key,b=JSON.stringify(v)===JSON.stringify(l);if(y&&b)return;d.options[f]=m;let x=_?.clone()??new u.ft;x.setContent(i,g,l),o(e,{config:d}),s(e,x),c({label:n(`updateItemResponseConfig`)})},P=()=>{f(!0)},F=e=>{h({optionId:e,focusField:`label`})},I=e=>{h({optionId:e,focusField:`key`})},L=e=>{h({optionId:e,focusField:`advanced`,advancedOpen:!0})},te=(t,i)=>{let l=u.f(a(e).config,e),d=l.options.findIndex(e=>e.id===t);if(d<0)return!1;let f=l.options[d],p=u.w(f.embeddedForm,t),m=(r?.getItemTranslations(e))?.clone()??new u.ft,h=u.u(t);if(i(p,m)===!1)return!1;let g=u.E(p),_=g.fieldGroups.length>0?g:void 0;return l.options[d]={...f,embeddedForm:_},_||m.removeContentKeysWithPrefix(h),o(e,{config:l}),s(e,m.clone().compact()),c({label:n(`updateItemResponseConfig`)}),!0},{isShortcutActive:ne}=qD(g,{key:`c`},{enabled:!l});return(0,m.jsxs)(`section`,{className:`min-h-24`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,m.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-2 text-sm font-semibold uppercase tracking-wider text-gray-600`,children:[(0,m.jsx)(`span`,{children:t(`responseConfig`)}),(0,m.jsxs)(`span`,{className:`font-normal normal-case tracking-normal text-muted-foreground`,children:[`(`,(0,m.jsx)(`span`,{className:`tabular-nums`,children:T}),`)`]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(ome,{maxSelection:v.maxSelection,shuffleOptions:v.shuffleOptions,onMaxSelectionChange:k,onShuffleOptionsChange:A}),(0,m.jsx)(B,{ref:g,type:`button`,variant:`outline`,size:`icon-sm`,className:z(`rounded-full text-muted-foreground shadow-sm`,ne&&`bg-primary/5 text-foreground ring-2 ring-ring/40 scale-[0.98]`),"aria-label":t(`addResponseElement`),onClick:P,children:(0,m.jsx)(yT,{className:`size-4`})})]})]}),(0,m.jsxs)(`div`,{className:`mt-2`,children:[(0,m.jsx)(Zpe,{itemId:e,items:y,onItemEditLabel:F,onItemEditKey:I,onItemEditEmbeddedForm:L,onItemDuplicate:N,onItemDelete:M,onItemsReorder:O}),(0,m.jsx)(kue,{isOpen:l,open:P,existingOptions:v.options,onCancel:()=>f(!1),onSubmit:j},e),b&&p&&C&&w&&S?(0,m.jsx)(dde,{open:!0,itemId:e,option:b,existingOptions:v.options,initialLabelContent:x,initialFocusField:p.focusField,initialAdvancedOpen:p.advancedOpen,embeddedFormConfig:C,embeddedFormEditingConfig:w,selectedLocale:i,translationNamespace:S,onSave:ee,onPersistEmbeddedForm:e=>te(b.id,e)},`${b.id}:${p.focusField}:${p.advancedOpen===!0?`advanced`:`basic`}:${i}`):null]})]})},cme=e=>{let t=J(`defaultEditors.placeholder`),n=J(`itemEditorCard`),r=q(e=>e.selectedLocale),i=[{id:`conditions`,title:t(`conditions`),description:n(`conditionsDescription`),icon:Gw}];return(0,m.jsx)(QO,{surveyItem:e.item,menu:{items:[(0,m.jsx)(JE,{itemId:e.item.id},`copy-item`)]},layoutVariant:`stacked`,sidePanelCards:i,children:(0,m.jsx)(j5,{itemId:e.item.id,locale:r,responseSection:(0,m.jsx)(sme,{itemId:e.item.id})})})},lme=({itemId:e})=>{let t=J(`history`),n=tD(),r=TE(),i=q(e=>e.selectedLocale),a=q(e=>e.getItemDataCopy),o=q(e=>e.updateItem),s=q(e=>e.updateItemTranslations),c=q(e=>e.commitByUser),l=n?.surveyItems.get(e),f=n?.getItemTranslations(e),p=(0,d.useMemo)(()=>u.w(l?.rawItem.config,e),[l?.rawItem.config,e]),h=(0,d.useMemo)(()=>u.T(p,f,i,{fallbackLocale:`en`}),[p,f,i]),g=(0,d.useMemo)(()=>u.T(p,f,i),[p,f,i]),_=e=>{let t=e?.clone().compact();if(t)return Object.fromEntries(t.locales.map(e=>[e,t.getAllForLocale(e)??{}]))};return(0,m.jsx)(R3,{itemId:e,config:h,editingConfig:g,selectedLocale:i,onPersist:n=>{let i=r.getState().editor;if(!i)return!1;let l=a(e),d=u.w(l.config,e),f=i.survey.getItemTranslations(e),p=f?.clone()??new u.ft;if(n(d,p)===!1)return!1;let m=u.E(d),h=p.clone().compact();return JSON.stringify(l.config)===JSON.stringify(m)&&JSON.stringify(_(f))===JSON.stringify(_(h))?!1:(o(e,{config:m}),s(e,h),c({label:t(`updateItemResponseConfig`)}),!0)}})},ume=e=>{let t=J(`defaultEditors.placeholder`),n=J(`itemEditorCard`),r=q(e=>e.selectedLocale),i=[{id:`conditions`,title:t(`conditions`),description:n(`conditionsDescription`),icon:Gw}];return(0,m.jsx)(QO,{surveyItem:e.item,menu:{items:[(0,m.jsx)(JE,{itemId:e.item.id},`copy-item`)]},layoutVariant:`stacked`,sidePanelCards:i,children:(0,m.jsx)(j5,{itemId:e.item.id,locale:r,responseSection:(0,m.jsx)(lme,{itemId:e.item.id})})})},dme=e=>{let t=J(`defaultEditors.infoEditor`),n=J(`itemEditorCard`),r=J(`defaultEditors.placeholder`),i=q(e=>e.selectedLocale),a=[{id:`conditions`,title:r(`conditions`),description:n(`conditionsDescription`),icon:Gw}];return(0,m.jsx)(QO,{surveyItem:e.item,menu:{items:[(0,m.jsx)(JE,{itemId:e.item.id},`copy-item`)]},layoutVariant:`stacked`,sidePanelCards:a,children:(0,m.jsx)(`div`,{className:`flex w-full max-w-3xl flex-col gap-4 px-4 py-3 text-base`,children:(0,m.jsx)(rme,{itemId:e.item.id,locale:i,placeholder:t(`contentPlaceholder`)})})})};function fme(e){return e.config.id??e.id}function I5(e,t){return`${e.id}...${t}...${fme(e)}`}function L5(e){return new u.et({type:u.gt.boolean,value:e})}function R5(e){return new u.et({type:u.gt.reference,value:e})}function z5(e){return new u.ut(I5(e,`get`))}function B5(e){return new u.ut(I5(e,`isDefined`))}function V5(e){return e.length===0?L5(!1):e.length===1&&e[0]?e[0]:new u.at(u.ot.or,e)}function H5(e){return e.length===0?L5(!0):e.length===1&&e[0]?e[0]:new u.at(u.ot.and,e)}function U5(e){return new u.at(u.ot.not,[e])}function pme(e){return e===`all`||e===`none`||e===`either`?e:`either`}function W5(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(Boolean))]:[]}function G5(e){return e.config.options.map(e=>({value:e.id,label:e.key??e.id,description:e.key&&e.key!==e.id?e.id:void 0}))}function K5(e,t,n){if(n.length===0)return L5(t!==`either`);if(u.i(e.config.maxSelection)){let r=n.map(t=>new u.at(u.ot.eq,[z5(e),R5(t)]));return t===`all`?H5(r):t===`none`?U5(V5(r)):V5(r)}let r=n.map(t=>new u.at(u.ot.list_contains,[z5(e),R5(t)]));return t===`all`?H5(r):t===`none`?U5(V5(r)):V5(r)}function mme(e,t){if(t.length===0)return U5(B5(e));if(u.i(e.config.maxSelection))return t.length===1?new u.at(u.ot.eq,[z5(e),R5(t[0])]):L5(!1);let n=new Set(t),r=e.config.options.map(e=>e.id).filter(e=>!n.has(e));return H5([K5(e,`all`,t),K5(e,`none`,r)])}var hme=[{id:`choice.selectionIncludesOptions`,label:`Selection includes options`,description:`Checks whether the selected options match all, none, or either of the chosen options.`,returnType:u.gt.boolean,parameters:[{key:`mode`,label:`Match mode`,input:`singleSelect`,required:!0,defaultValue:`either`,getOptions:()=>[{value:`all`,label:`All`},{value:`none`,label:`None`},{value:`either`,label:`Either`}]},{key:`optionIds`,label:`Options`,input:`multiSelect`,required:!0,getOptions:G5}],buildExpression:(e,t)=>K5(e,pme(t?.mode),W5(t?.optionIds))},{id:`choice.selectionMatchesExactly`,label:`Selection matches exactly`,description:`Checks whether the answer contains exactly the chosen option set and no other options.`,returnType:u.gt.boolean,parameters:[{key:`optionIds`,label:`Options`,input:`multiSelect`,required:!0,getOptions:G5}],buildExpression:(e,t)=>mme(e,W5(t?.optionIds))},{id:`choice.hasSelection`,label:`Has selection`,description:`Checks whether the question has any selected option.`,returnType:u.gt.boolean,buildExpression:e=>B5(e)}];function q5({itemContent:e,locales:t,locale:n}){return[...new Set([...t,...e?.locales??[],n])]}function J5(e,t){return q5(e).some(n=>!u.wt(e.itemContent?.getContent(n,t)))}function gme(e){return J5(e,`content`)?q5(e).every(t=>!u.wt(e.itemContent?.getContent(t,`content`)))?i_.ready:i_.incomplete:i_.blank}function _me({item:e,...t}){let n=u.w(e.config,e.id).fieldGroups.some(e=>e.fields.length>0),r=!u.wt(t.itemContent?.getContent(t.locale,`title`));return n&&r?i_.ready:n||J5(t,`title`)?i_.incomplete:i_.blank}function vme({item:e,...t}){let n=u.f(e.config,e.id),r=!u.wt(t.itemContent?.getContent(t.locale,`title`));return n.options.length>=1&&r?i_.ready:n.options.length>=1||J5(t,`title`)?i_.incomplete:i_.blank}function Y5(e,t,n){return!t||e.length<2?[...e]:u.Tt(e,u.yt(n))}function yme({className:e,...t}){return(0,m.jsx)(sa,{"data-slot":`checkbox`,className:z(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,e),...t,children:(0,m.jsx)(la,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,m.jsx)(_w,{})})})}function bme(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var xme={},X5={};function Z5(e,t){try{let n=(xme[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in X5?X5[n]:Q5(n,n.split(`:`))}catch{if(e in X5)return X5[e];let t=e?.match(Sme);return t?Q5(e,t.slice(1)):NaN}}var Sme=/([+-]\d\d):?(\d\d)?/;function Q5(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return X5[e]=n*60+r>0?n*60+r+i:n*60-r-i}var $5=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Z5(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),n7(this,NaN),t7(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-Z5(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),t7(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},e7=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!e7.test(e))return;let t=e.replace(e7,`$1UTC`);$5.prototype[t]&&(e.startsWith(`get`)?$5.prototype[e]=function(){return this.internal[t]()}:($5.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),Cme(this),+this},$5.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),t7(this),+this}))});function t7(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Z5(e.timeZone,e)*60))}function Cme(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),n7(e)}function n7(e){let t=Z5(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-(Z5(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=Z5(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f,m=f!==n,h=p-s;if(m&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);let t=Z5(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var r7=class e extends $5{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${bme(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},i7=5,wme=4;function Tme(e,t){let n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),a=t.addDays(i,i7*7-1);return t.getMonth(e)===t.getMonth(a)?i7:wme}function a7(e,t){let n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function Eme(e,t){let n=a7(e,t),r=Tme(e,t);return t.addDays(n,r*7-1)}var o7={...u.I,labels:{labelDayButton:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>u.N(e,t,{locale:u.I,...n});let a=i(e,`PPPP`);return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:`Choose the Month`,labelNext:`Go to the Next Month`,labelPrevious:`Go to the Previous Month`,labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:`Choose the Year`,labelGrid:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>u.N(e,n,{locale:u.I,...t}),r(e,`LLLL yyyy`)},labelGridcell:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>u.N(e,t,{locale:u.I,...n});let a=i(e,`PPPP`);return t?.today&&(a=`Today, ${a}`),a},labelNav:`Navigation bar`,labelWeekNumberHeader:`Week Number`,labelWeekday:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>u.N(e,n,{locale:u.I,...t}),r(e,`cccc`)}}},s7=class e{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?r7.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new r7(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):h(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):g(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):_(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):v(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):u.U(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):w(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):N(e),this.eachYearOfInterval=e=>{let t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):F(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;let r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):Eme(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):L(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):O(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):I(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):P(e),this.format=(e,t,n)=>{let r=this.overrides?.format?this.overrides.format(e,t,this.options):u.N(e,t,this.options);return this.options.numerals&&this.options.numerals!==`latn`?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):u.F(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):ie(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):ae(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):u.P(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):oe(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):se(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):u.H(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):C(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):ce(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):le(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):y(e),this.min=e=>this.overrides?.min?this.overrides.min(e):b(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):ue(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):de(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):a7(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):u.W(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):u.q(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):ee(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):u.J(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):u.V(e),this.options={locale:o7,...e},this.overrides=t}getDigitMap(){let{numerals:e=`latn`}=this.options,t=new Intl.NumberFormat(`en-US`,{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){let t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){let t=this.options.locale?.code;return t&&e.yearFirstLocales.has(t)?`year-first`:`month-first`}formatMonthYear(t){let{locale:n,timeZone:r,numerals:i}=this.options,a=n?.code;if(a&&e.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:`long`,year:`numeric`,timeZone:r,numberingSystem:i}).format(t)}catch{}let o=this.getMonthYearOrder()===`year-first`?`y LLLL`:`LLLL y`;return this.format(t,o)}};s7.yearFirstLocales=new Set([`eu`,`hu`,`ja`,`ja-Hira`,`ja-JP`,`ko`,`ko-KR`,`lt`,`lt-LT`,`lv`,`lv-LV`,`mn`,`mn-MN`,`zh`,`zh-CN`,`zh-HK`,`zh-TW`]);var c7=new s7,l7=class{constructor(e,t,n=c7){this.date=e,this.displayMonth=t,this.outside=!!(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,`yyyy-MM-dd`),this.displayMonthId=n.format(t,`yyyy-MM`),this.dateMonthId=n.format(e,`yyyy-MM`)}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}},Dme=class{constructor(e,t){this.date=e,this.weeks=t}},Ome=class{constructor(e,t){this.days=t,this.weekNumber=e}};function kme(e){return f.default.createElement(`button`,{...e})}function Ame(e){return f.default.createElement(`span`,{...e})}function jme(e){let{size:t=24,orientation:n=`left`,className:r}=e;return f.default.createElement(`svg`,{className:r,width:t,height:t,viewBox:`0 0 24 24`},n===`up`&&f.default.createElement(`polygon`,{points:`6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28`}),n===`down`&&f.default.createElement(`polygon`,{points:`6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72`}),n===`left`&&f.default.createElement(`polygon`,{points:`16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20`}),n===`right`&&f.default.createElement(`polygon`,{points:`8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20`}))}function Mme(e){let{day:t,modifiers:n,...r}=e;return f.default.createElement(`td`,{...r})}function Nme(e){let{day:t,modifiers:n,...r}=e,i=f.default.useRef(null);return f.default.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),f.default.createElement(`button`,{ref:i,...r})}var u7;(function(e){e.Root=`root`,e.Chevron=`chevron`,e.Day=`day`,e.DayButton=`day_button`,e.CaptionLabel=`caption_label`,e.Dropdowns=`dropdowns`,e.Dropdown=`dropdown`,e.DropdownRoot=`dropdown_root`,e.Footer=`footer`,e.MonthGrid=`month_grid`,e.MonthCaption=`month_caption`,e.MonthsDropdown=`months_dropdown`,e.Month=`month`,e.Months=`months`,e.Nav=`nav`,e.NextMonthButton=`button_next`,e.PreviousMonthButton=`button_previous`,e.Week=`week`,e.Weeks=`weeks`,e.Weekday=`weekday`,e.Weekdays=`weekdays`,e.WeekNumber=`week_number`,e.WeekNumberHeader=`week_number_header`,e.YearsDropdown=`years_dropdown`})(u7||={});var d7;(function(e){e.disabled=`disabled`,e.hidden=`hidden`,e.outside=`outside`,e.focused=`focused`,e.today=`today`})(d7||={});var f7;(function(e){e.range_end=`range_end`,e.range_middle=`range_middle`,e.range_start=`range_start`,e.selected=`selected`})(f7||={});var p7;(function(e){e.weeks_before_enter=`weeks_before_enter`,e.weeks_before_exit=`weeks_before_exit`,e.weeks_after_enter=`weeks_after_enter`,e.weeks_after_exit=`weeks_after_exit`,e.caption_after_enter=`caption_after_enter`,e.caption_after_exit=`caption_after_exit`,e.caption_before_enter=`caption_before_enter`,e.caption_before_exit=`caption_before_exit`})(p7||={});function Pme(e){let{options:t,className:n,components:r,classNames:i,...a}=e,o=[i[u7.Dropdown],n].join(` `),s=t?.find(({value:e})=>e===a.value);return f.default.createElement(`span`,{"data-disabled":a.disabled,className:i[u7.DropdownRoot]},f.default.createElement(r.Select,{className:o,...a},t?.map(({value:e,label:t,disabled:n})=>f.default.createElement(r.Option,{key:e,value:e,disabled:n},t))),f.default.createElement(`span`,{className:i[u7.CaptionLabel],"aria-hidden":!0},s?.label,f.default.createElement(r.Chevron,{orientation:`down`,size:18,className:i[u7.Chevron]})))}function Fme(e){return f.default.createElement(`div`,{...e})}function Ime(e){return f.default.createElement(`div`,{...e})}function Lme(e){let{calendarMonth:t,displayIndex:n,...r}=e;return f.default.createElement(`div`,{...r},e.children)}function Rme(e){let{calendarMonth:t,displayIndex:n,...r}=e;return f.default.createElement(`div`,{...r})}function zme(e){return f.default.createElement(`table`,{...e})}function Bme(e){return f.default.createElement(`div`,{...e})}var m7=(0,f.createContext)(void 0);function h7(){let e=(0,f.useContext)(m7);if(e===void 0)throw Error(`useDayPicker() must be used within a custom component.`);return e}function Vme(e){let{components:t}=h7();return f.default.createElement(t.Dropdown,{...e})}function Hme(e){let{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:i,...a}=e,{components:o,classNames:s,labels:{labelPrevious:c,labelNext:l}}=h7(),u=(0,f.useCallback)(e=>{i&&n?.(e)},[i,n]),d=(0,f.useCallback)(e=>{r&&t?.(e)},[r,t]);return f.default.createElement(`nav`,{...a},f.default.createElement(o.PreviousMonthButton,{type:`button`,className:s[u7.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:d},f.default.createElement(o.Chevron,{disabled:r?void 0:!0,className:s[u7.Chevron],orientation:`left`})),f.default.createElement(o.NextMonthButton,{type:`button`,className:s[u7.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":l(i),onClick:u},f.default.createElement(o.Chevron,{disabled:i?void 0:!0,orientation:`right`,className:s[u7.Chevron]})))}function Ume(e){let{components:t}=h7();return f.default.createElement(t.Button,{...e})}function Wme(e){return f.default.createElement(`option`,{...e})}function Gme(e){let{components:t}=h7();return f.default.createElement(t.Button,{...e})}function Kme(e){let{rootRef:t,...n}=e;return f.default.createElement(`div`,{...n,ref:t})}function qme(e){return f.default.createElement(`select`,{...e})}function Jme(e){let{week:t,...n}=e;return f.default.createElement(`tr`,{...n})}function Yme(e){return f.default.createElement(`th`,{...e})}function Xme(e){return f.default.createElement(`thead`,{"aria-hidden":!0},f.default.createElement(`tr`,{...e}))}function Zme(e){let{week:t,...n}=e;return f.default.createElement(`th`,{...n})}function Qme(e){return f.default.createElement(`th`,{...e})}function $me(e){return f.default.createElement(`tbody`,{...e})}function ehe(e){let{components:t}=h7();return f.default.createElement(t.Dropdown,{...e})}var the=s({Button:()=>kme,CaptionLabel:()=>Ame,Chevron:()=>jme,Day:()=>Mme,DayButton:()=>Nme,Dropdown:()=>Pme,DropdownNav:()=>Fme,Footer:()=>Ime,Month:()=>Lme,MonthCaption:()=>Rme,MonthGrid:()=>zme,Months:()=>Bme,MonthsDropdown:()=>Vme,Nav:()=>Hme,NextMonthButton:()=>Ume,Option:()=>Wme,PreviousMonthButton:()=>Gme,Root:()=>Kme,Select:()=>qme,Week:()=>Jme,WeekNumber:()=>Zme,WeekNumberHeader:()=>Qme,Weekday:()=>Yme,Weekdays:()=>Xme,Weeks:()=>$me,YearsDropdown:()=>ehe});function g7(e,t,n=!1,r=c7){let{from:i,to:a}=e,{differenceInCalendarDays:o,isSameDay:s}=r;return i&&a?(o(a,i)<0&&([i,a]=[a,i]),o(t,i)>=+!!n&&o(a,t)>=+!!n):!n&&a?s(a,t):!n&&i?s(i,t):!1}function _7(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function v7(e){return!!(e&&typeof e==`object`&&`from`in e)}function y7(e){return!!(e&&typeof e==`object`&&`after`in e)}function b7(e){return!!(e&&typeof e==`object`&&`before`in e)}function x7(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function S7(e,t){return Array.isArray(e)&&e.every(t.isDate)}function C7(e,t,n=c7){let r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:a,isAfter:o}=n;return r.some(t=>{if(typeof t==`boolean`)return t;if(n.isDate(t))return i(e,t);if(S7(t,n))return t.some(t=>i(e,t));if(v7(t))return g7(t,e,!1,n);if(x7(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(_7(t)){let n=a(t.before,e),r=a(t.after,e),i=n>0,s=r<0;return o(t.before,t.after)?s&&i:i||s}return y7(t)?a(e,t.after)>0:b7(t)?a(t.before,e)>0:typeof t==`function`?t(e):!1})}function nhe(e,t,n,r,i){let{disabled:a,hidden:o,modifiers:s,showOutsideDays:c,broadcastCalendar:l,today:u=i.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:m,endOfMonth:h,isAfter:g}=i,_=n&&p(n),v=r&&h(r),y={[d7.focused]:[],[d7.outside]:[],[d7.disabled]:[],[d7.hidden]:[],[d7.today]:[]},b={};for(let t of e){let{date:e,displayMonth:n}=t,r=!!(n&&!f(e,n)),p=!!(_&&m(e,_)),h=!!(v&&g(e,v)),x=!!(a&&C7(e,a,i)),S=!!(o&&C7(e,o,i))||p||h||!l&&!c&&r||l&&c===!1&&r,C=d(e,u);r&&y.outside.push(t),x&&y.disabled.push(t),S&&y.hidden.push(t),C&&y.today.push(t),s&&Object.keys(s).forEach(n=>{let r=s?.[n];r&&C7(e,r,i)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{let t={[d7.focused]:!1,[d7.disabled]:!1,[d7.hidden]:!1,[d7.outside]:!1,[d7.today]:!1},n={};for(let n in y)t[n]=y[n].some(t=>t===e);for(let t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}function rhe(e,t,n={}){return Object.entries(e).filter(([,e])=>e===!0).reduce((e,[r])=>(n[r]?e.push(n[r]):t[d7[r]]?e.push(t[d7[r]]):t[f7[r]]&&e.push(t[f7[r]]),e),[t[u7.Day]])}function ihe(e){return{...the,...e}}function ahe(e){let t={"data-mode":e.mode??void 0,"data-required":`required`in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith(`data-`)&&(t[e]=n)}),t}function w7(){let e={};for(let t in u7)e[u7[t]]=`rdp-${u7[t]}`;for(let t in d7)e[d7[t]]=`rdp-${d7[t]}`;for(let t in f7)e[f7[t]]=`rdp-${f7[t]}`;for(let t in p7)e[p7[t]]=`rdp-${p7[t]}`;return e}function T7(e,t,n){return(n??new s7(t)).formatMonthYear(e)}var ohe=T7;function she(e,t,n){return(n??new s7(t)).format(e,`d`)}function che(e,t=c7){return t.format(e,`LLLL`)}function lhe(e,t,n){return(n??new s7(t)).format(e,`cccccc`)}function uhe(e,t=c7){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function dhe(){return``}function E7(e,t=c7){return t.format(e,`yyyy`)}var fhe=E7,phe=s({formatCaption:()=>T7,formatDay:()=>she,formatMonthCaption:()=>ohe,formatMonthDropdown:()=>che,formatWeekNumber:()=>uhe,formatWeekNumberHeader:()=>dhe,formatWeekdayName:()=>lhe,formatYearCaption:()=>fhe,formatYearDropdown:()=>E7});function mhe(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...phe,...e}}function D7(e,t,n,r){let i=(r??new s7(n)).format(e,`PPPP`);return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}var hhe=D7;function O7(e,t,n){return(n??new s7(t)).formatMonthYear(e)}var ghe=O7;function k7(e,t,n,r){let i=(r??new s7(n)).format(e,`PPPP`);return t?.today&&(i=`Today, ${i}`),i}function A7(e){return`Choose the Month`}function j7(){return``}var _he=`Go to the Next Month`;function M7(e,t){return _he}function N7(e){return`Go to the Previous Month`}function P7(e,t,n){return(n??new s7(t)).format(e,`cccc`)}function F7(e,t){return`Week ${e}`}function I7(e){return`Week Number`}function L7(e){return`Choose the Year`}var vhe=s({labelCaption:()=>ghe,labelDay:()=>hhe,labelDayButton:()=>D7,labelGrid:()=>O7,labelGridcell:()=>k7,labelMonthDropdown:()=>A7,labelNav:()=>j7,labelNext:()=>M7,labelPrevious:()=>N7,labelWeekNumber:()=>F7,labelWeekNumberHeader:()=>I7,labelWeekday:()=>P7,labelYearDropdown:()=>L7}),R7=(e,t,n)=>t||(n?typeof n==`function`?n:(...e)=>n:e);function yhe(e,t){let n=t.locale?.labels??{};return{...vhe,...e??{},labelDayButton:R7(D7,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:R7(A7,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:R7(M7,e?.labelNext,n.labelNext),labelPrevious:R7(N7,e?.labelPrevious,n.labelPrevious),labelWeekNumber:R7(F7,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:R7(L7,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:R7(O7,e?.labelGrid,n.labelGrid),labelGridcell:R7(k7,e?.labelGridcell,n.labelGridcell),labelNav:R7(j7,e?.labelNav,n.labelNav),labelWeekNumberHeader:R7(I7,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:R7(P7,e?.labelWeekday,n.labelWeekday)}}function bhe(e,t,n,r,i){let{startOfMonth:a,startOfYear:o,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=i;return c({start:o(e),end:s(e)}).map(e=>{let o=r.formatMonthDropdown(e,i);return{value:l(e),label:o,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function xhe(e,t={},n={}){let r={...t?.[u7.Day]};return Object.entries(e).filter(([,e])=>e===!0).forEach(([e])=>{r={...r,...n?.[e]}}),r}function She(e,t,n,r){let i=r??e.today(),a=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i),o=[];for(let t=0;t<7;t++){let n=e.addDays(a,t);o.push(n)}return o}function Che(e,t,n,r,i=!1){if(!e||!t)return;let{startOfYear:a,endOfYear:o,eachYearOfInterval:s,getYear:c}=r,l=s({start:a(e),end:o(t)});return i&&l.reverse(),l.map(e=>{let t=n.formatYearDropdown(e,r);return{value:c(e),label:t,disabled:!1}})}function whe(e,t={}){let{weekStartsOn:n,locale:r}=t,i=n??r?.options?.weekStartsOn??0,a=t=>{let n=typeof t==`number`||typeof t==`string`?new Date(t):t;return new r7(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},o=e=>{let t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(r7.tz(e)),newDate:(t,n,r)=>new r7(t,n,r,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{let n=a(e),r=t?.weekStartsOn??i,o=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-o),n},startOfISOWeek:e=>{let t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{let t=a(e);return t.setDate(1),t},startOfYear:e=>{let t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{let n=a(e),r=(((t?.weekStartsOn??i)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{let t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{let t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{let t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new r7(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=r.getFullYear()*12+r.getMonth();for(;o.getFullYear()*12+o.getMonth()<=s;)i.push(new r7(o,e)),o.setMonth(o.getMonth()+1,1);return i},addDays:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t*7),n},addMonths:(e,t)=>{let n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{let n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new r7(n.getFullYear(),0,1,12,0,0,e);for(;o.getFullYear()<=r.getFullYear();)i.push(new r7(o,e)),o.setFullYear(o.getFullYear()+1,0,1);return i},getWeek:(e,t)=>u.P(o(e),{weekStartsOn:t?.weekStartsOn??i,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>u.F(o(e)),differenceInCalendarDays:(e,t)=>u.U(o(e),o(t)),differenceInCalendarMonths:(e,t)=>w(o(e),o(t))}}var z7=e=>e instanceof HTMLElement?e:null,B7=e=>[...e.querySelectorAll(`[data-animated-month]`)??[]],The=e=>z7(e.querySelector(`[data-animated-month]`)),V7=e=>z7(e.querySelector(`[data-animated-caption]`)),H7=e=>z7(e.querySelector(`[data-animated-weeks]`)),Ehe=e=>z7(e.querySelector(`[data-animated-nav]`)),Dhe=e=>z7(e.querySelector(`[data-animated-weekdays]`));function Ohe(e,t,{classNames:n,months:r,focused:i,dateLib:a}){let o=(0,f.useRef)(null),s=(0,f.useRef)(r),c=(0,f.useRef)(!1);(0,f.useLayoutEffect)(()=>{let l=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;let u=a.isSameMonth(r[0].date,l[0].date),d=a.isAfter(r[0].date,l[0].date),f=d?n[p7.caption_after_enter]:n[p7.caption_before_enter],p=d?n[p7.weeks_after_enter]:n[p7.weeks_before_enter],m=o.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(B7(h).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=The(e);t&&e.contains(t)&&e.removeChild(t);let n=V7(e);n&&n.classList.remove(f);let r=H7(e);r&&r.classList.remove(p)}),o.current=h):o.current=null,c.current||u||i)return;let g=m instanceof HTMLElement?B7(m):[],_=B7(e.current);if(_?.every(e=>e instanceof HTMLElement)&&g&&g.every(e=>e instanceof HTMLElement)){c.current=!0;let t=[];e.current.style.isolation=`isolate`;let r=Ehe(e.current);r&&(r.style.zIndex=`1`),_.forEach((i,a)=>{let o=g[a];if(!o)return;i.style.position=`relative`,i.style.overflow=`hidden`;let s=V7(i);s&&s.classList.add(f);let l=H7(i);l&&l.classList.add(p);let u=()=>{c.current=!1,e.current&&(e.current.style.isolation=``),r&&(r.style.zIndex=``),s&&s.classList.remove(f),l&&l.classList.remove(p),i.style.position=``,i.style.overflow=``,i.contains(o)&&i.removeChild(o)};t.push(u),o.style.pointerEvents=`none`,o.style.position=`absolute`,o.style.overflow=`hidden`,o.setAttribute(`aria-hidden`,`true`);let m=Dhe(o);m&&(m.style.opacity=`0`);let h=V7(o);h&&(h.classList.add(d?n[p7.caption_before_exit]:n[p7.caption_after_exit]),h.addEventListener(`animationend`,u));let _=H7(o);_&&_.classList.add(d?n[p7.weeks_before_exit]:n[p7.weeks_after_exit]),i.insertBefore(o,i.firstChild)})}})}function khe(e,t,n,r){let i=e[0],a=e[e.length-1],{ISOWeek:o,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:m,endOfWeek:h,isAfter:g,startOfBroadcastWeek:_,startOfISOWeek:v,startOfWeek:y}=r,b=c?_(i,r):o?v(i):y(i),x=c?f(a):o?p(m(a)):h(m(a)),S=t&&(c?f(t):o?p(t):h(t)),C=u(S&&g(x,S)?S:x,b),w=d(a,i)+1,T=[];for(let e=0;e<=C;e++){let t=l(b,e);T.push(t)}let E=(c?35:42)*w;if(s&&T.length<E){let e=E-T.length;for(let t=0;t<e;t++){let e=l(T[T.length-1],1);T.push(e)}}return T}function Ahe(e){let t=[];return e.reduce((e,n)=>{let r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}function jhe(e,t,n,r){let{numberOfMonths:i=1}=n,a=[];for(let n=0;n<i;n++){let i=r.addMonths(e,n);if(t&&i>t)break;a.push(i)}return a}function U7(e,t,n,r){let{month:i,defaultMonth:a,today:o=r.today(),numberOfMonths:s=1}=e,c=i||a||o,{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=r;return n&&l(n,c)<s-1&&(c=u(n,-1*(s-1))),t&&l(c,t)<0&&(c=t),d(c)}function Mhe(e,t,n,r){let{addDays:i,endOfBroadcastWeek:a,endOfISOWeek:o,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,m=e.reduce((e,m)=>{let h=n.broadcastCalendar?d(m,r):n.ISOWeek?f(m):p(m),g=n.broadcastCalendar?a(m):n.ISOWeek?o(s(m)):c(s(m)),_=t.filter(e=>e>=h&&e<=g),v=n.broadcastCalendar?35:42;if(n.fixedWeeks&&_.length<v){let e=t.filter(e=>{let t=v-_.length;return e>g&&e<=i(g,t)});_.push(...e)}let y=new Dme(m,_.reduce((e,t)=>{let i=n.ISOWeek?l(t):u(t),a=e.find(e=>e.weekNumber===i),o=new l7(t,m,r);return a?a.days.push(o):e.push(new Ome(i,[o])),e},[]));return e.push(y),e},[]);return n.reverseMonths?m.reverse():m}function Nhe(e,t){let{startMonth:n,endMonth:r}=e,{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:s,addYears:c,endOfYear:l,newDate:u,today:d}=t,{fromYear:f,toYear:p,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&f&&(n=t.newDate(f,0,1)),!r&&h&&(r=h),!r&&p&&(r=u(p,11,31));let g=e.captionLayout===`dropdown`||e.captionLayout===`dropdown-years`;return n?n=o(n):f?n=u(f,0,1):!n&&g&&(n=i(c(e.today??d(),-100))),r?r=s(r):p?r=u(p,11,31):!r&&g&&(r=l(e.today??d())),[n&&a(n),r&&a(r)]}function Phe(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a=1}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a:1,u=o(e);if(!t||!(c(t,e)<a))return s(u,l)}function Fhe(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a??1:1,u=o(e);if(!t||!(c(u,t)<=0))return s(u,-l)}function Ihe(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}function W7(e,t){let[n,r]=(0,f.useState)(e);return[t===void 0?n:t,r]}function Lhe(e,t){let[n,r]=Nhe(e,t),{startOfMonth:i,endOfMonth:a}=t,o=U7(e,n,r,t),[s,c]=W7(o,e.month?o:void 0);(0,f.useEffect)(()=>{c(U7(e,n,r,t))},[e.timeZone]);let{months:l,weeks:u,days:d,previousMonth:p,nextMonth:m}=(0,f.useMemo)(()=>{let i=jhe(s,r,{numberOfMonths:e.numberOfMonths},t),o=Mhe(i,khe(i,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t);return{months:o,weeks:Ihe(o),days:Ahe(o),previousMonth:Fhe(s,n,e,t),nextMonth:Phe(s,r,e,t)}},[t,s.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:h,onMonthChange:g}=e,_=e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))),v=e=>{if(h)return;let t=i(e);n&&t<i(n)&&(t=i(n)),r&&t>i(r)&&(t=i(r)),c(t),g?.(t)};return{months:l,weeks:u,days:d,navStart:n,navEnd:r,previousMonth:p,nextMonth:m,goToMonth:v,goToDay:e=>{_(e)||v(e.date)}}}var G7;(function(e){e[e.Today=0]=`Today`,e[e.Selected=1]=`Selected`,e[e.LastFocused=2]=`LastFocused`,e[e.FocusedModifier=3]=`FocusedModifier`})(G7||={});function K7(e){return!e[d7.disabled]&&!e[d7.hidden]&&!e[d7.outside]}function Rhe(e,t,n,r){let i,a=-1;for(let o of e){let e=t(o);K7(e)&&(e[d7.focused]&&a<G7.FocusedModifier?(i=o,a=G7.FocusedModifier):r?.isEqualTo(o)&&a<G7.LastFocused?(i=o,a=G7.LastFocused):n(o.date)&&a<G7.Selected?(i=o,a=G7.Selected):e[d7.today]&&a<G7.Today&&(i=o,a=G7.Today))}return i||=e.find(e=>K7(t(e))),i}function zhe(e,t,n,r,i,a,o){let{ISOWeek:s,broadcastCalendar:c}=a,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:h,max:g,min:_,startOfBroadcastWeek:v,startOfISOWeek:y,startOfWeek:b}=o,x={day:l,week:d,month:u,year:f,startOfWeek:e=>c?v(e,o):s?y(e):b(e),endOfWeek:e=>c?p(e):s?m(e):h(e)}[e](n,t===`after`?1:-1);return t===`before`&&r?x=g([r,x]):t===`after`&&i&&(x=_([i,x])),x}function q7(e,t,n,r,i,a,o,s=0){if(s>365)return;let c=zhe(e,t,n.date,r,i,a,o),l=!!(a.disabled&&C7(c,a.disabled,o)),u=!!(a.hidden&&C7(c,a.hidden,o)),d=new l7(c,c,o);return!l&&!u?d:q7(e,t,d,r,i,a,o,s+1)}function Bhe(e,t,n,r,i){let{autoFocus:a}=e,[o,s]=(0,f.useState)(),c=Rhe(t.days,n,r||(()=>!1),o),[l,u]=(0,f.useState)(a?c:void 0);return{isFocusTarget:e=>!!c?.isEqualTo(e),setFocused:u,focused:l,blur:()=>{s(l),u(void 0)},moveFocus:(n,r)=>{if(!l)return;let a=q7(n,r,l,t.navStart,t.navEnd,e,i);a&&(e.disableNavigation&&!t.days.some(e=>e.isEqualTo(a))||(t.goToDay(a),u(a)))}}}function Vhe(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=W7(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t,l=e=>s?.some(t=>c(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(l(e)){if(s?.length===u||r&&s?.length===1)return;a=s?.filter(t=>!c(t,e))}else a=s?.length===d?[e]:[...a,e];return i||o(a),i?.(a,e,t,n),a},isSelected:l}}function Hhe(e,t,n=0,r=0,i=!1,a=c7){let{from:o,to:s}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=a,d;if(!o&&!s)d={from:e,to:n>0?void 0:e};else if(o&&!s)d=c(o,e)?n===0?{from:o,to:e}:i?{from:o,to:void 0}:void 0:u(e,o)?{from:e,to:o}:{from:o,to:e};else if(o&&s)if(c(o,e)&&c(s,e))d=i?{from:o,to:s}:void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,o))d={from:e,to:s};else if(l(e,o))d={from:o,to:e};else if(l(e,s))d={from:o,to:e};else throw Error(`Invalid range`);if(d?.from&&d?.to){let t=a.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}function Uhe(e,t,n=c7){let r=Array.isArray(t)?t:[t],i=e.from,a=n.differenceInCalendarDays(e.to,e.from),o=Math.min(a,6);for(let e=0;e<=o;e++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function J7(e,t,n=c7){return g7(e,t.from,!1,n)||g7(e,t.to,!1,n)||g7(t,e.from,!1,n)||g7(t,e.to,!1,n)}function Whe(e,t,n=c7){let r=Array.isArray(t)?t:[t];if(r.filter(e=>typeof e!=`function`).some(t=>typeof t==`boolean`?t:n.isDate(t)?g7(e,t,!1,n):S7(t,n)?t.some(t=>g7(e,t,!1,n)):v7(t)?t.from&&t.to?J7(e,{from:t.from,to:t.to},n):!1:x7(t)?Uhe(e,t.dayOfWeek,n):_7(t)?n.isAfter(t.before,t.after)?J7(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):C7(e.from,t,n)||C7(e.to,t,n):y7(t)||b7(t)?C7(e.from,t,n)||C7(e.to,t,n):!1))return!0;let i=r.filter(e=>typeof e==`function`);if(i.length){let t=e.from,r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function Ghe(e,t){let{disabled:n,excludeDisabled:r,resetOnSelect:i,selected:a,required:o,onSelect:s}=e,[c,l]=W7(a,s?a:void 0),u=s?a:c;return{selected:u,select:(a,c,d)=>{let{min:f,max:p}=e,m;if(a){let e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(a,e);m=i&&(r||!u?.from)?!o&&s?void 0:{from:a,to:void 0}:Hhe(a,u,f,p,o,t)}return r&&n&&m?.from&&m.to&&Whe({from:m.from,to:m.to},n,t)&&(m.from=a,m.to=void 0),s||l(m),s?.(m,a,c,d),m},isSelected:e=>u&&g7(u,e,!1,t)}}function Khe(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=W7(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!r&&s&&s&&c(e,s)&&(a=void 0),i||o(a),i?.(a,e,t,n),a},isSelected:e=>s?c(s,e):!1}}function qhe(e,t){let n=Khe(e,t),r=Vhe(e,t),i=Ghe(e,t);switch(e.mode){case`single`:return n;case`multiple`:return r;case`range`:return i;default:return}}function Y7(e,t){return e instanceof r7&&e.timeZone===t?e:new r7(e,t)}function X7(e,t,n){if(!n)return Y7(e,t);let r=Y7(e,t),i=new r7(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(i.getTime())}function Z7(e,t,n){return typeof e==`boolean`||typeof e==`function`?e:e instanceof Date?X7(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?X7(e,t,n):e):v7(e)?{...e,from:e.from?Y7(e.from,t):e.from,to:e.to?Y7(e.to,t):e.to}:_7(e)?{before:X7(e.before,t,n),after:X7(e.after,t,n)}:y7(e)?{after:X7(e.after,t,n)}:b7(e)?{before:X7(e.before,t,n)}:e}function Q7(e,t,n){return e&&(Array.isArray(e)?e.map(e=>Z7(e,t,n)):Z7(e,t,n))}function Jhe(e){let t=e,n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&=Y7(t.today,n),t.month&&=Y7(t.month,n),t.defaultMonth&&=Y7(t.defaultMonth,n),t.startMonth&&=Y7(t.startMonth,n),t.endMonth&&=Y7(t.endMonth,n),t.mode===`single`&&t.selected?t.selected=Y7(t.selected,n):t.mode===`multiple`&&t.selected?t.selected=t.selected?.map(e=>Y7(e,n)):t.mode===`range`&&t.selected&&(t.selected={from:t.selected.from?Y7(t.selected.from,n):t.selected.from,to:t.selected.to?Y7(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=Q7(t.disabled,n)),t.hidden!==void 0&&(t.hidden=Q7(t.hidden,n)),t.modifiers)){let e={};Object.keys(t.modifiers).forEach(r=>{e[r]=Q7(t.modifiers?.[r],n)}),t.modifiers=e}let{components:r,formatters:i,labels:a,dateLib:o,locale:s,classNames:c}=(0,f.useMemo)(()=>{let e={...o7,...t.locale},n=t.broadcastCalendar?1:t.weekStartsOn,r=t.noonSafe&&t.timeZone?whe(t.timeZone,{weekStartsOn:n,locale:e}):void 0,i=t.dateLib&&r?{...r,...t.dateLib}:t.dateLib??r,a=new s7({locale:e,weekStartsOn:n,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},i);return{dateLib:a,components:ihe(t.components),formatters:mhe(t.formatters),labels:yhe(t.labels,a.options),locale:e,classNames:{...w7(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:o.today()});let{captionLayout:l,mode:u,navLayout:d,numberOfMonths:p=1,onDayBlur:m,onDayClick:h,onDayFocus:g,onDayKeyDown:_,onDayMouseEnter:v,onDayMouseLeave:y,onNextClick:b,onPrevClick:x,showWeekNumber:S,styles:C}=t,{formatCaption:w,formatDay:T,formatMonthDropdown:E,formatWeekNumber:D,formatWeekNumberHeader:O,formatWeekdayName:k,formatYearDropdown:A}=i,j=Lhe(t,o),{days:M,months:N,navStart:ee,navEnd:P,previousMonth:F,nextMonth:I,goToMonth:L}=j,te=nhe(M,t,ee,P,o),{isSelected:ne,select:re,selected:ie}=qhe(t,o)??{},{blur:ae,focused:oe,isFocusTarget:se,moveFocus:ce,setFocused:le}=Bhe(t,j,te,ne??(()=>!1),o),{labelDayButton:ue,labelGridcell:de,labelGrid:fe,labelMonthDropdown:pe,labelNav:me,labelPrevious:he,labelNext:ge,labelWeekday:_e,labelWeekNumber:ve,labelWeekNumberHeader:ye,labelYearDropdown:be}=a,xe=(0,f.useMemo)(()=>She(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),Se=u!==void 0||h!==void 0,Ce=(0,f.useCallback)(()=>{F&&(L(F),x?.(F))},[F,L,x]),we=(0,f.useCallback)(()=>{I&&(L(I),b?.(I))},[L,I,b]),Te=(0,f.useCallback)((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),le(e),!t.disabled&&(re?.(e.date,t,n),h?.(e.date,t,n))},[re,h,le]),Ee=(0,f.useCallback)((e,t)=>n=>{le(e),g?.(e.date,t,n)},[g,le]),De=(0,f.useCallback)((e,t)=>n=>{ae(),m?.(e.date,t,n)},[ae,m]),Oe=(0,f.useCallback)((e,n)=>r=>{let i={ArrowLeft:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`after`:`before`],ArrowRight:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`before`:`after`],ArrowDown:[r.shiftKey?`year`:`week`,`after`],ArrowUp:[r.shiftKey?`year`:`week`,`before`],PageUp:[r.shiftKey?`year`:`month`,`before`],PageDown:[r.shiftKey?`year`:`month`,`after`],Home:[`startOfWeek`,`before`],End:[`endOfWeek`,`after`]};if(i[r.key]){r.preventDefault(),r.stopPropagation();let[e,t]=i[r.key];ce(e,t)}_?.(e.date,n,r)},[ce,_,t.dir]),ke=(0,f.useCallback)((e,t)=>n=>{v?.(e.date,t,n)},[v]),Ae=(0,f.useCallback)((e,t)=>n=>{y?.(e.date,t,n)},[y]),je=(0,f.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setMonth(o.startOfMonth(e),n))},[o,L]),Me=(0,f.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setYear(o.startOfMonth(e),n))},[o,L]),{className:Ne,style:Pe}=(0,f.useMemo)(()=>({className:[c[u7.Root],t.className].filter(Boolean).join(` `),style:{...C?.[u7.Root],...t.style}}),[c,t.className,t.style,C]),Fe=ahe(t),Ie=(0,f.useRef)(null);Ohe(Ie,!!t.animate,{classNames:c,months:N,focused:oe,dateLib:o});let Le={dayPickerProps:t,selected:ie,select:re,isSelected:ne,months:N,nextMonth:I,previousMonth:F,goToMonth:L,getModifiers:te,components:r,classNames:c,styles:C,labels:a,formatters:i};return f.default.createElement(m7.Provider,{value:Le},f.default.createElement(r.Root,{rootRef:t.animate?Ie:void 0,className:Ne,style:Pe,dir:t.dir,id:t.id,lang:t.lang??s.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t[`aria-label`],"aria-labelledby":t[`aria-labelledby`],...Fe},f.default.createElement(r.Months,{className:c[u7.Months],style:C?.[u7.Months]},!t.hideNavigation&&!d&&f.default.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[u7.Nav],style:C?.[u7.Nav],"aria-label":me(),onPreviousClick:Ce,onNextClick:we,previousMonth:F,nextMonth:I}),N.map((e,n)=>f.default.createElement(r.Month,{"data-animated-month":t.animate?`true`:void 0,className:c[u7.Month],style:C?.[u7.Month],key:n,displayIndex:n,calendarMonth:e},d===`around`&&!t.hideNavigation&&n===0&&f.default.createElement(r.PreviousMonthButton,{type:`button`,className:c[u7.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":he(F),onClick:Ce,"data-animated-button":t.animate?`true`:void 0},f.default.createElement(r.Chevron,{disabled:F?void 0:!0,className:c[u7.Chevron],orientation:t.dir===`rtl`?`right`:`left`})),f.default.createElement(r.MonthCaption,{"data-animated-caption":t.animate?`true`:void 0,className:c[u7.MonthCaption],style:C?.[u7.MonthCaption],calendarMonth:e,displayIndex:n},l?.startsWith(`dropdown`)?f.default.createElement(r.DropdownNav,{className:c[u7.Dropdowns],style:C?.[u7.Dropdowns]},(()=>{let n=l===`dropdown`||l===`dropdown-months`?f.default.createElement(r.MonthsDropdown,{key:`month`,className:c[u7.MonthsDropdown],"aria-label":pe(),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:je(e.date),options:bhe(e.date,ee,P,i,o),style:C?.[u7.Dropdown],value:o.getMonth(e.date)}):f.default.createElement(`span`,{key:`month`},E(e.date,o)),a=l===`dropdown`||l===`dropdown-years`?f.default.createElement(r.YearsDropdown,{key:`year`,className:c[u7.YearsDropdown],"aria-label":be(o.options),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:Me(e.date),options:Che(ee,P,i,o,!!t.reverseYears),style:C?.[u7.Dropdown],value:o.getYear(e.date)}):f.default.createElement(`span`,{key:`year`},A(e.date,o));return o.getMonthYearOrder()===`year-first`?[a,n]:[n,a]})(),f.default.createElement(`span`,{role:`status`,"aria-live":`polite`,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`}},w(e.date,o.options,o))):f.default.createElement(r.CaptionLabel,{className:c[u7.CaptionLabel],role:`status`,"aria-live":`polite`},w(e.date,o.options,o))),d===`around`&&!t.hideNavigation&&n===p-1&&f.default.createElement(r.NextMonthButton,{type:`button`,className:c[u7.NextMonthButton],tabIndex:I?void 0:-1,"aria-disabled":I?void 0:!0,"aria-label":ge(I),onClick:we,"data-animated-button":t.animate?`true`:void 0},f.default.createElement(r.Chevron,{disabled:I?void 0:!0,className:c[u7.Chevron],orientation:t.dir===`rtl`?`left`:`right`})),n===p-1&&d===`after`&&!t.hideNavigation&&f.default.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[u7.Nav],style:C?.[u7.Nav],"aria-label":me(),onPreviousClick:Ce,onNextClick:we,previousMonth:F,nextMonth:I}),f.default.createElement(r.MonthGrid,{role:`grid`,"aria-multiselectable":u===`multiple`||u===`range`,"aria-label":fe(e.date,o.options,o)||void 0,className:c[u7.MonthGrid],style:C?.[u7.MonthGrid]},!t.hideWeekdays&&f.default.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?`true`:void 0,className:c[u7.Weekdays],style:C?.[u7.Weekdays]},S&&f.default.createElement(r.WeekNumberHeader,{"aria-label":ye(o.options),className:c[u7.WeekNumberHeader],style:C?.[u7.WeekNumberHeader],scope:`col`},O()),xe.map(e=>f.default.createElement(r.Weekday,{"aria-label":_e(e,o.options,o),className:c[u7.Weekday],key:String(e),style:C?.[u7.Weekday],scope:`col`},k(e,o.options,o)))),f.default.createElement(r.Weeks,{"data-animated-weeks":t.animate?`true`:void 0,className:c[u7.Weeks],style:C?.[u7.Weeks]},e.weeks.map(e=>f.default.createElement(r.Week,{className:c[u7.Week],key:e.weekNumber,style:C?.[u7.Week],week:e},S&&f.default.createElement(r.WeekNumber,{week:e,style:C?.[u7.WeekNumber],"aria-label":ve(e.weekNumber,{locale:s}),className:c[u7.WeekNumber],scope:`row`,role:`rowheader`},D(e.weekNumber,o)),e.days.map(e=>{let{date:n}=e,i=te(e);if(i[d7.focused]=!i.hidden&&!!oe?.isEqualTo(e),i[f7.selected]=ne?.(n)||i.selected,v7(ie)){let{from:e,to:t}=ie;i[f7.range_start]=!!(e&&t&&o.isSameDay(n,e)),i[f7.range_end]=!!(e&&t&&o.isSameDay(n,t)),i[f7.range_middle]=g7(ie,n,!0,o)}let a=xhe(i,C,t.modifiersStyles),s=rhe(i,c,t.modifiersClassNames),l=!Se&&!i.hidden?de(n,i,o.options,o):void 0;return f.default.createElement(r.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:i,className:s.join(` `),style:a,role:`gridcell`,"aria-selected":i.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":i.selected||void 0,"data-disabled":i.disabled||void 0,"data-hidden":i.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":i.focused||void 0,"data-today":i.today||void 0},!i.hidden&&Se?f.default.createElement(r.DayButton,{className:c[u7.DayButton],style:C?.[u7.DayButton],type:`button`,day:e,modifiers:i,disabled:!i.focused&&i.disabled||void 0,"aria-disabled":i.focused&&i.disabled||void 0,tabIndex:se(e)?0:-1,"aria-label":ue(n,i,o.options,o),onClick:Te(e,i),onBlur:De(e,i),onFocus:Ee(e,i),onKeyDown:Oe(e,i),onMouseEnter:ke(e,i),onMouseLeave:Ae(e,i)},T(n,o.options,o)):!i.hidden&&T(e.date,o.options,o))})))))))),t.footer&&f.default.createElement(r.Footer,{className:c[u7.Footer],style:C?.[u7.Footer],role:`status`,"aria-live":`polite`},t.footer)))}function Yhe({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r=`label`,buttonVariant:i=`ghost`,locale:a,formatters:o,components:s,...c}){let l=w7();return(0,m.jsx)(Jhe,{showOutsideDays:n,className:z(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,locale:a,formatters:{formatMonthDropdown:e=>e.toLocaleString(a?.code,{month:`short`}),...o},classNames:{root:z(`w-fit`,l.root),months:z(`relative flex flex-col gap-4 md:flex-row`,l.months),month:z(`flex w-full flex-col gap-4`,l.month),nav:z(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,l.nav),button_previous:z(gg({variant:i}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,l.button_previous),button_next:z(gg({variant:i}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,l.button_next),month_caption:z(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,l.month_caption),dropdowns:z(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,l.dropdowns),dropdown_root:z(`relative rounded-(--cell-radius)`,l.dropdown_root),dropdown:z(`absolute inset-0 bg-popover opacity-0`,l.dropdown),caption_label:z(`font-medium select-none`,r===`label`?`text-sm`:`flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,l.caption_label),table:`w-full border-collapse`,weekdays:z(`flex`,l.weekdays),weekday:z(`flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none`,l.weekday),week:z(`mt-2 flex w-full`,l.week),week_number_header:z(`w-(--cell-size) select-none`,l.week_number_header),week_number:z(`text-[0.8rem] text-muted-foreground select-none`,l.week_number),day:z(`group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)`,c.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)`:`[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)`,l.day),range_start:z(`relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted`,l.range_start),range_middle:z(`rounded-none`,l.range_middle),range_end:z(`relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted`,l.range_end),today:z(`rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none`,l.today),outside:z(`text-muted-foreground aria-selected:text-muted-foreground`,l.outside),disabled:z(`text-muted-foreground opacity-50`,l.disabled),hidden:z(`invisible`,l.hidden),...t},components:{Root:({className:e,rootRef:t,...n})=>(0,m.jsx)(`div`,{"data-slot":`calendar`,ref:t,className:z(e),...n}),Chevron:({className:e,orientation:t,...n})=>t===`left`?(0,m.jsx)(yw,{className:z(`size-4`,e),...n}):t===`right`?(0,m.jsx)(bw,{className:z(`size-4`,e),...n}):(0,m.jsx)(vw,{className:z(`size-4`,e),...n}),DayButton:({...e})=>(0,m.jsx)(Xhe,{locale:a,...e}),WeekNumber:({children:e,...t})=>(0,m.jsx)(`td`,{...t,children:(0,m.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:e})}),...s},...c})}function Xhe({className:e,day:t,modifiers:n,locale:r,...i}){let a=w7(),o=d.useRef(null);return d.useEffect(()=>{n.focused&&o.current?.focus()},[n.focused]),(0,m.jsx)(B,{ref:o,variant:`ghost`,size:`icon`,"data-day":t.date.toLocaleDateString(r?.code),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:z(`relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70`,a.day,e),...i})}function Zhe({className:e,...t}){return(0,m.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:z(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var Qhe=je(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function $he({className:e,align:t=`inline-start`,...n}){return(0,m.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:z(Qhe({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}function ege({className:e,...t}){return(0,m.jsx)(`span`,{className:z(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...t})}function tge({className:e,...t}){return(0,m.jsx)(Dg,{"data-slot":`input-group-control`,className:z(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}function nge({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...a}){let o=d.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return(0,m.jsxs)(one,{"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,className:z(`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,e),...a,children:[(0,m.jsx)(une,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-muted data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1`,children:(0,m.jsx)(dne,{"data-slot":`slider-range`,className:`absolute bg-primary select-none data-horizontal:h-full data-vertical:w-full`})}),Array.from({length:o.length},(e,t)=>(0,m.jsx)(hne,{"data-slot":`slider-thumb`,className:`relative block size-3 shrink-0 rounded-full border border-ring bg-white ring-ring/50 transition-[color,box-shadow] select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50`},t))]})}function rge(e){if(!e)return;let t=u.xt(e).trim();return t.length>0?t:void 0}var $7=({title:e,subtitle:t,topContent:n,bottomContent:r,footer:i,resolveImageAssetUrl:a,legendFallback:o=`Question`,className:s,children:c})=>{let l=rge(e)??o;return(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsxs)(qT,{className:z(`rounded-xl border border-border bg-card pb-2`,s),children:[(0,m.jsxs)(`div`,{className:`px-4 pt-4`,children:[(0,m.jsx)(JT,{className:`sr-only`,children:l}),e?(0,m.jsx)(`div`,{"aria-hidden":`true`,children:(0,m.jsx)(h3,{content:e,resolveImageAssetUrl:a,className:`[--rich-text-editor-font-weight-strong:800]`,paragraphClassName:`text-lg font-medium`,minHeadingLevel:2,headingLevelOffset:1})}):null,t?(0,m.jsx)(h3,{content:t,resolveImageAssetUrl:a,paragraphClassName:`text-sm leading-relaxed text-muted-foreground italic`,minHeadingLevel:3,headingLevelOffset:1}):null,n?(0,m.jsx)(`div`,{className:`pt-3`,children:(0,m.jsx)(h3,{content:n,resolveImageAssetUrl:a,paragraphClassName:`text-sm`,minHeadingLevel:3,headingLevelOffset:1})}):null]}),c,r?(0,m.jsx)(`div`,{className:`px-4 pb-2`,children:(0,m.jsx)(h3,{content:r,resolveImageAssetUrl:a,paragraphClassName:`text-sm`,minHeadingLevel:3,headingLevelOffset:1})}):null]}),i?(0,m.jsx)(`div`,{className:`px-3`,children:(0,m.jsx)(h3,{content:i,resolveImageAssetUrl:a,paragraphClassName:`text-xs text-muted-foreground`,minHeadingLevel:3,headingLevelOffset:1})}):null]})},ige=z(`grid gap-x-4 gap-y-6`,`grid-cols-[repeat(var(--form-group-cols-base),minmax(0,1fr))]`,`@xs/form-field-group:grid-cols-[repeat(var(--form-group-cols-xs),minmax(0,1fr))]`,`@sm/form-field-group:grid-cols-[repeat(var(--form-group-cols-sm),minmax(0,1fr))]`,`@md/form-field-group:grid-cols-[repeat(var(--form-group-cols-md),minmax(0,1fr))]`,`@xl/form-field-group:grid-cols-[repeat(var(--form-group-cols-xl),minmax(0,1fr))]`),e9=`!bg-card dark:!bg-card`;function age(e,t,n){let r=e?.clone()??new u.k;return r.setSlotValue(t,n),r.isEmpty()?void 0:r}function t9(e){return e.key}function oge(e,t){return e?.get(t9(t))!==void 0}function n9(e,t){let n=e?.get(t9(t));return n?.type===u.gt.string?n.value:void 0}function r9(e,t){let n=e?.get(t9(t));return n?.type===u.gt.number?n.value:void 0}function i9(e,t){let n=e?.get(t9(t));return n?.type===u.gt.boolean?n.value:void 0}function a9(e,t){let n=e?.get(t9(t));return n?.type===u.gt.date?n.value:void 0}var o9=1900,s9=2100,c9=Array.from({length:s9-o9+1},(e,t)=>s9-t);function sge(e){let t=e.trim().toLowerCase(),n=t.split(`-`)[0];return t===`de`||n===`de`?xe:t===`nl`||n===`nl`?Ee:u.I}function l9(e){if(e===void 0)return;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?void 0:t}function cge(e,t){return t===`year`?new Date(e.getFullYear(),0,1):t===`year-month`?new Date(e.getFullYear(),e.getMonth(),1):new Date(e.getFullYear(),e.getMonth(),e.getDate())}function lge(e){return Math.floor(e.getTime()/1e3)}function uge(e,t,n){let r=l9(e);if(r)return t===`year`?u.N(r,`yyyy`,{locale:n}):t===`year-month`?u.N(r,`MMMM yyyy`,{locale:n}):u.N(r,`PPP`,{locale:n})}function dge(e,t){return e.placeholder?.trim()?e.placeholder:e.mode===`year`?t(`datePickerSelectYear`):e.mode===`year-month`?t(`datePickerSelectMonthAndYear`):t(`datePickerSelectDate`)}function fge(e,t){switch(t.type){case`switch`:return oge(e,t);case`number`:case`slider`:return r9(e,t)!==void 0;case`datepicker`:return a9(e,t)!==void 0;default:{let n=n9(e,t);return typeof n==`string`&&n.length>0}}}function pge(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function mge(e){try{return new URL(e),!0}catch{return!1}}function u9(e){if(!e?.trim())return;let t=new Date(`${e}T00:00:00`).getTime();return Number.isNaN(t)?void 0:t}function d9(e,t,n){return t?.trim()||e.errorMessage?.trim()||n}function hge(e,t,n,r){if(!n.has(t9(e)))return;let i=n9(t,e)?.trim(),a=r9(t,e),o=i9(t,e),s=a9(t,e),c=fge(t,e);for(let t of e.validations)switch(t.type){case`required`:if(!c)return d9(e,t.message,r(`requiredError`));break;case`minLength`:if(i!==void 0&&typeof t.value==`number`&&i.length<t.value)return d9(e,t.message,r(`invalidError`));break;case`maxLength`:if(i!==void 0&&typeof t.value==`number`&&i.length>t.value)return d9(e,t.message,r(`invalidError`));break;case`pattern`:if(i!==void 0&&typeof t.value==`string`)try{if(!new RegExp(t.value).test(i))return d9(e,t.message,r(`invalidError`))}catch{}break;case`email`:if(i!==void 0&&!pge(i))return d9(e,t.message,r(`invalidError`));break;case`url`:if(i!==void 0&&!mge(i))return d9(e,t.message,r(`invalidError`));break;case`integer`:if(a!==void 0&&!Number.isInteger(a))return d9(e,t.message,r(`invalidError`));break;case`min`:if(a!==void 0&&typeof t.value==`number`&&a<t.value)return d9(e,t.message,r(`invalidError`));break;case`max`:if(a!==void 0&&typeof t.value==`number`&&a>t.value)return d9(e,t.message,r(`invalidError`));break;case`minDate`:{let n=typeof t.value==`string`?u9(t.value):void 0;if(s!==void 0&&n!==void 0&&s*1e3<n)return d9(e,t.message,r(`invalidError`));break}case`maxDate`:{let n=typeof t.value==`string`?u9(t.value):void 0;if(s!==void 0&&n!==void 0&&s*1e3>n)return d9(e,t.message,r(`invalidError`));break}case`mustBeTrue`:if(o!==!0)return d9(e,t.message,r(`invalidError`));break;default:break}}function gge({controlId:e,controller:t,value:n,describedBy:r,invalid:i,readOnly:a,onTouched:o,onValueChange:s}){let[c,l]=(0,d.useState)(!1),{locale:f}=Zg(),p=Qg(`defaultRenderers.form`),h=sge(f),g=l9(n),[_,v]=(0,d.useState)(g?.getFullYear()),[y,b]=(0,d.useState)(g?.getMonth()),x=uge(n,t.mode,h),S=Array.from({length:12},(e,t)=>({value:String(t),label:u.N(new Date(2e3,t,1),`MMMM`,{locale:h})})),C=e=>{s(e?lge(cge(e,t.mode)):void 0),o()},w=e=>{if(l(e),e){v(g?.getFullYear()),b(g?.getMonth());return}o()},T=(e,t)=>{e===void 0||t===void 0||(C(new Date(e,t,1)),l(!1))},E=g?(0,m.jsx)(`div`,{className:`mt-3 flex justify-end border-t pt-3`,children:(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:a,onClick:()=>{C(void 0),l(!1)},children:p(`clearDateSelection`)})}):null;return(0,m.jsxs)(zD,{open:c,onOpenChange:w,children:[(0,m.jsx)(BD,{asChild:!0,children:(0,m.jsxs)(B,{id:e,type:`button`,variant:`outline`,className:z(`w-full justify-start text-left font-normal active:scale-100`,e9,!x&&`text-muted-foreground`),"aria-describedby":r,"aria-invalid":i||void 0,disabled:a,children:[(0,m.jsx)(gw,{"data-icon":`inline-start`}),x??(0,m.jsx)(`span`,{children:dge(t,p)})]})}),t.mode===`year`?(0,m.jsxs)(VD,{align:`start`,className:`w-52 p-3`,children:[(0,m.jsx)(YT,{children:(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`${e}-year`,children:p(`datePickerYearLabel`)}),(0,m.jsxs)(G4,{value:_===void 0?void 0:String(_),onValueChange:e=>{let t=Number(e);v(t),C(new Date(t,0,1)),l(!1)},children:[(0,m.jsx)(J4,{id:`${e}-year`,className:z(`w-full`,e9),children:(0,m.jsx)(q4,{placeholder:p(`datePickerSelectYear`)})}),(0,m.jsx)(Y4,{children:(0,m.jsx)(K4,{children:c9.map(e=>(0,m.jsx)(X4,{value:String(e),children:e},e))})})]})]})}),E]}):null,t.mode===`year-month`?(0,m.jsxs)(VD,{align:`start`,className:`w-72 p-3`,children:[(0,m.jsxs)(YT,{className:`gap-3 @sm/field-group:grid @sm/field-group:grid-cols-2`,children:[(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`${e}-year`,children:p(`datePickerYearLabel`)}),(0,m.jsxs)(G4,{value:_===void 0?void 0:String(_),onValueChange:e=>{let t=Number(e);v(t),T(t,y)},children:[(0,m.jsx)(J4,{id:`${e}-year`,className:z(`w-full`,e9),children:(0,m.jsx)(q4,{placeholder:p(`datePickerSelectYear`)})}),(0,m.jsx)(Y4,{children:(0,m.jsx)(K4,{children:c9.map(e=>(0,m.jsx)(X4,{value:String(e),children:e},e))})})]})]}),(0,m.jsxs)(ZT,{children:[(0,m.jsx)($T,{htmlFor:`${e}-month`,children:p(`datePickerMonthLabel`)}),(0,m.jsxs)(G4,{value:y===void 0?void 0:String(y),onValueChange:e=>{let t=Number(e);b(t),T(_,t)},children:[(0,m.jsx)(J4,{id:`${e}-month`,className:z(`w-full`,e9),children:(0,m.jsx)(q4,{placeholder:p(`datePickerSelectMonth`)})}),(0,m.jsx)(Y4,{children:(0,m.jsx)(K4,{children:S.map(e=>(0,m.jsx)(X4,{value:e.value,children:e.label},e.value))})})]})]})]}),E]}):null,t.mode===`year-month-day`?(0,m.jsx)(VD,{align:`start`,className:`w-auto p-0`,children:(0,m.jsxs)(`div`,{className:`p-0`,children:[(0,m.jsx)(Yhe,{mode:`single`,selected:g,captionLayout:`dropdown`,locale:h,startMonth:new Date(o9,0),endMonth:new Date(s9,11),onSelect:e=>{C(e),e&&l(!1)}}),g?(0,m.jsx)(`div`,{className:`flex justify-end border-t p-3 pt-2`,children:(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:a,onClick:()=>{C(void 0),l(!1)},children:p(`clearDateSelection`)})}):null]})}):null]})}var f9=({itemId:e,groups:t,currentResponse:n,onResponseChange:r,readOnly:i=!1,controlIdPrefix:a,className:o,emptyState:s=(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No fields available.`})})=>{let[c,l]=(0,d.useState)(()=>new Set),f=Qg(`defaultRenderers.form`),p=e=>{let t=t9(e);l(e=>{if(e.has(t))return e;let n=new Set(e);return n.add(t),n})},h=(e,t,i)=>{i?.touched&&p(e),r?.(age(n,t9(e),t))},g=t=>{let r=`${a??`player-${e}`}-${t.id}`,o=`${r}-label`,s=t.description?.trim()?`${r}-description`:void 0,l=hge(t,n,c,f),d=l?`${r}-error`:void 0,g=[s,d].filter(Boolean).join(` `)||void 0,_=!!l,v=t.label?.trim()||t.key;switch(t.type){case`textarea`:{let e=t.controller,a=n9(n,t)??``;return(0,m.jsxs)(ZT,{className:`gap-1`,"data-invalid":_?`true`:void 0,children:[(0,m.jsxs)($T,{id:o,htmlFor:r,children:[v,t.required?(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[` `,`*`]}):null]}),(0,m.jsx)(e3,{id:r,rows:e.rows,placeholder:e.placeholder,value:a,className:e9,"aria-describedby":g,"aria-invalid":_||void 0,disabled:i,onBlur:()=>p(t),onChange:e=>{h(t,e.target.value?{type:u.gt.string,value:e.target.value}:void 0)}}),s?(0,m.jsx)(tE,{className:`text-xs`,id:s,children:t.description}):null,l?(0,m.jsx)(nE,{id:d,children:l}):null]},t.id)}case`number`:{let e=t.controller,a=r9(n,t),c={id:r,type:`number`,inputMode:`decimal`,placeholder:e.placeholder,value:a??e.defaultValue??``,step:e.step,"aria-describedby":g,"aria-invalid":_||void 0,disabled:i,onBlur:()=>p(t),onChange:e=>{let n=e.target.value;if(n===``){h(t,void 0);return}let r=Number(n);Number.isFinite(r)&&h(t,{type:u.gt.number,value:r})}};return(0,m.jsxs)(ZT,{"data-invalid":_?`true`:void 0,children:[(0,m.jsxs)($T,{id:o,htmlFor:r,children:[v,t.required?(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[` `,`*`]}):null]}),e.unit?(0,m.jsxs)(Zhe,{className:e9,children:[(0,m.jsx)(tge,{...c}),(0,m.jsx)($he,{align:`inline-end`,children:(0,m.jsx)(ege,{children:e.unit})})]}):(0,m.jsx)(Dg,{...c,className:e9}),s?(0,m.jsx)(tE,{id:s,className:`text-xs`,children:t.description}):null,l?(0,m.jsx)(nE,{id:d,children:l}):null]},t.id)}case`datepicker`:{let e=t.controller,a=a9(n,t);return(0,m.jsxs)(ZT,{"data-invalid":_?`true`:void 0,children:[(0,m.jsxs)($T,{id:o,htmlFor:r,children:[v,t.required?(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[` `,`*`]}):null]}),(0,m.jsx)(gge,{controlId:r,controller:e,value:a,describedBy:g,invalid:_,readOnly:i,onTouched:()=>p(t),onValueChange:e=>{h(t,e===void 0?void 0:{type:u.gt.date,value:e})}}),s?(0,m.jsx)(tE,{id:s,className:`text-xs`,children:t.description}):null,l?(0,m.jsx)(nE,{id:d,children:l}):null]},t.id)}case`switch`:{let e=t.controller,a=i9(n,t)??e.defaultChecked??!1,o=a?e.checkedLabel?.trim():e.uncheckedLabel?.trim();return(0,m.jsx)($T,{htmlFor:r,className:`border-border`,children:(0,m.jsxs)(ZT,{orientation:`horizontal`,"data-disabled":i?`true`:void 0,"data-invalid":_?`true`:void 0,children:[(0,m.jsxs)(QT,{children:[(0,m.jsxs)(eE,{children:[v,t.required?(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[` `,`*`]}):null]}),s?(0,m.jsx)(tE,{id:s,className:`text-xs`,children:t.description}):null,o?(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o}):null,l?(0,m.jsx)(nE,{id:d,children:l}):null]}),(0,m.jsx)(rE,{id:r,checked:a,disabled:i,"aria-describedby":g,"aria-invalid":_||void 0,onCheckedChange:e=>{h(t,{type:u.gt.boolean,value:e},{touched:!0})}})]})},t.id)}case`select`:{let e=t.controller,a=n9(n,t),c=!!(e.allowClear&&a),y=e.allowClear===!0,b=(0,m.jsxs)(G4,{value:a??``,onOpenChange:e=>{e||p(t)},onValueChange:e=>{h(t,e===``?void 0:{type:u.gt.string,value:e},{touched:!0})},disabled:i,children:[(0,m.jsx)(J4,{id:r,className:z(`min-w-0 py-2 outline-none`,e9,y?z(`h-8 flex-1 border-0 bg-transparent shadow-none ring-0 data-[size=default]:h-8 data-[size=sm]:h-7`,`rounded-none focus-visible:z-10 focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset`,c?`rounded-l-lg rounded-r-none pr-1 pl-2.5`:`rounded-lg`):`w-full`),"aria-labelledby":o,"aria-describedby":g,"aria-invalid":_||void 0,children:(0,m.jsx)(q4,{placeholder:e.placeholder||`Select an option`})}),(0,m.jsx)(Y4,{children:(0,m.jsx)(K4,{children:e.options.map(e=>(0,m.jsx)(X4,{value:e.value,children:e.label?.trim()||e.value},e.id))})})]});return(0,m.jsxs)(ZT,{"data-invalid":_?`true`:void 0,children:[(0,m.jsxs)($T,{id:o,children:[v,t.required?(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[` `,`*`]}):null]}),y?(0,m.jsxs)(`div`,{"data-slot":`button-group`,role:`group`,className:z(`flex w-full min-w-0 rounded-lg border border-input bg-transparent transition-colors select-none`,e9,`focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,`dark:bg-input/30 dark:hover:bg-input/50`,_&&`border-destructive ring-3 ring-destructive/20 dark:border-destructive/50 dark:ring-destructive/40`,i&&`opacity-50`),children:[b,c?(0,m.jsx)(B,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":f(`clearSelection`,{label:v}),disabled:i,onClick:e=>{e.preventDefault(),e.stopPropagation(),h(t,void 0,{touched:!0})},children:(0,m.jsx)(GT,{})}):null]}):b,s?(0,m.jsx)(tE,{id:s,className:`text-xs`,children:t.description}):null,l?(0,m.jsx)(nE,{id:d,children:l}):null]},t.id)}case`slider`:{let e=t.controller,r=r9(n,t)??e.defaultValue??e.min??0;return(0,m.jsxs)(ZT,{"data-invalid":_?`true`:void 0,children:[(0,m.jsxs)($T,{id:o,children:[v,t.required?(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[` `,`*`]}):null]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsx)(nge,{value:[r],min:e.min,max:e.max,step:e.step,disabled:i,"aria-labelledby":o,"aria-describedby":g,"aria-invalid":_||void 0,onValueChange:e=>{let n=e[0];typeof n==`number`&&h(t,{type:u.gt.number,value:n})},onValueCommit:()=>p(t)}),e.showValue?(0,m.jsx)(`output`,{className:`w-12 shrink-0 text-right text-sm font-medium text-foreground`,children:r}):null]}),s?(0,m.jsx)(tE,{id:s,className:`text-xs`,children:t.description}):null,l?(0,m.jsx)(nE,{id:d,children:l}):null]},t.id)}default:{let e=t.controller,a=n9(n,t)??``;return(0,m.jsxs)(ZT,{"data-invalid":_?`true`:void 0,children:[(0,m.jsxs)($T,{id:o,htmlFor:r,children:[v,t.required?(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-destructive`,children:[` `,`*`]}):null]}),(0,m.jsx)(Dg,{id:r,type:e.inputMode===`password`?`password`:`text`,inputMode:e.inputMode===`password`?void 0:e.inputMode,autoComplete:e.autocomplete,placeholder:e.placeholder,value:a,className:e9,"aria-describedby":g,"aria-invalid":_||void 0,disabled:i,onBlur:()=>p(t),onChange:e=>{h(t,e.target.value?{type:u.gt.string,value:e.target.value}:void 0)}}),s?(0,m.jsx)(tE,{id:s,className:`text-xs`,children:t.description}):null,l?(0,m.jsx)(nE,{id:d,children:l}):null]},t.id)}}};return(0,m.jsx)(`div`,{className:z(`flex flex-col gap-4`,o),children:t.length>0?t.map(t=>{let n=t.title?.trim(),r=t.description?.trim(),i=r?`player-${e}-${t.id}-description`:void 0,a=t.fields.length>0?(0,m.jsx)(`div`,{className:`@container/form-field-group`,style:u._(t.layout),children:(0,m.jsx)(YT,{className:ige,children:t.fields.map(g)})}):(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No fields available.`});return n?(0,m.jsxs)(qT,{className:`gap-3`,"aria-describedby":i,children:[(0,m.jsx)(JT,{variant:`label`,children:n}),r?(0,m.jsx)(tE,{id:i,children:r}):null,a]},t.id):(0,m.jsxs)(`div`,{className:`space-y-3`,children:[r?(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,a]},t.id)}):s})},_ge=({itemId:e,title:t,subtitle:n,topContent:r,bottomContent:i,footer:a,resolveImageAssetUrl:o,groups:s,currentResponse:c,onResponseChange:l,readOnly:u=!1})=>(0,m.jsx)($7,{title:t,subtitle:n,topContent:r,bottomContent:i,footer:a,resolveImageAssetUrl:o,legendFallback:`Form`,className:`gap-3`,children:(0,m.jsx)(`div`,{className:`px-4 pb-2`,children:(0,m.jsx)(f9,{itemId:e,groups:s,currentResponse:c,onResponseChange:l,readOnly:u})})});function vge(e){if(!e)return;let t=u.xt(e).trim();return t.length>0?t:void 0}function p9(e){return vge(e.labelContent)??e.label}var m9=`flex w-full cursor-pointer items-start gap-3 px-4 py-2 transition-colors hover:bg-muted/60 has-[:disabled]:cursor-not-allowed has-[:disabled]:hover:bg-transparent`,h9=`flex min-w-0 flex-1 flex-col`;function g9(e,t){if(!e)return;let n=t.target;if(n?.closest(`[data-choice-embedded-form]`))return;let r=t.target;e===r||e.contains(r)||n?.closest(`a[href], button`)||e.click()}function _9({text:e,content:t,className:n}){return t?(0,m.jsx)(h3,{content:t,className:n,paragraphClassName:n,minHeadingLevel:3,headingLevelOffset:1}):(0,m.jsx)(`span`,{className:n,children:e})}function yge(e,t,n){let r=e?.clone()??new u.k;return r.setSlotValue(t,{type:u.gt.reference,value:n}),r}function bge(e,t,n){let r=e?.clone()??new u.k;return r.setSlotValue(t,n.length>0?{type:u.gt.referenceArray,value:n}:void 0),r}function v9(e,t){for(let n of t.embeddedFormGroups??[])for(let r of n.fields)e.setSlotValue(u.l(t.id,r.key),void 0)}function y9(e){return e.isEmpty()?void 0:e}function b9(e,t){let n=t.embeddedFormGroups?.flatMap(n=>n.fields.flatMap(n=>{let r=e?.get(u.l(t.id,n.key));return r?[[n.key,r]]:[]}))??[];return n.length>0?new u.k(n):void 0}function xge(e,t){return b9(e,t)!==void 0}function x9({option:e,itemId:t,controlIdPrefix:n,currentResponse:r,readOnly:i,open:a,onResponseChange:o}){return(e.embeddedFormGroups?.length??0)===0?null:(0,m.jsx)(s3,{open:a,children:(0,m.jsx)(l3,{className:`grid transition-[grid-template-rows,opacity] duration-200 ease-out data-[state=closed]:grid-rows-[0fr] data-[state=open]:grid-rows-[1fr] data-[state=closed]:opacity-0 data-[state=open]:opacity-100`,children:(0,m.jsx)(`div`,{className:`overflow-hidden`,children:(0,m.jsx)(`div`,{className:`my-2 rounded-lg border border-border/70 bg-muted/25 p-3`,children:(0,m.jsx)(f9,{itemId:t,groups:e.embeddedFormGroups??[],currentResponse:b9(r,e),onResponseChange:t=>{let n=r?.clone()??new u.k;for(let r of e.embeddedFormGroups??[])for(let i of r.fields)n.setSlotValue(u.l(e.id,i.key),t?.get(i.key));o?.(y9(n))},readOnly:i,controlIdPrefix:`${n}-${e.id}-embedded`,className:`gap-5`,emptyState:null})})})})})}var Sge=({itemId:e,title:t,subtitle:n,topContent:r,bottomContent:i,footer:a,resolveImageAssetUrl:o,maxSelection:s,options:c,emptyState:l,legendFallback:f=`Question`,responseSlotId:p,currentResponse:h,onResponseChange:g,name:_,controlIdPrefix:v=`choice-question`,readOnly:y=!1})=>{let b=Mg(),x=Qg(`defaultRenderers.choice`),S=(0,d.useRef)({}),C=h?.get(p),w=C?.type===u.gt.reference?C.value:void 0,T=C?.type===u.gt.referenceArray?C.value:[],E=!u.i(s),D=s,O=D!==null&&T.length>=D,k=async e=>xge(h,e)?b({title:x(`embeddedFormResetTitle`),description:x(`embeddedFormResetDescription`,{optionLabel:p9(e)}),confirmButtonText:x(`embeddedFormResetConfirm`),cancelButtonText:x(`embeddedFormResetCancel`),variant:`destructive`}):!0;return(0,m.jsx)($7,{title:t,subtitle:n,topContent:r,bottomContent:i,footer:a,resolveImageAssetUrl:o,legendFallback:f,className:`has-[>[data-slot=checkbox-group]]:gap-2 has-[>[data-slot=radio-group]]:gap-2`,children:(0,m.jsx)(m.Fragment,{children:c.length===0?(0,m.jsx)(`p`,{className:`px-4 py-2 text-sm text-muted-foreground`,children:l}):E?(0,m.jsx)(`div`,{"data-slot":`checkbox-group`,className:`flex flex-col gap-0`,children:c.map(t=>{let n=`${v}-${t.id}`,r=`${n}-label`,i=p9(t),a=T.includes(t.id),o=y||t.disabled===!0||!a&&O;return(0,m.jsx)(ZT,{orientation:`horizontal`,"data-disabled":o?`true`:void 0,className:`items-stretch p-0`,children:(0,m.jsxs)(`div`,{className:m9,onClick:e=>{o||g9(S.current[n],e)},children:[(0,m.jsx)(yme,{id:n,ref:e=>{S.current[n]=e},checked:a,disabled:o,className:`mt-1`,"aria-labelledby":r,onCheckedChange:e=>{(async()=>{if(y||!g||e!==!0&&!await k(t))return;let n=bge(h,p,e===!0?T.includes(t.id)||D!==null&&T.length>=D?T:[...T,t.id]:T.filter(e=>e!==t.id));e!==!0&&v9(n,t),g(y9(n))})()}}),(0,m.jsxs)(`div`,{className:h9,children:[(0,m.jsx)(`div`,{id:r,className:`min-w-0 flex-1`,children:(0,m.jsx)(_9,{text:i,content:t.labelContent,className:`text-base text-foreground`})}),(0,m.jsx)(`div`,{"data-choice-embedded-form":!0,children:(0,m.jsx)(x9,{option:t,itemId:e,controlIdPrefix:v,currentResponse:h,readOnly:y||!a,open:a,onResponseChange:g})})]})]})},t.id)})}):(0,m.jsx)(oB,{name:_,value:w,onValueChange:e=>{(async()=>{if(y||!g)return;let t=c.find(e=>e.id===w);if(t&&t.id!==e&&!await k(t))return;let n=yge(h,p,e);for(let t of c)t.id!==e&&v9(n,t);g(y9(n))})()},className:`gap-0`,children:c.map(t=>{let n=`${v}-${t.id}`,r=`${n}-label`,i=p9(t),a=y||t.disabled===!0;return(0,m.jsx)(ZT,{orientation:`horizontal`,"data-disabled":a?`true`:void 0,className:`items-stretch p-0`,children:(0,m.jsxs)(`div`,{className:m9,onClick:e=>{a||g9(S.current[n],e)},children:[(0,m.jsx)(sB,{id:n,ref:e=>{S.current[n]=e},value:t.id,disabled:a,className:`mt-1`,"aria-labelledby":r}),(0,m.jsxs)(`div`,{className:h9,children:[(0,m.jsx)(`div`,{id:r,className:`min-w-0 flex-1`,children:(0,m.jsx)(_9,{text:i,content:t.labelContent,className:`text-base text-foreground`})}),(0,m.jsx)(`div`,{"data-choice-embedded-form":!0,children:(0,m.jsx)(x9,{option:t,itemId:e,controlIdPrefix:v,currentResponse:h,readOnly:y||w!==t.id,open:w===t.id,onResponseChange:g})})]})]})},t.id)})})})})};function Cge(e){if(!e)return;let t=u.xt(e).trim();return t.length>0?t:void 0}var S9=({content:e,resolveImageAssetUrl:t,legendFallback:n=`Information`,emptyState:r})=>(0,m.jsx)(`div`,{className:`space-y-1`,children:(0,m.jsx)(qT,{className:`rounded-xl border border-border bg-card pb-2`,children:(0,m.jsxs)(`div`,{className:`px-4 pt-4 pb-2`,children:[(0,m.jsx)(JT,{className:`sr-only`,children:Cge(e)??n}),e?(0,m.jsx)(h3,{content:e,resolveImageAssetUrl:t,paragraphClassName:`text-sm`,minHeadingLevel:2,headingLevelOffset:1}):r??null]})})});function C9(e){return u.wt(e)?void 0:e}var wge=e=>({type:u.tt.plain,content:e});function w9(e,t,n){return{title:C9(e?.getContent(t,`title`))??wge(n),subtitle:C9(e?.getContent(t,`subtitle`)),topContent:C9(e?.getContent(t,`topContent`)),bottomContent:C9(e?.getContent(t,`bottomContent`)),footer:C9(e?.getContent(t,`cardFooter`))}}function Tge(e){let{locale:t,survey:n}=Zg(),r=Qg(`contentAvailability`),{itemTranslations:i}=n_(),a=C9(i?.getContent(t,`content`));return(0,m.jsx)(S9,{content:a,resolveImageAssetUrl:e=>U3(n.getAsset(e)),emptyState:(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`noContentForLocale`,{locale:t})})})}function Ege(e){let{locale:t,survey:n,surveyEngine:r}=Zg(),i=Qg(`contentAvailability`),{item:a,itemTranslations:o}=n_(),{currentResponse:s,setResponse:c}=r_(),{title:l,subtitle:d,topContent:f,bottomContent:p,footer:h}=w9(o,t,i(`noTitleForLocale`,{locale:t})),g=e=>U3(n.getAsset(e)),_=u.T(u.w(a.config,a.id),o,t).fieldGroups.filter(e=>r.getDisplayConditionValue(a.id,e.id)!==!1);return(0,m.jsx)(_ge,{itemId:a.id,title:l,subtitle:d,topContent:f,bottomContent:p,footer:h,resolveImageAssetUrl:g,groups:_,currentResponse:s,onResponseChange:c})}function Dge(e){let{locale:t,survey:n,surveyEngine:r}=Zg(),i=Qg(`contentAvailability`),{item:a,itemTranslations:o}=n_(),{currentResponse:s,setResponse:c}=r_(),{title:l,subtitle:d,topContent:f,bottomContent:p,footer:h}=w9(o,t,i(`noTitleForLocale`,{locale:t})),g=u.f(a.config,a.id),_=e=>U3(n.getAsset(e)),v=g.id??a.id,y=Y5(g.options.map((e,t)=>({option:e,index:t})),g.shuffleOptions,`${r.sessionSeed}:${a.id}`).filter(({option:e})=>r.getDisplayConditionValue(a.id,e.id)!==!1).map(({option:e,index:n})=>{let i=C9(o?.getContent(t,u.d(e.id))),s=(i?u.xt(i).trim():``)||e.key?.trim()||`Option ${n+1}`;return{id:e.id,label:s,labelContent:i,disabled:r.getDisabledConditionValue(a.id,e.id)===!0,embeddedFormGroups:e.embeddedForm?u.T(u.w(e.embeddedForm,e.id),o,t,{translationNamespace:u.u(e.id)}).fieldGroups.filter(e=>r.getDisplayConditionValue(a.id,e.id)!==!1):void 0}});return(0,m.jsx)(Sge,{itemId:a.id,title:l,subtitle:d,topContent:f,bottomContent:p,footer:h,resolveImageAssetUrl:_,maxSelection:g.maxSelection,options:y,emptyState:`No options available.`,responseSlotId:v,currentResponse:s,onResponseChange:c,controlIdPrefix:`player-${a.id}`,name:`player-${a.id}`})}function Oge(e,t){return e&&e.trim().length>0?e:typeof t==`string`&&t.trim().length>0?t:``}var T9=({item:e,itemConfig:t,locale:n})=>{let r=J(`defaultEditors.groupPreview`),i=J(`registryLabels.items.pageBreak`),a=e,o=t,s=eD(),c=q(e=>e.editorItemRegistry),l=o?.items??a.items??[];return l.length===0?(0,m.jsx)(`div`,{className:`flex grow justify-center items-center text-center text-muted-foreground px-12 py-24 rounded-3xl border-2 border-dashed border-border`,children:(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`p`,{className:`text-lg font-medium mb-2`,children:r(`emptyTitle`)}),(0,m.jsx)(`p`,{className:`text-sm`,children:r(`emptyDescription`)})]})}):s?(0,m.jsxs)(`div`,{className:`space-y-1 p-4 bg-muted/30 rounded-lg @container/group-preview`,children:[(0,m.jsxs)(`div`,{className:`text-sm block font-medium text-muted-foreground mb-2`,children:[(0,m.jsx)(`span`,{children:r(`items`)}),(0,m.jsxs)(`span`,{className:`text-muted-foreground ml-1`,children:[`(`,l.length,`)`]})]}),(0,m.jsx)(`div`,{className:`space-y-1 hidden @sm/group-preview:block`,children:l.map(e=>{let t=s.survey.surveyItems.get(e);if(!t)return(0,m.jsxs)(`div`,{className:`flex items-center gap-3 p-3 bg-red-50 rounded-lg border border-red-200`,children:[(0,m.jsx)(`div`,{className:`shrink-0 text-red-500`,children:(0,m.jsx)(Cw,{className:`size-5`})}),(0,m.jsxs)(`div`,{className:`flex-1`,children:[(0,m.jsx)(`p`,{className:`font-mono text-sm font-medium text-red-700`,children:s.survey.getItemKey(e)?.itemKey}),(0,m.jsx)(`p`,{className:`text-xs text-red-600 mt-1`,children:r(`itemNotFound`)})]})]},e);let a=dD(t,c),o=cD(t),l=Oge(t.metadata?.itemLabel,u.xt(s?.survey.getItemTranslations(t.id)?.getContent(n,`title`,`en`)));return(0,m.jsxs)(`div`,{className:`flex items-center gap-2 p-2 bg-white rounded-lg border border-border`,children:[(0,m.jsx)(`div`,{className:`shrink-0`,style:{color:o},children:(0,m.jsx)(a.icon,{className:`size-5`})}),(0,m.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`p`,{className:`font-mono text-sm font-medium truncate grow`,style:{color:o},children:t.type===u.lt.PageBreak?i(`label`):s.survey.getItemKey(e)?.itemKey}),l&&(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground truncate`,children:l})]})})]},e)})}),(0,m.jsx)(`div`,{className:`grid grid-cols-2 gap-2 @sm/group-preview:hidden`,children:l.map((e,t)=>{let n=s.survey.surveyItems.get(e),a=s.survey.getItemKey(e)?.itemKey??r(`unknownItemKey`),o=n?cD(n):`#dc2626`,l=n?dD(n,c):void 0;return(0,m.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 rounded-md border border-border bg-background px-2 py-1.5`,children:[(0,m.jsx)(`span`,{className:`shrink-0 rounded-sm border border-border/70 bg-muted px-1 py-0.5 text-[10px] font-semibold leading-none text-muted-foreground`,"aria-label":r(`itemPosition`,{index:t+1}),children:t+1}),(0,m.jsx)(`div`,{className:`shrink-0`,style:{color:o},children:n&&l?(0,m.jsx)(l.icon,{className:`size-4`}):(0,m.jsx)(Cw,{className:`size-4`})}),(0,m.jsx)(`p`,{className:`truncate text-xs font-mono`,style:{color:o},children:n?.type===u.lt.PageBreak?i(`label`):a})]},e)})})]}):(0,m.jsx)(`div`,{className:`flex min-h-[220px] items-center justify-center rounded-xl border border-border/60 bg-muted/20`,children:(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`loading`)})})},kge=({item:e,itemContent:t,locale:n})=>{let r=J(`defaultEditors.pageBreakPreview`),i=J(`registryLabels.items.pageBreak`),a=cD(e),o=dD(e,q(e=>e.editorItemRegistry)),s=t?.getContent(n,`title`,`en`),c=u.xt(s).trim(),l=c.length>0?c:i(`label`);return(0,m.jsxs)(`div`,{className:`min-h-[220px] rounded-xl border-2 border-dashed border-border bg-muted/20 @container/page-break-preview`,children:[(0,m.jsxs)(`div`,{className:`hidden h-full min-h-[220px] items-center justify-center gap-3 px-6 @sm/page-break-preview:flex`,children:[(0,m.jsx)(`div`,{className:`flex items-center justify-center rounded-full border border-border bg-background p-5 shadow-sm`,style:{color:a},children:(0,m.jsx)(o.icon,{className:`size-8`})}),(0,m.jsxs)(`div`,{className:`text-left`,children:[(0,m.jsx)(`p`,{className:`text-sm font-semibold tracking-wide`,style:{color:a},children:l}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`nextPageDescription`)})]})]}),(0,m.jsx)(`div`,{className:`flex h-full min-h-[220px] items-center justify-center @sm/page-break-preview:hidden`,children:(0,m.jsx)(`div`,{className:`flex items-center justify-center rounded-full border border-border bg-background p-6 shadow-sm`,style:{color:a},children:(0,m.jsx)(o.icon,{className:`size-10`})})})]})};function E9(e,t,n){let r=e?.getContent(t,n);return u.wt(r)?void 0:r}function D9({title:e,subtitle:t,resolveImageAssetUrl:n}){return!e&&!t?null:(0,m.jsxs)(`div`,{className:``,children:[e&&(0,m.jsx)(h3,{content:e,resolveImageAssetUrl:n,paragraphClassName:`text-base font-medium text-foreground`}),t&&(0,m.jsx)(h3,{content:t,resolveImageAssetUrl:n,paragraphClassName:`text-sm leading-relaxed text-muted-foreground italic`})]})}var Age=({itemContent:e,locale:t})=>{let n=J(`defaultEditors.questionPreview`),r=tD(),i=E9(e,t,`title`),a=E9(e,t,`subtitle`),o=E9(e,t,`topContent`),s=E9(e,t,`bottomContent`),c=E9(e,t,`cardFooter`),l=e=>U3(r?.getAsset(e));return(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsxs)(`div`,{className:`rounded-xl border border-border p-4 bg-card space-y-2`,children:[(0,m.jsx)(D9,{title:i,subtitle:a,resolveImageAssetUrl:l}),o?(0,m.jsx)(h3,{content:o,resolveImageAssetUrl:l,paragraphClassName:`text-sm leading-6 text-foreground/90`}):null,(0,m.jsx)(`div`,{className:`rounded-lg border border-dashed border-border bg-background px-4 py-6 text-sm text-muted-foreground`,children:n(`formPlaceholder`)}),s?(0,m.jsx)(h3,{content:s,resolveImageAssetUrl:l,paragraphClassName:`text-sm leading-6 text-muted-foreground`}):null]}),(0,m.jsx)(`div`,{className:`px-3`,children:(0,m.jsx)(h3,{content:c,resolveImageAssetUrl:l,paragraphClassName:`text-xs text-muted-foreground`})})]})},jge=({item:e,itemConfig:t,itemContent:n,locale:r})=>{let i=J(`defaultEditors.questionPreview`),a=tD(),o=E9(n,r,`title`),s=E9(n,r,`subtitle`),c=E9(n,r,`topContent`),l=E9(n,r,`bottomContent`),d=E9(n,r,`cardFooter`),f=u.f(t,e.id),p=e=>U3(a?.getAsset(e)),h=Y5(f.options.map((e,t)=>({option:e,index:t})),f.shuffleOptions,`preview:${e.id}`).map(({option:e,index:t})=>{let a=E9(n,r,u.d(e.id));return{option:e,labelContent:a,label:(a?u.xt(a).trim():``)||e.key?.trim()||i(`optionLabel`,{index:t+1})}});return(0,m.jsxs)(`div`,{className:`space-y-1`,children:[(0,m.jsxs)(`div`,{className:`rounded-xl border border-border p-4 bg-card space-y-2`,children:[(0,m.jsx)(D9,{title:o,subtitle:s,resolveImageAssetUrl:p}),c?(0,m.jsx)(h3,{content:c,resolveImageAssetUrl:p,paragraphClassName:`text-sm leading-6 text-foreground/90`}):null,(0,m.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,m.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:f.maxSelection===1?i(`singleChoice`):f.maxSelection===null?i(`choicePreviewMaxUnlimited`):i(`choicePreviewMaxUpTo`,{max:f.maxSelection})})}),(0,m.jsx)(`div`,{className:`space-y-2`,children:h.length>0?h.map(({option:e,labelContent:t,label:n})=>(0,m.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-border/70 px-3 py-2 text-sm text-foreground`,children:[(0,m.jsx)(`span`,{className:`flex size-4 shrink-0 items-center justify-center border border-border bg-muted/50 ${f.maxSelection===1?`rounded-full`:`rounded-[4px]`}`}),t?(0,m.jsx)(h3,{content:t,className:`min-w-0 flex-1`,paragraphClassName:`text-sm leading-5 text-foreground`}):(0,m.jsx)(`span`,{children:n})]},e.id)):(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i(`choicePlaceholder`)})}),l?(0,m.jsx)(h3,{content:l,resolveImageAssetUrl:p,paragraphClassName:`text-sm leading-6 text-muted-foreground`}):null]}),(0,m.jsx)(`div`,{className:`px-3`,children:(0,m.jsx)(h3,{content:d,resolveImageAssetUrl:p,paragraphClassName:`text-xs text-muted-foreground`})})]})},Mge=({itemContent:e,locale:t})=>{let n=J(`defaultEditors.infoPreview`),r=tD(),i=E9(e,t,`content`);return(0,m.jsx)(S9,{content:i,resolveImageAssetUrl:e=>U3(r?.getAsset(e)),emptyState:(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`emptyContent`)})})},Nge=[`title`,`subtitle`,`topContent`,`bottomContent`,`description`,`cardFooter`];function Pge(e,t){return e.find(e=>e.toLowerCase().includes(t))}var Fge=e=>{let t=e.survey.surveyItems.get(e.itemId);if(!t)return;let n=e.survey.getItemTranslations(e.itemId);if(!n)return;let r=u.f(t.rawItem.config,e.itemId),i=n.locales,a=[];for(let e of Nge)for(let t of i){let r=u.xt(n.getContent(t,e)).trim();r.length>0&&a.push(r)}for(let e of r.options){let t=u.d(e.id);for(let e of i){let r=u.xt(n.getContent(e,t)).trim();r.length>0&&a.push(r)}}let o=Pge(a,e.searchTerm);if(o)return[{matchType:NC.Content,matchText:o}]},Ige=[`title`,`subtitle`,`topContent`,`bottomContent`,`cardFooter`];function Lge(e,t){return e.find(e=>e.toLowerCase().includes(t))}var Rge=e=>{let t=e.survey.surveyItems.get(e.itemId);if(!t)return;let n=e.survey.getItemTranslations(e.itemId);if(!n)return;let r=u.w(t.rawItem.config,e.itemId),i=[...Ige,...r.fieldGroups.flatMap(e=>[...u.v(e),...e.fields.flatMap(e=>u.b(e))])],a=[];for(let e of i)for(let t of n.locales){let r=u.xt(n.getContent(t,e)).trim();r.length>0&&a.push(r)}let o=Lge(a,e.searchTerm);if(o)return[{matchType:NC.Content,matchText:o}]},zge=e=>{let t=e.survey.getItemTranslations(e.itemId);if(t)for(let n of t.locales){let r=u.xt(t.getContent(n,`content`)).trim();if(r.toLowerCase().includes(e.searchTerm))return[{matchType:NC.Content,matchText:r}]}},O9=[`create-item`,`update-item-key`,`update-item-label`,`update-item-color`,`update-item-translation`,`update-placed-image`,`patch-item-config`,`remove-item`,`move-item`,`survey-json-patch`],k9=[{key:`title`,role:`primary`,format:`rich`,requiredOnCreate:!0,aliases:[`content`,`label`,`prompt`,`question`,`text`]},{key:`subtitle`,role:`secondary`,format:`rich`,aliases:[`subheading`,`subtext`]},{key:`topContent`,role:`secondary`,format:`rich`,aliases:[`preContent`,`preResponse`]},{key:`bottomContent`,role:`secondary`,format:`rich`,aliases:[`postContent`,`postResponse`]},{key:`cardFooter`,role:`secondary`,format:`rich`,aliases:[`footer`]}],A9=[`label`,`description`,`error`,`placeholder`,`unit`,`checkedLabel`,`uncheckedLabel`].map(e=>({key:`fields.<fieldId>.${e}`,role:e===`error`?`validation`:`field`,format:`rich`,pattern:!0})),j9=e=>({capabilityVersion:`1`,...e}),M9={topic:`item-types`,markdown:`Groups are containers. Create a group without child ids, then create or move children through separate operations. Page breaks are standalone structural boundaries.`},N9={topic:`item-types`,markdown:`Question titles and supporting text are translations. Configuration stores response behavior; respondent-visible option and field labels use the declared dynamic content surfaces.`},P9=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Bge=e=>{switch(e.type){case`number`:case`slider`:return u.gt.number;case`datepicker`:return u.gt.date;case`switch`:return u.gt.boolean;default:return u.gt.string}},F9=(e,t)=>{if(!P9(e)||!Array.isArray(e.fieldGroups))return{};let n={};for(let r of e.fieldGroups.filter(P9))if(Array.isArray(r.fields))for(let e of r.fields.filter(P9))typeof e.key!=`string`||e.key.length===0||(n[t?`${t}.${e.key}`:e.key]=Bge(e));return n},Vge=e=>{let t=P9(e.config)?e.config:{},n={[typeof t.id==`string`&&t.id.length>0?t.id:e.id]:t.maxSelection===1?u.gt.reference:u.gt.referenceArray};if(Array.isArray(t.options))for(let e of t.options.filter(P9))typeof e.id!=`string`||!e.embeddedForm||Object.assign(n,F9(e.embeddedForm,`embedded.${e.id}`));return n},I9={manifest:j9({itemType:`root`,displayName:`Survey root`,description:`The existing root container. A second root cannot be created.`,create:`unsupported`,supportedOperations:[`update-item-key`,`update-item-label`,`update-item-color`],contentSurfaces:[],referenceTopics:[`survey-data-model`,`item-types`]})},L9={manifest:j9({itemType:`group`,displayName:`Group`,description:`A structural container whose children are created as separate items.`,defaultItemKeyPrefix:`group`,create:`deterministic`,supportedOperations:[...O9,`reorder-items`],contentSurfaces:[{key:`title`,role:`primary`,format:`rich`,aliases:[`content`,`label`,`name`,`text`]}],referenceTopics:[`survey-data-model`,`item-types`]}),references:[M9]},R9={manifest:j9({itemType:`page-break`,displayName:`Page break`,description:`A structural page boundary.`,defaultItemKeyPrefix:`page`,create:`deterministic`,supportedOperations:O9,contentSurfaces:[{key:`title`,role:`primary`,format:`rich`,aliases:[`content`,`label`,`name`,`text`]}],referenceTopics:[`survey-data-model`,`item-types`]}),references:[M9]},z9={manifest:j9({itemType:`infoItem`,displayName:`Info`,description:`Display-only formatted content without a response slot.`,defaultItemKeyPrefix:`info`,create:`deterministic`,supportedOperations:O9,contentSurfaces:[{key:`content`,role:`primary`,format:`rich`,requiredOnCreate:!0,aliases:[`body`,`label`,`prompt`,`question`,`text`,`title`]}],referenceTopics:[`item-types`,`rich-text-content`]}),references:[{topic:`rich-text-content`,markdown:"Info content uses the rich `content` surface. Markdown strings are not parsed; send structured rich text when formatting matters."}]},B9={manifest:j9({itemType:`choiceItem`,displayName:`Choice question`,description:`A single- or multiple-choice question with optional embedded forms.`,defaultItemKeyPrefix:`choice`,create:`deterministic`,supportedOperations:[...O9,`add-choice-option`,`update-choice-option-label`,`remove-choice-option`,`reorder-choice-options`,`upsert-form-field-group`,`remove-form-field-group`,`reorder-form-field-groups`,`upsert-form-field`,`remove-form-field`,`move-form-field`,`set-embedded-form`,`remove-embedded-form`],contentSurfaces:[...k9,{key:`options.<optionId>.label`,role:`option`,format:`rich`,pattern:!0},...A9.map(e=>({...e,key:`embeddedForms.<optionId>.${e.key}`})),{key:`embeddedForms.<optionId>.fields.<fieldId>.options.<optionId>.label`,role:`option`,format:`rich`,pattern:!0},{key:`embeddedForms.<optionId>.fields.<fieldId>.validations.<validationId>.message`,role:`validation`,format:`rich`,pattern:!0},{key:`embeddedForms.<optionId>.fieldGroups.<groupId>.title`,role:`field`,format:`rich`,pattern:!0},{key:`embeddedForms.<optionId>.fieldGroups.<groupId>.description`,role:`field`,format:`rich`,pattern:!0}],responseSlots:[{key:`<responseId>`,valueType:`reference|referenceArray`}],referenceTopics:[`item-types`,`embedded-forms`,`localization`,`expressions`,`rich-text-content`],authoring:{configSummary:`Config stores id, maxSelection, shuffleOptions, and options. Use choice option operations for ordinary option edits.`}}),references:[N9],deriveResponseSlots:Vge},V9={manifest:j9({itemType:`formItem`,displayName:`Form`,description:`A form with groups, typed fields, validations, and select options.`,defaultItemKeyPrefix:`form`,create:`deterministic`,supportedOperations:[...O9,`upsert-form-field-group`,`remove-form-field-group`,`reorder-form-field-groups`,`upsert-form-field`,`remove-form-field`,`move-form-field`],contentSurfaces:[...k9,{key:`fieldGroups.<groupId>.title`,role:`field`,format:`rich`,pattern:!0},{key:`fieldGroups.<groupId>.description`,role:`field`,format:`rich`,pattern:!0},...A9,{key:`fields.<fieldId>.options.<optionId>.label`,role:`option`,format:`rich`,pattern:!0},{key:`fields.<fieldId>.validations.<validationId>.message`,role:`validation`,format:`rich`,pattern:!0}],responseSlots:[{key:`<fieldKey>`,valueType:`field-dependent`}],referenceTopics:[`item-types`,`localization`,`expressions`,`rich-text-content`],authoring:{configSummary:`Config stores fieldGroups with layouts and typed fields. Inspect current config and load item-types before editing fields.`}}),references:[N9],deriveResponseSlots:e=>F9(e.config)};uC([I9,L9,R9,z9,B9,V9]);var H9=[{itemType:`root`,infos:{icon:Vw,labelByLocale:{en:`Root`,nl:`Root`},descriptionByLocale:{en:`Survey root item.`,nl:`Survey-rootitem.`},defaultItemClassName:`text-sky-800`,categories:[`structure`]},editorComponent:aB,previewComponent:T9,constructor:u.st,assistantCapability:I9,isRootOnly:!0},{itemType:u.lt.Group,infos:{icon:Uw,labelByLocale:{en:`Group`,nl:`Groep`},descriptionByLocale:{en:`A container for organizing survey items.`,nl:`Een container om survey-items te organiseren.`},defaultItemClassName:`text-sky-600`,categories:[`structure`]},editorComponent:$O,previewComponent:T9,constructor:u.st,assistantCapability:L9,defaultItemKeyPrefix:`group`,getInitialItem:()=>({rawItem:{id:u.bt(),key:`group`,itemType:u.lt.Group}})},{itemType:u.lt.PageBreak,infos:{icon:Pw,labelByLocale:{en:`Page break`,nl:`Pagina-einde`},descriptionByLocale:{en:`Force items after this to appear on a new page.`,nl:`Dwing items hierna om op een nieuwe pagina te verschijnen.`},defaultItemClassName:`text-red-800`,categories:[`structure`]},editorComponent:ek,previewComponent:kge,constructor:u.ct,assistantCapability:R9,defaultItemKeyPrefix:`page`,getInitialItem:()=>({rawItem:{id:u.bt(),key:`page`,itemType:u.lt.PageBreak}})},{itemType:`infoItem`,constructor:u.r,assistantCapability:z9,renderComponent:Tge,previewComponent:Mge,getAuthoringState:gme,searchAdapters:[zge],infos:{icon:$w,labelByLocale:{en:`Info`,nl:`Info`},descriptionByLocale:{en:`Display-only content: markdown, info, warnings, media (no responses).`,nl:`Alleen-weergave-inhoud: markdown, info, waarschuwingen, media (geen antwoorden).`},gettingStarted:{rank:3,descriptionByLocale:{en:`Add an introduction or helpful context.`,nl:`Voeg een introductie of handige context toe.`}},defaultItemClassName:`text-neutral-700`,categories:[`display`]},editorComponent:dme,defaultItemKeyPrefix:`info`,getInitialItem:()=>{let e=u.bt(),t=new u.ft;return t.setContent(`en`,`content`,u.vt(``)),{rawItem:{id:e,key:`info`,itemType:`infoItem`,config:{}},translations:t}}},{itemType:`formItem`,constructor:u.n,assistantCapability:V9,renderComponent:Ege,playerLocalizations:{en:{defaultRenderers:{form:{clearSelection:`Clear {label}`,clearDateSelection:`Clear selected date`,requiredError:`This field is required.`,invalidError:`Invalid response.`,datePickerSelectDate:`Select a date`,datePickerSelectMonth:`Select a month`,datePickerSelectMonthAndYear:`Select month and year`,datePickerSelectYear:`Select a year`,datePickerMonthLabel:`Month`,datePickerYearLabel:`Year`}}},de:{defaultRenderers:{form:{clearSelection:`Auswahl fuer {label} loeschen`,clearDateSelection:`Ausgewaehltes Datum loeschen`,requiredError:`Dieses Feld ist erforderlich.`,invalidError:`Ungueltige Antwort.`,datePickerSelectDate:`Datum auswaehlen`,datePickerSelectMonth:`Monat auswaehlen`,datePickerSelectMonthAndYear:`Monat und Jahr auswaehlen`,datePickerSelectYear:`Jahr auswaehlen`,datePickerMonthLabel:`Monat`,datePickerYearLabel:`Jahr`}}},nl:{defaultRenderers:{form:{clearSelection:`Selectie voor {label} wissen`,clearDateSelection:`Geselecteerde datum wissen`,requiredError:`Dit veld is verplicht.`,invalidError:`Ongeldig antwoord.`,datePickerSelectDate:`Selecteer een datum`,datePickerSelectMonth:`Selecteer een maand`,datePickerSelectMonthAndYear:`Selecteer maand en jaar`,datePickerSelectYear:`Selecteer een jaar`,datePickerMonthLabel:`Maand`,datePickerYearLabel:`Jaar`}}}},previewComponent:Age,getAuthoringState:_me,searchAdapters:[Rge],infos:{icon:kw,labelByLocale:{en:`Form`,nl:`Formulier`},descriptionByLocale:{en:`Composable forms with groups and fields.`,nl:`Samenstelbare formulieren met groepen en velden.`},gettingStarted:{rank:1,descriptionByLocale:{en:`Collect an answer with a flexible question.`,nl:`Verzamel een antwoord met een flexibele vraag.`}},defaultItemClassName:`text-emerald-800`,categories:[`question`]},editorComponent:ume,defaultItemKeyPrefix:`form`,getInitialItem:()=>({rawItem:{id:u.bt(),key:`form`,itemType:`formItem`,config:{}}})},{itemType:`choiceItem`,constructor:u.t,assistantCapability:B9,renderComponent:Dge,previewComponent:jge,getAuthoringState:vme,searchAdapters:[Fge],playerLocalizations:{en:{defaultRenderers:{choice:{embeddedFormResetTitle:`Reset embedded form?`,embeddedFormResetDescription:`Changing {optionLabel} will clear the answers entered in its embedded form.`,embeddedFormResetConfirm:`Reset form`,embeddedFormResetCancel:`Keep answers`}}},de:{defaultRenderers:{choice:{embeddedFormResetTitle:`Eingebettetes Formular zuruecksetzen?`,embeddedFormResetDescription:`Wenn {optionLabel} geaendert wird, werden die Antworten im eingebetteten Formular entfernt.`,embeddedFormResetConfirm:`Formular zuruecksetzen`,embeddedFormResetCancel:`Antworten behalten`}}},nl:{defaultRenderers:{choice:{embeddedFormResetTitle:`Ingebed formulier resetten?`,embeddedFormResetDescription:`Als {optionLabel} wordt gewijzigd, worden de antwoorden in het ingebedde formulier gewist.`,embeddedFormResetConfirm:`Formulier resetten`,embeddedFormResetCancel:`Antwoorden behouden`}}}},infos:{icon:rT,labelByLocale:{en:`Choice`,nl:`Keuze`},descriptionByLocale:{en:`Choice groups with a configurable maximum number of selections; options may nest forms later.`,nl:`Keuzegroepen met een configureerbaar maximaal aantal selecties; opties kunnen later formulieren bevatten.`},gettingStarted:{rank:2,descriptionByLocale:{en:`Let respondents choose from a set of options.`,nl:`Laat respondenten uit een reeks opties kiezen.`}},defaultItemClassName:`text-fuchsia-800`,categories:[`question`]},expressions:hme,editorComponent:cme,defaultItemKeyPrefix:`choice`,getInitialItem:()=>{let e=u.bt();return{rawItem:{id:e,key:`choice`,itemType:`choiceItem`,config:u.o(e)}}}}],U9,W9;function G9(e){let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`string`?r:G9(r);return t}function Hge(e){let t={};for(let[n,r]of Object.entries(e))t[n]=G9(r);return t}function K9(e){return{...e,infos:e.infos?{...e.infos,labelByLocale:{...e.infos.labelByLocale},descriptionByLocale:{...e.infos.descriptionByLocale},categories:[...e.infos.categories]}:void 0,playerLocalizations:e.playerLocalizations?Hge(e.playerLocalizations):void 0,expressions:e.expressions?[...e.expressions]:void 0,searchAdapters:e.searchAdapters?[...e.searchAdapters]:void 0}}function q9(e){return e.map(e=>K9(e))}function J9(e={}){let{includeDefaultEntries:t=!0,entries:n=[],conflictStrategy:r=`override`}=e,i=[],a=new Map,o=e=>{let t=a.get(e.itemType),n=K9(e);if(t===void 0){a.set(e.itemType,i.length),i.push(n);return}if(r===`error`)throw Error(`Duplicate item registry entry for type: ${e.itemType}`);i[t]=n};if(t)for(let e of H9)o(e);for(let e of n)o(e);return i}function Y9(){return q9(H9)}function Uge(e={}){return JC(J9(e),{requireBuiltInTypes:e.requireBuiltInTypes,categoryLabels:e.categoryLabels})}function Wge(e={}){return WC(J9(e),{requireRenderer:e.requireRenderer})}function X9(){return U9||=JC(H9),U9}function Z9(){return W9||=WC(H9),W9}var Q9=({item:e})=>{let{surveyPlayerRegistry:t}=Zg(),n=(t??Z9()).getRenderer(e.type);return(0,m.jsx)(t_,{renderedItemInfos:e,children:n?d.default.createElement(n,{renderedItem:e}):(0,m.jsx)(`p`,{children:`not implemented`})})};function $9(e){if(!e)return;let t=u.xt(e).trim();return t.length>0?t:void 0}function Gge(e){let t=e.translations.navigationContent;if(!t)return;let n={};for(let[e,r]of Object.entries(t)){let t=$9(r.previousButtonText),i=$9(r.nextButtonText),a=$9(r.submitButtonText),o=$9(r.pageIndicatorText);!t&&!i&&!a&&!o||(n[e]={navigation:{...t?{previousButtonLabel:t}:{},...i?{nextButtonLabel:i}:{},...a?{submitButtonLabel:a}:{},...o?{pageIndicator:o}:{}}})}return Object.keys(n).length>0?n:void 0}var Kge=({survey:e,locale:t=`en`,size:n=`large`,surveyEngine:r,surveyPlayerRegistry:i,localizations:a,onSubmit:o,className:s})=>{let[c,l]=(0,d.useState)(0),[f,p]=(0,d.useState)(0),[h,g]=(0,d.useState)(e),_=(0,d.useRef)(null),v=(0,d.useRef)(!1);e!==h&&(g(e),p(0),l(0));let y=(0,d.useMemo)(()=>i??Z9(),[i]),b=(0,d.useMemo)(()=>Gge(e),[e]),x=(0,d.useMemo)(()=>Wg(y.localizations,a,b),[a,y.localizations,b]),S=(0,d.useMemo)(()=>Kg(t,x),[t,x]),C=(0,d.useMemo)(()=>new u.A(e,{locale:t}),[e,t]),w=r??C;(0,d.useEffect)(()=>{w.updateContext({locale:t})},[w,t]),(0,d.useEffect)(()=>{if(!v.current){v.current=!0;return}_.current?.scrollIntoView({block:`start`,inline:`nearest`})},[f]);let T=w.getSurveyPages(n);T.length===0?f!==0&&p(0):f>=T.length&&p(T.length-1);let E=T[f]??[],D=T.length>0&&f>=T.length-1,O=T.length>0?(f+1)/T.length*100:0,k=S(`navigation.previousButtonLabel`),A=S(`navigation.nextButtonLabel`),j=S(`navigation.submitButtonLabel`),M=S(`navigation.pageIndicator`,{current:f+1,total:T.length});return(0,m.jsx)(Yg,{survey:e,locale:t,surveyEngine:w,surveyPlayerRegistry:y,translate:S,onResponseChanged:()=>{l(e=>e+1)},children:(0,m.jsx)(`div`,{ref:_,className:s??`mx-auto flex w-full flex-col gap-4`,children:T.length>0?(0,m.jsxs)(`div`,{className:`space-y-4`,children:[T.length>1&&(0,m.jsxs)(`div`,{className:`space-y-2 px-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,m.jsx)(`p`,{className:`grow uppercase tracking-wide`,children:M}),(0,m.jsxs)(`p`,{children:[Math.round(O),`%`]})]}),(0,m.jsx)(Z8,{value:O})]}),E.map(e=>(0,m.jsx)(Q9,{item:e},e.id)),(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[f>0?(0,m.jsx)(B,{variant:`outline`,onClick:()=>{p(e=>Math.max(e-1,0))},children:k}):null,D?(0,m.jsx)(B,{onClick:()=>{o?.(w.getResponses(),w)},children:j}):(0,m.jsx)(B,{onClick:()=>{p(e=>Math.min(e+1,Math.max(T.length-1,0)))},children:A})]})]}):(0,m.jsx)(`div`,{className:`rounded-xl border border-dashed border-border bg-card/60 px-6 py-10 text-center text-sm text-muted-foreground`,children:S(`empty.noVisibleItems`)})})})};exports.APPLY_RICH_TEXT_STYLE_COMMAND=n0,exports.CONVERT_RICH_TEXT_LINK_TO_TEXT_COMMAND=s0,exports.DEFAULT_BLOCK_CONTENT_POLICY=m0,exports.DEFAULT_CATEGORY_LABELS=a_,exports.DEFAULT_COMPACT_CONTENT_POLICY=p0,exports.DEFAULT_DATE_FNS_LOCALES=VE,exports.DEFAULT_EDITOR_LANGUAGE=toe,exports.Dialog=aO,exports.DialogClose=cO,exports.DialogContent=uO,exports.DialogDescription=mO,exports.DialogFooter=fO,exports.DialogHeader=dO,exports.DialogOverlay=lO,exports.DialogPortal=sO,exports.DialogTitle=pO,exports.DialogTrigger=oO,exports.FilepickerDropzone=W4,exports.INSERT_RICH_TEXT_LINK_COMMAND=i0,exports.INSERT_RICH_TEXT_TEMPLATE_VARIABLE_COMMAND=r0,exports.OPEN_RICH_TEXT_LINK_EDITOR_COMMAND=a0,exports.RichTextBlockEditor=o3,exports.RichTextContentView=h3,exports.RichTextEditor=a3,exports.SortableTree=L8,exports.SurveyContextProvider=Xg,exports.SurveyEditor=Mpe,exports.SurveyImageAssetManager=G3,exports.SurveyItemRenderer=Q9,exports.SurveyPlayer=Kge,exports.UPDATE_RICH_TEXT_LINK_COMMAND=o0,exports.buildSurveyAssistantItemRegistryManifest=t5,exports.buildSurveyAssistantSnapshot=n5,exports.buildSurveyFileName=Wpe,exports.cloneRegistryEntries=q9,exports.createBlankEditorState=Vpe,exports.createComposedEditorRegistry=Uge,exports.createEditorStateFromRawSurvey=w5,exports.createRegistryEntries=J9,exports.createRichTextEditorValueFromContent=t2,exports.createRichTextEditorValueFromPlainText=V1,exports.createRichTextEditorValueFromText=n2,exports.createSnapshotSurveyEditorAIProvider=S5,exports.createSurveyPlayerRegistry=Wge,exports.defaultSurveyEditorLocalizations=zE,exports.entriesToComposedEditorRegistry=JC,exports.entriesToItemTypeRegistry=UC,exports.entriesToParticipantRegistry=WC,exports.getDateFnsLocale=UE,exports.getDefaultComposedEditorRegistry=X9,exports.getDefaultRegistryEntries=Y9,exports.getDefaultSurveyPlayerRegistry=Z9,exports.getRichTextContentFromEditorState=e2,exports.isBlockContentPolicyVariant=O0,exports.mergeDateFnsLocales=HE,exports.mergeEditorLocalizations=BE,exports.mergeRichTextContentPolicy=h0,exports.parseEditorStateFromJsonText=Hpe,exports.resolveCategoryLabel=s_,exports.sanitizeContentForPolicy=D0,exports.serializeSurveyStateForFile=Upe,exports.surveyEditorEnMessages=LE,exports.surveyEditorNlMessages=RE,exports.useSurveyAssets=z3,exports.useSurveyCtx=Zg,exports.useSurveyEditorAssistantIntegration=Bpe,exports.useSurveyImageAssets=B3,exports.useSurveyTranslation=Qg,exports.useUnusedSurveyAssetCount=V3,exports.validateRegistryEntries=HC;
|
|
199
|
-
//# sourceMappingURL=survey-ui.cjs.js.map
|