{"version":3,"file":"fuse_first-_AyAuqDf.js","sources":["../../../node_modules/@slideslive/fuse-kit/dist/utils/number/get_random_number.js","../../../node_modules/@slideslive/fuse-kit/dist/utils/utilities/run_callbacks.js","../../../node_modules/@slideslive/fuse-kit/dist/utils/utilities/set_img_src_from_file.js","../../../node_modules/@slideslive/fuse-kit/dist/utils/utilities/uppy_file_to_shrine_uploaded_file_data.js","../../../app/frontend/integration/turbo/initialize_turbo.js","../../../app/components/fuse/braintree_form_component/braintree_form_component.js","../../../app/components/fuse/button_base_component/button_base_component.js","../../../app/components/fuse/button_component/button_component.js","../../../app/components/fuse/button_to_component/button_to_component.js","../../../app/components/fuse/captcha_component/captcha_component.js","../../../app/components/fuse/circular_button_component/circular_button_component.js","../../../app/components/fuse/circular_button_to_component/circular_button_to_component.js","../../../app/components/fuse/clipboard_copy_component/clipboard_copy_component.js","../../../app/components/fuse/close_modal_component/close_modal_component.js","../../../app/components/fuse/count_component/count_component.js","../../../node_modules/dialog-polyfill/dist/dialog-polyfill.esm.js","../../../app/components/fuse/dialog_component/dialog_component.js","../../../app/components/fuse/drawer_component/drawer_component.js","../../../app/frontend/fuse/javascript/composables/use_floating.js","../../../app/components/fuse/dropdown_component/dropdown_component.js","../../../app/components/fuse/file_preview_component/file_preview_component.js","../../../app/components/fuse/form_field_base_component/form_field_base_component.js","../../../app/components/fuse/form_checkbox_component/form_checkbox_component.js","../../../app/frontend/fuse/javascript/composables/use_store.js","../../../node_modules/dayjs/plugin/quarterOfYear.js","../../../node_modules/dayjs/dayjs.min.js","../../../node_modules/chrono-node/dist/esm/types.js","../../../node_modules/chrono-node/dist/esm/utils/dayjs.js","../../../node_modules/chrono-node/dist/esm/timezone.js","../../../node_modules/chrono-node/dist/esm/results.js","../../../node_modules/chrono-node/dist/esm/utils/pattern.js","../../../node_modules/chrono-node/dist/esm/calculation/years.js","../../../node_modules/chrono-node/dist/esm/locales/en/constants.js","../../../node_modules/chrono-node/dist/esm/common/parsers/AbstractParserWithWordBoundary.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitWithinFormatParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENMonthNameLittleEndianParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENMonthNameMiddleEndianParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENMonthNameParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENYearMonthDayParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENSlashMonthFormatParser.js","../../../node_modules/chrono-node/dist/esm/common/parsers/AbstractTimeExpressionParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeExpressionParser.js","../../../node_modules/chrono-node/dist/esm/utils/timeunits.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitAgoFormatParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitLaterFormatParser.js","../../../node_modules/chrono-node/dist/esm/common/abstractRefiners.js","../../../node_modules/chrono-node/dist/esm/common/refiners/AbstractMergeDateRangeRefiner.js","../../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeDateRangeRefiner.js","../../../node_modules/chrono-node/dist/esm/calculation/mergingCalculation.js","../../../node_modules/chrono-node/dist/esm/common/refiners/AbstractMergeDateTimeRefiner.js","../../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeDateTimeRefiner.js","../../../node_modules/chrono-node/dist/esm/common/refiners/ExtractTimezoneAbbrRefiner.js","../../../node_modules/chrono-node/dist/esm/common/refiners/ExtractTimezoneOffsetRefiner.js","../../../node_modules/chrono-node/dist/esm/common/refiners/OverlapRemovalRefiner.js","../../../node_modules/chrono-node/dist/esm/common/refiners/ForwardDateRefiner.js","../../../node_modules/chrono-node/dist/esm/common/refiners/UnlikelyFormatFilter.js","../../../node_modules/chrono-node/dist/esm/common/parsers/ISOFormatParser.js","../../../node_modules/chrono-node/dist/esm/common/refiners/MergeWeekdayComponentRefiner.js","../../../node_modules/chrono-node/dist/esm/configurations.js","../../../node_modules/chrono-node/dist/esm/common/casualReferences.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENCasualDateParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENCasualTimeParser.js","../../../node_modules/chrono-node/dist/esm/common/calculation/weekdays.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENWeekdayParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENRelativeDateFormatParser.js","../../../node_modules/chrono-node/dist/esm/common/parsers/SlashDateFormatParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/parsers/ENTimeUnitCasualRelativeFormatParser.js","../../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeRelativeAfterDateRefiner.js","../../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENMergeRelativeFollowByDateRefiner.js","../../../node_modules/chrono-node/dist/esm/locales/en/refiners/ENExtractYearSuffixRefiner.js","../../../node_modules/chrono-node/dist/esm/locales/en/configuration.js","../../../node_modules/chrono-node/dist/esm/chrono.js","../../../node_modules/chrono-node/dist/esm/locales/en/index.js","../../../node_modules/chrono-node/dist/esm/locales/de/parsers/DETimeExpressionParser.js","../../../node_modules/chrono-node/dist/esm/locales/de/constants.js","../../../node_modules/chrono-node/dist/esm/locales/de/parsers/DEWeekdayParser.js","../../../node_modules/chrono-node/dist/esm/locales/de/parsers/DESpecificTimeExpressionParser.js","../../../node_modules/chrono-node/dist/esm/locales/de/refiners/DEMergeDateRangeRefiner.js","../../../node_modules/chrono-node/dist/esm/locales/de/refiners/DEMergeDateTimeRefiner.js","../../../node_modules/chrono-node/dist/esm/locales/de/parsers/DECasualTimeParser.js","../../../node_modules/chrono-node/dist/esm/locales/de/parsers/DECasualDateParser.js","../../../node_modules/chrono-node/dist/esm/locales/de/parsers/DEMonthNameLittleEndianParser.js","../../../node_modules/chrono-node/dist/esm/locales/de/parsers/DETimeUnitRelativeFormatParser.js","../../../node_modules/chrono-node/dist/esm/locales/de/parsers/DETimeUnitWithinFormatParser.js","../../../node_modules/chrono-node/dist/esm/locales/de/index.js","../../../app/components/fuse/form_field_component/form_field_component.js","../../../app/components/fuse/form_datetime_component/form_datetime_component.js","../../../app/components/fuse/form_location_component/form_location_component.js","../../../node_modules/libphonenumber-js/metadata.min.json.js","../../../node_modules/libphonenumber-js/min/exports/withMetadataArgument.js","../../../node_modules/libphonenumber-js/es6/ParseError.js","../../../node_modules/libphonenumber-js/es6/constants.js","../../../node_modules/libphonenumber-js/es6/tools/semver-compare.js","../../../node_modules/libphonenumber-js/es6/helpers/isObject.js","../../../node_modules/libphonenumber-js/es6/metadata.js","../../../node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js","../../../node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js","../../../node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js","../../../node_modules/libphonenumber-js/es6/helpers/parseDigits.js","../../../node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js","../../../node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js","../../../node_modules/libphonenumber-js/es6/isPossible.js","../../../node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js","../../../node_modules/libphonenumber-js/es6/helpers/getNumberType.js","../../../node_modules/libphonenumber-js/es6/isValid.js","../../../node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js","../../../node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js","../../../node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js","../../../node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js","../../../node_modules/libphonenumber-js/es6/helpers/RFC3966.js","../../../node_modules/libphonenumber-js/es6/format.js","../../../node_modules/libphonenumber-js/es6/PhoneNumber.js","../../../node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js","../../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js","../../../node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js","../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js","../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js","../../../node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js","../../../node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js","../../../node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js","../../../node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js","../../../node_modules/libphonenumber-js/es6/parse.js","../../../node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js","../../../node_modules/libphonenumber-js/es6/normalizeArguments.js","../../../node_modules/libphonenumber-js/es6/validatePhoneNumberLength.js","../../../node_modules/libphonenumber-js/es6/AsYouTypeState.js","../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js","../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js","../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js","../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js","../../../node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js","../../../node_modules/libphonenumber-js/es6/AsYouTypeParser.js","../../../node_modules/libphonenumber-js/es6/AsYouType.js","../../../node_modules/libphonenumber-js/es6/getExampleNumber.js","../../../node_modules/libphonenumber-js/min/exports/validatePhoneNumberLength.js","../../../node_modules/libphonenumber-js/min/exports/AsYouType.js","../../../node_modules/libphonenumber-js/min/exports/getExampleNumber.js","../../../node_modules/libphonenumber-js/examples.mobile.json.js","../../../app/components/fuse/form_phone_component/form_phone_component.js","../../../app/components/fuse/form_price_component/form_price_component.js","../../../app/components/fuse/form_radio_component/form_radio_component.js","../../../node_modules/@milkdown/exception/lib/index.es.js","../../../node_modules/@milkdown/ctx/lib/index.es.js","../../../node_modules/orderedmap/dist/index.js","../../../node_modules/prosemirror-model/dist/index.js","../../../node_modules/mdast-util-to-string/lib/index.js","../../../node_modules/decode-named-character-reference/index.dom.js","../../../node_modules/micromark-util-chunked/index.js","../../../node_modules/micromark-util-combine-extensions/index.js","../../../node_modules/micromark-util-decode-numeric-character-reference/index.js","../../../node_modules/micromark-util-normalize-identifier/index.js","../../../node_modules/micromark-util-character/index.js","../../../node_modules/micromark-factory-space/index.js","../../../node_modules/micromark/lib/initialize/content.js","../../../node_modules/micromark/lib/initialize/document.js","../../../node_modules/micromark-util-classify-character/index.js","../../../node_modules/micromark-util-resolve-all/index.js","../../../node_modules/micromark-core-commonmark/lib/attention.js","../../../node_modules/micromark-core-commonmark/lib/autolink.js","../../../node_modules/micromark-core-commonmark/lib/blank-line.js","../../../node_modules/micromark-core-commonmark/lib/block-quote.js","../../../node_modules/micromark-core-commonmark/lib/character-escape.js","../../../node_modules/micromark-core-commonmark/lib/character-reference.js","../../../node_modules/micromark-core-commonmark/lib/code-fenced.js","../../../node_modules/micromark-core-commonmark/lib/code-indented.js","../../../node_modules/micromark-core-commonmark/lib/code-text.js","../../../node_modules/micromark-util-subtokenize/lib/splice-buffer.js","../../../node_modules/micromark-util-subtokenize/index.js","../../../node_modules/micromark-core-commonmark/lib/content.js","../../../node_modules/micromark-factory-destination/index.js","../../../node_modules/micromark-factory-label/index.js","../../../node_modules/micromark-factory-title/index.js","../../../node_modules/micromark-factory-whitespace/index.js","../../../node_modules/micromark-core-commonmark/lib/definition.js","../../../node_modules/micromark-core-commonmark/lib/hard-break-escape.js","../../../node_modules/micromark-core-commonmark/lib/heading-atx.js","../../../node_modules/micromark-util-html-tag-name/index.js","../../../node_modules/micromark-core-commonmark/lib/html-flow.js","../../../node_modules/micromark-core-commonmark/lib/html-text.js","../../../node_modules/micromark-core-commonmark/lib/label-end.js","../../../node_modules/micromark-core-commonmark/lib/label-start-image.js","../../../node_modules/micromark-core-commonmark/lib/label-start-link.js","../../../node_modules/micromark-core-commonmark/lib/line-ending.js","../../../node_modules/micromark-core-commonmark/lib/thematic-break.js","../../../node_modules/micromark-core-commonmark/lib/list.js","../../../node_modules/micromark-core-commonmark/lib/setext-underline.js","../../../node_modules/micromark/lib/initialize/flow.js","../../../node_modules/micromark/lib/initialize/text.js","../../../node_modules/micromark/lib/constructs.js","../../../node_modules/micromark/lib/create-tokenizer.js","../../../node_modules/micromark/lib/parse.js","../../../node_modules/micromark/lib/postprocess.js","../../../node_modules/micromark/lib/preprocess.js","../../../node_modules/micromark-util-decode-string/index.js","../../../node_modules/unist-util-stringify-position/lib/index.js","../../../node_modules/mdast-util-from-markdown/lib/index.js","../../../node_modules/remark-parse/lib/index.js","../../../node_modules/zwitch/index.js","../../../node_modules/mdast-util-to-markdown/lib/configure.js","../../../node_modules/mdast-util-to-markdown/lib/handle/blockquote.js","../../../node_modules/mdast-util-to-markdown/lib/util/pattern-in-scope.js","../../../node_modules/mdast-util-to-markdown/lib/handle/break.js","../../../node_modules/longest-streak/index.js","../../../node_modules/mdast-util-to-markdown/lib/util/format-code-as-indented.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-fence.js","../../../node_modules/mdast-util-to-markdown/lib/handle/code.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-quote.js","../../../node_modules/mdast-util-to-markdown/lib/handle/definition.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-emphasis.js","../../../node_modules/mdast-util-to-markdown/lib/util/encode-character-reference.js","../../../node_modules/mdast-util-to-markdown/lib/util/encode-info.js","../../../node_modules/mdast-util-to-markdown/lib/handle/emphasis.js","../../../node_modules/unist-util-is/lib/index.js","../../../node_modules/unist-util-visit-parents/lib/index.js","../../../node_modules/unist-util-visit/lib/index.js","../../../node_modules/mdast-util-to-markdown/lib/util/format-heading-as-setext.js","../../../node_modules/mdast-util-to-markdown/lib/handle/heading.js","../../../node_modules/mdast-util-to-markdown/lib/handle/html.js","../../../node_modules/mdast-util-to-markdown/lib/handle/image.js","../../../node_modules/mdast-util-to-markdown/lib/handle/image-reference.js","../../../node_modules/mdast-util-to-markdown/lib/handle/inline-code.js","../../../node_modules/mdast-util-to-markdown/lib/util/format-link-as-autolink.js","../../../node_modules/mdast-util-to-markdown/lib/handle/link.js","../../../node_modules/mdast-util-to-markdown/lib/handle/link-reference.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-bullet.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-bullet-other.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-bullet-ordered.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-rule.js","../../../node_modules/mdast-util-to-markdown/lib/handle/list.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-list-item-indent.js","../../../node_modules/mdast-util-to-markdown/lib/handle/list-item.js","../../../node_modules/mdast-util-to-markdown/lib/handle/paragraph.js","../../../node_modules/mdast-util-phrasing/lib/index.js","../../../node_modules/mdast-util-to-markdown/lib/handle/root.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-strong.js","../../../node_modules/mdast-util-to-markdown/lib/handle/strong.js","../../../node_modules/mdast-util-to-markdown/lib/handle/text.js","../../../node_modules/mdast-util-to-markdown/lib/util/check-rule-repetition.js","../../../node_modules/mdast-util-to-markdown/lib/handle/thematic-break.js","../../../node_modules/mdast-util-to-markdown/lib/handle/index.js","../../../node_modules/mdast-util-to-markdown/lib/join.js","../../../node_modules/mdast-util-to-markdown/lib/unsafe.js","../../../node_modules/mdast-util-to-markdown/lib/util/association.js","../../../node_modules/mdast-util-to-markdown/lib/util/compile-pattern.js","../../../node_modules/mdast-util-to-markdown/lib/util/container-phrasing.js","../../../node_modules/mdast-util-to-markdown/lib/util/container-flow.js","../../../node_modules/mdast-util-to-markdown/lib/util/indent-lines.js","../../../node_modules/mdast-util-to-markdown/lib/util/safe.js","../../../node_modules/mdast-util-to-markdown/lib/util/track.js","../../../node_modules/mdast-util-to-markdown/lib/index.js","../../../node_modules/remark-stringify/lib/index.js","../../../node_modules/bail/index.js","../../../node_modules/extend/index.js","../../../node_modules/is-plain-obj/index.js","../../../node_modules/trough/lib/index.js","../../../node_modules/vfile-message/lib/index.js","../../../node_modules/vfile/lib/minpath.browser.js","../../../node_modules/vfile/lib/minproc.browser.js","../../../node_modules/vfile/lib/minurl.shared.js","../../../node_modules/vfile/lib/minurl.browser.js","../../../node_modules/vfile/lib/index.js","../../../node_modules/unified/lib/callable-instance.js","../../../node_modules/unified/lib/index.js","../../../node_modules/@milkdown/transformer/lib/index.es.js","../../../node_modules/prosemirror-transform/dist/index.js","../../../node_modules/prosemirror-state/dist/index.js","../../../node_modules/prosemirror-inputrules/dist/index.js","../../../node_modules/@milkdown/prose/lib/index.js","../../../node_modules/prosemirror-commands/dist/index.js","../../../node_modules/w3c-keyname/index.js","../../../node_modules/prosemirror-keymap/dist/index.js","../../../node_modules/prosemirror-view/dist/index.js","../../../node_modules/@milkdown/core/lib/index.es.js","../../../node_modules/@milkdown/utils/lib/index.es.js","../../../node_modules/@milkdown/plugin-clipboard/lib/index.es.js","../../../node_modules/rope-sequence/dist/index.js","../../../node_modules/prosemirror-history/dist/index.js","../../../node_modules/@milkdown/plugin-history/lib/index.es.js","../../../node_modules/@milkdown/plugin-indent/lib/index.es.js","../../../node_modules/lodash.debounce/index.js","../../../node_modules/@milkdown/plugin-listener/lib/index.es.js","../../../node_modules/refractor/lang/clike.js","../../../node_modules/refractor/lang/c.js","../../../node_modules/refractor/lang/cpp.js","../../../node_modules/refractor/lang/arduino.js","../../../node_modules/refractor/lang/bash.js","../../../node_modules/refractor/lang/csharp.js","../../../node_modules/refractor/lang/markup.js","../../../node_modules/refractor/lang/css.js","../../../node_modules/refractor/lang/diff.js","../../../node_modules/refractor/lang/go.js","../../../node_modules/refractor/lang/ini.js","../../../node_modules/refractor/lang/java.js","../../../node_modules/refractor/lang/regex.js","../../../node_modules/refractor/lang/javascript.js","../../../node_modules/refractor/lang/json.js","../../../node_modules/refractor/lang/kotlin.js","../../../node_modules/refractor/lang/less.js","../../../node_modules/refractor/lang/lua.js","../../../node_modules/refractor/lang/makefile.js","../../../node_modules/refractor/lang/yaml.js","../../../node_modules/refractor/lang/markdown.js","../../../node_modules/refractor/lang/objectivec.js","../../../node_modules/refractor/lang/perl.js","../../../node_modules/refractor/lang/markup-templating.js","../../../node_modules/refractor/lang/php.js","../../../node_modules/refractor/lang/python.js","../../../node_modules/refractor/lang/r.js","../../../node_modules/refractor/lang/ruby.js","../../../node_modules/refractor/lang/rust.js","../../../node_modules/refractor/lang/sass.js","../../../node_modules/refractor/lang/scss.js","../../../node_modules/refractor/lang/sql.js","../../../node_modules/refractor/lang/swift.js","../../../node_modules/refractor/lang/typescript.js","../../../node_modules/refractor/lang/basic.js","../../../node_modules/refractor/lang/vbnet.js","../../../node_modules/property-information/lib/util/schema.js","../../../node_modules/property-information/lib/util/merge.js","../../../node_modules/property-information/lib/normalize.js","../../../node_modules/property-information/lib/util/info.js","../../../node_modules/property-information/lib/util/types.js","../../../node_modules/property-information/lib/util/defined-info.js","../../../node_modules/property-information/lib/util/create.js","../../../node_modules/property-information/lib/xlink.js","../../../node_modules/property-information/lib/xml.js","../../../node_modules/property-information/lib/util/case-sensitive-transform.js","../../../node_modules/property-information/lib/util/case-insensitive-transform.js","../../../node_modules/property-information/lib/xmlns.js","../../../node_modules/property-information/lib/aria.js","../../../node_modules/property-information/lib/html.js","../../../node_modules/property-information/lib/svg.js","../../../node_modules/property-information/lib/find.js","../../../node_modules/property-information/index.js","../../../node_modules/hast-util-parse-selector/lib/index.js","../../../node_modules/space-separated-tokens/index.js","../../../node_modules/comma-separated-tokens/index.js","../../../node_modules/hastscript/lib/core.js","../../../node_modules/hastscript/lib/html.js","../../../node_modules/character-entities-legacy/index.js","../../../node_modules/character-reference-invalid/index.js","../../../node_modules/is-decimal/index.js","../../../node_modules/is-hexadecimal/index.js","../../../node_modules/is-alphabetical/index.js","../../../node_modules/is-alphanumerical/index.js","../../../node_modules/parse-entities/lib/index.js","../../../node_modules/refractor/lib/prism-core.js","../../../node_modules/refractor/lib/core.js","../../../node_modules/refractor/lib/common.js","../../../node_modules/@milkdown/plugin-prism/lib/index.es.js","../../../node_modules/escape-string-regexp/index.js","../../../node_modules/@sindresorhus/transliterate/replacements.js","../../../node_modules/@sindresorhus/transliterate/index.js","../../../node_modules/@sindresorhus/slugify/overridable-replacements.js","../../../node_modules/@sindresorhus/slugify/index.js","../../../node_modules/prosemirror-schema-list/dist/index.js","../../../node_modules/mdast-util-definitions/lib/index.js","../../../node_modules/remark-inline-links/lib/index.js","../../../node_modules/@milkdown/preset-commonmark/lib/index.es.js","../../../node_modules/prosemirror-tables/dist/index.js","../../../node_modules/prosemirror-safari-ime-span/dist/index.js","../../../node_modules/ccount/index.js","../../../node_modules/mdast-util-find-and-replace/lib/index.js","../../../node_modules/mdast-util-gfm-autolink-literal/lib/index.js","../../../node_modules/mdast-util-gfm-footnote/lib/index.js","../../../node_modules/mdast-util-gfm-strikethrough/lib/index.js","../../../node_modules/markdown-table/index.js","../../../node_modules/mdast-util-gfm-table/lib/index.js","../../../node_modules/mdast-util-gfm-task-list-item/lib/index.js","../../../node_modules/mdast-util-gfm/lib/index.js","../../../node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js","../../../node_modules/micromark-extension-gfm-footnote/lib/syntax.js","../../../node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js","../../../node_modules/micromark-extension-gfm-table/lib/edit-map.js","../../../node_modules/micromark-extension-gfm-table/lib/infer.js","../../../node_modules/micromark-extension-gfm-table/lib/syntax.js","../../../node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js","../../../node_modules/micromark-extension-gfm/index.js","../../../node_modules/remark-gfm/lib/index.js","../../../node_modules/@milkdown/preset-gfm/lib/index.es.js","../../../app/components/fuse/form_rich_text_component/code_block/config.js","../../../app/components/fuse/form_rich_text_component/code_block/component.js","../../../app/components/fuse/form_rich_text_component/code_block/view.js","../../../app/components/fuse/form_rich_text_component/code_block/index.js","../../../node_modules/prosemirror-gapcursor/dist/index.js","../../../app/components/fuse/form_rich_text_component/gap_cursor_plugin.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/config.js","../../../app/components/fuse/form_rich_text_component/tooltip_plugin/provider.js","../../../app/components/fuse/form_rich_text_component/tooltip_plugin/tooltip.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/tooltips.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/utils.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/edit/component.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/edit/view.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/edit/config.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/preview/component.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/preview/view.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/preview/config.js","../../../app/components/fuse/form_rich_text_component/utils.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/actions.js","../../../app/components/fuse/form_rich_text_component/link_tooltip_plugin/index.js","../../../app/components/fuse/form_rich_text_component/list_item_block/config.js","../../../app/components/fuse/form_rich_text_component/list_item_block/component.js","../../../app/components/fuse/form_rich_text_component/list_item_block/view.js","../../../app/components/fuse/form_rich_text_component/list_item_block/index.js","../../../app/components/fuse/form_rich_text_component/menu_button_highlight.js","../../../app/components/fuse/form_rich_text_component/menu_buttons_availability_by_selection.js","../../../app/components/fuse/form_rich_text_component/menu_link_button_availability.js","../../../app/components/fuse/form_rich_text_component/slash_menu_plugin/config.js","../../../app/components/fuse/form_rich_text_component/slash_menu_plugin/slash.js","../../../app/components/fuse/form_rich_text_component/slash_menu_plugin/component.js","../../../app/components/fuse/form_rich_text_component/slash_menu_plugin/view.js","../../../app/components/fuse/form_rich_text_component/slash_menu_plugin/index.js","../../../app/components/fuse/form_rich_text_component/tab_config_setting.js","../../../app/components/fuse/form_rich_text_component/table_tooltip_plugin/config.js","../../../app/components/fuse/form_rich_text_component/table_tooltip_plugin/tooltip.js","../../../app/components/fuse/form_rich_text_component/table_tooltip_plugin/selector_widget/component.js","../../../app/components/fuse/form_rich_text_component/table_tooltip_plugin/selector_widget/view.js","../../../app/components/fuse/form_rich_text_component/table_tooltip_plugin/tooltip/component.js","../../../app/components/fuse/form_rich_text_component/table_tooltip_plugin/tooltip/view.js","../../../app/components/fuse/form_rich_text_component/table_tooltip_plugin/tooltip/config.js","../../../app/components/fuse/form_rich_text_component/table_tooltip_plugin/index.js","../../../app/components/fuse/form_rich_text_component/toggle_commands.js","../../../app/components/fuse/form_rich_text_component/form_rich_text_component.js","../../../app/components/fuse/form_tag_component/form_tag_component.js","../../../app/components/fuse/form_value_switch_component/form_value_switch_component.js","../../../app/components/fuse/header/attendance_component/attendance_component.js","../../../app/components/fuse/header/search_component/search_component.js","../../../app/frontend/modules/cached_turbo_content/index.js","../../../app/components/fuse/infinite_scroll_component/infinite_scroll_component.js","../../../node_modules/fast-deep-equal/index.js","../../../node_modules/kdbush/index.js","../../../node_modules/supercluster/index.js","../../../node_modules/@googlemaps/markerclusterer/dist/index.esm.js","../../../app/components/fuse/map_with_markers_component/images/pin.png","../../../app/components/fuse/map_with_markers_component/map_style.js","../../../app/components/fuse/map_with_markers_component/map_with_markers_component.js","../../../app/components/fuse/nav_base_component/nav_base_component.js","../../../app/components/fuse/menu_component/menu_component.js","../../../app/components/fuse/modal_content_v2_component/modal_content_v2_component.js","../../../app/components/fuse/modal_v2_component/modal_v2_component.js","../../../app/components/fuse/notice_component/notice_component.js","../../../app/components/fuse/open_modal_component/open_modal_component.js","../../../app/components/fuse/open_url_component/open_url_component.js","../../../app/components/fuse/pdf_not_available_component/pdf_not_available_component.js","../../../app/components/fuse/progress_bar_component/progress_bar_component.js","../../../app/components/fuse/redirect_to_component/redirect_to_component.js","../../../app/components/fuse/replace_url_component/replace_url_component.js","../../../app/components/fuse/search/default_type_component/default_type_component.js","../../../app/components/fuse/search/result_component/result_component.js","../../../app/components/fuse/shrine_file_upload_component/shrine_file_upload_component.js","../../../app/components/fuse/shrine_image_upload_component/shrine_image_upload_component.js","../../../app/components/fuse/sticky_component/sticky_component.js","../../../app/components/fuse/table_header_component/table_header_component.js","../../../app/components/fuse/tabs_nav_component/tabs_nav_component.js","../../../app/components/fuse/time_ago_component/time_ago_component.js","../../../app/components/fuse/turbo_delayed_result_component/turbo_delayed_result_component.js","../../../app/components/fuse/turbo_frame_component/turbo_frame_component.js","../../../app/components/fuse/typed_text_component/typed_text_component.js","../../../app/components/fuse/virtual_list_component/virtual_list_component.js","../../../app/frontend/entrypoints/partials/_fuse_stimulus_register.js","../../../app/frontend/entrypoints/fuse_first.js"],"sourcesContent":["function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}\nexport {\n getRandomNumber as default\n};\n","function runCallbacks(callbacks, ...attrs) {\n for (const callback of callbacks || []) {\n callback(...attrs);\n }\n}\nexport {\n runCallbacks as default\n};\n","function setImgSrcFromFile(img, file) {\n const reader = new FileReader();\n reader.onload = (e) => {\n img.src = e.target.result;\n img.hidden = false;\n };\n reader.readAsDataURL(file);\n}\nexport {\n setImgSrcFromFile as default\n};\n","function uppyFileToShrineUploadedFileData(uppyFile) {\n return {\n id: uppyFile.meta.key,\n storage: uppyFile.meta.shrine_storage_key || \"cache\",\n metadata: {\n size: uppyFile.size,\n filename: uppyFile.name,\n mime_type: uppyFile.type\n }\n };\n}\nexport {\n uppyFileToShrineUploadedFileData as default\n};\n","import * as Turbo from '@hotwired/turbo-rails';\n\nimport './turbo.css';\n\nfunction initializeTurbo() {\n if (!window.Turbo) {\n window.Turbo = Turbo;\n }\n\n document.addEventListener('turbo:before-fetch-request', (event) => {\n event.detail.fetchOptions.credentials = 'include';\n });\n}\n\nexport default initializeTurbo;\n","import I18n from '@/fuse/javascript/i18n';\nimport { capitalizeFirstLetter, isObject } from '@slideslive/fuse-kit/utils';\nimport ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n static targets = [\n 'payButton',\n 'formFieldNumber',\n 'formFieldExpirationDate',\n 'formFieldCvv',\n 'formLabelNumber',\n 'formLabelExpirationDate',\n 'formLabelCvv',\n 'paymentResult',\n 'errors',\n 'errorMessageTemplate',\n ];\n\n connect() {\n if (this.isTurboPreview || this.element.dataset.initialized === 'true') return;\n\n this.element.dataset.initialized = true;\n\n this.saveCvvLabelContent();\n this.setupForm();\n }\n\n // Form setup and initialization\n\n setupForm() {\n this.disablePayButton();\n this.setupBraintreeComponents()\n .then(this.initializeBraintreeFields.bind(this))\n .catch(this.handleBraintreeSetupError.bind(this));\n }\n\n async setupBraintreeComponents() {\n const promises = [this.setupBraintreeHostedFields()];\n\n if (this.verifyWithThreeDS) {\n promises.push(this.setupBraintreeThreeDS());\n }\n\n return Promise.all(promises);\n }\n\n setupBraintreeHostedFields() {\n return braintree.hostedFields.create({\n authorization: this.braintreeClientToken,\n styles: this.hostedFieldsStyles,\n fields: this.hostedFieldsConfig,\n });\n }\n\n setupBraintreeThreeDS() {\n return braintree.threeDSecure.create({\n authorization: this.braintreeClientToken,\n version: 2,\n cardinalSDKConfig: { maxRequestRetries: 3 },\n });\n }\n\n initializeBraintreeFields(instances) {\n [this.hostedFields, this.threeDS] = instances;\n\n this.setupHostedFieldsListeners();\n this.enablePayButton();\n }\n\n setupHostedFieldsListeners() {\n this.hostedFields.on('focus', this.focusChangedHostedField.bind(this));\n this.hostedFields.on('blur', this.focusChangedHostedField.bind(this));\n this.hostedFields.on('validityChange', this.validityChangedHostedField.bind(this));\n this.hostedFields.on('cardTypeChange', this.cardTypeChangedHostedField.bind(this));\n this.hostedFields.on('inputSubmitRequest', this.triggerSubmit.bind(this));\n }\n\n // Form validation and submission\n\n validateHostedFields(event) {\n const state = this.hostedFields.getState();\n const isValid = Object.keys(state.fields).every((key) => {\n const field = state.fields[key];\n\n if (!field.isValid) {\n this.addFieldError(key, true);\n return false;\n }\n\n return true;\n });\n\n if (!isValid) event.preventDefault();\n }\n\n async createNoncePayload(event) {\n const { resume, cancel } = event.detail.intercept();\n let payload;\n\n try {\n payload = await this.hostedFields.tokenize(this.braintreeHostedFieldsTokenizeOptions);\n\n if (this.verifyWithThreeDS) {\n payload = await this.threeDS.verifyCard(this.braintreeThreeDSVerifyCardOptions(payload));\n }\n } catch (err) {\n this._showPaymentError(err);\n cancel();\n\n return;\n }\n\n if (payload) {\n event.detail.fetchOptions.body.append('payment_method_nonce', payload.nonce);\n resume();\n } else {\n cancel();\n }\n }\n\n // Error handling and display\n\n addFieldError(key, withMessage) {\n let message = '';\n\n if (withMessage) {\n if (key === 'number') {\n message = I18n.t('fuse.form.errors.payment.invalid_card_number');\n } else if (key === 'cvv') {\n message = I18n.t('fuse.form.errors.payment.invalid_cvv');\n } else if (key === 'expirationDate') {\n message = I18n.t('fuse.form.errors.payment.invalid_expiration_date');\n }\n }\n\n this.addErrors(message, [key]);\n }\n\n addErrors(message, elementKeys = []) {\n if (elementKeys.length) {\n this.handleFieldErrors(message, elementKeys);\n } else {\n this.handleGeneralError(message);\n }\n }\n\n handleFieldErrors(message, elementKeys) {\n this.errorsTarget.hidden = true;\n this.errorsTarget.firstElementChild.nextElementSibling.innerHTML = '';\n this.focusFirstInvalidHostedField();\n\n for (const key of elementKeys) {\n const formFieldTarget = this[`formField${capitalizeFirstLetter(key)}Target`];\n const formFieldController = this.findControllerOnElement(formFieldTarget, { controller: 'fuse--form-field' });\n\n formFieldController?.setValidity?.(message === '' ? null : 'error', message);\n }\n }\n\n handleGeneralError(message) {\n if (message === '') {\n this.errorsTarget.hidden = true;\n this.errorsTarget.firstElementChild.nextElementSibling.innerHTML = '';\n } else {\n const messageHTML = this.errorMessageTemplateTarget.innerHTML.replace('{content}', message);\n\n this.errorsTarget.firstElementChild.nextElementSibling.insertAdjacentHTML('beforeend', messageHTML);\n this.errorsTarget.hidden = false;\n }\n }\n\n removeFieldError(key) {\n const formFieldTarget = this[`formField${capitalizeFirstLetter(key)}Target`];\n const formFieldController = this.findControllerOnElement(formFieldTarget, { controller: 'fuse--form-field' });\n\n formFieldController?.setValidity(null, null);\n }\n\n removeErrors() {\n this.paymentResultTarget.innerHTML = '';\n this.errorsTarget.hidden = true;\n this.errorsTarget.firstElementChild.nextElementSibling.innerHTML = '';\n\n for (const key of ['number', 'expirationDate', 'cvv']) {\n const formFieldTarget = this[`formField${capitalizeFirstLetter(key)}Target`];\n const formFieldController = this.findControllerOnElement(formFieldTarget, { controller: 'fuse--form-field' });\n\n formFieldController?.setValidity?.(null, null);\n }\n }\n\n // Event handlers\n\n handleBraintreeSetupError(error) {\n console.warn('Braintree setup error:', error);\n\n this.addErrors(I18n.t('fuse.form.errors.payment.server.braintree_error'));\n this.reportErrorToSlidesLive(error);\n }\n\n focusChangedHostedField(event) {\n const { emittedBy, fields } = event;\n const formFieldTarget = this[`formField${capitalizeFirstLetter(emittedBy)}Target`];\n const formLabelTarget = this[`formLabel${capitalizeFirstLetter(emittedBy)}Target`];\n\n formFieldTarget.classList.toggle('active', fields[emittedBy].isFocused);\n\n if (fields[emittedBy].isFocused) formLabelTarget.click();\n }\n\n validityChangedHostedField(event) {\n const { emittedBy, fields } = event;\n const field = fields[emittedBy];\n\n if (!field.isValid) {\n this.addFieldError(emittedBy, true);\n } else {\n this.removeFieldError(emittedBy);\n\n if (!field.isPotentiallyValid) {\n this.focusNextField(emittedBy);\n }\n }\n }\n\n cardTypeChangedHostedField(event) {\n const { cards, fields } = event;\n const card = cards[0];\n\n if (!card || !card.supported || fields.number.isEmpty) {\n this.clearCardType();\n } else {\n this.element.dataset.cardType = card.type;\n this.formLabelCvvTarget.textContent = card.code.name;\n }\n }\n\n // Error handling methods\n\n showServerErrors(event) {\n const response = event.detail[0];\n\n if (response.braintree_errors) {\n this.handleBraintreeErrors(response.braintree_errors);\n } else if (response.errors) {\n response.errors.forEach((error) => this.addErrors(error));\n } else {\n this.addErrors(I18n.t('fuse.form.errors.payment.server.braintree_error'));\n }\n }\n\n handleBraintreeErrors(braintreeErrors) {\n if (braintreeErrors.errors) {\n braintreeErrors.errors.forEach((error) => {\n this.addErrors(`${error.message} [${error.code}, ${error.attribute}]`);\n });\n }\n\n if (braintreeErrors.processor_declined) {\n const error = braintreeErrors.processor_declined;\n this.addErrors(\n `${error.processor_response_text} [${error.processor_response_code}, ${error.processor_response_type}]`,\n );\n }\n\n if (braintreeErrors.settlement_declined) {\n const error = braintreeErrors.settlement_declined;\n this.addErrors(`${error.processor_settlement_response_text} [${error.processor_settlement_response_code}]`);\n }\n\n if (braintreeErrors.gateway_rejected) {\n this.addErrors(braintreeErrors.gateway_rejected.gateway_rejection_reason);\n }\n\n if (braintreeErrors.failed) {\n this.addErrors(I18n.t('fuse.form.errors.payment.failed'));\n }\n\n if (braintreeErrors.unknown_status) {\n this.addErrors(\n I18n.t('fuse.form.errors.payment.unknown_status', { status: braintreeErrors.unknown_status.status }),\n );\n }\n }\n\n _showPaymentError(err) {\n console.warn('Payment error:', err);\n\n this.reportErrorToSlidesLive(err);\n\n const errorHandlers = {\n HOSTED_FIELDS_FIELDS_EMPTY: () => this.addErrors(I18n.t('fuse.form.errors.payment.hosted_fields.fields_empty')),\n HOSTED_FIELDS_FIELDS_INVALID: () => {\n if (err.details && err.details.invalidFields) {\n Object.keys(err.details.invalidFields).forEach((key) => this.addFieldError(key, true));\n } else {\n this.addErrors('', ['number', 'expirationDate', 'cvv']);\n }\n },\n HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE: () => this.addErrors(''),\n HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED: () =>\n this.addErrors(I18n.t('fuse.form.errors.payment.hosted_fields.tokenization_cvv_verification_failed'), ['cvv']),\n HOSTED_FIELDS_FAILED_TOKENIZATION: () =>\n this.addErrors(I18n.t('fuse.form.errors.payment.hosted_fields.failed_tokenization')),\n HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR: () =>\n this.addErrors(I18n.t('fuse.form.errors.payment.hosted_fields.tokenization_network_error')),\n THREEDS_AUTHENTICATION_IN_PROGRESS: () =>\n this.addErrors(I18n.t('fuse.form.errors.payment.3ds.authentication_in_progress')),\n THREEDS_MISSING_VERIFY_CARD_OPTION: () =>\n this.addErrors(I18n.t('fuse.form.errors.payment.3ds.missing_verify_card_option')),\n THREEDS_JWT_AUTHENTICATION_FAILED: () =>\n this.addErrors(I18n.t('fuse.form.errors.payment.3ds.jwt_authentication_failed')),\n THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR: () =>\n this.addErrors(I18n.t('fuse.form.errors.payment.3ds.lookup_tokenized_card_not_found')),\n THREEDS_LOOKUP_VALIDATION_ERROR: () => {\n if (err.details?.originalError?.details?.originalError?.error?.message) {\n this.addErrors(err.details.originalError.details.originalError.error.message);\n }\n this.addErrors(I18n.t('fuse.form.errors.payment.3ds.lookup_validation_error'));\n },\n THREEDS_LOOKUP_ERROR: () => this.addErrors(I18n.t('fuse.form.errors.payment.3ds.lookup_error')),\n THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT: () =>\n this.addErrors(I18n.t('fuse.form.errors.payment.3ds.verify_card_canceled_by_merchant')),\n THREEDS_INLINE_IFRAME_DETAILS_INCORRECT: () =>\n this.addErrors(I18n.t('fuse.form.errors.payment.3ds.inline_iframe_details_incorrect')),\n };\n\n if (errorHandlers[err.code]) {\n errorHandlers[err.code]();\n\n return;\n }\n\n this.addErrors(I18n.t('fuse.form.errors.payment.unknown_error', { error: JSON.stringify(err) }));\n }\n\n // Utility methods\n\n clearCardType() {\n this.element.dataset.cardType = '';\n this.formLabelCvvTarget.textContent = this.formLabelCvvTarget.dataset.originalContent;\n }\n\n focusNextField(currentField) {\n const nextField = currentField === 'number' ? 'expirationDate' : 'cvv';\n\n this.hostedFields.focus(nextField);\n }\n\n triggerSubmit() {\n if (this.element.requestSubmit) {\n this.element.requestSubmit();\n } else {\n const submitButton = this.element.querySelector('[type=\"submit\"]');\n\n if (submitButton) submitButton.click();\n }\n }\n\n reportErrorToSlidesLive(error) {\n fetch(this.element.dataset.braintreeErrorUrl, {\n method: 'POST',\n credentials: 'include',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n user_agent: navigator.userAgent,\n error: JSON.stringify(error),\n }),\n });\n }\n\n // Helper methods\n\n saveCvvLabelContent() {\n if (this.hasFormLabelCvvTarget && !this.formLabelCvvTarget.dataset.originalContent) {\n this.formLabelCvvTarget.dataset.originalContent = this.formLabelCvvTarget.textContent;\n }\n }\n\n disablePayButton() {\n this.payButtonTarget.disabled = true;\n }\n\n enablePayButton() {\n this.payButtonTarget.disabled = false;\n }\n\n focusFirstInvalidHostedField() {\n const fieldsState = this.hostedFields.getState().fields;\n const focusOrder = ['number', 'expirationDate', 'cvv'];\n\n if (fieldsState.number.isFocused || fieldsState.expirationDate.isFocused || fieldsState.cvv.isFocused) return;\n\n for (const field of focusOrder) {\n if (!fieldsState[field].isValid && !fieldsState[field].isFocused) {\n this.hostedFields.focus(field);\n break;\n }\n }\n }\n\n clientInfoValueForInput(name) {\n const input = this.element.querySelector(`input[name=\"${name}\"], select[name=\"${name}\"]`);\n\n return input ? input.value : '';\n }\n\n removeEmptyValues(object) {\n for (const key of Object.keys(object)) {\n if (isObject(object[key])) {\n object[key] = this.removeEmptyValues(object[key]);\n }\n\n if (!object[key] || object[key] === '' || (isObject(object[key]) && Object.keys(object[key]).length === 0)) {\n delete object[key];\n }\n }\n\n return object;\n }\n\n braintreeThreeDSVerifyCardOptions(payload) {\n const clientInfo = this.clientInfo;\n const normalizedCustomerName = clientInfo.customer_name.normalize\n ? clientInfo.customer_name.normalize('NFKD').replace(/[^a-z0-9 ]/gi, '')\n : clientInfo.customer_name.replace(/[^a-z0-9 ]/gi, '');\n\n const [clientGivenName, ...clientSurnameParts] = normalizedCustomerName.split(' ');\n const clientSurname = clientSurnameParts.join(' ');\n\n return {\n onLookupComplete: (data, next) => next(),\n amount: this.element.dataset.amount,\n nonce: payload.nonce,\n bin: payload.details.bin,\n email: clientInfo.email,\n billingAddress: {\n givenName: clientGivenName,\n surname: clientSurname,\n streetAddress: clientInfo.address.street_1,\n extendedAddress: clientInfo.address.street_2,\n locality: clientInfo.address.city,\n region: clientInfo.address.state,\n postalCode: clientInfo.address.postal_code,\n countryCodeAlpha2: clientInfo.address.country,\n },\n };\n }\n\n get hostedFieldsStyles() {\n return {\n input: {\n color: 'rgba(255, 255, 255, 0.89)',\n 'font-size': '14px',\n 'font-family': 'monospace',\n padding: '0 20px 6px',\n },\n '::-webkit-input-placeholder': { color: 'rgba(255, 255, 255, 0.5)' },\n ':-moz-placeholder': { color: 'rgba(255, 255, 255, 0.5)' },\n '::-moz-placeholder': { color: 'rgba(255, 255, 255, 0.5)' },\n ':-ms-input-placeholder': { color: 'rgba(255, 255, 255, 0.5)' },\n };\n }\n\n get hostedFieldsConfig() {\n return {\n number: {\n selector: '#ccNumber',\n placeholder: this.formFieldNumberTarget.dataset.placeholder,\n },\n cvv: {\n selector: '#ccCvv',\n placeholder: this.formFieldCvvTarget.dataset.placeholder,\n },\n expirationDate: {\n selector: '#ccExpirationDate',\n placeholder: this.formFieldExpirationDateTarget.dataset.placeholder,\n },\n };\n }\n\n get braintreeClientToken() {\n return this.element.getAttribute('data-braintree-client-token');\n }\n\n get verifyWithThreeDS() {\n return this.element.getAttribute('data-braintree-require-three-ds') === 'true';\n }\n\n get braintreeHostedFieldsTokenizeOptions() {\n const clientInfo = this.clientInfo;\n const [clientGivenName, ...clientSurnameParts] = clientInfo.customer_name.split(' ');\n const clientSurname = clientSurnameParts.join(' ');\n\n return this.removeEmptyValues({\n cardholderName: clientInfo.customer_name,\n billingAddress: {\n company: clientInfo.company.name,\n firstName: clientGivenName,\n lastName: clientSurname,\n streetAddress: clientInfo.address.street_1,\n extendedAddress: clientInfo.address.street_2,\n locality: clientInfo.address.city,\n region: clientInfo.address.state,\n postalCode: clientInfo.address.postal_code,\n countryCodeAlpha2: clientInfo.address.country,\n },\n });\n }\n\n get clientInfo() {\n if (this.element.dataset.clientInfo && this.element.dataset.clientInfo !== '') {\n return JSON.parse(this.element.dataset.clientInfo);\n }\n\n return {\n customer_name: this.clientInfoValueForInput('billing[customer_name]'),\n email: this.clientInfoValueForInput('billing[email]'),\n address: {\n street_1: this.clientInfoValueForInput('billing[address][street_1]'),\n street_2: this.clientInfoValueForInput('billing[address][street_2]'),\n city: this.clientInfoValueForInput('billing[address][city]'),\n state: this.clientInfoValueForInput('billing[address][state]'),\n country: this.clientInfoValueForInput('billing[address][country]'),\n postal_code: this.clientInfoValueForInput('billing[address][postal_code]'),\n },\n company: {\n name: this.clientInfoValueForInput('billing[company][name]'),\n reg_no: this.clientInfoValueForInput('billing[company][reg_no]'),\n vat_reg_no: this.clientInfoValueForInput('billing[company][vat_reg_no]'),\n },\n };\n }\n}\n","import ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n static targets = ['spinner'];\n\n disconnect() {\n this.done();\n }\n\n loading() {\n if (!this.spinnerTarget.hidden) return;\n\n this.element.disabled = true;\n this.element.classList.add('disabled');\n this.spinnerTarget.hidden = false;\n }\n\n done() {\n if (this.spinnerTarget.hidden) return;\n\n this.spinnerTarget.hidden = true;\n this.element.classList.remove('disabled');\n this.element.disabled = false;\n }\n\n triggerLoading({ detail: { target = null } }) {\n if (this.preventFromTrigger(target)) return;\n\n this.loading();\n }\n\n triggerDone({ detail: { target = null } }) {\n if (this.preventFromTrigger(target)) return;\n\n this.done();\n }\n\n preventFromTrigger(target) {\n return !target || (!target.contains(this.element) && (!target.id || target.id !== this.form));\n }\n\n get form() {\n return this.element.getAttribute('form');\n }\n}\n","import ButtonBaseController from 'fuse/button_base_component/button_base_component';\n\nexport default class extends ButtonBaseController {}\n","import { remove } from '@slideslive/fuse-kit/utils';\nimport ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n remove() {\n remove(this.element);\n }\n}\n","import { isVariableDefinedNotNull } from '@slideslive/fuse-kit/utils';\nimport ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n static targets = ['captcha', 'warning', 'error'];\n\n static values = {\n debug: {\n type: Boolean,\n default: false,\n },\n turnstileAction: {\n type: String,\n default: null,\n },\n preferredProvider: {\n type: String,\n default: 'cloudflare-turnstile',\n },\n formId: {\n type: String,\n default: null,\n },\n theme: {\n type: String,\n default: 'dark',\n },\n size: {\n type: String,\n default: 'normal',\n },\n turnstileAppearance: {\n type: String,\n default: 'always',\n },\n turnstileLanguage: {\n type: String,\n default: 'en',\n },\n cloudflareTurnstileSiteKey: {\n type: String,\n required: true,\n },\n googleRecaptchaSiteKey: {\n type: String,\n required: true,\n },\n };\n\n initialize() {\n this.pendingCaptchaPromises = [];\n this.clouadflareTurnstileWidgetId = undefined;\n this.googleRecaptchaWidgetId = undefined;\n\n // eslint-disable-next-line no-console\n if (this.debugValue) console.log('Initialize Captcha');\n }\n\n connect() {\n this.toggleParentFormButtons(false);\n\n // eslint-disable-next-line no-console\n if (this.debugValue) console.log('Connect Captcha');\n\n if (this.preferredProviderValue === 'google-recaptcha') {\n this.renderGoogleRecaptcha('connect');\n } else {\n this.renderCloudflareTurnstile('connect');\n }\n }\n\n disconnect() {\n if (this.clouadflareTurnstileWidgetId) {\n window.turnstile.remove(this.clouadflareTurnstileWidgetId);\n }\n\n this.clouadflareTurnstileWidgetId = undefined;\n this.googleRecaptchaWidgetId = undefined;\n\n this.captchaTarget.innerHTML = '';\n }\n\n resetCaptcha() {\n this.rejectPendingCaptchaPromises();\n this.resetCloudflareTurnstile();\n this.resetGoogleRecaptcha();\n }\n\n resetCloudflareTurnstile() {\n this.toggleParentFormButtons(false);\n\n if (this.debugValue) {\n // eslint-disable-next-line no-console\n console.log('Reset Cloudflare Turnstile', this.clouadflareTurnstileWidgetId);\n }\n\n if (this.clouadflareTurnstileWidgetId) {\n window.turnstile.reset(this.clouadflareTurnstileWidgetId);\n }\n }\n\n renderCloudflareTurnstileFromCallback() {\n if (this.preferredProviderValue !== 'cloudflare-turnstile') return;\n\n this.renderCloudflareTurnstile('callback');\n }\n\n renderCloudflareTurnstile(source) {\n if (this.debugValue) {\n // eslint-disable-next-line no-console\n console.log('Render Cloudflare Turnstile', source, this.clouadflareTurnstileWidgetId, !!window.turnstile);\n }\n\n if (this.clouadflareTurnstileWidgetId) return;\n\n if (!window.turnstile) {\n console.warn('Cloudflare Turnstile is not loaded.');\n return;\n }\n\n this.captchaTarget.innerHTML = '';\n this.clouadflareTurnstileWidgetId = window.turnstile.render(this.captchaTarget, {\n sitekey: this.cloudflareTurnstileSiteKeyValue,\n theme: this.themeValue,\n action: this.turnstileActionValue,\n language: this.turnstileLanguageValue,\n size: this.sizeValue,\n appearance: this.turnstileAppearanceValue,\n callback: (args) => {\n this.toggleParentFormButtons(true);\n\n this.resolvePendingCaptchaPromises(args);\n this.dispatch('success', { detail: args });\n },\n 'error-callback': (args) => {\n this.dispatch('error', { detail: args });\n\n console.warn('Cloudflare Turnstile error:', args);\n\n this.renderGoogleRecaptcha('cloudflare-recaptcha-error');\n },\n 'expired-callback': (args) => {\n this.toggleParentFormButtons(false);\n\n this.rejectPendingCaptchaPromises(args);\n this.dispatch('expired', { detail: args });\n },\n 'before-interactive-callback': () => {\n // eslint-disable-next-line no-console\n console.log('Cloudflare Turnstile interactive challenge.');\n\n this.show();\n },\n 'unsupported-callback': () => {\n console.warn('Unsupported browser for Cloudflare Turnstile bot verification.');\n\n this.renderGoogleRecaptcha('cloudflare-recaptcha-unsupported');\n },\n });\n\n if (this.debugValue) {\n // eslint-disable-next-line no-console\n console.log('Rendered Cloudflare Turnstile', this.clouadflareTurnstileWidgetId);\n }\n }\n\n resetGoogleRecaptcha() {\n this.toggleParentFormButtons(false);\n\n if (this.debugValue) {\n // eslint-disable-next-line no-console\n console.log('Reset Google reCaptcha', this.googleRecaptchaWidgetId);\n }\n\n if (this.googleRecaptchaWidgetId) {\n window.grecaptcha.reset(this.googleRecaptchaWidgetId);\n }\n }\n\n renderGoogleRecaptchaFromCallback() {\n if (this.preferredProviderValue !== 'google-recaptcha') return;\n\n this.renderGoogleRecaptcha('callback');\n }\n\n renderGoogleRecaptcha(source) {\n if (this.debugValue) {\n // eslint-disable-next-line no-console\n console.log('Render Google reCaptcha', source, this.googleRecaptchaWidgetId, !!window.grecaptcha);\n }\n\n if (this.googleRecaptchaWidgetId) return;\n\n if (!window.grecaptcha || !window.grecaptcha.render) {\n console.warn('Google reCaptcha is not loaded.');\n return;\n }\n\n this.captchaTarget.innerHTML = '';\n this.googleRecaptchaWidgetId = window.grecaptcha.render(this.captchaTarget, {\n sitekey: this.googleRecaptchaSiteKeyValue,\n theme: this.themeValue,\n size: this.sizeValue,\n callback: (args) => {\n this.toggleParentFormButtons(true);\n\n this.resolvePendingCaptchaPromises(args);\n this.dispatch('success', { detail: args });\n },\n 'error-callback': (args) => {\n this.dispatch('error', { detail: args });\n\n console.warn('Turnstile error:', args);\n\n this.rejectPendingCaptchaPromises(args);\n this.showError(`Google reCaptcha bot verification error: ${JSON.stringify(args)}`);\n },\n 'expired-callback': (args) => {\n this.toggleParentFormButtons(false);\n\n this.rejectPendingCaptchaPromises(args);\n this.dispatch('expired', { detail: args });\n },\n });\n\n if (this.debugValue) {\n // eslint-disable-next-line no-console\n console.log('Rendered Google reCaptcha', this.googleRecaptchaWidgetId);\n }\n }\n\n show() {\n this.element.hidden = false;\n }\n\n showWarning(message) {\n this.warningTarget.querySelector('[data-captcha-message]').textContent = message;\n this.warningTarget.hidden = false;\n }\n\n showError(message) {\n this.errorTarget.querySelector('[data-captcha-message]').textContent = message;\n this.errorTarget.hidden = false;\n }\n\n toggleParentFormButtons(enabled) {\n if (this.invisible) {\n return;\n }\n\n const parentForm = this.parentForm;\n if (!parentForm) return;\n\n const buttons = parentForm.querySelectorAll('button[type=\"submit\"], input[type=\"submit\"]');\n for (const button of buttons) {\n button.disabled = !enabled;\n }\n }\n\n resolvePendingCaptchaPromises(arg) {\n for (const { resolve } of this.pendingCaptchaPromises) {\n resolve(arg);\n }\n\n this.pendingCaptchaPromises = [];\n }\n\n rejectPendingCaptchaPromises(arg) {\n for (const { reject } of this.pendingCaptchaPromises) {\n reject(arg);\n }\n\n this.pendingCaptchaPromises = [];\n }\n\n executeInvisibleCaptcha() {\n if (!this.invisible) {\n return Promise.reject();\n }\n\n if (!isVariableDefinedNotNull(this.googleRecaptchaWidgetId)) {\n return Promise.reject();\n }\n\n return new Promise((resolve, reject) => {\n this.pendingCaptchaPromises.push({ resolve, reject });\n window.grecaptcha.execute(this.googleRecaptchaWidgetId);\n });\n }\n\n get parentForm() {\n if (!this.formIdValue) return null;\n\n return document.getElementById(this.formIdValue);\n }\n\n get invisible() {\n return this.sizeValue === 'invisible';\n }\n}\n","import ButtonBaseController from 'fuse/button_base_component/button_base_component';\n\nexport default class extends ButtonBaseController {}\n","import { remove } from '@slideslive/fuse-kit/utils';\nimport ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n remove() {\n remove(this.element);\n }\n}\n","import ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n static targets = ['result'];\n\n initialize() {\n this.resultTimeoutId = null;\n }\n\n showResult() {\n clearTimeout(this.resultTimeoutId);\n\n this.resultTarget.hidden = false;\n this.resultTimeoutId = setTimeout(() => {\n this.resultTarget.hidden = true;\n }, 3000);\n }\n\n async copy(event) {\n event.preventDefault();\n\n try {\n if (this.value) {\n await navigator.clipboard.writeText(this.value);\n } else if (this.forId) {\n const element = this.elementToCopy;\n\n if (element) await this.copyFromElement(element);\n }\n\n this.showResult();\n this.dispatch('copied');\n } catch (error) {\n console.error('Copy failed:', error);\n }\n }\n\n async copyFromElement(element) {\n if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {\n await navigator.clipboard.writeText(element.value);\n } else if (element instanceof HTMLAnchorElement && element.hasAttribute('href')) {\n await navigator.clipboard.writeText(element.href);\n } else {\n await navigator.clipboard.writeText(element.textContent || '');\n }\n }\n\n get elementToCopy() {\n const root = this.element.getRootNode();\n\n return root instanceof Document || root instanceof ShadowRoot ? root.getElementById(this.forId) : null;\n }\n\n get value() {\n return this.element.dataset.value;\n }\n\n get forId() {\n return this.element.dataset.forId;\n }\n}\n","import { remove } from '@slideslive/fuse-kit/utils';\nimport ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n static values = {\n action: {\n type: String,\n default: 'accept',\n },\n modalComponentIdentifier: {\n type: String,\n required: true,\n },\n };\n\n connect() {\n const modalContentController = this._modalContentController;\n if (!modalContentController) return;\n\n if (this._isAcceptAction) {\n modalContentController.acceptModal(true);\n } else {\n modalContentController.rejectModal(true);\n }\n\n remove(this.element);\n }\n\n get _isAcceptAction() {\n return this.actionValue === 'accept';\n }\n\n get _modalContentController() {\n return this.findParentControllerByName(this.modalComponentIdentifierValue, {\n hideWarning: true,\n });\n }\n}\n","import { now } from '@slideslive/fuse-kit/utils';\nimport ApplicationController from 'modules/application_controller';\n\nexport default class extends ApplicationController {\n static values = {\n count: {\n type: Number,\n default: 0,\n },\n duration: {\n type: Number,\n default: 3000,\n },\n durationIsPerWholeNumber: {\n type: Boolean,\n default: true,\n },\n defaultStep: {\n type: Number,\n default: 1,\n },\n minIncreaseDelay: {\n type: Number,\n default: 25,\n },\n animationStartVisibilityThreshold: {\n type: Number,\n default: 0.1,\n },\n animationStartRootMargin: {\n type: Number,\n value: 0,\n },\n };\n\n initialize() {\n this.lastIncreaseAt = 0;\n this.observer = new IntersectionObserver(\n this.intersectionObserverCallback.bind(this),\n this.intersectionObserverOptions,\n );\n }\n\n connect() {\n this.currentValue = 0;\n this.element.textContent = this.currentValue;\n\n if (this.isTurboPreview) return;\n\n this.lastIncreaseAt = now();\n this.observer.observe(this.element);\n }\n\n disconnect() {\n this.observer.disconnect();\n }\n\n increase() {\n if (now() - this.lastIncreaseAt < this.increaseDelay) {\n requestAnimationFrame(this.increase.bind(this));\n return;\n }\n\n if (this.countValue <= this.currentValue) return;\n\n this.currentValue = Math.min(this.countValue, this.currentValue + this.increaseStep);\n this.element.textContent = this.currentValue.toLocaleString(gon.locale);\n\n this.lastIncreaseAt = now();\n requestAnimationFrame(this.increase.bind(this));\n }\n\n intersectionObserverCallback(entries, observer) {\n for (const { intersectionRatio, target } of entries) {\n if (intersectionRatio < this.animationStartVisibilityThresholdValue) continue;\n\n this.increase();\n observer.unobserve(target);\n }\n }\n\n get intersectionObserverOptions() {\n return {\n threshold: this.animationStartVisibilityThresholdValue,\n rootMargin: `${this.animationStartRootMarginValue}px`,\n };\n }\n\n get increaseStep() {\n if (!this.durationIsPerWholeNumberValue) {\n return this.defaultStepValue;\n }\n\n let step = this.defaultStepValue;\n\n while (this.durationValue / (this.countValue / step) < this.minIncreaseDelayValue) {\n step++;\n }\n\n return step;\n }\n\n get increaseDelay() {\n if (!this.durationIsPerWholeNumberValue) {\n return this.durationValue;\n }\n\n return this.durationValue / (this.countValue / this.increaseStep);\n }\n}\n","// nb. This is for IE10 and lower _only_.\nvar supportCustomEvent = window.CustomEvent;\nif (!supportCustomEvent || typeof supportCustomEvent === 'object') {\n supportCustomEvent = function CustomEvent(event, x) {\n x = x || {};\n var ev = document.createEvent('CustomEvent');\n ev.initCustomEvent(event, !!x.bubbles, !!x.cancelable, x.detail || null);\n return ev;\n };\n supportCustomEvent.prototype = window.Event.prototype;\n}\n\n/**\n * Dispatches the passed event to both an \"on\" handler as well as via the\n * normal dispatch operation. Does not bubble.\n *\n * @param {!EventTarget} target\n * @param {!Event} event\n * @return {boolean}\n */\nfunction safeDispatchEvent(target, event) {\n var check = 'on' + event.type.toLowerCase();\n if (typeof target[check] === 'function') {\n target[check](event);\n }\n return target.dispatchEvent(event);\n}\n\n/**\n * @param {Element} el to check for stacking context\n * @return {boolean} whether this el or its parents creates a stacking context\n */\nfunction createsStackingContext(el) {\n while (el && el !== document.body) {\n var s = window.getComputedStyle(el);\n var invalid = function(k, ok) {\n return !(s[k] === undefined || s[k] === ok);\n };\n\n if (s.opacity < 1 ||\n invalid('zIndex', 'auto') ||\n invalid('transform', 'none') ||\n invalid('mixBlendMode', 'normal') ||\n invalid('filter', 'none') ||\n invalid('perspective', 'none') ||\n s['isolation'] === 'isolate' ||\n s.position === 'fixed' ||\n s.webkitOverflowScrolling === 'touch') {\n return true;\n }\n el = el.parentElement;\n }\n return false;\n}\n\n/**\n * Finds the nearest from the passed element.\n *\n * @param {Element} el to search from\n * @return {HTMLDialogElement} dialog found\n */\nfunction findNearestDialog(el) {\n while (el) {\n if (el.localName === 'dialog') {\n return /** @type {HTMLDialogElement} */ (el);\n }\n if (el.parentElement) {\n el = el.parentElement;\n } else if (el.parentNode) {\n el = el.parentNode.host;\n } else {\n el = null;\n }\n }\n return null;\n}\n\n/**\n * Blur the specified element, as long as it's not the HTML body element.\n * This works around an IE9/10 bug - blurring the body causes Windows to\n * blur the whole application.\n *\n * @param {Element} el to blur\n */\nfunction safeBlur(el) {\n // Find the actual focused element when the active element is inside a shadow root\n while (el && el.shadowRoot && el.shadowRoot.activeElement) {\n el = el.shadowRoot.activeElement;\n }\n\n if (el && el.blur && el !== document.body) {\n el.blur();\n }\n}\n\n/**\n * @param {!NodeList} nodeList to search\n * @param {Node} node to find\n * @return {boolean} whether node is inside nodeList\n */\nfunction inNodeList(nodeList, node) {\n for (var i = 0; i < nodeList.length; ++i) {\n if (nodeList[i] === node) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * @param {HTMLFormElement} el to check\n * @return {boolean} whether this form has method=\"dialog\"\n */\nfunction isFormMethodDialog(el) {\n if (!el || !el.hasAttribute('method')) {\n return false;\n }\n return el.getAttribute('method').toLowerCase() === 'dialog';\n}\n\n/**\n * @param {!DocumentFragment|!Element} hostElement\n * @return {?Element}\n */\nfunction findFocusableElementWithin(hostElement) {\n // Note that this is 'any focusable area'. This list is probably not exhaustive, but the\n // alternative involves stepping through and trying to focus everything.\n var opts = ['button', 'input', 'keygen', 'select', 'textarea'];\n var query = opts.map(function(el) {\n return el + ':not([disabled])';\n });\n // TODO(samthor): tabindex values that are not numeric are not focusable.\n query.push('[tabindex]:not([disabled]):not([tabindex=\"\"])'); // tabindex != \"\", not disabled\n var target = hostElement.querySelector(query.join(', '));\n\n if (!target && 'attachShadow' in Element.prototype) {\n // If we haven't found a focusable target, see if the host element contains an element\n // which has a shadowRoot.\n // Recursively search for the first focusable item in shadow roots.\n var elems = hostElement.querySelectorAll('*');\n for (var i = 0; i < elems.length; i++) {\n if (elems[i].tagName && elems[i].shadowRoot) {\n target = findFocusableElementWithin(elems[i].shadowRoot);\n if (target) {\n break;\n }\n }\n }\n }\n return target;\n}\n\n/**\n * Determines if an element is attached to the DOM.\n * @param {Element} element to check\n * @return {boolean} whether the element is in DOM\n */\nfunction isConnected(element) {\n return element.isConnected || document.body.contains(element);\n}\n\n/**\n * @param {!Event} event\n * @return {?Element}\n */\nfunction findFormSubmitter(event) {\n if (event.submitter) {\n return event.submitter;\n }\n\n var form = event.target;\n if (!(form instanceof HTMLFormElement)) {\n return null;\n }\n\n var submitter = dialogPolyfill.formSubmitter;\n if (!submitter) {\n var target = event.target;\n var root = ('getRootNode' in target && target.getRootNode() || document);\n submitter = root.activeElement;\n }\n\n if (!submitter || submitter.form !== form) {\n return null;\n }\n return submitter;\n}\n\n/**\n * @param {!Event} event\n */\nfunction maybeHandleSubmit(event) {\n if (event.defaultPrevented) {\n return;\n }\n var form = /** @type {!HTMLFormElement} */ (event.target);\n\n // We'd have a value if we clicked on an imagemap.\n var value = dialogPolyfill.imagemapUseValue;\n var submitter = findFormSubmitter(event);\n if (value === null && submitter) {\n value = submitter.value;\n }\n\n // There should always be a dialog as this handler is added specifically on them, but check just\n // in case.\n var dialog = findNearestDialog(form);\n if (!dialog) {\n return;\n }\n\n // Prefer formmethod on the button.\n var formmethod = submitter && submitter.getAttribute('formmethod') || form.getAttribute('method');\n if (formmethod !== 'dialog') {\n return;\n }\n event.preventDefault();\n\n if (value != null) {\n // nb. we explicitly check against null/undefined\n dialog.close(value);\n } else {\n dialog.close();\n }\n}\n\n/**\n * @param {!HTMLDialogElement} dialog to upgrade\n * @constructor\n */\nfunction dialogPolyfillInfo(dialog) {\n this.dialog_ = dialog;\n this.replacedStyleTop_ = false;\n this.openAsModal_ = false;\n\n // Set a11y role. Browsers that support dialog implicitly know this already.\n if (!dialog.hasAttribute('role')) {\n dialog.setAttribute('role', 'dialog');\n }\n\n dialog.show = this.show.bind(this);\n dialog.showModal = this.showModal.bind(this);\n dialog.close = this.close.bind(this);\n\n dialog.addEventListener('submit', maybeHandleSubmit, false);\n\n if (!('returnValue' in dialog)) {\n dialog.returnValue = '';\n }\n\n if ('MutationObserver' in window) {\n var mo = new MutationObserver(this.maybeHideModal.bind(this));\n mo.observe(dialog, {attributes: true, attributeFilter: ['open']});\n } else {\n // IE10 and below support. Note that DOMNodeRemoved etc fire _before_ removal. They also\n // seem to fire even if the element was removed as part of a parent removal. Use the removed\n // events to force downgrade (useful if removed/immediately added).\n var removed = false;\n var cb = function() {\n removed ? this.downgradeModal() : this.maybeHideModal();\n removed = false;\n }.bind(this);\n var timeout;\n var delayModel = function(ev) {\n if (ev.target !== dialog) { return; } // not for a child element\n var cand = 'DOMNodeRemoved';\n removed |= (ev.type.substr(0, cand.length) === cand);\n window.clearTimeout(timeout);\n timeout = window.setTimeout(cb, 0);\n };\n ['DOMAttrModified', 'DOMNodeRemoved', 'DOMNodeRemovedFromDocument'].forEach(function(name) {\n dialog.addEventListener(name, delayModel);\n });\n }\n // Note that the DOM is observed inside DialogManager while any dialog\n // is being displayed as a modal, to catch modal removal from the DOM.\n\n Object.defineProperty(dialog, 'open', {\n set: this.setOpen.bind(this),\n get: dialog.hasAttribute.bind(dialog, 'open')\n });\n\n this.backdrop_ = document.createElement('div');\n this.backdrop_.className = 'backdrop';\n this.backdrop_.addEventListener('mouseup' , this.backdropMouseEvent_.bind(this));\n this.backdrop_.addEventListener('mousedown', this.backdropMouseEvent_.bind(this));\n this.backdrop_.addEventListener('click' , this.backdropMouseEvent_.bind(this));\n}\n\ndialogPolyfillInfo.prototype = /** @type {HTMLDialogElement.prototype} */ ({\n\n get dialog() {\n return this.dialog_;\n },\n\n /**\n * Maybe remove this dialog from the modal top layer. This is called when\n * a modal dialog may no longer be tenable, e.g., when the dialog is no\n * longer open or is no longer part of the DOM.\n */\n maybeHideModal: function() {\n if (this.dialog_.hasAttribute('open') && isConnected(this.dialog_)) { return; }\n this.downgradeModal();\n },\n\n /**\n * Remove this dialog from the modal top layer, leaving it as a non-modal.\n */\n downgradeModal: function() {\n if (!this.openAsModal_) { return; }\n this.openAsModal_ = false;\n this.dialog_.style.zIndex = '';\n\n // This won't match the native exactly because if the user set top on a centered\n // polyfill dialog, that top gets thrown away when the dialog is closed. Not sure it's\n // possible to polyfill this perfectly.\n if (this.replacedStyleTop_) {\n this.dialog_.style.top = '';\n this.replacedStyleTop_ = false;\n }\n\n // Clear the backdrop and remove from the manager.\n this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_);\n dialogPolyfill.dm.removeDialog(this);\n },\n\n /**\n * @param {boolean} value whether to open or close this dialog\n */\n setOpen: function(value) {\n if (value) {\n this.dialog_.hasAttribute('open') || this.dialog_.setAttribute('open', '');\n } else {\n this.dialog_.removeAttribute('open');\n this.maybeHideModal(); // nb. redundant with MutationObserver\n }\n },\n\n /**\n * Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if\n * they were on the dialog itself.\n *\n * @param {!Event} e to redirect\n */\n backdropMouseEvent_: function(e) {\n if (!this.dialog_.hasAttribute('tabindex')) {\n // Clicking on the backdrop should move the implicit cursor, even if dialog cannot be\n // focused. Create a fake thing to focus on. If the backdrop was _before_ the dialog, this\n // would not be needed - clicks would move the implicit cursor there.\n var fake = document.createElement('div');\n this.dialog_.insertBefore(fake, this.dialog_.firstChild);\n fake.tabIndex = -1;\n fake.focus();\n this.dialog_.removeChild(fake);\n } else {\n this.dialog_.focus();\n }\n\n var redirectedEvent = document.createEvent('MouseEvents');\n redirectedEvent.initMouseEvent(e.type, e.bubbles, e.cancelable, window,\n e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey,\n e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);\n this.dialog_.dispatchEvent(redirectedEvent);\n e.stopPropagation();\n },\n\n /**\n * Focuses on the first focusable element within the dialog. This will always blur the current\n * focus, even if nothing within the dialog is found.\n */\n focus_: function() {\n // Find element with `autofocus` attribute, or fall back to the first form/tabindex control.\n var target = this.dialog_.querySelector('[autofocus]:not([disabled])');\n if (!target && this.dialog_.tabIndex >= 0) {\n target = this.dialog_;\n }\n if (!target) {\n target = findFocusableElementWithin(this.dialog_);\n }\n safeBlur(document.activeElement);\n target && target.focus();\n },\n\n /**\n * Sets the zIndex for the backdrop and dialog.\n *\n * @param {number} dialogZ\n * @param {number} backdropZ\n */\n updateZIndex: function(dialogZ, backdropZ) {\n if (dialogZ < backdropZ) {\n throw new Error('dialogZ should never be < backdropZ');\n }\n this.dialog_.style.zIndex = dialogZ;\n this.backdrop_.style.zIndex = backdropZ;\n },\n\n /**\n * Shows the dialog. If the dialog is already open, this does nothing.\n */\n show: function() {\n if (!this.dialog_.open) {\n this.setOpen(true);\n this.focus_();\n }\n },\n\n /**\n * Show this dialog modally.\n */\n showModal: function() {\n if (this.dialog_.hasAttribute('open')) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: The element is already open, and therefore cannot be opened modally.');\n }\n if (!isConnected(this.dialog_)) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: The element is not in a Document.');\n }\n if (!dialogPolyfill.dm.pushDialog(this)) {\n throw new Error('Failed to execute \\'showModal\\' on dialog: There are too many open modal dialogs.');\n }\n\n if (createsStackingContext(this.dialog_.parentElement)) {\n console.warn('A dialog is being shown inside a stacking context. ' +\n 'This may cause it to be unusable. For more information, see this link: ' +\n 'https://github.com/GoogleChrome/dialog-polyfill/#stacking-context');\n }\n\n this.setOpen(true);\n this.openAsModal_ = true;\n\n // Optionally center vertically, relative to the current viewport.\n if (dialogPolyfill.needsCentering(this.dialog_)) {\n dialogPolyfill.reposition(this.dialog_);\n this.replacedStyleTop_ = true;\n } else {\n this.replacedStyleTop_ = false;\n }\n\n // Insert backdrop.\n this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling);\n\n // Focus on whatever inside the dialog.\n this.focus_();\n },\n\n /**\n * Closes this HTMLDialogElement. This is optional vs clearing the open\n * attribute, however this fires a 'close' event.\n *\n * @param {string=} opt_returnValue to use as the returnValue\n */\n close: function(opt_returnValue) {\n if (!this.dialog_.hasAttribute('open')) {\n throw new Error('Failed to execute \\'close\\' on dialog: The element does not have an \\'open\\' attribute, and therefore cannot be closed.');\n }\n this.setOpen(false);\n\n // Leave returnValue untouched in case it was set directly on the element\n if (opt_returnValue !== undefined) {\n this.dialog_.returnValue = opt_returnValue;\n }\n\n // Triggering \"close\" event for any attached listeners on the .\n var closeEvent = new supportCustomEvent('close', {\n bubbles: false,\n cancelable: false\n });\n safeDispatchEvent(this.dialog_, closeEvent);\n }\n\n});\n\nvar dialogPolyfill = {};\n\ndialogPolyfill.reposition = function(element) {\n var scrollTop = document.body.scrollTop || document.documentElement.scrollTop;\n var topValue = scrollTop + (window.innerHeight - element.offsetHeight) / 2;\n element.style.top = Math.max(scrollTop, topValue) + 'px';\n};\n\ndialogPolyfill.isInlinePositionSetByStylesheet = function(element) {\n for (var i = 0; i < document.styleSheets.length; ++i) {\n var styleSheet = document.styleSheets[i];\n var cssRules = null;\n // Some browsers throw on cssRules.\n try {\n cssRules = styleSheet.cssRules;\n } catch (e) {}\n if (!cssRules) { continue; }\n for (var j = 0; j < cssRules.length; ++j) {\n var rule = cssRules[j];\n var selectedNodes = null;\n // Ignore errors on invalid selector texts.\n try {\n selectedNodes = document.querySelectorAll(rule.selectorText);\n } catch(e) {}\n if (!selectedNodes || !inNodeList(selectedNodes, element)) {\n continue;\n }\n var cssTop = rule.style.getPropertyValue('top');\n var cssBottom = rule.style.getPropertyValue('bottom');\n if ((cssTop && cssTop !== 'auto') || (cssBottom && cssBottom !== 'auto')) {\n return true;\n }\n }\n }\n return false;\n};\n\ndialogPolyfill.needsCentering = function(dialog) {\n var computedStyle = window.getComputedStyle(dialog);\n if (computedStyle.position !== 'absolute') {\n return false;\n }\n\n // We must determine whether the top/bottom specified value is non-auto. In\n // WebKit/Blink, checking computedStyle.top == 'auto' is sufficient, but\n // Firefox returns the used value. So we do this crazy thing instead: check\n // the inline style and then go through CSS rules.\n if ((dialog.style.top !== 'auto' && dialog.style.top !== '') ||\n (dialog.style.bottom !== 'auto' && dialog.style.bottom !== '')) {\n return false;\n }\n return !dialogPolyfill.isInlinePositionSetByStylesheet(dialog);\n};\n\n/**\n * @param {!Element} element to force upgrade\n */\ndialogPolyfill.forceRegisterDialog = function(element) {\n if (window.HTMLDialogElement || element.showModal) {\n console.warn('This browser already supports , the polyfill ' +\n 'may not work correctly', element);\n }\n if (element.localName !== 'dialog') {\n throw new Error('Failed to register dialog: The element is not a dialog.');\n }\n new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));\n};\n\n/**\n * @param {!Element} element to upgrade, if necessary\n */\ndialogPolyfill.registerDialog = function(element) {\n if (!element.showModal) {\n dialogPolyfill.forceRegisterDialog(element);\n }\n};\n\n/**\n * @constructor\n */\ndialogPolyfill.DialogManager = function() {\n /** @type {!Array} */\n this.pendingDialogStack = [];\n\n var checkDOM = this.checkDOM_.bind(this);\n\n // The overlay is used to simulate how a modal dialog blocks the document.\n // The blocking dialog is positioned on top of the overlay, and the rest of\n // the dialogs on the pending dialog stack are positioned below it. In the\n // actual implementation, the modal dialog stacking is controlled by the\n // top layer, where z-index has no effect.\n this.overlay = document.createElement('div');\n this.overlay.className = '_dialog_overlay';\n this.overlay.addEventListener('click', function(e) {\n this.forwardTab_ = undefined;\n e.stopPropagation();\n checkDOM([]); // sanity-check DOM\n }.bind(this));\n\n this.handleKey_ = this.handleKey_.bind(this);\n this.handleFocus_ = this.handleFocus_.bind(this);\n\n this.zIndexLow_ = 100000;\n this.zIndexHigh_ = 100000 + 150;\n\n this.forwardTab_ = undefined;\n\n if ('MutationObserver' in window) {\n this.mo_ = new MutationObserver(function(records) {\n var removed = [];\n records.forEach(function(rec) {\n for (var i = 0, c; c = rec.removedNodes[i]; ++i) {\n if (!(c instanceof Element)) {\n continue;\n } else if (c.localName === 'dialog') {\n removed.push(c);\n }\n removed = removed.concat(c.querySelectorAll('dialog'));\n }\n });\n removed.length && checkDOM(removed);\n });\n }\n};\n\n/**\n * Called on the first modal dialog being shown. Adds the overlay and related\n * handlers.\n */\ndialogPolyfill.DialogManager.prototype.blockDocument = function() {\n document.documentElement.addEventListener('focus', this.handleFocus_, true);\n document.addEventListener('keydown', this.handleKey_);\n this.mo_ && this.mo_.observe(document, {childList: true, subtree: true});\n};\n\n/**\n * Called on the first modal dialog being removed, i.e., when no more modal\n * dialogs are visible.\n */\ndialogPolyfill.DialogManager.prototype.unblockDocument = function() {\n document.documentElement.removeEventListener('focus', this.handleFocus_, true);\n document.removeEventListener('keydown', this.handleKey_);\n this.mo_ && this.mo_.disconnect();\n};\n\n/**\n * Updates the stacking of all known dialogs.\n */\ndialogPolyfill.DialogManager.prototype.updateStacking = function() {\n var zIndex = this.zIndexHigh_;\n\n for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n dpi.updateZIndex(--zIndex, --zIndex);\n if (i === 0) {\n this.overlay.style.zIndex = --zIndex;\n }\n }\n\n // Make the overlay a sibling of the dialog itself.\n var last = this.pendingDialogStack[0];\n if (last) {\n var p = last.dialog.parentNode || document.body;\n p.appendChild(this.overlay);\n } else if (this.overlay.parentNode) {\n this.overlay.parentNode.removeChild(this.overlay);\n }\n};\n\n/**\n * @param {Element} candidate to check if contained or is the top-most modal dialog\n * @return {boolean} whether candidate is contained in top dialog\n */\ndialogPolyfill.DialogManager.prototype.containedByTopDialog_ = function(candidate) {\n while (candidate = findNearestDialog(candidate)) {\n for (var i = 0, dpi; dpi = this.pendingDialogStack[i]; ++i) {\n if (dpi.dialog === candidate) {\n return i === 0; // only valid if top-most\n }\n }\n candidate = candidate.parentElement;\n }\n return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleFocus_ = function(event) {\n var target = event.composedPath ? event.composedPath()[0] : event.target;\n\n if (this.containedByTopDialog_(target)) { return; }\n\n if (document.activeElement === document.documentElement) { return; }\n\n event.preventDefault();\n event.stopPropagation();\n safeBlur(/** @type {Element} */ (target));\n\n if (this.forwardTab_ === undefined) { return; } // move focus only from a tab key\n\n var dpi = this.pendingDialogStack[0];\n var dialog = dpi.dialog;\n var position = dialog.compareDocumentPosition(target);\n if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n if (this.forwardTab_) {\n // forward\n dpi.focus_();\n } else if (target !== document.documentElement) {\n // backwards if we're not already focused on \n document.documentElement.focus();\n }\n }\n\n return false;\n};\n\ndialogPolyfill.DialogManager.prototype.handleKey_ = function(event) {\n this.forwardTab_ = undefined;\n if (event.keyCode === 27) {\n event.preventDefault();\n event.stopPropagation();\n var cancelEvent = new supportCustomEvent('cancel', {\n bubbles: false,\n cancelable: true\n });\n var dpi = this.pendingDialogStack[0];\n if (dpi && safeDispatchEvent(dpi.dialog, cancelEvent)) {\n dpi.dialog.close();\n }\n } else if (event.keyCode === 9) {\n this.forwardTab_ = !event.shiftKey;\n }\n};\n\n/**\n * Finds and downgrades any known modal dialogs that are no longer displayed. Dialogs that are\n * removed and immediately readded don't stay modal, they become normal.\n *\n * @param {!Array} removed that have definitely been removed\n */\ndialogPolyfill.DialogManager.prototype.checkDOM_ = function(removed) {\n // This operates on a clone because it may cause it to change. Each change also calls\n // updateStacking, which only actually needs to happen once. But who removes many modal dialogs\n // at a time?!\n var clone = this.pendingDialogStack.slice();\n clone.forEach(function(dpi) {\n if (removed.indexOf(dpi.dialog) !== -1) {\n dpi.downgradeModal();\n } else {\n dpi.maybeHideModal();\n }\n });\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n * @return {boolean} whether the dialog was allowed\n */\ndialogPolyfill.DialogManager.prototype.pushDialog = function(dpi) {\n var allowed = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;\n if (this.pendingDialogStack.length >= allowed) {\n return false;\n }\n if (this.pendingDialogStack.unshift(dpi) === 1) {\n this.blockDocument();\n }\n this.updateStacking();\n return true;\n};\n\n/**\n * @param {!dialogPolyfillInfo} dpi\n */\ndialogPolyfill.DialogManager.prototype.removeDialog = function(dpi) {\n var index = this.pendingDialogStack.indexOf(dpi);\n if (index === -1) { return; }\n\n this.pendingDialogStack.splice(index, 1);\n if (this.pendingDialogStack.length === 0) {\n this.unblockDocument();\n }\n this.updateStacking();\n};\n\ndialogPolyfill.dm = new dialogPolyfill.DialogManager();\ndialogPolyfill.formSubmitter = null;\ndialogPolyfill.imagemapUseValue = null;\n\n/**\n * Installs global handlers, such as click listers and native method overrides. These are needed\n * even if a no dialog is registered, as they deal with
.\n */\nif (window.HTMLDialogElement === undefined) {\n\n /**\n * If HTMLFormElement translates method=\"DIALOG\" into 'get', then replace the descriptor with\n * one that returns the correct value.\n */\n var testForm = document.createElement('form');\n testForm.setAttribute('method', 'dialog');\n if (testForm.method !== 'dialog') {\n var methodDescriptor = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'method');\n if (methodDescriptor) {\n // nb. Some older iOS and older PhantomJS fail to return the descriptor. Don't do anything\n // and don't bother to update the element.\n var realGet = methodDescriptor.get;\n methodDescriptor.get = function() {\n if (isFormMethodDialog(this)) {\n return 'dialog';\n }\n return realGet.call(this);\n };\n var realSet = methodDescriptor.set;\n /** @this {HTMLElement} */\n methodDescriptor.set = function(v) {\n if (typeof v === 'string' && v.toLowerCase() === 'dialog') {\n return this.setAttribute('method', v);\n }\n return realSet.call(this, v);\n };\n Object.defineProperty(HTMLFormElement.prototype, 'method', methodDescriptor);\n }\n }\n\n /**\n * Global 'click' handler, to capture the or