{"version":3,"file":"compiler.mjs","sources":["src/compiler/Stats.ts","src/compiler/utils/patterns.ts","src/compiler/utils/extract_svelte_ignore.ts","src/compiler/utils/fuzzymatch.ts","src/shared/utils/names.ts","src/compiler/parse/errors.ts","node_modules/estree-walker/src/walker.js","node_modules/estree-walker/src/sync.js","node_modules/estree-walker/src/index.js","node_modules/code-red/src/utils/id.js","node_modules/code-red/src/utils/comments.js","node_modules/is-reference/src/index.js","node_modules/periscopic/src/index.js","node_modules/code-red/src/utils/push_array.js","node_modules/code-red/src/print/handlers.js","node_modules/sourcemap-codec/dist/sourcemap-codec.es.js","node_modules/code-red/src/print/index.js","node_modules/code-red/src/index.js","src/compiler/parse/acorn.ts","src/compiler/parse/read/script.ts","src/compiler/parse/read/style.ts","src/compiler/parse/utils/entities.ts","src/compiler/parse/utils/html.ts","src/compiler/parse/state/tag.ts","src/compiler/utils/full_char_code_at.ts","src/compiler/parse/utils/bracket.ts","src/compiler/utils/trim.ts","src/compiler/parse/state/mustache.ts","src/compiler/utils/names.ts","node_modules/locate-character/dist/locate-character.es.js","src/compiler/utils/get_code_frame.ts","src/compiler/utils/error.ts","src/compiler/parse/index.ts","src/compiler/compile/compiler_warnings.ts","src/compiler/compile/nodes/shared/AbstractBlock.ts","src/compiler/compile/utils/flatten_reference.ts","src/compiler/compile/utils/reserved_keywords.ts","src/compiler/compile/render_dom/invalidate.ts","src/compiler/utils/clone.ts","src/compiler/compile/compiler_errors.ts","src/compiler/compile/nodes/shared/Expression.ts","src/compiler/compile/nodes/shared/Context.ts","src/compiler/compile/nodes/ConstTag.ts","src/compiler/compile/nodes/AwaitBlock.ts","src/compiler/compile/nodes/EventHandler.ts","src/compiler/compile/nodes/Body.ts","src/compiler/compile/nodes/EachBlock.ts","src/compiler/compile/utils/stringify.ts","src/compiler/compile/nodes/Binding.ts","src/compiler/compile/utils/nodes_to_template_literal.ts","src/compiler/compile/nodes/StyleDirective.ts","src/compiler/compile/nodes/Text.ts","src/compiler/utils/namespaces.ts","src/compiler/compile/nodes/Let.ts","node_modules/aria-query/lib/util/iteratorProxy.js","node_modules/aria-query/lib/util/iterationDecorator.js","node_modules/aria-query/lib/ariaPropsMap.js","node_modules/aria-query/lib/domMap.js","node_modules/aria-query/lib/etc/roles/abstract/commandRole.js","node_modules/aria-query/lib/etc/roles/abstract/compositeRole.js","node_modules/aria-query/lib/etc/roles/abstract/inputRole.js","node_modules/aria-query/lib/etc/roles/abstract/landmarkRole.js","node_modules/aria-query/lib/etc/roles/abstract/rangeRole.js","node_modules/aria-query/lib/etc/roles/abstract/roletypeRole.js","node_modules/aria-query/lib/etc/roles/abstract/sectionRole.js","node_modules/aria-query/lib/etc/roles/abstract/sectionheadRole.js","node_modules/aria-query/lib/etc/roles/abstract/selectRole.js","node_modules/aria-query/lib/etc/roles/abstract/structureRole.js","node_modules/aria-query/lib/etc/roles/abstract/widgetRole.js","node_modules/aria-query/lib/etc/roles/abstract/windowRole.js","node_modules/aria-query/lib/etc/roles/ariaAbstractRoles.js","node_modules/aria-query/lib/etc/roles/literal/alertRole.js","node_modules/aria-query/lib/etc/roles/literal/alertdialogRole.js","node_modules/aria-query/lib/etc/roles/literal/applicationRole.js","node_modules/aria-query/lib/etc/roles/literal/articleRole.js","node_modules/aria-query/lib/etc/roles/literal/bannerRole.js","node_modules/aria-query/lib/etc/roles/literal/blockquoteRole.js","node_modules/aria-query/lib/etc/roles/literal/buttonRole.js","node_modules/aria-query/lib/etc/roles/literal/captionRole.js","node_modules/aria-query/lib/etc/roles/literal/cellRole.js","node_modules/aria-query/lib/etc/roles/literal/checkboxRole.js","node_modules/aria-query/lib/etc/roles/literal/codeRole.js","node_modules/aria-query/lib/etc/roles/literal/columnheaderRole.js","node_modules/aria-query/lib/etc/roles/literal/comboboxRole.js","node_modules/aria-query/lib/etc/roles/literal/complementaryRole.js","node_modules/aria-query/lib/etc/roles/literal/contentinfoRole.js","node_modules/aria-query/lib/etc/roles/literal/definitionRole.js","node_modules/aria-query/lib/etc/roles/literal/deletionRole.js","node_modules/aria-query/lib/etc/roles/literal/dialogRole.js","node_modules/aria-query/lib/etc/roles/literal/directoryRole.js","node_modules/aria-query/lib/etc/roles/literal/documentRole.js","node_modules/aria-query/lib/etc/roles/literal/emphasisRole.js","node_modules/aria-query/lib/etc/roles/literal/feedRole.js","node_modules/aria-query/lib/etc/roles/literal/figureRole.js","node_modules/aria-query/lib/etc/roles/literal/formRole.js","node_modules/aria-query/lib/etc/roles/literal/genericRole.js","node_modules/aria-query/lib/etc/roles/literal/gridRole.js","node_modules/aria-query/lib/etc/roles/literal/gridcellRole.js","node_modules/aria-query/lib/etc/roles/literal/groupRole.js","node_modules/aria-query/lib/etc/roles/literal/headingRole.js","node_modules/aria-query/lib/etc/roles/literal/imgRole.js","node_modules/aria-query/lib/etc/roles/literal/insertionRole.js","node_modules/aria-query/lib/etc/roles/literal/linkRole.js","node_modules/aria-query/lib/etc/roles/literal/listRole.js","node_modules/aria-query/lib/etc/roles/literal/listboxRole.js","node_modules/aria-query/lib/etc/roles/literal/listitemRole.js","node_modules/aria-query/lib/etc/roles/literal/logRole.js","node_modules/aria-query/lib/etc/roles/literal/mainRole.js","node_modules/aria-query/lib/etc/roles/literal/marqueeRole.js","node_modules/aria-query/lib/etc/roles/literal/mathRole.js","node_modules/aria-query/lib/etc/roles/literal/menuRole.js","node_modules/aria-query/lib/etc/roles/literal/menubarRole.js","node_modules/aria-query/lib/etc/roles/literal/menuitemRole.js","node_modules/aria-query/lib/etc/roles/literal/menuitemcheckboxRole.js","node_modules/aria-query/lib/etc/roles/literal/menuitemradioRole.js","node_modules/aria-query/lib/etc/roles/literal/meterRole.js","node_modules/aria-query/lib/etc/roles/literal/navigationRole.js","node_modules/aria-query/lib/etc/roles/literal/noneRole.js","node_modules/aria-query/lib/etc/roles/literal/noteRole.js","node_modules/aria-query/lib/etc/roles/literal/optionRole.js","node_modules/aria-query/lib/etc/roles/literal/paragraphRole.js","node_modules/aria-query/lib/etc/roles/literal/presentationRole.js","node_modules/aria-query/lib/etc/roles/literal/progressbarRole.js","node_modules/aria-query/lib/etc/roles/literal/radioRole.js","node_modules/aria-query/lib/etc/roles/literal/radiogroupRole.js","node_modules/aria-query/lib/etc/roles/literal/regionRole.js","node_modules/aria-query/lib/etc/roles/literal/rowRole.js","node_modules/aria-query/lib/etc/roles/literal/rowgroupRole.js","node_modules/aria-query/lib/etc/roles/literal/rowheaderRole.js","node_modules/aria-query/lib/etc/roles/literal/scrollbarRole.js","node_modules/aria-query/lib/etc/roles/literal/searchRole.js","node_modules/aria-query/lib/etc/roles/literal/searchboxRole.js","node_modules/aria-query/lib/etc/roles/literal/separatorRole.js","node_modules/aria-query/lib/etc/roles/literal/sliderRole.js","node_modules/aria-query/lib/etc/roles/literal/spinbuttonRole.js","node_modules/aria-query/lib/etc/roles/literal/statusRole.js","node_modules/aria-query/lib/etc/roles/literal/strongRole.js","node_modules/aria-query/lib/etc/roles/literal/subscriptRole.js","node_modules/aria-query/lib/etc/roles/literal/superscriptRole.js","node_modules/aria-query/lib/etc/roles/literal/switchRole.js","node_modules/aria-query/lib/etc/roles/literal/tabRole.js","node_modules/aria-query/lib/etc/roles/literal/tableRole.js","node_modules/aria-query/lib/etc/roles/literal/tablistRole.js","node_modules/aria-query/lib/etc/roles/literal/tabpanelRole.js","node_modules/aria-query/lib/etc/roles/literal/termRole.js","node_modules/aria-query/lib/etc/roles/literal/textboxRole.js","node_modules/aria-query/lib/etc/roles/literal/timeRole.js","node_modules/aria-query/lib/etc/roles/literal/timerRole.js","node_modules/aria-query/lib/etc/roles/literal/toolbarRole.js","node_modules/aria-query/lib/etc/roles/literal/tooltipRole.js","node_modules/aria-query/lib/etc/roles/literal/treeRole.js","node_modules/aria-query/lib/etc/roles/literal/treegridRole.js","node_modules/aria-query/lib/etc/roles/literal/treeitemRole.js","node_modules/aria-query/lib/etc/roles/ariaLiteralRoles.js","node_modules/aria-query/lib/etc/roles/dpub/docAbstractRole.js","node_modules/aria-query/lib/etc/roles/dpub/docAcknowledgmentsRole.js","node_modules/aria-query/lib/etc/roles/dpub/docAfterwordRole.js","node_modules/aria-query/lib/etc/roles/dpub/docAppendixRole.js","node_modules/aria-query/lib/etc/roles/dpub/docBacklinkRole.js","node_modules/aria-query/lib/etc/roles/dpub/docBiblioentryRole.js","node_modules/aria-query/lib/etc/roles/dpub/docBibliographyRole.js","node_modules/aria-query/lib/etc/roles/dpub/docBibliorefRole.js","node_modules/aria-query/lib/etc/roles/dpub/docChapterRole.js","node_modules/aria-query/lib/etc/roles/dpub/docColophonRole.js","node_modules/aria-query/lib/etc/roles/dpub/docConclusionRole.js","node_modules/aria-query/lib/etc/roles/dpub/docCoverRole.js","node_modules/aria-query/lib/etc/roles/dpub/docCreditRole.js","node_modules/aria-query/lib/etc/roles/dpub/docCreditsRole.js","node_modules/aria-query/lib/etc/roles/dpub/docDedicationRole.js","node_modules/aria-query/lib/etc/roles/dpub/docEndnoteRole.js","node_modules/aria-query/lib/etc/roles/dpub/docEndnotesRole.js","node_modules/aria-query/lib/etc/roles/dpub/docEpigraphRole.js","node_modules/aria-query/lib/etc/roles/dpub/docEpilogueRole.js","node_modules/aria-query/lib/etc/roles/dpub/docErrataRole.js","node_modules/aria-query/lib/etc/roles/dpub/docExampleRole.js","node_modules/aria-query/lib/etc/roles/dpub/docFootnoteRole.js","node_modules/aria-query/lib/etc/roles/dpub/docForewordRole.js","node_modules/aria-query/lib/etc/roles/dpub/docGlossaryRole.js","node_modules/aria-query/lib/etc/roles/dpub/docGlossrefRole.js","node_modules/aria-query/lib/etc/roles/dpub/docIndexRole.js","node_modules/aria-query/lib/etc/roles/dpub/docIntroductionRole.js","node_modules/aria-query/lib/etc/roles/dpub/docNoterefRole.js","node_modules/aria-query/lib/etc/roles/dpub/docNoticeRole.js","node_modules/aria-query/lib/etc/roles/dpub/docPagebreakRole.js","node_modules/aria-query/lib/etc/roles/dpub/docPagelistRole.js","node_modules/aria-query/lib/etc/roles/dpub/docPartRole.js","node_modules/aria-query/lib/etc/roles/dpub/docPrefaceRole.js","node_modules/aria-query/lib/etc/roles/dpub/docPrologueRole.js","node_modules/aria-query/lib/etc/roles/dpub/docPullquoteRole.js","node_modules/aria-query/lib/etc/roles/dpub/docQnaRole.js","node_modules/aria-query/lib/etc/roles/dpub/docSubtitleRole.js","node_modules/aria-query/lib/etc/roles/dpub/docTipRole.js","node_modules/aria-query/lib/etc/roles/dpub/docTocRole.js","node_modules/aria-query/lib/etc/roles/ariaDpubRoles.js","node_modules/aria-query/lib/rolesMap.js","node_modules/object-keys/isArguments.js","node_modules/object-keys/implementation.js","node_modules/object-keys/index.js","node_modules/has-symbols/shams.js","node_modules/has-tostringtag/shams.js","node_modules/has-symbols/index.js","node_modules/function-bind/implementation.js","node_modules/function-bind/index.js","node_modules/has/src/index.js","node_modules/get-intrinsic/index.js","node_modules/call-bind/index.js","node_modules/call-bind/callBound.js","node_modules/is-arguments/index.js","node_modules/has-property-descriptors/index.js","node_modules/define-properties/index.js","node_modules/object-is/implementation.js","node_modules/object-is/polyfill.js","node_modules/object-is/shim.js","node_modules/object-is/index.js","node_modules/is-regex/index.js","node_modules/functions-have-names/index.js","node_modules/regexp.prototype.flags/implementation.js","node_modules/regexp.prototype.flags/polyfill.js","node_modules/regexp.prototype.flags/shim.js","node_modules/regexp.prototype.flags/index.js","node_modules/deep-equal/node_modules/isarray/index.js","node_modules/is-date-object/index.js","node_modules/is-string/index.js","node_modules/is-number-object/index.js","node_modules/is-boolean-object/index.js","node_modules/is-symbol/index.js","node_modules/has-bigints/index.js","node_modules/is-bigint/index.js","node_modules/which-boxed-primitive/index.js","node_modules/is-map/index.js","node_modules/is-set/index.js","node_modules/is-weakmap/index.js","node_modules/is-weakset/index.js","node_modules/which-collection/index.js","node_modules/es-get-iterator/node.mjs","node_modules/is-generator-function/index.js","node_modules/is-callable/index.js","node_modules/for-each/index.js","node_modules/available-typed-arrays/index.js","node_modules/es-abstract/helpers/getOwnPropertyDescriptor.js","node_modules/is-typed-array/index.js","node_modules/which-typed-array/index.js","node_modules/util/support/types.js","node_modules/util/support/isBuffer.js","node_modules/inherits/inherits_browser.js","node_modules/inherits/inherits.js","node_modules/util/util.js","node_modules/object-inspect/util.inspect.js","node_modules/object-inspect/index.js","node_modules/side-channel/index.js","node_modules/deep-equal/node_modules/object.assign/implementation.js","node_modules/deep-equal/node_modules/object.assign/polyfill.js","node_modules/deep-equal/node_modules/object.assign/shim.js","node_modules/deep-equal/node_modules/object.assign/index.js","node_modules/deep-equal/index.js","node_modules/aria-query/lib/elementRoleMap.js","node_modules/aria-query/lib/roleElementMap.js","node_modules/aria-query/lib/index.js","node_modules/axobject-query/lib/util/iteratorProxy.js","node_modules/axobject-query/lib/util/iterationDecorator.js","node_modules/axobject-query/lib/etc/objects/AbbrRole.js","node_modules/axobject-query/lib/etc/objects/AlertDialogRole.js","node_modules/axobject-query/lib/etc/objects/AlertRole.js","node_modules/axobject-query/lib/etc/objects/AnnotationRole.js","node_modules/axobject-query/lib/etc/objects/ApplicationRole.js","node_modules/axobject-query/lib/etc/objects/ArticleRole.js","node_modules/axobject-query/lib/etc/objects/AudioRole.js","node_modules/axobject-query/lib/etc/objects/BannerRole.js","node_modules/axobject-query/lib/etc/objects/BlockquoteRole.js","node_modules/axobject-query/lib/etc/objects/BusyIndicatorRole.js","node_modules/axobject-query/lib/etc/objects/ButtonRole.js","node_modules/axobject-query/lib/etc/objects/CanvasRole.js","node_modules/axobject-query/lib/etc/objects/CaptionRole.js","node_modules/axobject-query/lib/etc/objects/CellRole.js","node_modules/axobject-query/lib/etc/objects/CheckBoxRole.js","node_modules/axobject-query/lib/etc/objects/ColorWellRole.js","node_modules/axobject-query/lib/etc/objects/ColumnHeaderRole.js","node_modules/axobject-query/lib/etc/objects/ColumnRole.js","node_modules/axobject-query/lib/etc/objects/ComboBoxRole.js","node_modules/axobject-query/lib/etc/objects/ComplementaryRole.js","node_modules/axobject-query/lib/etc/objects/ContentInfoRole.js","node_modules/axobject-query/lib/etc/objects/DateRole.js","node_modules/axobject-query/lib/etc/objects/DateTimeRole.js","node_modules/axobject-query/lib/etc/objects/DefinitionRole.js","node_modules/axobject-query/lib/etc/objects/DescriptionListDetailRole.js","node_modules/axobject-query/lib/etc/objects/DescriptionListRole.js","node_modules/axobject-query/lib/etc/objects/DescriptionListTermRole.js","node_modules/axobject-query/lib/etc/objects/DetailsRole.js","node_modules/axobject-query/lib/etc/objects/DialogRole.js","node_modules/axobject-query/lib/etc/objects/DirectoryRole.js","node_modules/axobject-query/lib/etc/objects/DisclosureTriangleRole.js","node_modules/axobject-query/lib/etc/objects/DivRole.js","node_modules/axobject-query/lib/etc/objects/DocumentRole.js","node_modules/axobject-query/lib/etc/objects/EmbeddedObjectRole.js","node_modules/axobject-query/lib/etc/objects/FeedRole.js","node_modules/axobject-query/lib/etc/objects/FigcaptionRole.js","node_modules/axobject-query/lib/etc/objects/FigureRole.js","node_modules/axobject-query/lib/etc/objects/FooterRole.js","node_modules/axobject-query/lib/etc/objects/FormRole.js","node_modules/axobject-query/lib/etc/objects/GridRole.js","node_modules/axobject-query/lib/etc/objects/GroupRole.js","node_modules/axobject-query/lib/etc/objects/HeadingRole.js","node_modules/axobject-query/lib/etc/objects/IframePresentationalRole.js","node_modules/axobject-query/lib/etc/objects/IframeRole.js","node_modules/axobject-query/lib/etc/objects/IgnoredRole.js","node_modules/axobject-query/lib/etc/objects/ImageMapLinkRole.js","node_modules/axobject-query/lib/etc/objects/ImageMapRole.js","node_modules/axobject-query/lib/etc/objects/ImageRole.js","node_modules/axobject-query/lib/etc/objects/InlineTextBoxRole.js","node_modules/axobject-query/lib/etc/objects/InputTimeRole.js","node_modules/axobject-query/lib/etc/objects/LabelRole.js","node_modules/axobject-query/lib/etc/objects/LegendRole.js","node_modules/axobject-query/lib/etc/objects/LineBreakRole.js","node_modules/axobject-query/lib/etc/objects/LinkRole.js","node_modules/axobject-query/lib/etc/objects/ListBoxOptionRole.js","node_modules/axobject-query/lib/etc/objects/ListBoxRole.js","node_modules/axobject-query/lib/etc/objects/ListItemRole.js","node_modules/axobject-query/lib/etc/objects/ListMarkerRole.js","node_modules/axobject-query/lib/etc/objects/ListRole.js","node_modules/axobject-query/lib/etc/objects/LogRole.js","node_modules/axobject-query/lib/etc/objects/MainRole.js","node_modules/axobject-query/lib/etc/objects/MarkRole.js","node_modules/axobject-query/lib/etc/objects/MarqueeRole.js","node_modules/axobject-query/lib/etc/objects/MathRole.js","node_modules/axobject-query/lib/etc/objects/MenuBarRole.js","node_modules/axobject-query/lib/etc/objects/MenuButtonRole.js","node_modules/axobject-query/lib/etc/objects/MenuItemRole.js","node_modules/axobject-query/lib/etc/objects/MenuItemCheckBoxRole.js","node_modules/axobject-query/lib/etc/objects/MenuItemRadioRole.js","node_modules/axobject-query/lib/etc/objects/MenuListOptionRole.js","node_modules/axobject-query/lib/etc/objects/MenuListPopupRole.js","node_modules/axobject-query/lib/etc/objects/MenuRole.js","node_modules/axobject-query/lib/etc/objects/MeterRole.js","node_modules/axobject-query/lib/etc/objects/NavigationRole.js","node_modules/axobject-query/lib/etc/objects/NoneRole.js","node_modules/axobject-query/lib/etc/objects/NoteRole.js","node_modules/axobject-query/lib/etc/objects/OutlineRole.js","node_modules/axobject-query/lib/etc/objects/ParagraphRole.js","node_modules/axobject-query/lib/etc/objects/PopUpButtonRole.js","node_modules/axobject-query/lib/etc/objects/PreRole.js","node_modules/axobject-query/lib/etc/objects/PresentationalRole.js","node_modules/axobject-query/lib/etc/objects/ProgressIndicatorRole.js","node_modules/axobject-query/lib/etc/objects/RadioButtonRole.js","node_modules/axobject-query/lib/etc/objects/RadioGroupRole.js","node_modules/axobject-query/lib/etc/objects/RegionRole.js","node_modules/axobject-query/lib/etc/objects/RootWebAreaRole.js","node_modules/axobject-query/lib/etc/objects/RowHeaderRole.js","node_modules/axobject-query/lib/etc/objects/RowRole.js","node_modules/axobject-query/lib/etc/objects/RubyRole.js","node_modules/axobject-query/lib/etc/objects/RulerRole.js","node_modules/axobject-query/lib/etc/objects/ScrollAreaRole.js","node_modules/axobject-query/lib/etc/objects/ScrollBarRole.js","node_modules/axobject-query/lib/etc/objects/SeamlessWebAreaRole.js","node_modules/axobject-query/lib/etc/objects/SearchRole.js","node_modules/axobject-query/lib/etc/objects/SearchBoxRole.js","node_modules/axobject-query/lib/etc/objects/SliderRole.js","node_modules/axobject-query/lib/etc/objects/SliderThumbRole.js","node_modules/axobject-query/lib/etc/objects/SpinButtonRole.js","node_modules/axobject-query/lib/etc/objects/SpinButtonPartRole.js","node_modules/axobject-query/lib/etc/objects/SplitterRole.js","node_modules/axobject-query/lib/etc/objects/StaticTextRole.js","node_modules/axobject-query/lib/etc/objects/StatusRole.js","node_modules/axobject-query/lib/etc/objects/SVGRootRole.js","node_modules/axobject-query/lib/etc/objects/SwitchRole.js","node_modules/axobject-query/lib/etc/objects/TabGroupRole.js","node_modules/axobject-query/lib/etc/objects/TabRole.js","node_modules/axobject-query/lib/etc/objects/TableHeaderContainerRole.js","node_modules/axobject-query/lib/etc/objects/TableRole.js","node_modules/axobject-query/lib/etc/objects/TabListRole.js","node_modules/axobject-query/lib/etc/objects/TabPanelRole.js","node_modules/axobject-query/lib/etc/objects/TermRole.js","node_modules/axobject-query/lib/etc/objects/TextFieldRole.js","node_modules/axobject-query/lib/etc/objects/TimeRole.js","node_modules/axobject-query/lib/etc/objects/TimerRole.js","node_modules/axobject-query/lib/etc/objects/ToggleButtonRole.js","node_modules/axobject-query/lib/etc/objects/ToolbarRole.js","node_modules/axobject-query/lib/etc/objects/TreeRole.js","node_modules/axobject-query/lib/etc/objects/TreeGridRole.js","node_modules/axobject-query/lib/etc/objects/TreeItemRole.js","node_modules/axobject-query/lib/etc/objects/UserInterfaceTooltipRole.js","node_modules/axobject-query/lib/etc/objects/VideoRole.js","node_modules/axobject-query/lib/etc/objects/WebAreaRole.js","node_modules/axobject-query/lib/etc/objects/WindowRole.js","node_modules/axobject-query/lib/AXObjectsMap.js","node_modules/axobject-query/lib/AXObjectElementMap.js","node_modules/axobject-query/lib/AXObjectRoleMap.js","node_modules/axobject-query/lib/elementAXObjectMap.js","node_modules/axobject-query/lib/index.js","src/compiler/compile/utils/a11y.ts","src/compiler/compile/nodes/Element.ts","src/compiler/compile/utils/hash.ts","src/compiler/compile/nodes/InlineComponent.ts","src/compiler/compile/nodes/Slot.ts","src/compiler/compile/nodes/SlotTemplate.ts","src/compiler/compile/nodes/Window.ts","src/compiler/utils/push_array.ts","src/compiler/compile/nodes/shared/map_children.ts","src/compiler/compile/nodes/shared/get_const_tags.ts","src/compiler/compile/render_dom/wrappers/shared/add_const_tags.ts","src/compiler/compile/render_dom/wrappers/AwaitBlock.ts","src/compiler/compile/render_dom/wrappers/Element/EventHandler.ts","src/compiler/compile/render_dom/wrappers/shared/add_event_handlers.ts","src/compiler/compile/render_dom/wrappers/shared/add_actions.ts","src/compiler/compile/render_dom/wrappers/EachBlock.ts","src/compiler/compile/render_dom/wrappers/Text.ts","src/compiler/compile/render_dom/wrappers/Element/fix_attribute_casing.ts","src/shared/boolean_attributes.ts","src/compiler/compile/render_dom/wrappers/Element/Attribute.ts","src/compiler/compile/render_dom/wrappers/Element/StyleAttribute.ts","src/compiler/compile/render_dom/wrappers/Element/Binding.ts","src/compiler/compile/render_dom/wrappers/MustacheTag.ts","src/compiler/compile/render_dom/wrappers/RawMustacheTag.ts","src/compiler/compile/render_dom/wrappers/Element/index.ts","src/compiler/compile/render_dom/wrappers/IfBlock.ts","src/compiler/compile/render_dom/wrappers/KeyBlock.ts","src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts","src/compiler/compile/utils/get_slot_data.ts","src/compiler/compile/render_dom/wrappers/Slot.ts","src/compiler/compile/render_dom/wrappers/Window.ts","src/compiler/compile/render_dom/wrappers/Fragment.ts","node_modules/@ampproject/remapping/dist/remapping.mjs","src/compiler/utils/mapped_code.ts","src/compiler/compile/render_ssr/handlers/shared/get_attribute_value.ts","src/compiler/compile/render_ssr/handlers/utils/remove_whitespace_children.ts","src/compiler/compile/render_ssr/handlers/InlineComponent.ts","src/compiler/compile/render_ssr/handlers/SlotTemplate.ts","src/compiler/compile/render_ssr/Renderer.ts","src/compiler/compile/render_ssr/index.ts","src/compiler/utils/globals.ts","src/compiler/compile/create_module.ts","src/compiler/compile/css/gather_possible_values.ts","src/compiler/compile/css/Selector.ts","src/compiler/compile/css/Stylesheet.ts","src/compiler/compile/internal_exports.ts","src/compiler/compile/Component.ts","src/compiler/compile/utils/get_name_from_filename.ts","src/compiler/compile/index.ts","src/compiler/preprocess/decode_sourcemap.ts","src/compiler/preprocess/replace_in_code.ts","src/compiler/preprocess/index.ts"],"sourcesContent":["const now = (typeof process !== 'undefined' && process.hrtime)\r\n\t? () => {\r\n\t\tconst t = process.hrtime();\r\n\t\treturn t[0] * 1e3 + t[1] / 1e6;\r\n\t}\r\n\t: () => self.performance.now();\r\n\r\ninterface Timing {\r\n\tlabel: string;\r\n\tstart: number;\r\n\tend: number;\r\n\tchildren: Timing[];\r\n}\r\n\r\nfunction collapse_timings(timings) {\r\n\tconst result = {};\r\n\ttimings.forEach(timing => {\r\n\t\tresult[timing.label] = Object.assign({\r\n\t\t\ttotal: timing.end - timing.start\r\n\t\t}, timing.children && collapse_timings(timing.children));\r\n\t});\r\n\treturn result;\r\n}\r\n\r\nexport default class Stats {\r\n\tstart_time: number;\r\n\tcurrent_timing: Timing;\r\n\tcurrent_children: Timing[];\r\n\ttimings: Timing[];\r\n\tstack: Timing[];\r\n\r\n\tconstructor() {\r\n\t\tthis.start_time = now();\r\n\t\tthis.stack = [];\r\n\t\tthis.current_children = this.timings = [];\r\n\t}\r\n\r\n\tstart(label) {\r\n\t\tconst timing = {\r\n\t\t\tlabel,\r\n\t\t\tstart: now(),\r\n\t\t\tend: null,\r\n\t\t\tchildren: []\r\n\t\t};\r\n\r\n\t\tthis.current_children.push(timing);\r\n\t\tthis.stack.push(timing);\r\n\r\n\t\tthis.current_timing = timing;\r\n\t\tthis.current_children = timing.children;\r\n\t}\r\n\r\n\tstop(label) {\r\n\t\tif (label !== this.current_timing.label) {\r\n\t\t\tthrow new Error(`Mismatched timing labels (expected ${this.current_timing.label}, got ${label})`);\r\n\t\t}\r\n\r\n\t\tthis.current_timing.end = now();\r\n\t\tthis.stack.pop();\r\n\t\tthis.current_timing = this.stack[this.stack.length - 1];\r\n\t\tthis.current_children = this.current_timing ? this.current_timing.children : this.timings;\r\n\t}\r\n\r\n\trender() {\r\n\t\tconst timings = Object.assign({\r\n\t\t\ttotal: now() - this.start_time\r\n\t\t}, collapse_timings(this.timings));\r\n\r\n\t\treturn {\r\n\t\t\ttimings\r\n\t\t};\r\n\t}\r\n}\r\n","export const regex_whitespace = /\\s/;\r\nexport const regex_whitespaces = /\\s+/;\r\nexport const regex_starts_with_whitespace = /^\\s/;\r\nexport const regex_starts_with_whitespaces = /^[ \\t\\r\\n]*/;\r\nexport const regex_ends_with_whitespace = /\\s$/;\r\nexport const regex_ends_with_whitespaces = /[ \\t\\r\\n]*$/;\r\nexport const regex_only_whitespaces = /^\\s+$/;\r\n\r\nexport const regex_whitespace_characters = /\\s/g;\r\nexport const regex_non_whitespace_character = /\\S/;\r\n\r\nexport const regex_starts_with_newline = /^\\r?\\n/;\r\nexport const regex_not_newline_characters = /[^\\n]/g;\r\n\r\nexport const regex_double_quotes = /\"/g;\r\n\r\nexport const regex_backslashes = /\\\\/g;\r\n\r\nexport const regex_starts_with_underscore = /^_/;\r\nexport const regex_ends_with_underscore = /_$/;\r\n\r\nexport const regex_invalid_variable_identifier_characters = /[^a-zA-Z0-9_$]/g;\r\n\r\nexport const regex_dimensions = /^(?:offset|client)(?:Width|Height)$/;\r\n","import { TemplateNode } from '../interfaces';\r\nimport { flatten } from './flatten';\r\nimport { regex_whitespace } from './patterns';\r\n\r\nconst regex_svelte_ignore = /^\\s*svelte-ignore\\s+([\\s\\S]+)\\s*$/m;\r\n\r\nexport function extract_svelte_ignore(text: string): string[] {\r\n\tconst match = regex_svelte_ignore.exec(text);\r\n\treturn match ? match[1].split(regex_whitespace).map(x => x.trim()).filter(Boolean) : [];\r\n}\r\n\r\nexport function extract_svelte_ignore_from_comments<Node extends { leadingComments?: Array<{value: string}> }>(node: Node): string[] {\r\n\treturn flatten((node.leadingComments || []).map(comment => extract_svelte_ignore(comment.value)));\r\n}\r\n\r\nexport function extract_ignores_above_position(position: number, template_nodes: TemplateNode[]): string[] {\r\n\tconst previous_node_idx = template_nodes.findIndex(child => child.end === position);\r\n\tif (previous_node_idx === -1) {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tfor (let i = previous_node_idx; i >= 0; i--) {\r\n\t\tconst node = template_nodes[i];\r\n\t\tif (node.type !== 'Comment' && node.type !== 'Text') {\r\n\t\t\treturn [];\r\n\t\t}\r\n\t\tif (node.type === 'Comment') {\r\n\t\t\tif (node.ignores.length) {\r\n\t\t\t\treturn node.ignores;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn [];\r\n}\r\n","export default function fuzzymatch(name: string, names: string[]) {\r\n\tconst set = new FuzzySet(names);\r\n\tconst matches = set.get(name);\r\n\r\n\treturn matches && matches[0] && matches[0][0] > 0.7 ? matches[0][1] : null;\r\n}\r\n\r\n// adapted from https://github.com/Glench/fuzzyset.js/blob/master/lib/fuzzyset.js\r\n// BSD Licensed\r\n\r\nconst GRAM_SIZE_LOWER = 2;\r\nconst GRAM_SIZE_UPPER = 3;\r\n\r\n// return an edit distance from 0 to 1\r\nfunction _distance(str1: string, str2: string) {\r\n\tif (str1 === null && str2 === null) {\r\n\t\tthrow 'Trying to compare two null values';\r\n\t}\r\n\tif (str1 === null || str2 === null) return 0;\r\n\tstr1 = String(str1);\r\n\tstr2 = String(str2);\r\n\r\n\tconst distance = levenshtein(str1, str2);\r\n\tif (str1.length > str2.length) {\r\n\t\treturn 1 - distance / str1.length;\r\n\t} else {\r\n\t\treturn 1 - distance / str2.length;\r\n\t}\r\n}\r\n\r\n// helper functions\r\nfunction levenshtein(str1: string, str2: string) {\r\n\tconst current: number[] = [];\r\n\tlet prev;\r\n\tlet value;\r\n\r\n\tfor (let i = 0; i <= str2.length; i++) {\r\n\t\tfor (let j = 0; j <= str1.length; j++) {\r\n\t\t\tif (i && j) {\r\n\t\t\t\tif (str1.charAt(j - 1) === str2.charAt(i - 1)) {\r\n\t\t\t\t\tvalue = prev;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalue = Math.min(current[j], current[j - 1], prev) + 1;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tvalue = i + j;\r\n\t\t\t}\r\n\r\n\t\t\tprev = current[j];\r\n\t\t\tcurrent[j] = value;\r\n\t\t}\r\n\t}\r\n\r\n\treturn current.pop();\r\n}\r\n\r\nconst non_word_regex = /[^\\w, ]+/;\r\n\r\nfunction iterate_grams(value: string, gram_size = 2) {\r\n\tconst simplified = '-' + value.toLowerCase().replace(non_word_regex, '') + '-';\r\n\tconst len_diff = gram_size - simplified.length;\r\n\tconst results = [];\r\n\r\n\tif (len_diff > 0) {\r\n\t\tfor (let i = 0; i < len_diff; ++i) {\r\n\t\t\tvalue += '-';\r\n\t\t}\r\n\t}\r\n\tfor (let i = 0; i < simplified.length - gram_size + 1; ++i) {\r\n\t\tresults.push(simplified.slice(i, i + gram_size));\r\n\t}\r\n\treturn results;\r\n}\r\n\r\nfunction gram_counter(value: string, gram_size = 2) {\r\n\t// return an object where key=gram, value=number of occurrences\r\n\tconst result = {};\r\n\tconst grams = iterate_grams(value, gram_size);\r\n\tlet i = 0;\r\n\r\n\tfor (i; i < grams.length; ++i) {\r\n\t\tif (grams[i] in result) {\r\n\t\t\tresult[grams[i]] += 1;\r\n\t\t} else {\r\n\t\t\tresult[grams[i]] = 1;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}\r\n\r\nfunction sort_descending(a, b) {\r\n\treturn b[0] - a[0];\r\n}\r\n\r\nclass FuzzySet {\r\n\texact_set = {};\r\n\tmatch_dict = {};\r\n\titems = {};\r\n\r\n\tconstructor(arr: string[]) {\r\n\t\t// initialization\r\n\t\tfor (let i = GRAM_SIZE_LOWER; i < GRAM_SIZE_UPPER + 1; ++i) {\r\n\t\t\tthis.items[i] = [];\r\n\t\t}\r\n\r\n\t\t// add all the items to the set\r\n\t\tfor (let i = 0; i < arr.length; ++i) {\r\n\t\t\tthis.add(arr[i]);\r\n\t\t}\r\n\t}\r\n\r\n\tadd(value: string) {\r\n\t\tconst normalized_value = value.toLowerCase();\r\n\t\tif (normalized_value in this.exact_set) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tlet i = GRAM_SIZE_LOWER;\r\n\t\tfor (i; i < GRAM_SIZE_UPPER + 1; ++i) {\r\n\t\t\tthis._add(value, i);\r\n\t\t}\r\n\t}\r\n\r\n\t_add(value: string, gram_size: number) {\r\n\t\tconst normalized_value = value.toLowerCase();\r\n\t\tconst items = this.items[gram_size] || [];\r\n\t\tconst index = items.length;\r\n\r\n\t\titems.push(0);\r\n\t\tconst gram_counts = gram_counter(normalized_value, gram_size);\r\n\t\tlet sum_of_square_gram_counts = 0;\r\n\t\tlet gram;\r\n\t\tlet gram_count;\r\n\r\n\t\tfor (gram in gram_counts) {\r\n\t\t\tgram_count = gram_counts[gram];\r\n\t\t\tsum_of_square_gram_counts += Math.pow(gram_count, 2);\r\n\t\t\tif (gram in this.match_dict) {\r\n\t\t\t\tthis.match_dict[gram].push([index, gram_count]);\r\n\t\t\t} else {\r\n\t\t\t\tthis.match_dict[gram] = [[index, gram_count]];\r\n\t\t\t}\r\n\t\t}\r\n\t\tconst vector_normal = Math.sqrt(sum_of_square_gram_counts);\r\n\t\titems[index] = [vector_normal, normalized_value];\r\n\t\tthis.items[gram_size] = items;\r\n\t\tthis.exact_set[normalized_value] = value;\r\n\t}\r\n\r\n\tget(value: string) {\r\n\t\tconst normalized_value = value.toLowerCase();\r\n\t\tconst result = this.exact_set[normalized_value];\r\n\r\n\t\tif (result) {\r\n\t\t\treturn [[1, result]];\r\n\t\t}\r\n\r\n\t\tlet results = [];\r\n\t\t// start with high gram size and if there are no results, go to lower gram sizes\r\n\t\tfor (\r\n\t\t\tlet gram_size = GRAM_SIZE_UPPER;\r\n\t\t\tgram_size >= GRAM_SIZE_LOWER;\r\n\t\t\t--gram_size\r\n\t\t) {\r\n\t\t\tresults = this.__get(value, gram_size);\r\n\t\t\tif (results) {\r\n\t\t\t\treturn results;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\t__get(value: string, gram_size: number) {\r\n\t\tconst normalized_value = value.toLowerCase();\r\n\t\tconst matches = {};\r\n\t\tconst gram_counts = gram_counter(normalized_value, gram_size);\r\n\t\tconst items = this.items[gram_size];\r\n\t\tlet sum_of_square_gram_counts = 0;\r\n\t\tlet gram;\r\n\t\tlet gram_count;\r\n\t\tlet i;\r\n\t\tlet index;\r\n\t\tlet other_gram_count;\r\n\r\n\t\tfor (gram in gram_counts) {\r\n\t\t\tgram_count = gram_counts[gram];\r\n\t\t\tsum_of_square_gram_counts += Math.pow(gram_count, 2);\r\n\t\t\tif (gram in this.match_dict) {\r\n\t\t\t\tfor (i = 0; i < this.match_dict[gram].length; ++i) {\r\n\t\t\t\t\tindex = this.match_dict[gram][i][0];\r\n\t\t\t\t\tother_gram_count = this.match_dict[gram][i][1];\r\n\t\t\t\t\tif (index in matches) {\r\n\t\t\t\t\t\tmatches[index] += gram_count * other_gram_count;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmatches[index] = gram_count * other_gram_count;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst vector_normal = Math.sqrt(sum_of_square_gram_counts);\r\n\t\tlet results = [];\r\n\t\tlet match_score;\r\n\r\n\t\t// build a results list of [score, str]\r\n\t\tfor (const match_index in matches) {\r\n\t\t\tmatch_score = matches[match_index];\r\n\t\t\tresults.push([\r\n\t\t\t\tmatch_score / (vector_normal * items[match_index][0]),\r\n\t\t\t\titems[match_index][1]\r\n\t\t\t]);\r\n\t\t}\r\n\r\n\t\tresults.sort(sort_descending);\r\n\r\n\t\tlet new_results = [];\r\n\t\tconst end_index = Math.min(50, results.length);\r\n\t\t// truncate somewhat arbitrarily to 50\r\n\t\tfor (let i = 0; i < end_index; ++i) {\r\n\t\t\tnew_results.push([\r\n\t\t\t\t_distance(results[i][1], normalized_value),\r\n\t\t\t\tresults[i][1]\r\n\t\t\t]);\r\n\t\t}\r\n\t\tresults = new_results;\r\n\t\tresults.sort(sort_descending);\r\n\r\n\t\tnew_results = [];\r\n\t\tfor (let i = 0; i < results.length; ++i) {\r\n\t\t\tif (results[i][0] == results[0][0]) {\r\n\t\t\t\tnew_results.push([results[i][0], this.exact_set[results[i][1]]]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn new_results;\r\n\t}\r\n}\r\n","/** regex of all html void element names */\r\nconst void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;\r\n/** regex of all html element names. svg and math are omitted because they belong to the svg elements namespace */\r\nconst html_element_names = /^(?:a|abbr|address|area|article|aside|audio|b|base|bdi|bdo|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|head|header|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|main|map|mark|meta|meter|nav|noscript|object|ol|optgroup|option|output|p|param|picture|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|source|span|strong|style|sub|summary|sup|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr|track|u|ul|var|video|wbr)$/;\r\n/** regex of all svg element names */\r\nconst svg = /^(?:altGlyph|altGlyphDef|altGlyphItem|animate|animateColor|animateMotion|animateTransform|circle|clipPath|color-profile|cursor|defs|desc|discard|ellipse|feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feImage|feMerge|feMergeNode|feMorphology|feOffset|fePointLight|feSpecularLighting|feSpotLight|feTile|feTurbulence|filter|font|font-face|font-face-format|font-face-name|font-face-src|font-face-uri|foreignObject|g|glyph|glyphRef|hatch|hatchpath|hkern|image|line|linearGradient|marker|mask|mesh|meshgradient|meshpatch|meshrow|metadata|missing-glyph|mpath|path|pattern|polygon|polyline|radialGradient|rect|set|solidcolor|stop|svg|switch|symbol|text|textPath|tref|tspan|unknown|use|view|vkern)$/;\r\n\r\nexport function is_void(name: string) {\r\n\treturn void_element_names.test(name) || name.toLowerCase() === '!doctype';\r\n}\r\n\r\nexport function is_html(name: string) {\r\n\treturn html_element_names.test(name);\r\n}\r\n\r\nexport function is_svg(name: string) {\r\n\treturn svg.test(name);\r\n}\r\n","// All parser errors should be listed and accessed from here\r\n\r\nimport list from '../utils/list';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport default {\r\n\tcss_syntax_error: (message) => ({\r\n\t\tcode: 'css-syntax-error',\r\n\t\tmessage\r\n\t}),\r\n\tduplicate_attribute: {\r\n\t\tcode: 'duplicate-attribute',\r\n\t\tmessage: 'Attributes need to be unique'\r\n\t},\r\n\tduplicate_element: (slug: string, name: string) => ({\r\n\t\tcode: `duplicate-${slug}`,\r\n\t\tmessage: `A component can only have one <${name}> tag`\r\n\t}),\r\n\tduplicate_style: {\r\n\t\tcode: 'duplicate-style',\r\n\t\tmessage: 'You can only have one top-level <style> tag per component'\r\n\t},\r\n\tempty_attribute_shorthand: {\r\n\t\tcode: 'empty-attribute-shorthand',\r\n\t\tmessage: 'Attribute shorthand cannot be empty'\r\n\t},\r\n\tempty_directive_name: (type: string) => ({\r\n\t\tcode: 'empty-directive-name',\r\n\t\tmessage: `${type} name cannot be empty`\r\n\t}),\r\n\tempty_global_selector: {\r\n\t\tcode: 'css-syntax-error',\r\n\t\tmessage: ':global() must contain a selector'\r\n\t},\r\n\texpected_block_type: {\r\n\t\tcode: 'expected-block-type',\r\n\t\tmessage: 'Expected if, each or await'\r\n\t},\r\n\texpected_name: {\r\n\t\tcode: 'expected-name',\r\n\t\tmessage: 'Expected name'\r\n\t},\r\n\tinvalid_catch_placement_unclosed_block: (block) => ({\r\n\t\tcode: 'invalid-catch-placement',\r\n\t\tmessage: `Expected to close ${block} before seeing {:catch} block`\r\n\t}),\r\n\tinvalid_catch_placement_without_await: {\r\n\t\tcode: 'invalid-catch-placement',\r\n\t\tmessage: 'Cannot have an {:catch} block outside an {#await ...} block'\r\n\t},\r\n\tinvalid_component_definition: {\r\n\t\tcode: 'invalid-component-definition',\r\n\t\tmessage: 'invalid component definition'\r\n\t},\r\n\tinvalid_closing_tag_unopened: (name: string) => ({\r\n\t\tcode: 'invalid-closing-tag',\r\n\t\tmessage: `</${name}> attempted to close an element that was not open`\r\n\t}),\r\n\tinvalid_closing_tag_autoclosed: (name: string, reason: string) => ({\r\n\t\tcode: 'invalid-closing-tag',\r\n\t\tmessage: `</${name}> attempted to close <${name}> that was already automatically closed by <${reason}>`\r\n\t}),\r\n\tinvalid_debug_args: {\r\n\t\tcode: 'invalid-debug-args',\r\n\t\tmessage:\r\n\t\t\t'{@debug ...} arguments must be identifiers, not arbitrary expressions'\r\n\t},\r\n\tinvalid_declaration: {\r\n\t\tcode: 'invalid-declaration',\r\n\t\tmessage: 'Declaration cannot be empty'\r\n\t},\r\n\tinvalid_directive_value: {\r\n\t\tcode: 'invalid-directive-value',\r\n\t\tmessage: 'Directive value must be a JavaScript expression enclosed in curly braces'\r\n\t},\r\n\tinvalid_elseif: {\r\n\t\tcode: 'invalid-elseif',\r\n\t\tmessage: '\\'elseif\\' should be \\'else if\\''\r\n\t},\r\n\tinvalid_elseif_placement_outside_if: {\r\n\t\tcode: 'invalid-elseif-placement',\r\n\t\tmessage: 'Cannot have an {:else if ...} block outside an {#if ...} block'\r\n\t},\r\n\tinvalid_elseif_placement_unclosed_block: (block) => ({\r\n\t\tcode: 'invalid-elseif-placement',\r\n\t\tmessage: `Expected to close ${block} before seeing {:else if ...} block`\r\n\t}),\r\n\tinvalid_else_placement_outside_if: {\r\n\t\tcode: 'invalid-else-placement',\r\n\t\tmessage: 'Cannot have an {:else} block outside an {#if ...} or {#each ...} block'\r\n\t},\r\n\tinvalid_else_placement_unclosed_block: (block) => ({\r\n\t\tcode: 'invalid-else-placement',\r\n\t\tmessage: `Expected to close ${block} before seeing {:else} block`\r\n\t}),\r\n\tinvalid_element_content: (slug: string, name: string) => ({\r\n\t\tcode: `invalid-${slug}-content`,\r\n\t\tmessage: `<${name}> cannot have children`\r\n\t}),\r\n\tinvalid_element_definition: {\r\n\t\tcode: 'invalid-element-definition',\r\n\t\tmessage: 'Invalid element definition'\r\n\t},\r\n\tinvalid_element_placement: (slug: string, name: string) => ({\r\n\t\tcode: `invalid-${slug}-placement`,\r\n\t\tmessage: `<${name}> tags cannot be inside elements or blocks`\r\n\t}),\r\n\tinvalid_logic_block_placement: (location: string, name: string) => ({\r\n\t\tcode: 'invalid-logic-block-placement',\r\n\t\tmessage: `{#${name}} logic block cannot be ${location}`\r\n\t}),\r\n\tinvalid_tag_placement: (location: string, name: string) => ({\r\n\t\tcode: 'invalid-tag-placement',\r\n\t\tmessage: `{@${name}} tag cannot be ${location}`\r\n\t}),\r\n\tinvalid_ref_directive: (name: string) => ({\r\n\t\tcode: 'invalid-ref-directive',\r\n\t\tmessage: `The ref directive is no longer supported — use \\`bind:this={${name}}\\` instead`\r\n\t}),\r\n\tinvalid_ref_selector: {\r\n\t\tcode: 'invalid-ref-selector',\r\n\t\tmessage: 'ref selectors are no longer supported'\r\n\t},\r\n\tinvalid_self_placement: {\r\n\t\tcode: 'invalid-self-placement',\r\n\t\tmessage: '<svelte:self> components can only exist inside {#if} blocks, {#each} blocks, or slots passed to components'\r\n\t},\r\n\tinvalid_script_instance: {\r\n\t\tcode: 'invalid-script',\r\n\t\tmessage: 'A component can only have one instance-level <script> element'\r\n\t},\r\n\tinvalid_script_module: {\r\n\t\tcode: 'invalid-script',\r\n\t\tmessage: 'A component can only have one <script context=\"module\"> element'\r\n\t},\r\n\tinvalid_script_context_attribute: {\r\n\t\tcode: 'invalid-script',\r\n\t\tmessage: 'context attribute must be static'\r\n\t},\r\n\tinvalid_script_context_value: {\r\n\t\tcode: 'invalid-script',\r\n\t\tmessage: 'If the context attribute is supplied, its value must be \"module\"'\r\n\t},\r\n\tinvalid_tag_name: {\r\n\t\tcode: 'invalid-tag-name',\r\n\t\tmessage: 'Expected valid tag name'\r\n\t},\r\n\tinvalid_tag_name_svelte_element: (tags: string[], match: string) => ({\r\n\t\tcode: 'invalid-tag-name',\r\n\t\tmessage: `Valid <svelte:...> tag names are ${list(tags)}${\r\n\t\t\tmatch ? ' (did you mean ' + match + '?)' : ''\r\n\t\t}`\r\n\t}),\r\n\tinvalid_then_placement_unclosed_block: (block) => ({\r\n\t\tcode: 'invalid-then-placement',\r\n\t\tmessage: `Expected to close ${block} before seeing {:then} block`\r\n\t}),\r\n\tinvalid_then_placement_without_await: {\r\n\t\tcode: 'invalid-then-placement',\r\n\t\tmessage: 'Cannot have an {:then} block outside an {#await ...} block'\r\n\t},\r\n\tinvalid_void_content: (name: string) => ({\r\n\t\tcode: 'invalid-void-content',\r\n\t\tmessage: `<${name}> is a void element and cannot have children, or a closing tag`\r\n\t}),\r\n\tmissing_component_definition: {\r\n\t\tcode: 'missing-component-definition',\r\n\t\tmessage: '<svelte:component> must have a \\'this\\' attribute'\r\n\t},\r\n\tmissing_attribute_value: {\r\n\t\tcode: 'missing-attribute-value',\r\n\t\tmessage: 'Expected value for the attribute'\r\n\t},\r\n\tmissing_element_definition: {\r\n\t\tcode: 'missing-element-definition',\r\n\t\tmessage: '<svelte:element> must have a \\'this\\' attribute'\r\n\t},\r\n\tunclosed_script: {\r\n\t\tcode: 'unclosed-script',\r\n\t\tmessage: '<script> must have a closing tag'\r\n\t},\r\n\tunclosed_style: {\r\n\t\tcode: 'unclosed-style',\r\n\t\tmessage: '<style> must have a closing tag'\r\n\t},\r\n\tunclosed_comment: {\r\n\t\tcode: 'unclosed-comment',\r\n\t\tmessage: 'comment was left open, expected -->'\r\n\t},\r\n\tunclosed_attribute_value: (token: string) => ({\r\n\t\tcode: 'unclosed-attribute-value',\r\n\t\tmessage: `Expected to close the attribute value with ${token}`\r\n\t}),\r\n\tunexpected_block_close: {\r\n\t\tcode: 'unexpected-block-close',\r\n\t\tmessage: 'Unexpected block closing tag'\r\n\t},\r\n\tunexpected_eof: {\r\n\t\tcode: 'unexpected-eof',\r\n\t\tmessage: 'Unexpected end of input'\r\n\t},\r\n\tunexpected_eof_token: (token: string) => ({\r\n\t\tcode: 'unexpected-eof',\r\n\t\tmessage: `Unexpected ${token}`\r\n\t}),\r\n\tunexpected_token: (token: string) => ({\r\n\t\tcode: 'unexpected-token',\r\n\t\tmessage: `Expected ${token}`\r\n\t}),\r\n\tunexpected_token_destructure: {\r\n\t\tcode: 'unexpected-token',\r\n\t\tmessage: 'Expected identifier or destructure pattern'\r\n\t}\r\n};\r\n","// @ts-check\n/** @typedef { import('estree').BaseNode} BaseNode */\n\n/** @typedef {{\n\tskip: () => void;\n\tremove: () => void;\n\treplace: (node: BaseNode) => void;\n}} WalkerContext */\n\nexport class WalkerBase {\n\tconstructor() {\n\t\t/** @type {boolean} */\n\t\tthis.should_skip = false;\n\n\t\t/** @type {boolean} */\n\t\tthis.should_remove = false;\n\n\t\t/** @type {BaseNode | null} */\n\t\tthis.replacement = null;\n\n\t\t/** @type {WalkerContext} */\n\t\tthis.context = {\n\t\t\tskip: () => (this.should_skip = true),\n\t\t\tremove: () => (this.should_remove = true),\n\t\t\treplace: (node) => (this.replacement = node)\n\t\t};\n\t}\n\n\t/**\n\t *\n\t * @param {any} parent\n\t * @param {string} prop\n\t * @param {number} index\n\t * @param {BaseNode} node\n\t */\n\treplace(parent, prop, index, node) {\n\t\tif (parent) {\n\t\t\tif (index !== null) {\n\t\t\t\tparent[prop][index] = node;\n\t\t\t} else {\n\t\t\t\tparent[prop] = node;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * @param {any} parent\n\t * @param {string} prop\n\t * @param {number} index\n\t */\n\tremove(parent, prop, index) {\n\t\tif (parent) {\n\t\t\tif (index !== null) {\n\t\t\t\tparent[prop].splice(index, 1);\n\t\t\t} else {\n\t\t\t\tdelete parent[prop];\n\t\t\t}\n\t\t}\n\t}\n}\n","// @ts-check\nimport { WalkerBase } from './walker.js';\n\n/** @typedef { import('estree').BaseNode} BaseNode */\n/** @typedef { import('./walker.js').WalkerContext} WalkerContext */\n\n/** @typedef {(\n *    this: WalkerContext,\n *    node: BaseNode,\n *    parent: BaseNode,\n *    key: string,\n *    index: number\n * ) => void} SyncHandler */\n\nexport class SyncWalker extends WalkerBase {\n\t/**\n\t *\n\t * @param {SyncHandler} enter\n\t * @param {SyncHandler} leave\n\t */\n\tconstructor(enter, leave) {\n\t\tsuper();\n\n\t\t/** @type {SyncHandler} */\n\t\tthis.enter = enter;\n\n\t\t/** @type {SyncHandler} */\n\t\tthis.leave = leave;\n\t}\n\n\t/**\n\t *\n\t * @param {BaseNode} node\n\t * @param {BaseNode} parent\n\t * @param {string} [prop]\n\t * @param {number} [index]\n\t * @returns {BaseNode}\n\t */\n\tvisit(node, parent, prop, index) {\n\t\tif (node) {\n\t\t\tif (this.enter) {\n\t\t\t\tconst _should_skip = this.should_skip;\n\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\tthis.should_skip = false;\n\t\t\t\tthis.should_remove = false;\n\t\t\t\tthis.replacement = null;\n\n\t\t\t\tthis.enter.call(this.context, node, parent, prop, index);\n\n\t\t\t\tif (this.replacement) {\n\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t}\n\n\t\t\t\tif (this.should_remove) {\n\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t}\n\n\t\t\t\tconst skipped = this.should_skip;\n\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\tthis.should_skip = _should_skip;\n\t\t\t\tthis.should_remove = _should_remove;\n\t\t\t\tthis.replacement = _replacement;\n\n\t\t\t\tif (skipped) return node;\n\t\t\t\tif (removed) return null;\n\t\t\t}\n\n\t\t\tfor (const key in node) {\n\t\t\t\tconst value = node[key];\n\n\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (Array.isArray(value)) {\n\t\t\t\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\t\t\t\tif (value[i] !== null && typeof value[i].type === 'string') {\n\t\t\t\t\t\t\tif (!this.visit(value[i], node, key, i)) {\n\t\t\t\t\t\t\t\t// removed\n\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (value !== null && typeof value.type === \"string\") {\n\t\t\t\t\tthis.visit(value, node, key, null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.leave) {\n\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\tthis.replacement = null;\n\t\t\t\tthis.should_remove = false;\n\n\t\t\t\tthis.leave.call(this.context, node, parent, prop, index);\n\n\t\t\t\tif (this.replacement) {\n\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t}\n\n\t\t\t\tif (this.should_remove) {\n\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t}\n\n\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\tthis.replacement = _replacement;\n\t\t\t\tthis.should_remove = _should_remove;\n\n\t\t\t\tif (removed) return null;\n\t\t\t}\n\t\t}\n\n\t\treturn node;\n\t}\n}\n","// @ts-check\nimport { SyncWalker } from './sync.js';\nimport { AsyncWalker } from './async.js';\n\n/** @typedef { import('estree').BaseNode} BaseNode */\n/** @typedef { import('./sync.js').SyncHandler} SyncHandler */\n/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */\n\n/**\n *\n * @param {BaseNode} ast\n * @param {{\n *   enter?: SyncHandler\n *   leave?: SyncHandler\n * }} walker\n * @returns {BaseNode}\n */\nexport function walk(ast, { enter, leave }) {\n\tconst instance = new SyncWalker(enter, leave);\n\treturn instance.visit(ast, null);\n}\n\n/**\n *\n * @param {BaseNode} ast\n * @param {{\n *   enter?: AsyncHandler\n *   leave?: AsyncHandler\n * }} walker\n * @returns {Promise<BaseNode>}\n */\nexport async function asyncWalk(ast, { enter, leave }) {\n\tconst instance = new AsyncWalker(enter, leave);\n\treturn await instance.visit(ast, null);\n}\n","// generate an ID that is, to all intents and purposes, unique\nexport const id = (Math.round(Math.random() * 1e20)).toString(36);\nexport const re = new RegExp(`_${id}_(?:(\\\\d+)|(AT)|(HASH))_(\\\\w+)?`, 'g');\n","import { re } from './id.js';\n\n/** @typedef {import('estree').Comment} Comment */\n/** @typedef {import('estree').Node} Node */\n\n/**\n * @typedef {Node & {\n *   start: number;\n *   end: number;\n *   has_trailing_newline?: boolean\n * }} NodeWithLocation\n */\n\n/**\n * @typedef {Comment & {\n *   start: number;\n *   end: number;\n *   has_trailing_newline?: boolean\n * }} CommentWithLocation\n */\n\n/**\n * @param {CommentWithLocation[]} comments\n * @param {string} raw\n */\nexport const get_comment_handlers = (comments, raw) => ({\n\n\t// pass to acorn options\n\t/**\n\t * @param {boolean} block\n\t * @param {string} value\n\t * @param {number} start\n\t * @param {number} end\n\t */\n\tonComment: (block, value, start, end) => {\n\t\tif (block && /\\n/.test(value)) {\n\t\t\tlet a = start;\n\t\t\twhile (a > 0 && raw[a - 1] !== '\\n') a -= 1;\n\n\t\t\tlet b = a;\n\t\t\twhile (/[ \\t]/.test(raw[b])) b += 1;\n\n\t\t\tconst indentation = raw.slice(a, b);\n\t\t\tvalue = value.replace(new RegExp(`^${indentation}`, 'gm'), '');\n\t\t}\n\n\t\tcomments.push({ type: block ? 'Block' : 'Line', value, start, end });\n\t},\n\n\t// pass to estree-walker options\n\t/** @param {NodeWithLocation} node */\n\tenter(node) {\n\t\tlet comment;\n\n\t\twhile (comments[0] && comments[0].start < node.start) {\n\t\t\tcomment = comments.shift();\n\n\t\t\tcomment.value = comment.value.replace(re, (match, id, at, hash, value) => {\n\t\t\t\tif (hash) return `#${value}`;\n\t\t\t\tif (at) return `@${value}`;\n\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\tconst next = comments[0] || node;\n\t\t\tcomment.has_trailing_newline = (\n\t\t\t\tcomment.type === 'Line' ||\n\t\t\t\t/\\n/.test(raw.slice(comment.end, next.start))\n\t\t\t);\n\n\t\t\t(node.leadingComments || (node.leadingComments = [])).push(comment);\n\t\t}\n\t},\n\n\t/** @param {NodeWithLocation} node */\n\tleave(node) {\n\t\tif (comments[0]) {\n\t\t\tconst slice = raw.slice(node.end, comments[0].start);\n\n\t\t\tif (/^[,) \\t]*$/.test(slice)) {\n\t\t\t\tnode.trailingComments = [comments.shift()];\n\t\t\t}\n\t\t}\n\t}\n});\n","//@ts-check\n/** @typedef { import('estree').Node} Node */\n/** @typedef {Node | {\n *   type: 'PropertyDefinition';\n *   computed: boolean;\n *   value: Node\n * }} NodeWithPropertyDefinition */\n\n/**\n *\n * @param {NodeWithPropertyDefinition} node\n * @param {NodeWithPropertyDefinition} parent\n * @returns boolean\n */\nexport default function is_reference (node, parent) {\n\tif (node.type === 'MemberExpression') {\n\t\treturn !node.computed && is_reference(node.object, node);\n\t}\n\n\tif (node.type === 'Identifier') {\n\t\tif (!parent) return true;\n\n\t\tswitch (parent.type) {\n\t\t\t// disregard `bar` in `foo.bar`\n\t\t\tcase 'MemberExpression': return parent.computed || node === parent.object;\n\n\t\t\t// disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`\n\t\t\tcase 'MethodDefinition': return parent.computed;\n\n\t\t\t// disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`\n\t\t\tcase 'PropertyDefinition': return parent.computed || node === parent.value;\n\n\t\t\t// disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`\n\t\t\tcase 'Property': return parent.computed || node === parent.value;\n\n\t\t\t// disregard the `bar` in `export { foo as bar }` or\n\t\t\t// the foo in `import { foo as bar }`\n\t\t\tcase 'ExportSpecifier':\n\t\t\tcase 'ImportSpecifier': return node === parent.local;\n\n\t\t\t// disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`\n\t\t\tcase 'LabeledStatement':\n\t\t\tcase 'BreakStatement':\n\t\t\tcase 'ContinueStatement': return false;\n\t\t\tdefault: return true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","import { walk } from 'estree-walker';\nimport is_reference from 'is-reference';\n\n/** @param {import('estree').Node} expression */\nexport function analyze(expression) {\n\t/** @typedef {import('estree').Node} Node */\n\n\t/** @type {WeakMap<Node, Scope>} */\n\tconst map = new WeakMap();\n\n\t/** @type {Map<string, Node>} */\n\tconst globals = new Map();\n\n\tconst scope = new Scope(null, false);\n\n\t/** @type {[Scope, import('estree').Identifier][]} */\n\tconst references = [];\n\tlet current_scope = scope;\n\n\twalk(expression, {\n\t\t/**\n\t\t * @param {Node} node\n\t\t * @param {any} parent\n\t\t */\n\t\tenter(node, parent) {\n\t\t\tswitch (node.type) {\n\t\t\t\tcase 'Identifier':\n\t\t\t\t\tif (is_reference(node, parent)) {\n\t\t\t\t\t\treferences.push([current_scope, node]);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ImportDeclaration':\n\t\t\t\t\tnode.specifiers.forEach((specifier) => {\n\t\t\t\t\t\tcurrent_scope.declarations.set(specifier.local.name, specifier);\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'FunctionExpression':\n\t\t\t\tcase 'FunctionDeclaration':\n\t\t\t\tcase 'ArrowFunctionExpression':\n\t\t\t\t\tif (node.type === 'FunctionDeclaration') {\n\t\t\t\t\t\tif (node.id) {\n\t\t\t\t\t\t\tcurrent_scope.declarations.set(node.id.name, node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmap.set(node, current_scope = new Scope(current_scope, false));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmap.set(node, current_scope = new Scope(current_scope, false));\n\n\t\t\t\t\t\tif (node.type === 'FunctionExpression' && node.id) {\n\t\t\t\t\t\t\tcurrent_scope.declarations.set(node.id.name, node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tnode.params.forEach(param => {\n\t\t\t\t\t\textract_names(param).forEach(name => {\n\t\t\t\t\t\t\tcurrent_scope.declarations.set(name, node);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ForStatement':\n\t\t\t\tcase 'ForInStatement':\n\t\t\t\tcase 'ForOfStatement':\n\t\t\t\t\tmap.set(node, current_scope = new Scope(current_scope, true));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'BlockStatement':\n\t\t\t\t\tmap.set(node, current_scope = new Scope(current_scope, true));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ClassDeclaration':\n\t\t\t\tcase 'VariableDeclaration':\n\t\t\t\t\tcurrent_scope.add_declaration(node);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'CatchClause':\n\t\t\t\t\tmap.set(node, current_scope = new Scope(current_scope, true));\n\n\t\t\t\t\tif (node.param) {\n\t\t\t\t\t\textract_names(node.param).forEach(name => {\n\t\t\t\t\t\t\tcurrent_scope.declarations.set(name, node.param);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\n\t\t/** @param {Node} node */\n\t\tleave(node) {\n\t\t\tif (map.has(node)) {\n\t\t\t\tcurrent_scope = current_scope.parent;\n\t\t\t}\n\t\t}\n\t});\n\n\tfor (let i = references.length - 1; i >= 0; --i) {\n\t\tconst [scope, reference] = references[i];\n\n\t\tif (!scope.references.has(reference.name)) {\n\t\t\tadd_reference(scope, reference.name);\n\t\t}\n\t\tif (!scope.find_owner(reference.name)) {\n\t\t\tglobals.set(reference.name, reference);\n\t\t}\n\t}\n\n\treturn { map, scope, globals };\n}\n\n/**\n *\n * @param {Scope} scope\n * @param {string} name\n */\nfunction add_reference(scope, name) {\n\tscope.references.add(name);\n\tif (scope.parent) add_reference(scope.parent, name);\n}\n\nexport class Scope {\n\tconstructor(parent, block) {\n\t\t/** @type {Scope | null} */\n\t\tthis.parent = parent;\n\n\t\t/** @type {boolean} */\n\t\tthis.block = block;\n\n\t\t/** @type {Map<string, import('estree').Node>} */\n\t\tthis.declarations = new Map();\n\n\t\t/** @type {Set<string>} */\n\t\tthis.initialised_declarations = new Set();\n\n\t\t/** @type {Set<string>} */\n\t\tthis.references = new Set();\n\t}\n\n\t/** @param {import('estree').VariableDeclaration | import('estree').ClassDeclaration} node */\n\tadd_declaration(node) {\n\t\tif (node.type === 'VariableDeclaration') {\n\t\t\tif (node.kind === 'var' && this.block && this.parent) {\n\t\t\t\tthis.parent.add_declaration(node);\n\t\t\t} else {\n\t\t\t\t/** @param {import('estree').VariableDeclarator} declarator */\n\t\t\t\tconst handle_declarator = (declarator) => {\n\t\t\t\t\textract_names(declarator.id).forEach(name => {\n\t\t\t\t\t\tthis.declarations.set(name, node);\n\t\t\t\t\t\tif (declarator.init) this.initialised_declarations.add(name);\n\t\t\t\t\t});;\n\t\t\t\t}\n\n\t\t\t\tnode.declarations.forEach(handle_declarator);\n\t\t\t}\n\t\t} else if (node.id) {\n\t\t\tthis.declarations.set(node.id.name, node);\n\t\t}\n\t}\n\n\t/**\n\t * @param {string} name\n\t * @returns {Scope | null}\n\t */\n\tfind_owner(name) {\n\t\tif (this.declarations.has(name)) return this;\n\t\treturn this.parent && this.parent.find_owner(name);\n\t}\n\n\t/**\n\t * @param {string} name\n\t * @returns {boolean}\n\t */\n\thas(name) {\n\t\treturn (\n\t\t\tthis.declarations.has(name) || (!!this.parent && this.parent.has(name))\n\t\t);\n\t}\n}\n\n/**\n * @param {import('estree').Node} param\n * @returns {string[]}\n */\nexport function extract_names(param) {\n\treturn extract_identifiers(param).map(node => node.name);\n}\n\n/**\n * @param {import('estree').Node} param\n * @param {import('estree').Identifier[]} nodes\n * @returns {import('estree').Identifier[]}\n */\nexport function extract_identifiers(param, nodes = []) {\n\tswitch (param.type) {\n\t\tcase 'Identifier':\n\t\t\tnodes.push(param);\n\t\t\tbreak;\n\n\t\tcase 'MemberExpression':\n\t\t\tlet object = param;\n\t\t\twhile (object.type === 'MemberExpression') {\n\t\t\t\tobject = /** @type {any} */ (object.object);\n\t\t\t}\n\t\t\tnodes.push(/** @type {any} */ (object));\n\t\t\tbreak;\n\n\t\tcase 'ObjectPattern':\n\t\t\t/** @param {import('estree').Property | import('estree').RestElement} prop */\n\t\t\tconst handle_prop = (prop) => {\n\t\t\t\tif (prop.type === 'RestElement') {\n\t\t\t\t\textract_identifiers(prop.argument, nodes);\n\t\t\t\t} else {\n\t\t\t\t\textract_identifiers(prop.value, nodes);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tparam.properties.forEach(handle_prop);\n\t\t\tbreak;\n\n\t\tcase 'ArrayPattern':\n\t\t\t/** @param {import('estree').Node} element */\n\t\t\tconst handle_element = (element) => {\n\t\t\t\tif (element) extract_identifiers(element, nodes);\n\t\t\t};\n\n\t\t\tparam.elements.forEach(handle_element);\n\t\t\tbreak;\n\n\t\tcase 'RestElement':\n\t\t\textract_identifiers(param.argument, nodes);\n\t\t\tbreak;\n\n\t\tcase 'AssignmentPattern':\n\t\t\textract_identifiers(param.left, nodes);\n\t\t\tbreak;\n\t}\n\n\treturn nodes;\n}\n","/**\n * Does `array.push` for all `items`. Needed because `array.push(...items)` throws\n * \"Maximum call stack size exceeded\" when `items` is too big of an array.\n *\n * @param {any[]} array \n * @param {any[]} items \n */\nexport function push_array(array, items) {\n\tfor (let i = 0; i < items.length; i++) {\n\t\tarray.push(items[i]);\n\t}\n};\n","// heavily based on https://github.com/davidbonnet/astring\n// released under MIT license https://github.com/davidbonnet/astring/blob/master/LICENSE\n\nimport { re } from '../utils/id.js';\nimport { push_array } from '../utils/push_array.js';\n\n/** @typedef {import('estree').ArrowFunctionExpression} ArrowFunctionExpression */\n/** @typedef {import('estree').BinaryExpression} BinaryExpression */\n/** @typedef {import('estree').CallExpression} CallExpression */\n/** @typedef {import('estree').Comment} Comment */\n/** @typedef {import('estree').ExportSpecifier} ExportSpecifier */\n/** @typedef {import('estree').Expression} Expression */\n/** @typedef {import('estree').FunctionDeclaration} FunctionDeclaration */\n/** @typedef {import('estree').ImportDeclaration} ImportDeclaration */\n/** @typedef {import('estree').ImportSpecifier} ImportSpecifier */\n/** @typedef {import('estree').Literal} Literal */\n/** @typedef {import('estree').LogicalExpression} LogicalExpression */\n/** @typedef {import('estree').NewExpression} NewExpression */\n/** @typedef {import('estree').Node} Node */\n/** @typedef {import('estree').ObjectExpression} ObjectExpression */\n/** @typedef {import('estree').Pattern} Pattern */\n/** @typedef {import('estree').SequenceExpression} SequenceExpression */\n/** @typedef {import('estree').SimpleCallExpression} SimpleCallExpression */\n/** @typedef {import('estree').SwitchStatement} SwitchStatement */\n/** @typedef {import('estree').VariableDeclaration} VariableDeclaration */\n\n/**\n * @typedef {{\n *   content: string;\n *   loc?: {\n *     start: { line: number; column: number; };\n *     end: { line: number; column: number; };\n *   };\n *   has_newline: boolean;\n * }} Chunk\n */\n\n/**\n * @typedef {(node: any, state: State) => Chunk[]} Handler\n */\n\n/**\n * @typedef {{\n *   indent: string;\n *   scope: any; // TODO import from periscopic\n *   scope_map: WeakMap<Node, any>;\n *   getName: (name: string) => string;\n *   deconflicted: WeakMap<Node, Map<string, string>>;\n *   comments: Comment[];\n * }} State\n */\n\n/**\n * @param {Node} node\n * @param {State} state\n * @returns {Chunk[]}\n */\nexport function handle(node, state) {\n\tconst handler = handlers[node.type];\n\n\tif (!handler) {\n\t\tthrow new Error(`Not implemented ${node.type}`);\n\t}\n\n\tconst result = handler(node, state);\n\n\tif (node.leadingComments) {\n\t\tresult.unshift(c(node.leadingComments.map(comment => comment.type === 'Block'\n\t\t\t? `/*${comment.value}*/${/** @type {any} */ (comment).has_trailing_newline ? `\\n${state.indent}` : ` `}`\n\t\t\t: `//${comment.value}${/** @type {any} */ (comment).has_trailing_newline ? `\\n${state.indent}` : ` `}`).join(``)));\n\t}\n\n\tif (node.trailingComments) {\n\t\tstate.comments.push(node.trailingComments[0]); // there is only ever one\n\t}\n\n\treturn result;\n}\n\n/**\n * @param {string} content\n * @param {Node} [node]\n * @returns {Chunk}\n */\nfunction c(content, node) {\n\treturn {\n\t\tcontent,\n\t\tloc: node && node.loc,\n\t\thas_newline: /\\n/.test(content)\n\t};\n}\n\nconst OPERATOR_PRECEDENCE = {\n\t'||': 2,\n\t'&&': 3,\n\t'??': 4,\n\t'|': 5,\n\t'^': 6,\n\t'&': 7,\n\t'==': 8,\n\t'!=': 8,\n\t'===': 8,\n\t'!==': 8,\n\t'<': 9,\n\t'>': 9,\n\t'<=': 9,\n\t'>=': 9,\n\tin: 9,\n\tinstanceof: 9,\n\t'<<': 10,\n\t'>>': 10,\n\t'>>>': 10,\n\t'+': 11,\n\t'-': 11,\n\t'*': 12,\n\t'%': 12,\n\t'/': 12,\n\t'**': 13,\n};\n\n/** @type {Record<string, number>} */\nconst EXPRESSIONS_PRECEDENCE = {\n\tArrayExpression: 20,\n\tTaggedTemplateExpression: 20,\n\tThisExpression: 20,\n\tIdentifier: 20,\n\tLiteral: 18,\n\tTemplateLiteral: 20,\n\tSuper: 20,\n\tSequenceExpression: 20,\n\tMemberExpression: 19,\n\tCallExpression: 19,\n\tNewExpression: 19,\n\tAwaitExpression: 17,\n\tClassExpression: 17,\n\tFunctionExpression: 17,\n\tObjectExpression: 17,\n\tUpdateExpression: 16,\n\tUnaryExpression: 15,\n\tBinaryExpression: 14,\n\tLogicalExpression: 13,\n\tConditionalExpression: 4,\n\tArrowFunctionExpression: 3,\n\tAssignmentExpression: 3,\n\tYieldExpression: 2,\n\tRestElement: 1\n};\n\n/**\n *\n * @param {Expression} node\n * @param {BinaryExpression | LogicalExpression} parent\n * @param {boolean} is_right\n * @returns\n */\nfunction needs_parens(node, parent, is_right) {\n\t// special case where logical expressions and coalesce expressions cannot be mixed,\n\t// either of them need to be wrapped with parentheses\n\tif (\n\t\tnode.type === 'LogicalExpression' &&\n\t\tparent.type === 'LogicalExpression' &&\n\t\t((parent.operator === '??' && node.operator !== '??') ||\n\t\t\t(parent.operator !== '??' && node.operator === '??'))\n\t) {\n\t\treturn true;\n\t}\n\n\tconst precedence = EXPRESSIONS_PRECEDENCE[node.type];\n\tconst parent_precedence = EXPRESSIONS_PRECEDENCE[parent.type];\n\n\tif (precedence !== parent_precedence) {\n\t\t// Different node types\n\t\treturn (\n\t\t\t(!is_right &&\n\t\t\t\tprecedence === 15 &&\n\t\t\t\tparent_precedence === 14 &&\n\t\t\t\tparent.operator === '**') ||\n\t\t\tprecedence < parent_precedence\n\t\t);\n\t}\n\n\tif (precedence !== 13 && precedence !== 14) {\n\t\t// Not a `LogicalExpression` or `BinaryExpression`\n\t\treturn false;\n\t}\n\n\tif (/** @type {BinaryExpression} */ (node).operator === '**' && parent.operator === '**') {\n\t\t// Exponentiation operator has right-to-left associativity\n\t\treturn !is_right;\n\t}\n\n\tif (is_right) {\n\t\t// Parenthesis are used if both operators have the same precedence\n\t\treturn (\n\t\t\tOPERATOR_PRECEDENCE[/** @type {BinaryExpression} */ (node).operator] <=\n\t\t\tOPERATOR_PRECEDENCE[parent.operator]\n\t\t);\n\t}\n\n\treturn (\n\t\tOPERATOR_PRECEDENCE[/** @type {BinaryExpression} */ (node).operator] <\n\t\tOPERATOR_PRECEDENCE[parent.operator]\n\t);\n}\n\n/** @param {Node} node */\nfunction has_call_expression(node) {\n\twhile (node) {\n\t\tif (node.type[0] === 'CallExpression') {\n\t\t\treturn true;\n\t\t} else if (node.type === 'MemberExpression') {\n\t\t\tnode = node.object;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n}\n\n/** @param {Chunk[]} chunks */\nconst has_newline = (chunks) => {\n\tfor (let i = 0; i < chunks.length; i += 1) {\n\t\tif (chunks[i].has_newline) return true;\n\t}\n\treturn false;\n};\n\n/** @param {Chunk[]} chunks */\nconst get_length = (chunks) => {\n\tlet total = 0;\n\tfor (let i = 0; i < chunks.length; i += 1) {\n\t\ttotal += chunks[i].content.length;\n\t}\n\treturn total;\n};\n\n/**\n * @param {number} a\n * @param {number} b\n */\nconst sum = (a, b) => a + b;\n\n/**\n * @param {Chunk[][]} nodes\n * @param {Chunk} separator\n * @returns {Chunk[]}\n */\nconst join = (nodes, separator) => {\n\tif (nodes.length === 0) return [];\n\n\tconst joined = [...nodes[0]];\n\tfor (let i = 1; i < nodes.length; i += 1) {\n\t\tjoined.push(separator);\n\t\tpush_array(joined, nodes[i]);\n\t}\n\treturn joined;\n};\n\n/**\n * @param {(node: any, state: State) => Chunk[]} fn\n */\nconst scoped = (fn) => {\n\t/**\n\t * @param {any} node\n\t * @param {State} state\n\t */\n\tconst scoped_fn = (node, state) => {\n\t\treturn fn(node, {\n\t\t\t...state,\n\t\t\tscope: state.scope_map.get(node)\n\t\t});\n\t};\n\n\treturn scoped_fn;\n};\n\n/**\n * @param {string} name\n * @param {Set<string>} names\n */\nconst deconflict = (name, names) => {\n\tconst original = name;\n\tlet i = 1;\n\n\twhile (names.has(name)) {\n\t\tname = `${original}$${i++}`;\n\t}\n\n\treturn name;\n};\n\n/**\n * @param {Node[]} nodes\n * @param {State} state\n */\nconst handle_body = (nodes, state) => {\n\tconst chunks = [];\n\n\tconst body = nodes.map(statement => {\n\t\tconst chunks = handle(statement, {\n\t\t\t...state,\n\t\t\tindent: state.indent\n\t\t});\n\n\t\tlet add_newline = false;\n\n\t\twhile (state.comments.length) {\n\t\t\tconst comment = state.comments.shift();\n\t\t\tconst prefix = add_newline ? `\\n${state.indent}` : ` `;\n\n\t\t\tchunks.push(c(comment.type === 'Block'\n\t\t\t\t? `${prefix}/*${comment.value}*/`\n\t\t\t\t: `${prefix}//${comment.value}`));\n\n\t\t\tadd_newline = (comment.type === 'Line');\n\t\t}\n\n\t\treturn chunks;\n\t});\n\n\tlet needed_padding = false;\n\n\tfor (let i = 0; i < body.length; i += 1) {\n\t\tconst needs_padding = has_newline(body[i]);\n\n\t\tif (i > 0) {\n\t\t\tchunks.push(\n\t\t\t\tc(needs_padding || needed_padding ? `\\n\\n${state.indent}` : `\\n${state.indent}`)\n\t\t\t);\n\t\t}\n\n\t\tpush_array(chunks, body[i]);\n\n\t\tneeded_padding = needs_padding;\n\t}\n\n\treturn chunks;\n};\n\n/**\n * @param {VariableDeclaration} node\n * @param {State} state\n */\nconst handle_var_declaration = (node, state) => {\n\tconst chunks = [c(`${node.kind} `)];\n\n\tconst declarators = node.declarations.map(d => handle(d, {\n\t\t...state,\n\t\tindent: state.indent + (node.declarations.length === 1 ? '' : '\\t')\n\t}));\n\n\tconst multiple_lines = (\n\t\tdeclarators.some(has_newline) ||\n\t\t(declarators.map(get_length).reduce(sum, 0) + (state.indent.length + declarators.length - 1) * 2) > 80\n\t);\n\n\tconst separator = c(multiple_lines ? `,\\n${state.indent}\\t` : ', ');\n\n\tpush_array(chunks, join(declarators, separator));\n\n\treturn chunks;\n};\n\n/** @type {Record<string, Handler>} */\nconst handlers = {\n\tProgram(node, state) {\n\t\treturn handle_body(node.body, state);\n\t},\n\n\tBlockStatement: scoped((node, state) => {\n\t\treturn [\n\t\t\tc(`{\\n${state.indent}\\t`),\n\t\t\t...handle_body(node.body, { ...state, indent: state.indent + '\\t' }),\n\t\t\tc(`\\n${state.indent}}`)\n\t\t];\n\t}),\n\n\tEmptyStatement(node, state) {\n\t\treturn [c(';')];\n\t},\n\n\tParenthesizedExpression(node, state) {\n\t\treturn handle(node.expression, state);\n\t},\n\n\tExpressionStatement(node, state) {\n\t\tif (\n\t\t\tnode.expression.type === 'AssignmentExpression' &&\n\t\t\tnode.expression.left.type === 'ObjectPattern'\n\t\t) {\n\t\t\t// is an AssignmentExpression to an ObjectPattern\n\t\t\treturn [\n\t\t\t\tc('('),\n\t\t\t\t...handle(node.expression, state),\n\t\t\t\tc(');')\n\t\t\t];\n\t\t}\n\n\t\treturn [\n\t\t\t...handle(node.expression, state),\n\t\t\tc(';')\n\t\t];\n\t},\n\n\tIfStatement(node, state) {\n\t\tconst chunks = [\n\t\t\tc('if ('),\n\t\t\t...handle(node.test, state),\n\t\t\tc(') '),\n\t\t\t...handle(node.consequent, state)\n\t\t];\n\n\t\tif (node.alternate) {\n\t\t\tchunks.push(c(' else '));\n\t\t\tpush_array(chunks, handle(node.alternate, state));\n\t\t}\n\n\t\treturn chunks;\n\t},\n\n\tLabeledStatement(node, state) {\n\t\treturn [\n\t\t\t...handle(node.label, state),\n\t\t\tc(': '),\n\t\t\t...handle(node.body, state)\n\t\t];\n\t},\n\n\tBreakStatement(node, state) {\n\t\treturn node.label\n\t\t\t? [c('break '), ...handle(node.label, state), c(';')]\n\t\t\t: [c('break;')];\n\t},\n\n\tContinueStatement(node, state) {\n\t\treturn node.label\n\t\t\t? [c('continue '), ...handle(node.label, state), c(';')]\n\t\t\t: [c('continue;')];\n\t},\n\n\tWithStatement(node, state) {\n\t\treturn [\n\t\t\tc('with ('),\n\t\t\t...handle(node.object, state),\n\t\t\tc(') '),\n\t\t\t...handle(node.body, state)\n\t\t];\n\t},\n\n\tSwitchStatement(/** @type {SwitchStatement} */ node, state) {\n\t\tconst chunks = [\n\t\t\tc('switch ('),\n\t\t\t...handle(node.discriminant, state),\n\t\t\tc(') {')\n\t\t];\n\n\t\tnode.cases.forEach(block => {\n\t\t\tif (block.test) {\n\t\t\t\tchunks.push(c(`\\n${state.indent}\\tcase `));\n\t\t\t\tpush_array(chunks, handle(block.test, { ...state, indent: `${state.indent}\\t` }));\n\t\t\t\tchunks.push(c(':'));\n\t\t\t} else {\n\t\t\t\tchunks.push(c(`\\n${state.indent}\\tdefault:`))\n\t\t\t}\n\n\t\t\tblock.consequent.forEach(statement => {\n\t\t\t\tchunks.push(c(`\\n${state.indent}\\t\\t`));\n\t\t\t\tpush_array(chunks, handle(statement, { ...state, indent: `${state.indent}\\t\\t` }));\n\t\t\t});\n\t\t});\n\n\t\tchunks.push(c(`\\n${state.indent}}`));\n\n\t\treturn chunks;\n\t},\n\n\tReturnStatement(node, state) {\n\t\tif (node.argument) {\n\t\t\tconst contains_comment = node.argument.leadingComments && node.argument.leadingComments.some((/** @type import('../utils/comments.js').CommentWithLocation */ comment) => comment.has_trailing_newline);\n\t\t\treturn [\n\t\t\t\tc(contains_comment ? 'return (' : 'return '),\n\t\t\t\t...handle(node.argument, state),\n\t\t\t\tc(contains_comment ? ');' : ';')\n\t\t\t];\n\t\t} else {\n\t\t\treturn [c('return;')];\n\t\t}\n\t},\n\n\tThrowStatement(node, state) {\n\t\treturn [\n\t\t\tc('throw '),\n\t\t\t...handle(node.argument, state),\n\t\t\tc(';')\n\t\t];\n\t},\n\n\tTryStatement(node, state) {\n\t\tconst chunks = [\n\t\t\tc('try '),\n\t\t\t...handle(node.block, state)\n\t\t];\n\n\t\tif (node.handler) {\n\t\t\tif (node.handler.param) {\n\t\t\t\tchunks.push(c(' catch('));\n\t\t\t\tpush_array(chunks, handle(node.handler.param, state));\n\t\t\t\tchunks.push(c(') '));\n\t\t\t} else {\n\t\t\t\tchunks.push(c(' catch '));\n\t\t\t}\n\n\t\t\tpush_array(chunks, handle(node.handler.body, state));\n\t\t}\n\n\t\tif (node.finalizer) {\n\t\t\tchunks.push(c(' finally '));\n\t\t\tpush_array(chunks, handle(node.finalizer, state));\n\t\t}\n\n\t\treturn chunks;\n\t},\n\n\tWhileStatement(node, state) {\n\t\treturn [\n\t\t\tc('while ('),\n\t\t\t...handle(node.test, state),\n\t\t\tc(') '),\n\t\t\t...handle(node.body, state)\n\t\t];\n\t},\n\n\tDoWhileStatement(node, state) {\n\t\treturn [\n\t\t\tc('do '),\n\t\t\t...handle(node.body, state),\n\t\t\tc(' while ('),\n\t\t\t...handle(node.test, state),\n\t\t\tc(');')\n\t\t];\n\t},\n\n\tForStatement: scoped((node, state) => {\n\t\tconst chunks = [c('for (')];\n\n\t\tif (node.init) {\n\t\t\tif (node.init.type === 'VariableDeclaration') {\n\t\t\t\tpush_array(chunks, handle_var_declaration(node.init, state));\n\t\t\t} else {\n\t\t\t\tpush_array(chunks, handle(node.init, state));\n\t\t\t}\n\t\t}\n\n\t\tchunks.push(c('; '));\n\t\tif (node.test) push_array(chunks, handle(node.test, state));\n\t\tchunks.push(c('; '));\n\t\tif (node.update) push_array(chunks, handle(node.update, state));\n\n\t\tchunks.push(c(') '));\n\t\tpush_array(chunks, handle(node.body, state));\n\n\t\treturn chunks;\n\t}),\n\n\tForInStatement: scoped((node, state) => {\n\t\tconst chunks = [\n\t\t\tc(`for ${node.await ? 'await ' : ''}(`)\n\t\t];\n\n\t\tif (node.left.type === 'VariableDeclaration') {\n\t\t\tpush_array(chunks, handle_var_declaration(node.left, state));\n\t\t} else {\n\t\t\tpush_array(chunks, handle(node.left, state));\n\t\t}\n\n\t\tchunks.push(c(node.type === 'ForInStatement' ? ` in ` : ` of `));\n\t\tpush_array(chunks, handle(node.right, state));\n\t\tchunks.push(c(') '));\n\t\tpush_array(chunks, handle(node.body, state));\n\n\t\treturn chunks;\n\t}),\n\n\tDebuggerStatement(node, state) {\n\t\treturn [c('debugger', node), c(';')];\n\t},\n\n\tFunctionDeclaration: scoped((/** @type {FunctionDeclaration} */ node, state) => {\n\t\tconst chunks = [];\n\n\t\tif (node.async) chunks.push(c('async '));\n\t\tchunks.push(c(node.generator ? 'function* ' : 'function '));\n\t\tif (node.id) push_array(chunks, handle(node.id, state));\n\t\tchunks.push(c('('));\n\n\t\tconst params = node.params.map(p => handle(p, {\n\t\t\t...state,\n\t\t\tindent: state.indent + '\\t'\n\t\t}));\n\n\t\tconst multiple_lines = (\n\t\t\tparams.some(has_newline) ||\n\t\t\t(params.map(get_length).reduce(sum, 0) + (state.indent.length + params.length - 1) * 2) > 80\n\t\t);\n\n\t\tconst separator = c(multiple_lines ? `,\\n${state.indent}` : ', ');\n\n\t\tif (multiple_lines) {\n\t\t\tchunks.push(c(`\\n${state.indent}\\t`));\n\t\t\tpush_array(chunks, join(params, separator));\n\t\t\tchunks.push(c(`\\n${state.indent}`));\n\t\t} else {\n\t\t\tpush_array(chunks, join(params, separator));\n\t\t}\n\n\t\tchunks.push(c(') '));\n\t\tpush_array(chunks, handle(node.body, state));\n\n\t\treturn chunks;\n\t}),\n\n\tVariableDeclaration(node, state) {\n\t\treturn handle_var_declaration(node, state).concat(c(';'));\n\t},\n\n\tVariableDeclarator(node, state) {\n\t\tif (node.init) {\n\t\t\treturn [\n\t\t\t\t...handle(node.id, state),\n\t\t\t\tc(' = '),\n\t\t\t\t...handle(node.init, state)\n\t\t\t];\n\t\t} else {\n\t\t\treturn handle(node.id, state);\n\t\t}\n\t},\n\n\tClassDeclaration(node, state) {\n\t\tconst chunks = [c('class ')];\n\n\t\tif (node.id) {\n\t\t\tpush_array(chunks, handle(node.id, state));\n\t\t\tchunks.push(c(' '));\n\t\t}\n\n\t\tif (node.superClass) {\n\t\t\tchunks.push(c('extends '));\n\t\t\tpush_array(chunks, handle(node.superClass, state));\n\t\t\tchunks.push(c(' '));\n\t\t}\n\n\t\tpush_array(chunks, handle(node.body, state));\n\n\t\treturn chunks;\n\t},\n\n\tImportDeclaration(/** @type {ImportDeclaration} */ node, state) {\n\t\tconst chunks = [c('import ')];\n\n\t\tconst { length } = node.specifiers;\n\t\tconst source = handle(node.source, state);\n\n\t\tif (length > 0) {\n\t\t\tlet i = 0;\n\n\t\t\twhile (i < length) {\n\t\t\t\tif (i > 0) {\n\t\t\t\t\tchunks.push(c(', '));\n\t\t\t\t}\n\n\t\t\t\tconst specifier = node.specifiers[i];\n\n\t\t\t\tif (specifier.type === 'ImportDefaultSpecifier') {\n\t\t\t\t\tchunks.push(c(specifier.local.name, specifier));\n\t\t\t\t\ti += 1;\n\t\t\t\t} else if (specifier.type === 'ImportNamespaceSpecifier') {\n\t\t\t\t\tchunks.push(c('* as ' + specifier.local.name, specifier));\n\t\t\t\t\ti += 1;\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i < length) {\n\t\t\t\t// we have named specifiers\n\t\t\t\tconst specifiers = node.specifiers.slice(i).map((/** @type {ImportSpecifier} */ specifier) => {\n\t\t\t\t\tconst name = handle(specifier.imported, state)[0];\n\t\t\t\t\tconst as = handle(specifier.local, state)[0];\n\n\t\t\t\t\tif (name.content === as.content) {\n\t\t\t\t\t\treturn [as];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [name, c(' as '), as];\n\t\t\t\t});\n\n\t\t\t\tconst width = get_length(chunks) + specifiers.map(get_length).reduce(sum, 0) + (2 * specifiers.length) + 6 + get_length(source);\n\n\t\t\t\tif (width > 80) {\n\t\t\t\t\tchunks.push(c(`{\\n\\t`));\n\t\t\t\t\tpush_array(chunks, join(specifiers, c(',\\n\\t')));\n\t\t\t\t\tchunks.push(c('\\n}'));\n\t\t\t\t} else {\n\t\t\t\t\tchunks.push(c(`{ `));\n\t\t\t\t\tpush_array(chunks, join(specifiers, c(', ')));\n\t\t\t\t\tchunks.push(c(' }'));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchunks.push(c(' from '));\n\t\t}\n\n\t\tpush_array(chunks, source);\n\t\tchunks.push(c(';'));\n\n\t\treturn chunks;\n\t},\n\n\tImportExpression(node, state) {\n\t\treturn [c('import('), ...handle(node.source, state), c(')')];\n\t},\n\n\tExportDefaultDeclaration(node, state) {\n\t\tconst chunks = [\n\t\t\tc(`export default `),\n\t\t\t...handle(node.declaration, state)\n\t\t];\n\n\t\tif (node.declaration.type !== 'FunctionDeclaration') {\n\t\t\tchunks.push(c(';'));\n\t\t}\n\n\t\treturn chunks;\n\t},\n\n\tExportNamedDeclaration(node, state) {\n\t\tconst chunks = [c('export ')];\n\n\t\tif (node.declaration) {\n\t\t\tpush_array(chunks, handle(node.declaration, state));\n\t\t} else {\n\t\t\tconst specifiers = node.specifiers.map((/** @type {ExportSpecifier} */ specifier) => {\n\t\t\t\tconst name = handle(specifier.local, state)[0];\n\t\t\t\tconst as = handle(specifier.exported, state)[0];\n\n\t\t\t\tif (name.content === as.content) {\n\t\t\t\t\treturn [name];\n\t\t\t\t}\n\n\t\t\t\treturn [name, c(' as '), as];\n\t\t\t});\n\n\t\t\tconst width = 7 + specifiers.map(get_length).reduce(sum, 0) + 2 * specifiers.length;\n\n\t\t\tif (width > 80) {\n\t\t\t\tchunks.push(c('{\\n\\t'));\n\t\t\t\tpush_array(chunks, join(specifiers, c(',\\n\\t')));\n\t\t\t\tchunks.push(c('\\n}'));\n\t\t\t} else {\n\t\t\t\tchunks.push(c('{ '));\n\t\t\t\tpush_array(chunks, join(specifiers, c(', ')));\n\t\t\t\tchunks.push(c(' }'));\n\t\t\t}\n\n\t\t\tif (node.source) {\n\t\t\t\tchunks.push(c(' from '));\n\t\t\t\tpush_array(chunks, handle(node.source, state));\n\t\t\t}\n\t\t}\n\n\t\tchunks.push(c(';'));\n\n\t\treturn chunks;\n\t},\n\n\tExportAllDeclaration(node, state) {\n\t\treturn [\n\t\t\tc(`export * from `),\n\t\t\t...handle(node.source, state),\n\t\t\tc(`;`)\n\t\t];\n\t},\n\n\tMethodDefinition(node, state) {\n\t\tconst chunks = [];\n\n\t\tif (node.static) {\n\t\t\tchunks.push(c('static '));\n\t\t}\n\n\t\tif (node.kind === 'get' || node.kind === 'set') {\n\t\t\t// Getter or setter\n\t\t\tchunks.push(c(node.kind + ' '));\n\t\t}\n\n\t\tif (node.value.async) {\n\t\t\tchunks.push(c('async '));\n\t\t}\n\n\t\tif (node.value.generator) {\n\t\t\tchunks.push(c('*'));\n\t\t}\n\n\t\tif (node.computed) {\n\t\t\tchunks.push(c('['));\n\t\t\tpush_array(chunks, handle(node.key, state));\n\t\t\tchunks.push(c(']'));\n\t\t} else {\n\t\t\tpush_array(chunks, handle(node.key, state));\n\t\t}\n\n\t\tchunks.push(c('('));\n\n\t\tconst { params } = node.value;\n\t\tfor (let i = 0; i < params.length; i += 1) {\n\t\t\tpush_array(chunks, handle(params[i], state));\n\t\t\tif (i < params.length - 1) chunks.push(c(', '));\n\t\t}\n\n\t\tchunks.push(c(') '));\n\t\tpush_array(chunks, handle(node.value.body, state));\n\n\t\treturn chunks;\n\t},\n\n\tArrowFunctionExpression: scoped((/** @type {ArrowFunctionExpression} */ node, state) => {\n\t\tconst chunks = [];\n\n\t\tif (node.async) chunks.push(c('async '));\n\n\t\tif (node.params.length === 1 && node.params[0].type === 'Identifier') {\n\t\t\tpush_array(chunks, handle(node.params[0], state));\n\t\t} else {\n\t\t\tconst params = node.params.map(param => handle(param, {\n\t\t\t\t...state,\n\t\t\t\tindent: state.indent + '\\t'\n\t\t\t}));\n\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, join(params, c(', ')));\n\t\t\tchunks.push(c(')'));\n\t\t}\n\n\t\tchunks.push(c(' => '));\n\n\t\tif (\n\t\t\tnode.body.type === 'ObjectExpression' ||\n\t\t\t(node.body.type === 'AssignmentExpression' && node.body.left.type === 'ObjectPattern')\n\t\t) {\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, handle(node.body, state));\n\t\t\tchunks.push(c(')'));\n\t\t} else {\n\t\t\tpush_array(chunks, handle(node.body, state));\n\t\t}\n\n\t\treturn chunks;\n\t}),\n\n\tThisExpression(node, state) {\n\t\treturn [c('this', node)];\n\t},\n\n\tSuper(node, state) {\n\t\treturn [c('super', node)];\n\t},\n\n\tRestElement(node, state) {\n\t\treturn [c('...'), ...handle(node.argument, state)];\n\t},\n\n\tYieldExpression(node, state) {\n\t\tif (node.argument) {\n\t\t\treturn [c(node.delegate ? `yield* ` : `yield `), ...handle(node.argument, state)];\n\t\t}\n\n\t\treturn [c(node.delegate ? `yield*` : `yield`)];\n\t},\n\n\tAwaitExpression(node, state) {\n\t\tif (node.argument) {\n\t\t\tconst precedence = EXPRESSIONS_PRECEDENCE[node.argument.type];\n\n\t\t\tif (precedence && (precedence < EXPRESSIONS_PRECEDENCE.AwaitExpression)) {\n\t\t\t\treturn [c('await ('), ...handle(node.argument, state), c(')')];\n\t\t\t} else {\n\t\t\t\treturn [c('await '), ...handle(node.argument, state)];\n\t\t\t}\n\t\t}\n\n\t\treturn [c('await')];\n\t},\n\n\tTemplateLiteral(node, state) {\n\t\tconst chunks = [c('`')];\n\n\t\tconst { quasis, expressions } = node;\n\n\t\tfor (let i = 0; i < expressions.length; i++) {\n\t\t\tchunks.push(\n\t\t\t\tc(quasis[i].value.raw),\n\t\t\t\tc('${')\n\t\t\t);\n\t\t\tpush_array(chunks, handle(expressions[i], state));\n\t\t\tchunks.push(c('}'));\n\t\t}\n\n\t\tchunks.push(\n\t\t\tc(quasis[quasis.length - 1].value.raw),\n\t\t\tc('`')\n\t\t);\n\n\t\treturn chunks;\n\t},\n\n\tTaggedTemplateExpression(node, state) {\n\t\treturn handle(node.tag, state).concat(handle(node.quasi, state));\n\t},\n\n\tArrayExpression(node, state) {\n\t\tconst chunks = [c('[')];\n\n\t\t/** @type {Chunk[][]} */\n\t\tconst elements = [];\n\n\t\t/** @type {Chunk[]} */\n\t\tlet sparse_commas = [];\n\n\t\tfor (let i = 0; i < node.elements.length; i += 1) {\n\t\t\t// can't use map/forEach because of sparse arrays\n\t\t\tconst element = node.elements[i];\n\t\t\tif (element) {\n\t\t\t\telements.push([...sparse_commas, ...handle(element, {\n\t\t\t\t\t...state,\n\t\t\t\t\tindent: state.indent + '\\t'\n\t\t\t\t})]);\n\t\t\t\tsparse_commas = [];\n\t\t\t} else {\n\t\t\t\tsparse_commas.push(c(','));\n\t\t\t}\n\t\t}\n\n\t\tconst multiple_lines = (\n\t\t\telements.some(has_newline) ||\n\t\t\t(elements.map(get_length).reduce(sum, 0) + (state.indent.length + elements.length - 1) * 2) > 80\n\t\t);\n\n\t\tif (multiple_lines) {\n\t\t\tchunks.push(c(`\\n${state.indent}\\t`));\n\t\t\tpush_array(chunks, join(elements, c(`,\\n${state.indent}\\t`)));\n\t\t\tchunks.push(c(`\\n${state.indent}`));\n\t\t\tpush_array(chunks, sparse_commas);\n\t\t} else {\n\t\t\tpush_array(chunks, join(elements, c(', ')));\n\t\t\tpush_array(chunks, sparse_commas);\n\t\t}\n\n\t\tchunks.push(c(']'));\n\n\t\treturn chunks;\n\t},\n\n\tObjectExpression(/** @type {ObjectExpression} */ node, state) {\n\t\tif (node.properties.length === 0) {\n\t\t\treturn [c('{}')];\n\t\t}\n\n\t\tlet has_inline_comment = false;\n\n\t\t/** @type {Chunk[]} */\n\t\tconst chunks = [];\n\t\tconst separator = c(', ');\n\n\t\tnode.properties.forEach((p, i) => {\n\t\t\tpush_array(chunks, handle(p, {\n\t\t\t\t...state,\n\t\t\t\tindent: state.indent + '\\t'\n\t\t\t}));\n\n\t\t\tif (state.comments.length) {\n\t\t\t\t// TODO generalise this, so it works with ArrayExpressions and other things.\n\t\t\t\t// At present, stuff will just get appended to the closest statement/declaration\n\t\t\t\tchunks.push(c(', '));\n\n\t\t\t\twhile (state.comments.length) {\n\t\t\t\t\tconst comment = state.comments.shift();\n\n\t\t\t\t\tchunks.push(c(comment.type === 'Block'\n\t\t\t\t\t\t? `/*${comment.value}*/\\n${state.indent}\\t`\n\t\t\t\t\t\t: `//${comment.value}\\n${state.indent}\\t`));\n\n\t\t\t\t\tif (comment.type === 'Line') {\n\t\t\t\t\t\thas_inline_comment = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (i < node.properties.length - 1) {\n\t\t\t\t\tchunks.push(separator);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tconst multiple_lines = (\n\t\t\thas_inline_comment ||\n\t\t\thas_newline(chunks) ||\n\t\t\tget_length(chunks) > 40\n\t\t);\n\n\t\tif (multiple_lines) {\n\t\t\tseparator.content = `,\\n${state.indent}\\t`;\n\t\t}\n\n\t\treturn [\n\t\t\tc(multiple_lines ? `{\\n${state.indent}\\t` : `{ `),\n\t\t\t...chunks,\n\t\t\tc(multiple_lines ? `\\n${state.indent}}` : ` }`)\n\t\t];\n\t},\n\n\tProperty(node, state) {\n\t\tconst value = handle(node.value, state);\n\n\t\tif (node.key === node.value) {\n\t\t\treturn value;\n\t\t}\n\n\t\t// special case\n\t\tif (\n\t\t\t!node.computed &&\n\t\t\tnode.value.type === 'AssignmentPattern' &&\n\t\t\tnode.value.left.type === 'Identifier' &&\n\t\t\tnode.value.left.name === node.key.name\n\t\t) {\n\t\t\treturn value;\n\t\t}\n\n\t\tif (!node.computed && node.value.type === 'Identifier' && (\n\t\t\t(node.key.type === 'Identifier' && node.key.name === value[0].content) ||\n\t\t\t(node.key.type === 'Literal' && node.key.value === value[0].content)\n\t\t)) {\n\t\t\treturn value;\n\t\t}\n\n\t\tconst key = handle(node.key, state);\n\n\t\tif (node.value.type === 'FunctionExpression' && !node.value.id) {\n\t\t\tstate = {\n\t\t\t\t...state,\n\t\t\t\tscope: state.scope_map.get(node.value)\n\t\t\t};\n\n\t\t\tconst chunks = node.kind !== 'init'\n\t\t\t\t? [c(`${node.kind} `)]\n\t\t\t\t: [];\n\n\t\t\tif (node.value.async) {\n\t\t\t\tchunks.push(c('async '));\n\t\t\t}\n\t\t\tif (node.value.generator) {\n\t\t\t\tchunks.push(c('*'));\n\t\t\t}\n\n\t\t\tpush_array(chunks, node.computed ? [c('['), ...key, c(']')] : key);\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, join(node.value.params.map((/** @type {Pattern} */ param) => handle(param, state)), c(', ')));\n\t\t\tchunks.push(c(') '));\n\t\t\tpush_array(chunks, handle(node.value.body, state));\n\n\t\t\treturn chunks;\n\t\t}\n\n\t\tif (node.computed) {\n\t\t\treturn [\n\t\t\t\tc('['),\n\t\t\t\t...key,\n\t\t\t\tc(']: '),\n\t\t\t\t...value\n\t\t\t];\n\t\t}\n\n\t\treturn [\n\t\t\t...key,\n\t\t\tc(': '),\n\t\t\t...value\n\t\t];\n\t},\n\n\tObjectPattern(node, state) {\n\t\tconst chunks = [c('{ ')];\n\n\t\tfor (let i = 0; i < node.properties.length; i += 1) {\n\t\t\tpush_array(chunks, handle(node.properties[i], state));\n\t\t\tif (i < node.properties.length - 1) chunks.push(c(', '));\n\t\t}\n\n\t\tchunks.push(c(' }'));\n\n\t\treturn chunks;\n\t},\n\n\tSequenceExpression(/** @type {SequenceExpression} */ node, state) {\n\t\tconst expressions = node.expressions.map(e => handle(e, state));\n\n\t\treturn [\n\t\t\tc('('),\n\t\t\t...join(expressions, c(', ')),\n\t\t\tc(')')\n\t\t];\n\t},\n\n\tUnaryExpression(node, state) {\n\t\tconst chunks = [c(node.operator)];\n\n\t\tif (node.operator.length > 1) {\n\t\t\tchunks.push(c(' '));\n\t\t}\n\n\t\tif (\n\t\t\tEXPRESSIONS_PRECEDENCE[node.argument.type] <\n\t\t\tEXPRESSIONS_PRECEDENCE.UnaryExpression\n\t\t) {\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, handle(node.argument, state));\n\t\t\tchunks.push(c(')'));\n\t\t} else {\n\t\t\tpush_array(chunks, handle(node.argument, state));\n\t\t}\n\n\t\treturn chunks;\n\t},\n\n\tUpdateExpression(node, state) {\n\t\treturn node.prefix\n\t\t\t? [c(node.operator), ...handle(node.argument, state)]\n\t\t\t: [...handle(node.argument, state), c(node.operator)];\n\t},\n\n\tAssignmentExpression(node, state) {\n\t\treturn [\n\t\t\t...handle(node.left, state),\n\t\t\tc(` ${node.operator || '='} `),\n\t\t\t...handle(node.right, state)\n\t\t];\n\t},\n\n\tBinaryExpression(node, state) {\n\t\t/**\n\t\t * @type any[]\n\t\t */\n\t\tconst chunks = [];\n\n\t\t// TODO\n\t\t// const is_in = node.operator === 'in';\n\t\t// if (is_in) {\n\t\t// \t// Avoids confusion in `for` loops initializers\n\t\t// \tchunks.push(c('('));\n\t\t// }\n\n\t\tif (needs_parens(node.left, node, false)) {\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, handle(node.left, state));\n\t\t\tchunks.push(c(')'));\n\t\t} else {\n\t\t\tpush_array(chunks, handle(node.left, state));\n\t\t}\n\n\t\tchunks.push(c(` ${node.operator} `));\n\n\t\tif (needs_parens(node.right, node, true)) {\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, handle(node.right, state));\n\t\t\tchunks.push(c(')'));\n\t\t} else {\n\t\t\tpush_array(chunks, handle(node.right, state));\n\t\t}\n\n\t\treturn chunks;\n\t},\n\n\tConditionalExpression(node, state) {\n\t\t/**\n\t\t * @type any[]\n\t\t */\n\t\tconst chunks = [];\n\n\t\tif (\n\t\t\tEXPRESSIONS_PRECEDENCE[node.test.type] >\n\t\t\tEXPRESSIONS_PRECEDENCE.ConditionalExpression\n\t\t) {\n\t\t\tpush_array(chunks, handle(node.test, state));\n\t\t} else {\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, handle(node.test, state));\n\t\t\tchunks.push(c(')'));\n\t\t}\n\n\t\tconst child_state = { ...state, indent: state.indent + '\\t' };\n\n\t\tconst consequent = handle(node.consequent, child_state);\n\t\tconst alternate = handle(node.alternate, child_state);\n\n\t\tconst multiple_lines = (\n\t\t\thas_newline(consequent) || has_newline(alternate) ||\n\t\t\tget_length(chunks) + get_length(consequent) + get_length(alternate) > 50\n\t\t);\n\n\t\tif (multiple_lines) {\n\t\t\tchunks.push(c(`\\n${state.indent}? `));\n\t\t\tpush_array(chunks, consequent);\n\t\t\tchunks.push(c(`\\n${state.indent}: `));\n\t\t\tpush_array(chunks, alternate);\n\t\t} else {\n\t\t\tchunks.push(c(` ? `));\n\t\t\tpush_array(chunks, consequent);\n\t\t\tchunks.push(c(` : `));\n\t\t\tpush_array(chunks, alternate);\n\t\t}\n\n\t\treturn chunks;\n\t},\n\n\tNewExpression(/** @type {NewExpression} */ node, state) {\n\t\tconst chunks = [c('new ')];\n\n\t\tif (\n\t\t\tEXPRESSIONS_PRECEDENCE[node.callee.type] <\n\t\t\tEXPRESSIONS_PRECEDENCE.CallExpression || has_call_expression(node.callee)\n\t\t) {\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, handle(node.callee, state));\n\t\t\tchunks.push(c(')'));\n\t\t} else {\n\t\t\tpush_array(chunks, handle(node.callee, state));\n\t\t}\n\n\t\t// TODO this is copied from CallExpression — DRY it out\n\t\tconst args = node.arguments.map(arg => handle(arg, {\n\t\t\t...state,\n\t\t\tindent: state.indent + '\\t'\n\t\t}));\n\n\t\tconst separator = args.some(has_newline) // TODO or length exceeds 80\n\t\t\t? c(',\\n' + state.indent)\n\t\t\t: c(', ');\n\n\t\tchunks.push(c('('));\n\t\tpush_array(chunks, join(args, separator));\n\t\tchunks.push(c(')'));\n\n\t\treturn chunks;\n\t},\n\n\tChainExpression(node, state) {\n\t\treturn handle(node.expression, state);\n\t},\n\n\tCallExpression(/** @type {CallExpression} */ node, state) {\n\t\t/**\n\t\t * @type any[]\n\t\t */\n\t\tconst chunks = [];\n\n\t\tif (\n\t\t\tEXPRESSIONS_PRECEDENCE[node.callee.type] <\n\t\t\tEXPRESSIONS_PRECEDENCE.CallExpression\n\t\t) {\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, handle(node.callee, state));\n\t\t\tchunks.push(c(')'));\n\t\t} else {\n\t\t\tpush_array(chunks, handle(node.callee, state));\n\t\t}\n\n\t\tif (/** @type {SimpleCallExpression} */ (node).optional) {\n\t\t\tchunks.push(c('?.'));\n\t\t}\n\n\t\tconst args = node.arguments.map(arg => handle(arg, state));\n\n\t\tconst multiple_lines = args.slice(0, -1).some(has_newline); // TODO or length exceeds 80\n\n\t\tif (multiple_lines) {\n\t\t\t// need to handle args again. TODO find alternative approach?\n\t\t\tconst args = node.arguments.map(arg => handle(arg, {\n\t\t\t\t...state,\n\t\t\t\tindent: `${state.indent}\\t`\n\t\t\t}));\n\n\t\t\tchunks.push(c(`(\\n${state.indent}\\t`));\n\t\t\tpush_array(chunks, join(args, c(`,\\n${state.indent}\\t`)));\n\t\t\tchunks.push(c(`\\n${state.indent})`));\n\t\t} else {\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, join(args, c(', ')));\n\t\t\tchunks.push(c(')'));\n\t\t}\n\n\t\treturn chunks;\n\t},\n\n\tMemberExpression(node, state) {\n\t\t/**\n\t\t * @type any[]\n\t\t */\n\t\tconst chunks = [];\n\n\t\tif (EXPRESSIONS_PRECEDENCE[node.object.type] < EXPRESSIONS_PRECEDENCE.MemberExpression) {\n\t\t\tchunks.push(c('('));\n\t\t\tpush_array(chunks, handle(node.object, state));\n\t\t\tchunks.push(c(')'));\n\t\t} else {\n\t\t\tpush_array(chunks, handle(node.object, state));\n\t\t}\n\n\t\tif (node.computed) {\n\t\t\tif (node.optional) {\n\t\t\t\tchunks.push(c('?.'));\n\t\t\t}\n\t\t\tchunks.push(c('['));\n\t\t\tpush_array(chunks, handle(node.property, state));\n\t\t\tchunks.push(c(']'));\n\t\t} else {\n\t\t\tchunks.push(c(node.optional ? '?.' : '.'));\n\t\t\tpush_array(chunks, handle(node.property, state));\n\t\t}\n\n\t\treturn chunks;\n\t},\n\n\tMetaProperty(node, state) {\n\t\treturn [...handle(node.meta, state), c('.'), ...handle(node.property, state)];\n\t},\n\n\tIdentifier(node, state) {\n\t\tlet name = node.name;\n\n\t\tif (name[0] === '@') {\n\t\t\tname = state.getName(name.slice(1));\n\t\t} else if (node.name[0] === '#') {\n\t\t\tconst owner = state.scope.find_owner(node.name);\n\n\t\t\tif (!owner) {\n\t\t\t\tthrow new Error(`Could not find owner for node`);\n\t\t\t}\n\n\t\t\tif (!state.deconflicted.has(owner)) {\n\t\t\t\tstate.deconflicted.set(owner, new Map());\n\t\t\t}\n\n\t\t\tconst deconflict_map = state.deconflicted.get(owner);\n\n\t\t\tif (!deconflict_map.has(node.name)) {\n\t\t\t\tdeconflict_map.set(node.name, deconflict(node.name.slice(1), owner.references));\n\t\t\t}\n\n\t\t\tname = deconflict_map.get(node.name);\n\t\t}\n\n\t\treturn [c(name, node)];\n\t},\n\n\tLiteral(/** @type {Literal} */ node, state) {\n\t\tif (typeof node.value === 'string') {\n\t\t\treturn [\n\t\t\t\t// TODO do we need to handle weird unicode characters somehow?\n\t\t\t\t// str.replace(/\\\\u(\\d{4})/g, (m, n) => String.fromCharCode(+n))\n\t\t\t\tc((node.raw || JSON.stringify(node.value)).replace(re, (_m, _i, at, hash, name) => {\n\t\t\t\t\tif (at)\treturn '@' + name;\n\t\t\t\t\tif (hash) return '#' + name;\n\t\t\t\t\tthrow new Error(`this shouldn't happen`);\n\t\t\t\t}), node)\n\t\t\t];\n\t\t}\n\n\t\treturn [c(node.raw || String(node.value), node)];\n\t}\n};\n\nhandlers.ForOfStatement = handlers.ForInStatement;\nhandlers.FunctionExpression = handlers.FunctionDeclaration;\nhandlers.ClassExpression = handlers.ClassDeclaration;\nhandlers.ClassBody = handlers.BlockStatement;\nhandlers.SpreadElement = handlers.RestElement;\nhandlers.ArrayPattern = handlers.ArrayExpression;\nhandlers.LogicalExpression = handlers.BinaryExpression;\nhandlers.AssignmentPattern = handlers.AssignmentExpression;\n","var charToInteger = {};\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nfor (var i = 0; i < chars.length; i++) {\n    charToInteger[chars.charCodeAt(i)] = i;\n}\nfunction decode(mappings) {\n    var decoded = [];\n    var line = [];\n    var segment = [\n        0,\n        0,\n        0,\n        0,\n        0,\n    ];\n    var j = 0;\n    for (var i = 0, shift = 0, value = 0; i < mappings.length; i++) {\n        var c = mappings.charCodeAt(i);\n        if (c === 44) { // \",\"\n            segmentify(line, segment, j);\n            j = 0;\n        }\n        else if (c === 59) { // \";\"\n            segmentify(line, segment, j);\n            j = 0;\n            decoded.push(line);\n            line = [];\n            segment[0] = 0;\n        }\n        else {\n            var integer = charToInteger[c];\n            if (integer === undefined) {\n                throw new Error('Invalid character (' + String.fromCharCode(c) + ')');\n            }\n            var hasContinuationBit = integer & 32;\n            integer &= 31;\n            value += integer << shift;\n            if (hasContinuationBit) {\n                shift += 5;\n            }\n            else {\n                var shouldNegate = value & 1;\n                value >>>= 1;\n                if (shouldNegate) {\n                    value = value === 0 ? -0x80000000 : -value;\n                }\n                segment[j] += value;\n                j++;\n                value = shift = 0; // reset\n            }\n        }\n    }\n    segmentify(line, segment, j);\n    decoded.push(line);\n    return decoded;\n}\nfunction segmentify(line, segment, j) {\n    // This looks ugly, but we're creating specialized arrays with a specific\n    // length. This is much faster than creating a new array (which v8 expands to\n    // a capacity of 17 after pushing the first item), or slicing out a subarray\n    // (which is slow). Length 4 is assumed to be the most frequent, followed by\n    // length 5 (since not everything will have an associated name), followed by\n    // length 1 (it's probably rare for a source substring to not have an\n    // associated segment data).\n    if (j === 4)\n        line.push([segment[0], segment[1], segment[2], segment[3]]);\n    else if (j === 5)\n        line.push([segment[0], segment[1], segment[2], segment[3], segment[4]]);\n    else if (j === 1)\n        line.push([segment[0]]);\n}\nfunction encode(decoded) {\n    var sourceFileIndex = 0; // second field\n    var sourceCodeLine = 0; // third field\n    var sourceCodeColumn = 0; // fourth field\n    var nameIndex = 0; // fifth field\n    var mappings = '';\n    for (var i = 0; i < decoded.length; i++) {\n        var line = decoded[i];\n        if (i > 0)\n            mappings += ';';\n        if (line.length === 0)\n            continue;\n        var generatedCodeColumn = 0; // first field\n        var lineMappings = [];\n        for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {\n            var segment = line_1[_i];\n            var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn);\n            generatedCodeColumn = segment[0];\n            if (segment.length > 1) {\n                segmentMappings +=\n                    encodeInteger(segment[1] - sourceFileIndex) +\n                        encodeInteger(segment[2] - sourceCodeLine) +\n                        encodeInteger(segment[3] - sourceCodeColumn);\n                sourceFileIndex = segment[1];\n                sourceCodeLine = segment[2];\n                sourceCodeColumn = segment[3];\n            }\n            if (segment.length === 5) {\n                segmentMappings += encodeInteger(segment[4] - nameIndex);\n                nameIndex = segment[4];\n            }\n            lineMappings.push(segmentMappings);\n        }\n        mappings += lineMappings.join(',');\n    }\n    return mappings;\n}\nfunction encodeInteger(num) {\n    var result = '';\n    num = num < 0 ? (-num << 1) | 1 : num << 1;\n    do {\n        var clamped = num & 31;\n        num >>>= 5;\n        if (num > 0) {\n            clamped |= 32;\n        }\n        result += chars[clamped];\n    } while (num > 0);\n    return result;\n}\n\nexport { decode, encode };\n//# sourceMappingURL=sourcemap-codec.es.js.map\n","import * as perisopic from 'periscopic';\nimport { handle } from './handlers.js';\nimport { encode } from 'sourcemap-codec';\n\n/** @type {(str?: string) => string} str */\nlet btoa = () => {\n\tthrow new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');\n};\n\nif (typeof window !== 'undefined' && typeof window.btoa === 'function') {\n\tbtoa = (str) => window.btoa(unescape(encodeURIComponent(str)));\n} else if (typeof Buffer === 'function') {\n\tbtoa = (str) => Buffer.from(str, 'utf-8').toString('base64');\n}\n\n/** @typedef {import('estree').Node} Node */\n\n/**\n * @typedef {{\n *   file?: string;\n *   sourceMapSource?: string;\n *   sourceMapContent?: string;\n *   sourceMapEncodeMappings?: boolean; // default true\n *   getName?: (name: string) => string;\n * }} PrintOptions\n */\n\n/**\n * @param {Node} node\n * @param {PrintOptions} opts\n * @returns {{ code: string, map: any }} // TODO\n */\nexport function print(node, opts = {}) {\n\tif (Array.isArray(node)) {\n\t\treturn print({\n\t\t\ttype: 'Program',\n\t\t\tbody: node,\n\t\t\tsourceType: 'module'\n\t\t}, opts);\n\t}\n\n\tconst {\n\t\tgetName = /** @param {string} x */ (x) => {\n\t\t\tthrow new Error(`Unhandled sigil @${x}`);\n\t\t}\n\t} = opts;\n\n\tlet { map: scope_map, scope } = perisopic.analyze(node);\n\tconst deconflicted = new WeakMap();\n\n\tconst chunks = handle(node, {\n\t\tindent: '',\n\t\tgetName,\n\t\tscope,\n\t\tscope_map,\n\t\tdeconflicted,\n\t\tcomments: []\n\t});\n\n\t/** @typedef {[number, number, number, number]} Segment */\n\n\tlet code = '';\n\tlet current_column = 0;\n\n\t/** @type {Segment[][]} */\n\tlet mappings = [];\n\n\t/** @type {Segment[]} */\n\tlet current_line = [];\n\n\tfor (let i = 0; i < chunks.length; i += 1) {\n\t\tconst chunk = chunks[i];\n\n\t\tcode += chunk.content;\n\n\t\tif (chunk.loc) {\n\t\t\tcurrent_line.push([\n\t\t\t\tcurrent_column,\n\t\t\t\t0, // source index is always zero\n\t\t\t\tchunk.loc.start.line - 1,\n\t\t\t\tchunk.loc.start.column,\n\t\t\t]);\n\t\t}\n\n\t\tfor (let i = 0; i < chunk.content.length; i += 1) {\n\t\t\tif (chunk.content[i] === '\\n') {\n\t\t\t\tmappings.push(current_line);\n\t\t\t\tcurrent_line = [];\n\t\t\t\tcurrent_column = 0;\n\t\t\t} else {\n\t\t\t\tcurrent_column += 1;\n\t\t\t}\n\t\t}\n\n\t\tif (chunk.loc) {\n\t\t\tcurrent_line.push([\n\t\t\t\tcurrent_column,\n\t\t\t\t0, // source index is always zero\n\t\t\t\tchunk.loc.end.line - 1,\n\t\t\t\tchunk.loc.end.column,\n\t\t\t]);\n\t\t}\n\t}\n\n\tmappings.push(current_line);\n\n\tconst map = {\n\t\tversion: 3,\n\t\t/** @type {string[]} */\n\t\tnames: [],\n\t\tsources: [opts.sourceMapSource || null],\n\t\tsourcesContent: [opts.sourceMapContent || null],\n\t\tmappings: opts.sourceMapEncodeMappings == undefined || opts.sourceMapEncodeMappings\n\t\t\t? encode(mappings) : mappings\n\t};\n\n\tObject.defineProperties(map, {\n\t\ttoString: {\n\t\t\tenumerable: false,\n\t\t\tvalue: function toString() {\n\t\t\t\treturn JSON.stringify(this);\n\t\t\t}\n\t\t},\n\t\ttoUrl: {\n\t\t\tenumerable: false,\n\t\t\tvalue: function toUrl() {\n\t\t\t\treturn 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());\n\t\t\t}\n\t\t}\n\t});\n\n\treturn {\n\t\tcode,\n\t\tmap\n\t};\n}","import * as acorn from 'acorn';\nimport { walk } from 'estree-walker';\nimport { id, re } from './utils/id.js';\nimport { get_comment_handlers } from './utils/comments.js';\n\n/** @typedef {import('estree').Expression} Expression */\n/** @typedef {import('estree').Node} Node */\n/** @typedef {import('estree').ObjectExpression} ObjectExpression */\n/** @typedef {import('estree').Property} Property */\n/** @typedef {import('estree').SpreadElement} SpreadElement */\n\n/** @typedef {import('./utils/comments').CommentWithLocation} CommentWithLocation */\n\n/** @type {Record<string, string>} */\nconst sigils = {\n\t'@': 'AT',\n\t'#': 'HASH'\n};\n\n/** @param {TemplateStringsArray} strings */\nconst join = (strings) => {\n\tlet str = strings[0];\n\tfor (let i = 1; i < strings.length; i += 1) {\n\t\tstr += `_${id}_${i - 1}_${strings[i]}`;\n\t}\n\treturn str.replace(\n\t\t/([@#])(\\w+)/g,\n\t\t(_m, sigil, name) => `_${id}_${sigils[sigil]}_${name}`\n\t);\n};\n\n/**\n * @param {any[]} array\n * @param {any[]} target\n */\nconst flatten_body = (array, target) => {\n\tfor (let i = 0; i < array.length; i += 1) {\n\t\tconst statement = array[i];\n\t\tif (Array.isArray(statement)) {\n\t\t\tflatten_body(statement, target);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (statement.type === 'ExpressionStatement') {\n\t\t\tif (statement.expression === EMPTY) continue;\n\n\t\t\tif (Array.isArray(statement.expression)) {\n\t\t\t\t// TODO this is hacktacular\n\t\t\t\tlet node = statement.expression[0];\n\t\t\t\twhile (Array.isArray(node)) node = node[0];\n\t\t\t\tif (node) node.leadingComments = statement.leadingComments;\n\n\t\t\t\tflatten_body(statement.expression, target);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (/(Expression|Literal)$/.test(statement.expression.type)) {\n\t\t\t\ttarget.push(statement);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (statement.leadingComments)\n\t\t\t\tstatement.expression.leadingComments = statement.leadingComments;\n\t\t\tif (statement.trailingComments)\n\t\t\t\tstatement.expression.trailingComments = statement.trailingComments;\n\n\t\t\ttarget.push(statement.expression);\n\t\t\tcontinue;\n\t\t}\n\n\t\ttarget.push(statement);\n\t}\n\n\treturn target;\n};\n\n/**\n * @param {any[]} array\n * @param {any[]} target\n */\nconst flatten_properties = (array, target) => {\n\tfor (let i = 0; i < array.length; i += 1) {\n\t\tconst property = array[i];\n\n\t\tif (property.value === EMPTY) continue;\n\n\t\tif (property.key === property.value && Array.isArray(property.key)) {\n\t\t\tflatten_properties(property.key, target);\n\t\t\tcontinue;\n\t\t}\n\n\t\ttarget.push(property);\n\t}\n\n\treturn target;\n};\n\n/**\n * @param {any[]} nodes\n * @param {any[]} target\n */\nconst flatten = (nodes, target) => {\n\tfor (let i = 0; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\n\t\tif (node === EMPTY) continue;\n\n\t\tif (Array.isArray(node)) {\n\t\t\tflatten(node, target);\n\t\t\tcontinue;\n\t\t}\n\n\t\ttarget.push(node);\n\t}\n\n\treturn target;\n};\n\nconst EMPTY = { type: 'Empty' };\n\n/**\n *\n * @param {CommentWithLocation[]} comments\n * @param {string} raw\n * @returns {any}\n */\nconst acorn_opts = (comments, raw) => {\n\tconst { onComment } = get_comment_handlers(comments, raw);\n\treturn {\n\t\tecmaVersion: 2020,\n\t\tsourceType: 'module',\n\t\tallowAwaitOutsideFunction: true,\n\t\tallowImportExportEverywhere: true,\n\t\tallowReturnOutsideFunction: true,\n\t\tonComment\n\t};\n};\n\n/**\n * @param {string} raw\n * @param {Node} node\n * @param {any[]} values\n * @param {CommentWithLocation[]} comments\n */\nconst inject = (raw, node, values, comments) => {\n\tcomments.forEach((comment) => {\n\t\tcomment.value = comment.value.replace(re, (m, i) =>\n\t\t\t+i in values ? values[+i] : m\n\t\t);\n\t});\n\n\tconst { enter, leave } = get_comment_handlers(comments, raw);\n\n\treturn walk(node, {\n\t\tenter,\n\n\t\t/** @param {any} node */\n\t\tleave(node) {\n\t\t\tif (node.type === 'Identifier') {\n\t\t\t\tre.lastIndex = 0;\n\t\t\t\tconst match = re.exec(node.name);\n\n\t\t\t\tif (match) {\n\t\t\t\t\tif (match[1]) {\n\t\t\t\t\t\tif (+match[1] in values) {\n\t\t\t\t\t\t\tlet value = values[+match[1]];\n\n\t\t\t\t\t\t\tif (typeof value === 'string') {\n\t\t\t\t\t\t\t\tvalue = {\n\t\t\t\t\t\t\t\t\ttype: 'Identifier',\n\t\t\t\t\t\t\t\t\tname: value,\n\t\t\t\t\t\t\t\t\tleadingComments: node.leadingComments,\n\t\t\t\t\t\t\t\t\ttrailingComments: node.trailingComments\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t} else if (typeof value === 'number') {\n\t\t\t\t\t\t\t\tvalue = {\n\t\t\t\t\t\t\t\t\ttype: 'Literal',\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\tleadingComments: node.leadingComments,\n\t\t\t\t\t\t\t\t\ttrailingComments: node.trailingComments\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis.replace(value || EMPTY);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.name = `${match[2] ? `@` : `#`}${match[4]}`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node.type === 'Literal') {\n\t\t\t\tif (typeof node.value === 'string') {\n\t\t\t\t\tre.lastIndex = 0;\n\t\t\t\t\tconst new_value = /** @type {string} */ (node.value).replace(\n\t\t\t\t\t\tre,\n\t\t\t\t\t\t(m, i) => (+i in values ? values[+i] : m)\n\t\t\t\t\t);\n\t\t\t\t\tconst has_changed = new_value !== node.value;\n\t\t\t\t\tnode.value = new_value;\n\t\t\t\t\tif (has_changed && node.raw) {\n\t\t\t\t\t\t// preserve the quotes\n\t\t\t\t\t\tnode.raw = `${node.raw[0]}${JSON.stringify(node.value).slice(\n\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t-1\n\t\t\t\t\t\t)}${node.raw[node.raw.length - 1]}`;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (node.type === 'TemplateElement') {\n\t\t\t\tre.lastIndex = 0;\n\t\t\t\tnode.value.raw = /** @type {string} */ (node.value.raw).replace(\n\t\t\t\t\tre,\n\t\t\t\t\t(m, i) => (+i in values ? values[+i] : m)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (node.type === 'Program' || node.type === 'BlockStatement') {\n\t\t\t\tnode.body = flatten_body(node.body, []);\n\t\t\t}\n\n\t\t\tif (node.type === 'ObjectExpression' || node.type === 'ObjectPattern') {\n\t\t\t\tnode.properties = flatten_properties(node.properties, []);\n\t\t\t}\n\n\t\t\tif (node.type === 'ArrayExpression' || node.type === 'ArrayPattern') {\n\t\t\t\tnode.elements = flatten(node.elements, []);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tnode.type === 'FunctionExpression' ||\n\t\t\t\tnode.type === 'FunctionDeclaration' ||\n\t\t\t\tnode.type === 'ArrowFunctionExpression'\n\t\t\t) {\n\t\t\t\tnode.params = flatten(node.params, []);\n\t\t\t}\n\n\t\t\tif (node.type === 'CallExpression' || node.type === 'NewExpression') {\n\t\t\t\tnode.arguments = flatten(node.arguments, []);\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tnode.type === 'ImportDeclaration' ||\n\t\t\t\tnode.type === 'ExportNamedDeclaration'\n\t\t\t) {\n\t\t\t\tnode.specifiers = flatten(node.specifiers, []);\n\t\t\t}\n\n\t\t\tif (node.type === 'ForStatement') {\n\t\t\t\tnode.init = node.init === EMPTY ? null : node.init;\n\t\t\t\tnode.test = node.test === EMPTY ? null : node.test;\n\t\t\t\tnode.update = node.update === EMPTY ? null : node.update;\n\t\t\t}\n\n\t\t\tleave(node);\n\t\t}\n\t});\n};\n\n/**\n *\n * @param {TemplateStringsArray} strings\n * @param  {any[]} values\n * @returns {Node[]}\n */\nexport function b(strings, ...values) {\n\tconst str = join(strings);\n\n\t/** @type {CommentWithLocation[]} */\n\tconst comments = [];\n\n\ttry {\n\t\tlet ast = /** @type {any} */ (\n\t\t\tacorn.parse(str, acorn_opts(comments, str))\n\t\t);\n\n\t\tast = inject(str, ast, values, comments);\n\n\t\treturn ast.body;\n\t} catch (err) {\n\t\thandle_error(str, err);\n\t}\n}\n\n/**\n *\n * @param {TemplateStringsArray} strings\n * @param  {any[]} values\n * @returns {Expression & { start: Number, end: number }}\n */\nexport function x(strings, ...values) {\n\tconst str = join(strings);\n\n\t/** @type {CommentWithLocation[]} */\n\tconst comments = [];\n\n\ttry {\n\t\tlet expression =\n\t\t\t/** @type {Expression & { start: Number, end: number }} */ (\n\t\t\t\tacorn.parseExpressionAt(str, 0, acorn_opts(comments, str))\n\t\t\t);\n\t\tconst match = /\\S+/.exec(str.slice(expression.end));\n\t\tif (match) {\n\t\t\tthrow new Error(`Unexpected token '${match[0]}'`);\n\t\t}\n\n\t\texpression = /** @type {Expression & { start: Number, end: number }} */ (\n\t\t\tinject(str, expression, values, comments)\n\t\t);\n\n\t\treturn expression;\n\t} catch (err) {\n\t\thandle_error(str, err);\n\t}\n}\n\n/**\n *\n * @param {TemplateStringsArray} strings\n * @param  {any[]} values\n * @returns {(Property | SpreadElement) & { start: Number, end: number }}\n */\nexport function p(strings, ...values) {\n\tconst str = `{${join(strings)}}`;\n\n\t/** @type {CommentWithLocation[]} */\n\tconst comments = [];\n\n\ttry {\n\t\tlet expression = /** @type {any} */ (\n\t\t\tacorn.parseExpressionAt(str, 0, acorn_opts(comments, str))\n\t\t);\n\n\t\texpression = inject(str, expression, values, comments);\n\n\t\treturn expression.properties[0];\n\t} catch (err) {\n\t\thandle_error(str, err);\n\t}\n}\n\n/**\n * @param {string} str\n * @param {Error} err\n */\nfunction handle_error(str, err) {\n\t// TODO location/code frame\n\n\tre.lastIndex = 0;\n\n\tstr = str.replace(re, (m, i, at, hash, name) => {\n\t\tif (at) return `@${name}`;\n\t\tif (hash) return `#${name}`;\n\n\t\treturn '${...}';\n\t});\n\n\tconsole.log(`failed to parse:\\n${str}`);\n\tthrow err;\n}\n\nexport { print } from './print/index.js';\n\n/**\n * @param {string} source\n * @param {any} opts\n */\nexport const parse = (source, opts) => {\n\t/** @type {CommentWithLocation[]} */\n\tconst comments = [];\n\tconst { onComment, enter, leave } = get_comment_handlers(comments, source);\n\tconst ast = /** @type {any} */ (acorn.parse(source, { onComment, ...opts }));\n\twalk(ast, { enter, leave });\n\treturn ast;\n};\n\n/**\n * @param {string} source\n * @param {number} index\n * @param {any} opts\n */\nexport const parseExpressionAt = (source, index, opts) => {\n\t/** @type {CommentWithLocation[]} */\n\tconst comments = [];\n\tconst { onComment, enter, leave } = get_comment_handlers(comments, source);\n\tconst ast = /** @type {any} */ (\n\t\tacorn.parseExpressionAt(source, index, { onComment, ...opts })\n\t);\n\twalk(ast, { enter, leave });\n\treturn ast;\n};\n","import { Node } from 'acorn';\r\nimport * as code_red from 'code-red';\r\n\r\nexport const parse = (source: string): Node => code_red.parse(source, {\r\n\tsourceType: 'module',\r\n\tecmaVersion: 12,\r\n\tlocations: true\r\n});\r\n\r\nexport const parse_expression_at = (source: string, index: number): Node => code_red.parseExpressionAt(source, index, {\r\n\tsourceType: 'module',\r\n\tecmaVersion: 12,\r\n\tlocations: true\r\n});\r\n","import * as acorn from '../acorn';\r\nimport { Parser } from '../index';\r\nimport { Script } from '../../interfaces';\r\nimport { Node, Program } from 'estree';\r\nimport parser_errors from '../errors';\r\nimport { regex_not_newline_characters } from '../../utils/patterns';\r\n\r\nconst regex_closing_script_tag = /<\\/script\\s*>/;\r\n\r\nfunction get_context(parser: Parser, attributes: any[], start: number): string {\r\n\tconst context = attributes.find(attribute => attribute.name === 'context');\r\n\tif (!context) return 'default';\r\n\r\n\tif (context.value.length !== 1 || context.value[0].type !== 'Text') {\r\n\t\tparser.error(parser_errors.invalid_script_context_attribute, start);\r\n\t}\r\n\r\n\tconst value = context.value[0].data;\r\n\r\n\tif (value !== 'module') {\r\n\t\tparser.error(parser_errors.invalid_script_context_value, context.start);\r\n\t}\r\n\r\n\treturn value;\r\n}\r\n\r\nexport default function read_script(parser: Parser, start: number, attributes: Node[]): Script {\r\n\tconst script_start = parser.index;\r\n\tconst data = parser.read_until(regex_closing_script_tag, parser_errors.unclosed_script);\r\n\tif (parser.index >= parser.template.length) {\r\n\t\tparser.error(parser_errors.unclosed_script);\r\n\t}\r\n\r\n\tconst source = parser.template.slice(0, script_start).replace(regex_not_newline_characters, ' ') + data;\r\n\tparser.read(regex_closing_script_tag);\r\n\r\n\tlet ast: Program;\r\n\r\n\ttry {\r\n\t\tast = acorn.parse(source) as any as Program;\r\n\t} catch (err) {\r\n\t\tparser.acorn_error(err);\r\n\t}\r\n\r\n\t// TODO is this necessary?\r\n\t(ast as any).start = script_start;\r\n\r\n\treturn {\r\n\t\ttype: 'Script',\r\n\t\tstart,\r\n\t\tend: parser.index,\r\n\t\tcontext: get_context(parser, attributes, start),\r\n\t\tcontent: ast\r\n\t};\r\n}\r\n","// @ts-ignore\r\nimport parse from 'css-tree/parser';\r\nimport { walk } from 'estree-walker';\r\nimport { Parser } from '../index';\r\nimport { Node } from 'estree';\r\nimport { Style } from '../../interfaces';\r\nimport parser_errors from '../errors';\r\n\r\nconst regex_closing_style_tag = /<\\/style\\s*>/;\r\n\r\nexport default function read_style(parser: Parser, start: number, attributes: Node[]): Style {\r\n\tconst content_start = parser.index;\r\n\r\n\tconst styles = parser.read_until(regex_closing_style_tag, parser_errors.unclosed_style);\r\n\r\n\tif (parser.index >= parser.template.length) {\r\n\t\tparser.error(parser_errors.unclosed_style);\r\n\t}\r\n\r\n\tconst content_end = parser.index;\r\n\r\n\t// discard styles when css is disabled\r\n\tif (parser.css_mode === 'none') {\r\n\t\tparser.read(regex_closing_style_tag);\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet ast;\r\n\r\n\ttry {\r\n\t\tast = parse(styles, {\r\n\t\t\tpositions: true,\r\n\t\t\toffset: content_start,\r\n\t\t\tonParseError(error) {\r\n\t\t\t\tthrow error;\r\n\t\t\t}\r\n\t\t});\r\n\t} catch (err) {\r\n\t\tif (err.name === 'SyntaxError') {\r\n\t\t\tparser.error(parser_errors.css_syntax_error(err.message), err.offset);\r\n\t\t} else {\r\n\t\t\tthrow err;\r\n\t\t}\r\n\t}\r\n\r\n\tast = JSON.parse(JSON.stringify(ast));\r\n\r\n\t// tidy up AST\r\n\twalk(ast, {\r\n\t\tenter: (node: any) => { // `any` because this isn't an ESTree node\r\n\t\t\t// replace `ref:a` nodes\r\n\t\t\tif (node.type === 'Selector') {\r\n\t\t\t\tfor (let i = 0; i < node.children.length; i += 1) {\r\n\t\t\t\t\tconst a = node.children[i];\r\n\t\t\t\t\tconst b = node.children[i + 1];\r\n\r\n\t\t\t\t\tif (is_ref_selector(a, b)) {\r\n\t\t\t\t\t\tparser.error(parser_errors.invalid_ref_selector, a.loc.start.offset);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (node.type === 'Declaration' && node.value.type === 'Value' && node.value.children.length === 0) {\r\n\t\t\t\tparser.error(parser_errors.invalid_declaration, node.start);\r\n\t\t\t}\r\n\r\n\t\t\tif (node.type === 'PseudoClassSelector' && node.name === 'global' && node.children === null) {\r\n\t\t\t\tparser.error(parser_errors.empty_global_selector, node.loc.start.offset);\r\n\t\t\t}\r\n\r\n\t\t\tif (node.loc) {\r\n\t\t\t\tnode.start = node.loc.start.offset;\r\n\t\t\t\tnode.end = node.loc.end.offset;\r\n\t\t\t\tdelete node.loc;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tparser.read(regex_closing_style_tag);\r\n  \r\n\tconst end = parser.index;\r\n\r\n\treturn {\r\n\t\ttype: 'Style',\r\n\t\tstart,\r\n\t\tend,\r\n\t\tattributes,\r\n\t\tchildren: ast.children,\r\n\t\tcontent: {\r\n\t\t\tstart: content_start,\r\n\t\t\tend: content_end,\r\n\t\t\tstyles\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction is_ref_selector(a: any, b: any) { // TODO add CSS node types\r\n\tif (!b) return false;\r\n\r\n\treturn (\r\n\t\ta.type === 'TypeSelector' &&\r\n\t\ta.name === 'ref' &&\r\n\t\tb.type === 'PseudoClassSelector'\r\n\t);\r\n}\r\n","// https://dev.w3.org/html5/html-author/charref\r\nexport default {\r\n\tCounterClockwiseContourIntegral: 8755,\r\n\tClockwiseContourIntegral: 8754,\r\n\tDoubleLongLeftRightArrow: 10234,\r\n\tDiacriticalDoubleAcute: 733,\r\n\tNotSquareSupersetEqual: 8931,\r\n\tCloseCurlyDoubleQuote: 8221,\r\n\tDoubleContourIntegral: 8751,\r\n\tFilledVerySmallSquare: 9642,\r\n\tNegativeVeryThinSpace: 8203,\r\n\tNotPrecedesSlantEqual: 8928,\r\n\tNotRightTriangleEqual: 8941,\r\n\tNotSucceedsSlantEqual: 8929,\r\n\tCapitalDifferentialD: 8517,\r\n\tDoubleLeftRightArrow: 8660,\r\n\tDoubleLongRightArrow: 10233,\r\n\tEmptyVerySmallSquare: 9643,\r\n\tNestedGreaterGreater: 8811,\r\n\tNotDoubleVerticalBar: 8742,\r\n\tNotLeftTriangleEqual: 8940,\r\n\tNotSquareSubsetEqual: 8930,\r\n\tOpenCurlyDoubleQuote: 8220,\r\n\tReverseUpEquilibrium: 10607,\r\n\tDoubleLongLeftArrow: 10232,\r\n\tDownLeftRightVector: 10576,\r\n\tLeftArrowRightArrow: 8646,\r\n\tNegativeMediumSpace: 8203,\r\n\tRightArrowLeftArrow: 8644,\r\n\tSquareSupersetEqual: 8850,\r\n\tleftrightsquigarrow: 8621,\r\n\tDownRightTeeVector: 10591,\r\n\tDownRightVectorBar: 10583,\r\n\tLongLeftRightArrow: 10231,\r\n\tLongleftrightarrow: 10234,\r\n\tNegativeThickSpace: 8203,\r\n\tPrecedesSlantEqual: 8828,\r\n\tReverseEquilibrium: 8651,\r\n\tRightDoubleBracket: 10215,\r\n\tRightDownTeeVector: 10589,\r\n\tRightDownVectorBar: 10581,\r\n\tRightTriangleEqual: 8885,\r\n\tSquareIntersection: 8851,\r\n\tSucceedsSlantEqual: 8829,\r\n\tblacktriangleright: 9656,\r\n\tlongleftrightarrow: 10231,\r\n\tDoubleUpDownArrow: 8661,\r\n\tDoubleVerticalBar: 8741,\r\n\tDownLeftTeeVector: 10590,\r\n\tDownLeftVectorBar: 10582,\r\n\tFilledSmallSquare: 9724,\r\n\tGreaterSlantEqual: 10878,\r\n\tLeftDoubleBracket: 10214,\r\n\tLeftDownTeeVector: 10593,\r\n\tLeftDownVectorBar: 10585,\r\n\tLeftTriangleEqual: 8884,\r\n\tNegativeThinSpace: 8203,\r\n\tNotReverseElement: 8716,\r\n\tNotTildeFullEqual: 8775,\r\n\tRightAngleBracket: 10217,\r\n\tRightUpDownVector: 10575,\r\n\tSquareSubsetEqual: 8849,\r\n\tVerticalSeparator: 10072,\r\n\tblacktriangledown: 9662,\r\n\tblacktriangleleft: 9666,\r\n\tleftrightharpoons: 8651,\r\n\trightleftharpoons: 8652,\r\n\ttwoheadrightarrow: 8608,\r\n\tDiacriticalAcute: 180,\r\n\tDiacriticalGrave: 96,\r\n\tDiacriticalTilde: 732,\r\n\tDoubleRightArrow: 8658,\r\n\tDownArrowUpArrow: 8693,\r\n\tEmptySmallSquare: 9723,\r\n\tGreaterEqualLess: 8923,\r\n\tGreaterFullEqual: 8807,\r\n\tLeftAngleBracket: 10216,\r\n\tLeftUpDownVector: 10577,\r\n\tLessEqualGreater: 8922,\r\n\tNonBreakingSpace: 160,\r\n\tNotRightTriangle: 8939,\r\n\tNotSupersetEqual: 8841,\r\n\tRightTriangleBar: 10704,\r\n\tRightUpTeeVector: 10588,\r\n\tRightUpVectorBar: 10580,\r\n\tUnderParenthesis: 9181,\r\n\tUpArrowDownArrow: 8645,\r\n\tcirclearrowright: 8635,\r\n\tdownharpoonright: 8642,\r\n\tntrianglerighteq: 8941,\r\n\trightharpoondown: 8641,\r\n\trightrightarrows: 8649,\r\n\ttwoheadleftarrow: 8606,\r\n\tvartriangleright: 8883,\r\n\tCloseCurlyQuote: 8217,\r\n\tContourIntegral: 8750,\r\n\tDoubleDownArrow: 8659,\r\n\tDoubleLeftArrow: 8656,\r\n\tDownRightVector: 8641,\r\n\tLeftRightVector: 10574,\r\n\tLeftTriangleBar: 10703,\r\n\tLeftUpTeeVector: 10592,\r\n\tLeftUpVectorBar: 10584,\r\n\tLowerRightArrow: 8600,\r\n\tNotGreaterEqual: 8817,\r\n\tNotGreaterTilde: 8821,\r\n\tNotLeftTriangle: 8938,\r\n\tOverParenthesis: 9180,\r\n\tRightDownVector: 8642,\r\n\tShortRightArrow: 8594,\r\n\tUpperRightArrow: 8599,\r\n\tbigtriangledown: 9661,\r\n\tcirclearrowleft: 8634,\r\n\tcurvearrowright: 8631,\r\n\tdownharpoonleft: 8643,\r\n\tleftharpoondown: 8637,\r\n\tleftrightarrows: 8646,\r\n\tnLeftrightarrow: 8654,\r\n\tnleftrightarrow: 8622,\r\n\tntrianglelefteq: 8940,\r\n\trightleftarrows: 8644,\r\n\trightsquigarrow: 8605,\r\n\trightthreetimes: 8908,\r\n\tstraightepsilon: 1013,\r\n\ttrianglerighteq: 8885,\r\n\tvartriangleleft: 8882,\r\n\tDiacriticalDot: 729,\r\n\tDoubleRightTee: 8872,\r\n\tDownLeftVector: 8637,\r\n\tGreaterGreater: 10914,\r\n\tHorizontalLine: 9472,\r\n\tInvisibleComma: 8291,\r\n\tInvisibleTimes: 8290,\r\n\tLeftDownVector: 8643,\r\n\tLeftRightArrow: 8596,\r\n\tLeftrightarrow: 8660,\r\n\tLessSlantEqual: 10877,\r\n\tLongRightArrow: 10230,\r\n\tLongrightarrow: 10233,\r\n\tLowerLeftArrow: 8601,\r\n\tNestedLessLess: 8810,\r\n\tNotGreaterLess: 8825,\r\n\tNotLessGreater: 8824,\r\n\tNotSubsetEqual: 8840,\r\n\tNotVerticalBar: 8740,\r\n\tOpenCurlyQuote: 8216,\r\n\tReverseElement: 8715,\r\n\tRightTeeVector: 10587,\r\n\tRightVectorBar: 10579,\r\n\tShortDownArrow: 8595,\r\n\tShortLeftArrow: 8592,\r\n\tSquareSuperset: 8848,\r\n\tTildeFullEqual: 8773,\r\n\tUpperLeftArrow: 8598,\r\n\tZeroWidthSpace: 8203,\r\n\tcurvearrowleft: 8630,\r\n\tdoublebarwedge: 8966,\r\n\tdowndownarrows: 8650,\r\n\thookrightarrow: 8618,\r\n\tleftleftarrows: 8647,\r\n\tleftrightarrow: 8596,\r\n\tleftthreetimes: 8907,\r\n\tlongrightarrow: 10230,\r\n\tlooparrowright: 8620,\r\n\tnshortparallel: 8742,\r\n\tntriangleright: 8939,\r\n\trightarrowtail: 8611,\r\n\trightharpoonup: 8640,\r\n\ttrianglelefteq: 8884,\r\n\tupharpoonright: 8638,\r\n\tApplyFunction: 8289,\r\n\tDifferentialD: 8518,\r\n\tDoubleLeftTee: 10980,\r\n\tDoubleUpArrow: 8657,\r\n\tLeftTeeVector: 10586,\r\n\tLeftVectorBar: 10578,\r\n\tLessFullEqual: 8806,\r\n\tLongLeftArrow: 10229,\r\n\tLongleftarrow: 10232,\r\n\tNotTildeEqual: 8772,\r\n\tNotTildeTilde: 8777,\r\n\tPoincareplane: 8460,\r\n\tPrecedesEqual: 10927,\r\n\tPrecedesTilde: 8830,\r\n\tRightArrowBar: 8677,\r\n\tRightTeeArrow: 8614,\r\n\tRightTriangle: 8883,\r\n\tRightUpVector: 8638,\r\n\tSucceedsEqual: 10928,\r\n\tSucceedsTilde: 8831,\r\n\tSupersetEqual: 8839,\r\n\tUpEquilibrium: 10606,\r\n\tVerticalTilde: 8768,\r\n\tVeryThinSpace: 8202,\r\n\tbigtriangleup: 9651,\r\n\tblacktriangle: 9652,\r\n\tdivideontimes: 8903,\r\n\tfallingdotseq: 8786,\r\n\thookleftarrow: 8617,\r\n\tleftarrowtail: 8610,\r\n\tleftharpoonup: 8636,\r\n\tlongleftarrow: 10229,\r\n\tlooparrowleft: 8619,\r\n\tmeasuredangle: 8737,\r\n\tntriangleleft: 8938,\r\n\tshortparallel: 8741,\r\n\tsmallsetminus: 8726,\r\n\ttriangleright: 9657,\r\n\tupharpoonleft: 8639,\r\n\tDownArrowBar: 10515,\r\n\tDownTeeArrow: 8615,\r\n\tExponentialE: 8519,\r\n\tGreaterEqual: 8805,\r\n\tGreaterTilde: 8819,\r\n\tHilbertSpace: 8459,\r\n\tHumpDownHump: 8782,\r\n\tIntersection: 8898,\r\n\tLeftArrowBar: 8676,\r\n\tLeftTeeArrow: 8612,\r\n\tLeftTriangle: 8882,\r\n\tLeftUpVector: 8639,\r\n\tNotCongruent: 8802,\r\n\tNotLessEqual: 8816,\r\n\tNotLessTilde: 8820,\r\n\tProportional: 8733,\r\n\tRightCeiling: 8969,\r\n\tRoundImplies: 10608,\r\n\tShortUpArrow: 8593,\r\n\tSquareSubset: 8847,\r\n\tUnderBracket: 9141,\r\n\tVerticalLine: 124,\r\n\tblacklozenge: 10731,\r\n\texponentiale: 8519,\r\n\trisingdotseq: 8787,\r\n\ttriangledown: 9663,\r\n\ttriangleleft: 9667,\r\n\tCircleMinus: 8854,\r\n\tCircleTimes: 8855,\r\n\tEquilibrium: 8652,\r\n\tGreaterLess: 8823,\r\n\tLeftCeiling: 8968,\r\n\tLessGreater: 8822,\r\n\tMediumSpace: 8287,\r\n\tNotPrecedes: 8832,\r\n\tNotSucceeds: 8833,\r\n\tOverBracket: 9140,\r\n\tRightVector: 8640,\r\n\tRrightarrow: 8667,\r\n\tRuleDelayed: 10740,\r\n\tSmallCircle: 8728,\r\n\tSquareUnion: 8852,\r\n\tSubsetEqual: 8838,\r\n\tUpDownArrow: 8597,\r\n\tUpdownarrow: 8661,\r\n\tVerticalBar: 8739,\r\n\tbackepsilon: 1014,\r\n\tblacksquare: 9642,\r\n\tcircledcirc: 8858,\r\n\tcircleddash: 8861,\r\n\tcurlyeqprec: 8926,\r\n\tcurlyeqsucc: 8927,\r\n\tdiamondsuit: 9830,\r\n\teqslantless: 10901,\r\n\texpectation: 8496,\r\n\tnRightarrow: 8655,\r\n\tnrightarrow: 8603,\r\n\tpreccurlyeq: 8828,\r\n\tprecnapprox: 10937,\r\n\tquaternions: 8461,\r\n\tstraightphi: 981,\r\n\tsucccurlyeq: 8829,\r\n\tsuccnapprox: 10938,\r\n\tthickapprox: 8776,\r\n\tupdownarrow: 8597,\r\n\tBernoullis: 8492,\r\n\tCirclePlus: 8853,\r\n\tEqualTilde: 8770,\r\n\tFouriertrf: 8497,\r\n\tImaginaryI: 8520,\r\n\tLaplacetrf: 8466,\r\n\tLeftVector: 8636,\r\n\tLleftarrow: 8666,\r\n\tNotElement: 8713,\r\n\tNotGreater: 8815,\r\n\tProportion: 8759,\r\n\tRightArrow: 8594,\r\n\tRightFloor: 8971,\r\n\tRightarrow: 8658,\r\n\tTildeEqual: 8771,\r\n\tTildeTilde: 8776,\r\n\tUnderBrace: 9183,\r\n\tUpArrowBar: 10514,\r\n\tUpTeeArrow: 8613,\r\n\tcircledast: 8859,\r\n\tcomplement: 8705,\r\n\tcurlywedge: 8911,\r\n\teqslantgtr: 10902,\r\n\tgtreqqless: 10892,\r\n\tlessapprox: 10885,\r\n\tlesseqqgtr: 10891,\r\n\tlmoustache: 9136,\r\n\tlongmapsto: 10236,\r\n\tmapstodown: 8615,\r\n\tmapstoleft: 8612,\r\n\tnLeftarrow: 8653,\r\n\tnleftarrow: 8602,\r\n\tprecapprox: 10935,\r\n\trightarrow: 8594,\r\n\trmoustache: 9137,\r\n\tsqsubseteq: 8849,\r\n\tsqsupseteq: 8850,\r\n\tsubsetneqq: 10955,\r\n\tsuccapprox: 10936,\r\n\tsupsetneqq: 10956,\r\n\tupuparrows: 8648,\r\n\tvarepsilon: 949,\r\n\tvarnothing: 8709,\r\n\tBackslash: 8726,\r\n\tCenterDot: 183,\r\n\tCircleDot: 8857,\r\n\tCongruent: 8801,\r\n\tCoproduct: 8720,\r\n\tDoubleDot: 168,\r\n\tDownArrow: 8595,\r\n\tDownBreve: 785,\r\n\tDownarrow: 8659,\r\n\tHumpEqual: 8783,\r\n\tLeftArrow: 8592,\r\n\tLeftFloor: 8970,\r\n\tLeftarrow: 8656,\r\n\tLessTilde: 8818,\r\n\tMellintrf: 8499,\r\n\tMinusPlus: 8723,\r\n\tNotCupCap: 8813,\r\n\tNotExists: 8708,\r\n\tOverBrace: 9182,\r\n\tPlusMinus: 177,\r\n\tTherefore: 8756,\r\n\tThinSpace: 8201,\r\n\tTripleDot: 8411,\r\n\tUnionPlus: 8846,\r\n\tbackprime: 8245,\r\n\tbacksimeq: 8909,\r\n\tbigotimes: 10754,\r\n\tcenterdot: 183,\r\n\tcheckmark: 10003,\r\n\tcomplexes: 8450,\r\n\tdotsquare: 8865,\r\n\tdownarrow: 8595,\r\n\tgtrapprox: 10886,\r\n\tgtreqless: 8923,\r\n\theartsuit: 9829,\r\n\tleftarrow: 8592,\r\n\tlesseqgtr: 8922,\r\n\tnparallel: 8742,\r\n\tnshortmid: 8740,\r\n\tnsubseteq: 8840,\r\n\tnsupseteq: 8841,\r\n\tpitchfork: 8916,\r\n\trationals: 8474,\r\n\tspadesuit: 9824,\r\n\tsubseteqq: 10949,\r\n\tsubsetneq: 8842,\r\n\tsupseteqq: 10950,\r\n\tsupsetneq: 8843,\r\n\ttherefore: 8756,\r\n\ttriangleq: 8796,\r\n\tvarpropto: 8733,\r\n\tDDotrahd: 10513,\r\n\tDotEqual: 8784,\r\n\tIntegral: 8747,\r\n\tLessLess: 10913,\r\n\tNotEqual: 8800,\r\n\tNotTilde: 8769,\r\n\tPartialD: 8706,\r\n\tPrecedes: 8826,\r\n\tRightTee: 8866,\r\n\tSucceeds: 8827,\r\n\tSuchThat: 8715,\r\n\tSuperset: 8835,\r\n\tUarrocir: 10569,\r\n\tUnderBar: 818,\r\n\tandslope: 10840,\r\n\tangmsdaa: 10664,\r\n\tangmsdab: 10665,\r\n\tangmsdac: 10666,\r\n\tangmsdad: 10667,\r\n\tangmsdae: 10668,\r\n\tangmsdaf: 10669,\r\n\tangmsdag: 10670,\r\n\tangmsdah: 10671,\r\n\tangrtvbd: 10653,\r\n\tapproxeq: 8778,\r\n\tawconint: 8755,\r\n\tbackcong: 8780,\r\n\tbarwedge: 8965,\r\n\tbbrktbrk: 9142,\r\n\tbigoplus: 10753,\r\n\tbigsqcup: 10758,\r\n\tbiguplus: 10756,\r\n\tbigwedge: 8896,\r\n\tboxminus: 8863,\r\n\tboxtimes: 8864,\r\n\tcapbrcup: 10825,\r\n\tcircledR: 174,\r\n\tcircledS: 9416,\r\n\tcirfnint: 10768,\r\n\tclubsuit: 9827,\r\n\tcupbrcap: 10824,\r\n\tcurlyvee: 8910,\r\n\tcwconint: 8754,\r\n\tdoteqdot: 8785,\r\n\tdotminus: 8760,\r\n\tdrbkarow: 10512,\r\n\tdzigrarr: 10239,\r\n\telinters: 9191,\r\n\temptyset: 8709,\r\n\teqvparsl: 10725,\r\n\tfpartint: 10765,\r\n\tgeqslant: 10878,\r\n\tgesdotol: 10884,\r\n\tgnapprox: 10890,\r\n\thksearow: 10533,\r\n\thkswarow: 10534,\r\n\timagline: 8464,\r\n\timagpart: 8465,\r\n\tinfintie: 10717,\r\n\tintegers: 8484,\r\n\tintercal: 8890,\r\n\tintlarhk: 10775,\r\n\tlaemptyv: 10676,\r\n\tldrushar: 10571,\r\n\tleqslant: 10877,\r\n\tlesdotor: 10883,\r\n\tllcorner: 8990,\r\n\tlnapprox: 10889,\r\n\tlrcorner: 8991,\r\n\tlurdshar: 10570,\r\n\tmapstoup: 8613,\r\n\tmultimap: 8888,\r\n\tnaturals: 8469,\r\n\totimesas: 10806,\r\n\tparallel: 8741,\r\n\tplusacir: 10787,\r\n\tpointint: 10773,\r\n\tprecneqq: 10933,\r\n\tprecnsim: 8936,\r\n\tprofalar: 9006,\r\n\tprofline: 8978,\r\n\tprofsurf: 8979,\r\n\traemptyv: 10675,\r\n\trealpart: 8476,\r\n\trppolint: 10770,\r\n\trtriltri: 10702,\r\n\tscpolint: 10771,\r\n\tsetminus: 8726,\r\n\tshortmid: 8739,\r\n\tsmeparsl: 10724,\r\n\tsqsubset: 8847,\r\n\tsqsupset: 8848,\r\n\tsubseteq: 8838,\r\n\tsuccneqq: 10934,\r\n\tsuccnsim: 8937,\r\n\tsupseteq: 8839,\r\n\tthetasym: 977,\r\n\tthicksim: 8764,\r\n\ttimesbar: 10801,\r\n\ttriangle: 9653,\r\n\ttriminus: 10810,\r\n\ttrpezium: 9186,\r\n\tulcorner: 8988,\r\n\turcorner: 8989,\r\n\tvarkappa: 1008,\r\n\tvarsigma: 962,\r\n\tvartheta: 977,\r\n\tBecause: 8757,\r\n\tCayleys: 8493,\r\n\tCconint: 8752,\r\n\tCedilla: 184,\r\n\tDiamond: 8900,\r\n\tDownTee: 8868,\r\n\tElement: 8712,\r\n\tEpsilon: 917,\r\n\tImplies: 8658,\r\n\tLeftTee: 8867,\r\n\tNewLine: 10,\r\n\tNoBreak: 8288,\r\n\tNotLess: 8814,\r\n\tOmicron: 927,\r\n\tOverBar: 175,\r\n\tProduct: 8719,\r\n\tUpArrow: 8593,\r\n\tUparrow: 8657,\r\n\tUpsilon: 933,\r\n\talefsym: 8501,\r\n\tangrtvb: 8894,\r\n\tangzarr: 9084,\r\n\tasympeq: 8781,\r\n\tbacksim: 8765,\r\n\tbecause: 8757,\r\n\tbemptyv: 10672,\r\n\tbetween: 8812,\r\n\tbigcirc: 9711,\r\n\tbigodot: 10752,\r\n\tbigstar: 9733,\r\n\tboxplus: 8862,\r\n\tccupssm: 10832,\r\n\tcemptyv: 10674,\r\n\tcirscir: 10690,\r\n\tcoloneq: 8788,\r\n\tcongdot: 10861,\r\n\tcudarrl: 10552,\r\n\tcudarrr: 10549,\r\n\tcularrp: 10557,\r\n\tcurarrm: 10556,\r\n\tdbkarow: 10511,\r\n\tddagger: 8225,\r\n\tddotseq: 10871,\r\n\tdemptyv: 10673,\r\n\tdiamond: 8900,\r\n\tdigamma: 989,\r\n\tdotplus: 8724,\r\n\tdwangle: 10662,\r\n\tepsilon: 949,\r\n\teqcolon: 8789,\r\n\tequivDD: 10872,\r\n\tgesdoto: 10882,\r\n\tgtquest: 10876,\r\n\tgtrless: 8823,\r\n\tharrcir: 10568,\r\n\tintprod: 10812,\r\n\tisindot: 8949,\r\n\tlarrbfs: 10527,\r\n\tlarrsim: 10611,\r\n\tlbrksld: 10639,\r\n\tlbrkslu: 10637,\r\n\tldrdhar: 10599,\r\n\tlesdoto: 10881,\r\n\tlessdot: 8918,\r\n\tlessgtr: 8822,\r\n\tlesssim: 8818,\r\n\tlotimes: 10804,\r\n\tlozenge: 9674,\r\n\tltquest: 10875,\r\n\tluruhar: 10598,\r\n\tmaltese: 10016,\r\n\tminusdu: 10794,\r\n\tnapprox: 8777,\r\n\tnatural: 9838,\r\n\tnearrow: 8599,\r\n\tnexists: 8708,\r\n\tnotinva: 8713,\r\n\tnotinvb: 8951,\r\n\tnotinvc: 8950,\r\n\tnotniva: 8716,\r\n\tnotnivb: 8958,\r\n\tnotnivc: 8957,\r\n\tnpolint: 10772,\r\n\tnsqsube: 8930,\r\n\tnsqsupe: 8931,\r\n\tnvinfin: 10718,\r\n\tnwarrow: 8598,\r\n\tolcross: 10683,\r\n\tomicron: 959,\r\n\torderof: 8500,\r\n\torslope: 10839,\r\n\tpertenk: 8241,\r\n\tplanckh: 8462,\r\n\tpluscir: 10786,\r\n\tplussim: 10790,\r\n\tplustwo: 10791,\r\n\tprecsim: 8830,\r\n\tquatint: 10774,\r\n\tquesteq: 8799,\r\n\trarrbfs: 10528,\r\n\trarrsim: 10612,\r\n\trbrksld: 10638,\r\n\trbrkslu: 10640,\r\n\trdldhar: 10601,\r\n\trealine: 8475,\r\n\trotimes: 10805,\r\n\truluhar: 10600,\r\n\tsearrow: 8600,\r\n\tsimplus: 10788,\r\n\tsimrarr: 10610,\r\n\tsubedot: 10947,\r\n\tsubmult: 10945,\r\n\tsubplus: 10943,\r\n\tsubrarr: 10617,\r\n\tsuccsim: 8831,\r\n\tsupdsub: 10968,\r\n\tsupedot: 10948,\r\n\tsuphsub: 10967,\r\n\tsuplarr: 10619,\r\n\tsupmult: 10946,\r\n\tsupplus: 10944,\r\n\tswarrow: 8601,\r\n\ttopfork: 10970,\r\n\ttriplus: 10809,\r\n\ttritime: 10811,\r\n\tuparrow: 8593,\r\n\tupsilon: 965,\r\n\tuwangle: 10663,\r\n\tvzigzag: 10650,\r\n\tzigrarr: 8669,\r\n\tAacute: 193,\r\n\tAbreve: 258,\r\n\tAgrave: 192,\r\n\tAssign: 8788,\r\n\tAtilde: 195,\r\n\tBarwed: 8966,\r\n\tBumpeq: 8782,\r\n\tCacute: 262,\r\n\tCcaron: 268,\r\n\tCcedil: 199,\r\n\tColone: 10868,\r\n\tConint: 8751,\r\n\tCupCap: 8781,\r\n\tDagger: 8225,\r\n\tDcaron: 270,\r\n\tDotDot: 8412,\r\n\tDstrok: 272,\r\n\tEacute: 201,\r\n\tEcaron: 282,\r\n\tEgrave: 200,\r\n\tExists: 8707,\r\n\tForAll: 8704,\r\n\tGammad: 988,\r\n\tGbreve: 286,\r\n\tGcedil: 290,\r\n\tHARDcy: 1066,\r\n\tHstrok: 294,\r\n\tIacute: 205,\r\n\tIgrave: 204,\r\n\tItilde: 296,\r\n\tJsercy: 1032,\r\n\tKcedil: 310,\r\n\tLacute: 313,\r\n\tLambda: 923,\r\n\tLcaron: 317,\r\n\tLcedil: 315,\r\n\tLmidot: 319,\r\n\tLstrok: 321,\r\n\tNacute: 323,\r\n\tNcaron: 327,\r\n\tNcedil: 325,\r\n\tNtilde: 209,\r\n\tOacute: 211,\r\n\tOdblac: 336,\r\n\tOgrave: 210,\r\n\tOslash: 216,\r\n\tOtilde: 213,\r\n\tOtimes: 10807,\r\n\tRacute: 340,\r\n\tRarrtl: 10518,\r\n\tRcaron: 344,\r\n\tRcedil: 342,\r\n\tSHCHcy: 1065,\r\n\tSOFTcy: 1068,\r\n\tSacute: 346,\r\n\tScaron: 352,\r\n\tScedil: 350,\r\n\tSquare: 9633,\r\n\tSubset: 8912,\r\n\tSupset: 8913,\r\n\tTcaron: 356,\r\n\tTcedil: 354,\r\n\tTstrok: 358,\r\n\tUacute: 218,\r\n\tUbreve: 364,\r\n\tUdblac: 368,\r\n\tUgrave: 217,\r\n\tUtilde: 360,\r\n\tVdashl: 10982,\r\n\tVerbar: 8214,\r\n\tVvdash: 8874,\r\n\tYacute: 221,\r\n\tZacute: 377,\r\n\tZcaron: 381,\r\n\taacute: 225,\r\n\tabreve: 259,\r\n\tagrave: 224,\r\n\tandand: 10837,\r\n\tangmsd: 8737,\r\n\tangsph: 8738,\r\n\tapacir: 10863,\r\n\tapprox: 8776,\r\n\tatilde: 227,\r\n\tbarvee: 8893,\r\n\tbarwed: 8965,\r\n\tbecaus: 8757,\r\n\tbernou: 8492,\r\n\tbigcap: 8898,\r\n\tbigcup: 8899,\r\n\tbigvee: 8897,\r\n\tbkarow: 10509,\r\n\tbottom: 8869,\r\n\tbowtie: 8904,\r\n\tboxbox: 10697,\r\n\tbprime: 8245,\r\n\tbrvbar: 166,\r\n\tbullet: 8226,\r\n\tbumpeq: 8783,\r\n\tcacute: 263,\r\n\tcapand: 10820,\r\n\tcapcap: 10827,\r\n\tcapcup: 10823,\r\n\tcapdot: 10816,\r\n\tccaron: 269,\r\n\tccedil: 231,\r\n\tcirceq: 8791,\r\n\tcirmid: 10991,\r\n\tcolone: 8788,\r\n\tcommat: 64,\r\n\tcompfn: 8728,\r\n\tconint: 8750,\r\n\tcoprod: 8720,\r\n\tcopysr: 8471,\r\n\tcularr: 8630,\r\n\tcupcap: 10822,\r\n\tcupcup: 10826,\r\n\tcupdot: 8845,\r\n\tcurarr: 8631,\r\n\tcurren: 164,\r\n\tcylcty: 9005,\r\n\tdagger: 8224,\r\n\tdaleth: 8504,\r\n\tdcaron: 271,\r\n\tdfisht: 10623,\r\n\tdivide: 247,\r\n\tdivonx: 8903,\r\n\tdlcorn: 8990,\r\n\tdlcrop: 8973,\r\n\tdollar: 36,\r\n\tdrcorn: 8991,\r\n\tdrcrop: 8972,\r\n\tdstrok: 273,\r\n\teacute: 233,\r\n\teaster: 10862,\r\n\tecaron: 283,\r\n\tecolon: 8789,\r\n\tegrave: 232,\r\n\tegsdot: 10904,\r\n\telsdot: 10903,\r\n\temptyv: 8709,\r\n\temsp13: 8196,\r\n\temsp14: 8197,\r\n\teparsl: 10723,\r\n\teqcirc: 8790,\r\n\tequals: 61,\r\n\tequest: 8799,\r\n\tfemale: 9792,\r\n\tffilig: 64259,\r\n\tffllig: 64260,\r\n\tforall: 8704,\r\n\tfrac12: 189,\r\n\tfrac13: 8531,\r\n\tfrac14: 188,\r\n\tfrac15: 8533,\r\n\tfrac16: 8537,\r\n\tfrac18: 8539,\r\n\tfrac23: 8532,\r\n\tfrac25: 8534,\r\n\tfrac34: 190,\r\n\tfrac35: 8535,\r\n\tfrac38: 8540,\r\n\tfrac45: 8536,\r\n\tfrac56: 8538,\r\n\tfrac58: 8541,\r\n\tfrac78: 8542,\r\n\tgacute: 501,\r\n\tgammad: 989,\r\n\tgbreve: 287,\r\n\tgesdot: 10880,\r\n\tgesles: 10900,\r\n\tgtlPar: 10645,\r\n\tgtrarr: 10616,\r\n\tgtrdot: 8919,\r\n\tgtrsim: 8819,\r\n\thairsp: 8202,\r\n\thamilt: 8459,\r\n\thardcy: 1098,\r\n\thearts: 9829,\r\n\thellip: 8230,\r\n\thercon: 8889,\r\n\thomtht: 8763,\r\n\thorbar: 8213,\r\n\thslash: 8463,\r\n\thstrok: 295,\r\n\thybull: 8259,\r\n\thyphen: 8208,\r\n\tiacute: 237,\r\n\tigrave: 236,\r\n\tiiiint: 10764,\r\n\tiinfin: 10716,\r\n\tincare: 8453,\r\n\tinodot: 305,\r\n\tintcal: 8890,\r\n\tiquest: 191,\r\n\tisinsv: 8947,\r\n\titilde: 297,\r\n\tjsercy: 1112,\r\n\tkappav: 1008,\r\n\tkcedil: 311,\r\n\tkgreen: 312,\r\n\tlAtail: 10523,\r\n\tlacute: 314,\r\n\tlagran: 8466,\r\n\tlambda: 955,\r\n\tlangle: 10216,\r\n\tlarrfs: 10525,\r\n\tlarrhk: 8617,\r\n\tlarrlp: 8619,\r\n\tlarrpl: 10553,\r\n\tlarrtl: 8610,\r\n\tlatail: 10521,\r\n\tlbrace: 123,\r\n\tlbrack: 91,\r\n\tlcaron: 318,\r\n\tlcedil: 316,\r\n\tldquor: 8222,\r\n\tlesdot: 10879,\r\n\tlesges: 10899,\r\n\tlfisht: 10620,\r\n\tlfloor: 8970,\r\n\tlharul: 10602,\r\n\tllhard: 10603,\r\n\tlmidot: 320,\r\n\tlmoust: 9136,\r\n\tloplus: 10797,\r\n\tlowast: 8727,\r\n\tlowbar: 95,\r\n\tlparlt: 10643,\r\n\tlrhard: 10605,\r\n\tlsaquo: 8249,\r\n\tlsquor: 8218,\r\n\tlstrok: 322,\r\n\tlthree: 8907,\r\n\tltimes: 8905,\r\n\tltlarr: 10614,\r\n\tltrPar: 10646,\r\n\tmapsto: 8614,\r\n\tmarker: 9646,\r\n\tmcomma: 10793,\r\n\tmidast: 42,\r\n\tmidcir: 10992,\r\n\tmiddot: 183,\r\n\tminusb: 8863,\r\n\tminusd: 8760,\r\n\tmnplus: 8723,\r\n\tmodels: 8871,\r\n\tmstpos: 8766,\r\n\tnVDash: 8879,\r\n\tnVdash: 8878,\r\n\tnacute: 324,\r\n\tncaron: 328,\r\n\tncedil: 326,\r\n\tnearhk: 10532,\r\n\tnequiv: 8802,\r\n\tnesear: 10536,\r\n\tnexist: 8708,\r\n\tnltrie: 8940,\r\n\tnprcue: 8928,\r\n\tnrtrie: 8941,\r\n\tnsccue: 8929,\r\n\tnsimeq: 8772,\r\n\tntilde: 241,\r\n\tnumero: 8470,\r\n\tnvDash: 8877,\r\n\tnvHarr: 10500,\r\n\tnvdash: 8876,\r\n\tnvlArr: 10498,\r\n\tnvrArr: 10499,\r\n\tnwarhk: 10531,\r\n\tnwnear: 10535,\r\n\toacute: 243,\r\n\todblac: 337,\r\n\todsold: 10684,\r\n\tograve: 242,\r\n\tominus: 8854,\r\n\torigof: 8886,\r\n\toslash: 248,\r\n\totilde: 245,\r\n\totimes: 8855,\r\n\tparsim: 10995,\r\n\tpercnt: 37,\r\n\tperiod: 46,\r\n\tpermil: 8240,\r\n\tphmmat: 8499,\r\n\tplanck: 8463,\r\n\tplankv: 8463,\r\n\tplusdo: 8724,\r\n\tplusdu: 10789,\r\n\tplusmn: 177,\r\n\tpreceq: 10927,\r\n\tprimes: 8473,\r\n\tprnsim: 8936,\r\n\tpropto: 8733,\r\n\tprurel: 8880,\r\n\tpuncsp: 8200,\r\n\tqprime: 8279,\r\n\trAtail: 10524,\r\n\tracute: 341,\r\n\trangle: 10217,\r\n\trarrap: 10613,\r\n\trarrfs: 10526,\r\n\trarrhk: 8618,\r\n\trarrlp: 8620,\r\n\trarrpl: 10565,\r\n\trarrtl: 8611,\r\n\tratail: 10522,\r\n\trbrace: 125,\r\n\trbrack: 93,\r\n\trcaron: 345,\r\n\trcedil: 343,\r\n\trdquor: 8221,\r\n\trfisht: 10621,\r\n\trfloor: 8971,\r\n\trharul: 10604,\r\n\trmoust: 9137,\r\n\troplus: 10798,\r\n\trpargt: 10644,\r\n\trsaquo: 8250,\r\n\trsquor: 8217,\r\n\trthree: 8908,\r\n\trtimes: 8906,\r\n\tsacute: 347,\r\n\tscaron: 353,\r\n\tscedil: 351,\r\n\tscnsim: 8937,\r\n\tsearhk: 10533,\r\n\tseswar: 10537,\r\n\tsfrown: 8994,\r\n\tshchcy: 1097,\r\n\tsigmaf: 962,\r\n\tsigmav: 962,\r\n\tsimdot: 10858,\r\n\tsmashp: 10803,\r\n\tsoftcy: 1100,\r\n\tsolbar: 9023,\r\n\tspades: 9824,\r\n\tsqsube: 8849,\r\n\tsqsupe: 8850,\r\n\tsquare: 9633,\r\n\tsquarf: 9642,\r\n\tssetmn: 8726,\r\n\tssmile: 8995,\r\n\tsstarf: 8902,\r\n\tsubdot: 10941,\r\n\tsubset: 8834,\r\n\tsubsim: 10951,\r\n\tsubsub: 10965,\r\n\tsubsup: 10963,\r\n\tsucceq: 10928,\r\n\tsupdot: 10942,\r\n\tsupset: 8835,\r\n\tsupsim: 10952,\r\n\tsupsub: 10964,\r\n\tsupsup: 10966,\r\n\tswarhk: 10534,\r\n\tswnwar: 10538,\r\n\ttarget: 8982,\r\n\ttcaron: 357,\r\n\ttcedil: 355,\r\n\ttelrec: 8981,\r\n\tthere4: 8756,\r\n\tthetav: 977,\r\n\tthinsp: 8201,\r\n\tthksim: 8764,\r\n\ttimesb: 8864,\r\n\ttimesd: 10800,\r\n\ttopbot: 9014,\r\n\ttopcir: 10993,\r\n\ttprime: 8244,\r\n\ttridot: 9708,\r\n\ttstrok: 359,\r\n\tuacute: 250,\r\n\tubreve: 365,\r\n\tudblac: 369,\r\n\tufisht: 10622,\r\n\tugrave: 249,\r\n\tulcorn: 8988,\r\n\tulcrop: 8975,\r\n\turcorn: 8989,\r\n\turcrop: 8974,\r\n\tutilde: 361,\r\n\tvangrt: 10652,\r\n\tvarphi: 966,\r\n\tvarrho: 1009,\r\n\tveebar: 8891,\r\n\tvellip: 8942,\r\n\tverbar: 124,\r\n\twedbar: 10847,\r\n\twedgeq: 8793,\r\n\tweierp: 8472,\r\n\twreath: 8768,\r\n\txoplus: 10753,\r\n\txotime: 10754,\r\n\txsqcup: 10758,\r\n\txuplus: 10756,\r\n\txwedge: 8896,\r\n\tyacute: 253,\r\n\tzacute: 378,\r\n\tzcaron: 382,\r\n\tzeetrf: 8488,\r\n\tAElig: 198,\r\n\tAcirc: 194,\r\n\tAlpha: 913,\r\n\tAmacr: 256,\r\n\tAogon: 260,\r\n\tAring: 197,\r\n\tBreve: 728,\r\n\tCcirc: 264,\r\n\tColon: 8759,\r\n\tCross: 10799,\r\n\tDashv: 10980,\r\n\tDelta: 916,\r\n\tEcirc: 202,\r\n\tEmacr: 274,\r\n\tEogon: 280,\r\n\tEqual: 10869,\r\n\tGamma: 915,\r\n\tGcirc: 284,\r\n\tHacek: 711,\r\n\tHcirc: 292,\r\n\tIJlig: 306,\r\n\tIcirc: 206,\r\n\tImacr: 298,\r\n\tIogon: 302,\r\n\tIukcy: 1030,\r\n\tJcirc: 308,\r\n\tJukcy: 1028,\r\n\tKappa: 922,\r\n\tOElig: 338,\r\n\tOcirc: 212,\r\n\tOmacr: 332,\r\n\tOmega: 937,\r\n\tPrime: 8243,\r\n\tRBarr: 10512,\r\n\tScirc: 348,\r\n\tSigma: 931,\r\n\tTHORN: 222,\r\n\tTRADE: 8482,\r\n\tTSHcy: 1035,\r\n\tTheta: 920,\r\n\tTilde: 8764,\r\n\tUbrcy: 1038,\r\n\tUcirc: 219,\r\n\tUmacr: 362,\r\n\tUnion: 8899,\r\n\tUogon: 370,\r\n\tUpTee: 8869,\r\n\tUring: 366,\r\n\tVDash: 8875,\r\n\tVdash: 8873,\r\n\tWcirc: 372,\r\n\tWedge: 8896,\r\n\tYcirc: 374,\r\n\tacirc: 226,\r\n\tacute: 180,\r\n\taelig: 230,\r\n\taleph: 8501,\r\n\talpha: 945,\r\n\tamacr: 257,\r\n\tamalg: 10815,\r\n\tangle: 8736,\r\n\tangrt: 8735,\r\n\tangst: 8491,\r\n\taogon: 261,\r\n\taring: 229,\r\n\tasymp: 8776,\r\n\tawint: 10769,\r\n\tbcong: 8780,\r\n\tbdquo: 8222,\r\n\tbepsi: 1014,\r\n\tblank: 9251,\r\n\tblk12: 9618,\r\n\tblk14: 9617,\r\n\tblk34: 9619,\r\n\tblock: 9608,\r\n\tboxDL: 9559,\r\n\tboxDR: 9556,\r\n\tboxDl: 9558,\r\n\tboxDr: 9555,\r\n\tboxHD: 9574,\r\n\tboxHU: 9577,\r\n\tboxHd: 9572,\r\n\tboxHu: 9575,\r\n\tboxUL: 9565,\r\n\tboxUR: 9562,\r\n\tboxUl: 9564,\r\n\tboxUr: 9561,\r\n\tboxVH: 9580,\r\n\tboxVL: 9571,\r\n\tboxVR: 9568,\r\n\tboxVh: 9579,\r\n\tboxVl: 9570,\r\n\tboxVr: 9567,\r\n\tboxdL: 9557,\r\n\tboxdR: 9554,\r\n\tboxdl: 9488,\r\n\tboxdr: 9484,\r\n\tboxhD: 9573,\r\n\tboxhU: 9576,\r\n\tboxhd: 9516,\r\n\tboxhu: 9524,\r\n\tboxuL: 9563,\r\n\tboxuR: 9560,\r\n\tboxul: 9496,\r\n\tboxur: 9492,\r\n\tboxvH: 9578,\r\n\tboxvL: 9569,\r\n\tboxvR: 9566,\r\n\tboxvh: 9532,\r\n\tboxvl: 9508,\r\n\tboxvr: 9500,\r\n\tbreve: 728,\r\n\tbsemi: 8271,\r\n\tbsime: 8909,\r\n\tbsolb: 10693,\r\n\tbumpE: 10926,\r\n\tbumpe: 8783,\r\n\tcaret: 8257,\r\n\tcaron: 711,\r\n\tccaps: 10829,\r\n\tccirc: 265,\r\n\tccups: 10828,\r\n\tcedil: 184,\r\n\tcheck: 10003,\r\n\tclubs: 9827,\r\n\tcolon: 58,\r\n\tcomma: 44,\r\n\tcrarr: 8629,\r\n\tcross: 10007,\r\n\tcsube: 10961,\r\n\tcsupe: 10962,\r\n\tctdot: 8943,\r\n\tcuepr: 8926,\r\n\tcuesc: 8927,\r\n\tcupor: 10821,\r\n\tcuvee: 8910,\r\n\tcuwed: 8911,\r\n\tcwint: 8753,\r\n\tdashv: 8867,\r\n\tdblac: 733,\r\n\tddarr: 8650,\r\n\tdelta: 948,\r\n\tdharl: 8643,\r\n\tdharr: 8642,\r\n\tdiams: 9830,\r\n\tdisin: 8946,\r\n\tdoteq: 8784,\r\n\tdtdot: 8945,\r\n\tdtrif: 9662,\r\n\tduarr: 8693,\r\n\tduhar: 10607,\r\n\teDDot: 10871,\r\n\tecirc: 234,\r\n\tefDot: 8786,\r\n\temacr: 275,\r\n\tempty: 8709,\r\n\teogon: 281,\r\n\teplus: 10865,\r\n\tepsiv: 949,\r\n\teqsim: 8770,\r\n\tequiv: 8801,\r\n\terDot: 8787,\r\n\terarr: 10609,\r\n\tesdot: 8784,\r\n\texist: 8707,\r\n\tfflig: 64256,\r\n\tfilig: 64257,\r\n\tfllig: 64258,\r\n\tfltns: 9649,\r\n\tforkv: 10969,\r\n\tfrasl: 8260,\r\n\tfrown: 8994,\r\n\tgamma: 947,\r\n\tgcirc: 285,\r\n\tgescc: 10921,\r\n\tgimel: 8503,\r\n\tgneqq: 8809,\r\n\tgnsim: 8935,\r\n\tgrave: 96,\r\n\tgsime: 10894,\r\n\tgsiml: 10896,\r\n\tgtcir: 10874,\r\n\tgtdot: 8919,\r\n\tharrw: 8621,\r\n\thcirc: 293,\r\n\thoarr: 8703,\r\n\ticirc: 238,\r\n\tiexcl: 161,\r\n\tiiint: 8749,\r\n\tiiota: 8489,\r\n\tijlig: 307,\r\n\timacr: 299,\r\n\timage: 8465,\r\n\timath: 305,\r\n\timped: 437,\r\n\tinfin: 8734,\r\n\tiogon: 303,\r\n\tiprod: 10812,\r\n\tisinE: 8953,\r\n\tisins: 8948,\r\n\tisinv: 8712,\r\n\tiukcy: 1110,\r\n\tjcirc: 309,\r\n\tjmath: 567,\r\n\tjukcy: 1108,\r\n\tkappa: 954,\r\n\tlAarr: 8666,\r\n\tlBarr: 10510,\r\n\tlangd: 10641,\r\n\tlaquo: 171,\r\n\tlarrb: 8676,\r\n\tlbarr: 10508,\r\n\tlbbrk: 10098,\r\n\tlbrke: 10635,\r\n\tlceil: 8968,\r\n\tldquo: 8220,\r\n\tlescc: 10920,\r\n\tlhard: 8637,\r\n\tlharu: 8636,\r\n\tlhblk: 9604,\r\n\tllarr: 8647,\r\n\tlltri: 9722,\r\n\tlneqq: 8808,\r\n\tlnsim: 8934,\r\n\tloang: 10220,\r\n\tloarr: 8701,\r\n\tlobrk: 10214,\r\n\tlopar: 10629,\r\n\tlrarr: 8646,\r\n\tlrhar: 8651,\r\n\tlrtri: 8895,\r\n\tlsime: 10893,\r\n\tlsimg: 10895,\r\n\tlsquo: 8216,\r\n\tltcir: 10873,\r\n\tltdot: 8918,\r\n\tltrie: 8884,\r\n\tltrif: 9666,\r\n\tmDDot: 8762,\r\n\tmdash: 8212,\r\n\tmicro: 181,\r\n\tminus: 8722,\r\n\tmumap: 8888,\r\n\tnabla: 8711,\r\n\tnapos: 329,\r\n\tnatur: 9838,\r\n\tncong: 8775,\r\n\tndash: 8211,\r\n\tneArr: 8663,\r\n\tnearr: 8599,\r\n\tngsim: 8821,\r\n\tnhArr: 8654,\r\n\tnharr: 8622,\r\n\tnhpar: 10994,\r\n\tnlArr: 8653,\r\n\tnlarr: 8602,\r\n\tnless: 8814,\r\n\tnlsim: 8820,\r\n\tnltri: 8938,\r\n\tnotin: 8713,\r\n\tnotni: 8716,\r\n\tnprec: 8832,\r\n\tnrArr: 8655,\r\n\tnrarr: 8603,\r\n\tnrtri: 8939,\r\n\tnsime: 8772,\r\n\tnsmid: 8740,\r\n\tnspar: 8742,\r\n\tnsube: 8840,\r\n\tnsucc: 8833,\r\n\tnsupe: 8841,\r\n\tnumsp: 8199,\r\n\tnwArr: 8662,\r\n\tnwarr: 8598,\r\n\tocirc: 244,\r\n\todash: 8861,\r\n\toelig: 339,\r\n\tofcir: 10687,\r\n\tohbar: 10677,\r\n\tolarr: 8634,\r\n\tolcir: 10686,\r\n\toline: 8254,\r\n\tomacr: 333,\r\n\tomega: 969,\r\n\toperp: 10681,\r\n\toplus: 8853,\r\n\torarr: 8635,\r\n\torder: 8500,\r\n\tovbar: 9021,\r\n\tparsl: 11005,\r\n\tphone: 9742,\r\n\tplusb: 8862,\r\n\tpluse: 10866,\r\n\tpound: 163,\r\n\tprcue: 8828,\r\n\tprime: 8242,\r\n\tprnap: 10937,\r\n\tprsim: 8830,\r\n\tquest: 63,\r\n\trAarr: 8667,\r\n\trBarr: 10511,\r\n\tradic: 8730,\r\n\trangd: 10642,\r\n\trange: 10661,\r\n\traquo: 187,\r\n\trarrb: 8677,\r\n\trarrc: 10547,\r\n\trarrw: 8605,\r\n\tratio: 8758,\r\n\trbarr: 10509,\r\n\trbbrk: 10099,\r\n\trbrke: 10636,\r\n\trceil: 8969,\r\n\trdquo: 8221,\r\n\treals: 8477,\r\n\trhard: 8641,\r\n\trharu: 8640,\r\n\trlarr: 8644,\r\n\trlhar: 8652,\r\n\trnmid: 10990,\r\n\troang: 10221,\r\n\troarr: 8702,\r\n\trobrk: 10215,\r\n\tropar: 10630,\r\n\trrarr: 8649,\r\n\trsquo: 8217,\r\n\trtrie: 8885,\r\n\trtrif: 9656,\r\n\tsbquo: 8218,\r\n\tsccue: 8829,\r\n\tscirc: 349,\r\n\tscnap: 10938,\r\n\tscsim: 8831,\r\n\tsdotb: 8865,\r\n\tsdote: 10854,\r\n\tseArr: 8664,\r\n\tsearr: 8600,\r\n\tsetmn: 8726,\r\n\tsharp: 9839,\r\n\tsigma: 963,\r\n\tsimeq: 8771,\r\n\tsimgE: 10912,\r\n\tsimlE: 10911,\r\n\tsimne: 8774,\r\n\tslarr: 8592,\r\n\tsmile: 8995,\r\n\tsqcap: 8851,\r\n\tsqcup: 8852,\r\n\tsqsub: 8847,\r\n\tsqsup: 8848,\r\n\tsrarr: 8594,\r\n\tstarf: 9733,\r\n\tstrns: 175,\r\n\tsubnE: 10955,\r\n\tsubne: 8842,\r\n\tsupnE: 10956,\r\n\tsupne: 8843,\r\n\tswArr: 8665,\r\n\tswarr: 8601,\r\n\tszlig: 223,\r\n\ttheta: 952,\r\n\tthkap: 8776,\r\n\tthorn: 254,\r\n\ttilde: 732,\r\n\ttimes: 215,\r\n\ttrade: 8482,\r\n\ttrisb: 10701,\r\n\ttshcy: 1115,\r\n\ttwixt: 8812,\r\n\tubrcy: 1118,\r\n\tucirc: 251,\r\n\tudarr: 8645,\r\n\tudhar: 10606,\r\n\tuharl: 8639,\r\n\tuharr: 8638,\r\n\tuhblk: 9600,\r\n\tultri: 9720,\r\n\tumacr: 363,\r\n\tuogon: 371,\r\n\tuplus: 8846,\r\n\tupsih: 978,\r\n\turing: 367,\r\n\turtri: 9721,\r\n\tutdot: 8944,\r\n\tutrif: 9652,\r\n\tuuarr: 8648,\r\n\tvBarv: 10985,\r\n\tvDash: 8872,\r\n\tvarpi: 982,\r\n\tvdash: 8866,\r\n\tveeeq: 8794,\r\n\tvltri: 8882,\r\n\tvprop: 8733,\r\n\tvrtri: 8883,\r\n\twcirc: 373,\r\n\twedge: 8743,\r\n\txcirc: 9711,\r\n\txdtri: 9661,\r\n\txhArr: 10234,\r\n\txharr: 10231,\r\n\txlArr: 10232,\r\n\txlarr: 10229,\r\n\txodot: 10752,\r\n\txrArr: 10233,\r\n\txrarr: 10230,\r\n\txutri: 9651,\r\n\tycirc: 375,\r\n\tAopf: 120120,\r\n\tAscr: 119964,\r\n\tAuml: 196,\r\n\tBarv: 10983,\r\n\tBeta: 914,\r\n\tBopf: 120121,\r\n\tBscr: 8492,\r\n\tCHcy: 1063,\r\n\tCOPY: 169,\r\n\tCdot: 266,\r\n\tCopf: 8450,\r\n\tCscr: 119966,\r\n\tDJcy: 1026,\r\n\tDScy: 1029,\r\n\tDZcy: 1039,\r\n\tDarr: 8609,\r\n\tDopf: 120123,\r\n\tDscr: 119967,\r\n\tEdot: 278,\r\n\tEopf: 120124,\r\n\tEscr: 8496,\r\n\tEsim: 10867,\r\n\tEuml: 203,\r\n\tFopf: 120125,\r\n\tFscr: 8497,\r\n\tGJcy: 1027,\r\n\tGdot: 288,\r\n\tGopf: 120126,\r\n\tGscr: 119970,\r\n\tHopf: 8461,\r\n\tHscr: 8459,\r\n\tIEcy: 1045,\r\n\tIOcy: 1025,\r\n\tIdot: 304,\r\n\tIopf: 120128,\r\n\tIota: 921,\r\n\tIscr: 8464,\r\n\tIuml: 207,\r\n\tJopf: 120129,\r\n\tJscr: 119973,\r\n\tKHcy: 1061,\r\n\tKJcy: 1036,\r\n\tKopf: 120130,\r\n\tKscr: 119974,\r\n\tLJcy: 1033,\r\n\tLang: 10218,\r\n\tLarr: 8606,\r\n\tLopf: 120131,\r\n\tLscr: 8466,\r\n\tMopf: 120132,\r\n\tMscr: 8499,\r\n\tNJcy: 1034,\r\n\tNopf: 8469,\r\n\tNscr: 119977,\r\n\tOopf: 120134,\r\n\tOscr: 119978,\r\n\tOuml: 214,\r\n\tPopf: 8473,\r\n\tPscr: 119979,\r\n\tQUOT: 34,\r\n\tQopf: 8474,\r\n\tQscr: 119980,\r\n\tRang: 10219,\r\n\tRarr: 8608,\r\n\tRopf: 8477,\r\n\tRscr: 8475,\r\n\tSHcy: 1064,\r\n\tSopf: 120138,\r\n\tSqrt: 8730,\r\n\tSscr: 119982,\r\n\tStar: 8902,\r\n\tTScy: 1062,\r\n\tTopf: 120139,\r\n\tTscr: 119983,\r\n\tUarr: 8607,\r\n\tUopf: 120140,\r\n\tUpsi: 978,\r\n\tUscr: 119984,\r\n\tUuml: 220,\r\n\tVbar: 10987,\r\n\tVert: 8214,\r\n\tVopf: 120141,\r\n\tVscr: 119985,\r\n\tWopf: 120142,\r\n\tWscr: 119986,\r\n\tXopf: 120143,\r\n\tXscr: 119987,\r\n\tYAcy: 1071,\r\n\tYIcy: 1031,\r\n\tYUcy: 1070,\r\n\tYopf: 120144,\r\n\tYscr: 119988,\r\n\tYuml: 376,\r\n\tZHcy: 1046,\r\n\tZdot: 379,\r\n\tZeta: 918,\r\n\tZopf: 8484,\r\n\tZscr: 119989,\r\n\tandd: 10844,\r\n\tandv: 10842,\r\n\tange: 10660,\r\n\taopf: 120146,\r\n\tapid: 8779,\r\n\tapos: 39,\r\n\tascr: 119990,\r\n\tauml: 228,\r\n\tbNot: 10989,\r\n\tbbrk: 9141,\r\n\tbeta: 946,\r\n\tbeth: 8502,\r\n\tbnot: 8976,\r\n\tbopf: 120147,\r\n\tboxH: 9552,\r\n\tboxV: 9553,\r\n\tboxh: 9472,\r\n\tboxv: 9474,\r\n\tbscr: 119991,\r\n\tbsim: 8765,\r\n\tbsol: 92,\r\n\tbull: 8226,\r\n\tbump: 8782,\r\n\tcdot: 267,\r\n\tcent: 162,\r\n\tchcy: 1095,\r\n\tcirE: 10691,\r\n\tcirc: 710,\r\n\tcire: 8791,\r\n\tcomp: 8705,\r\n\tcong: 8773,\r\n\tcopf: 120148,\r\n\tcopy: 169,\r\n\tcscr: 119992,\r\n\tcsub: 10959,\r\n\tcsup: 10960,\r\n\tdArr: 8659,\r\n\tdHar: 10597,\r\n\tdarr: 8595,\r\n\tdash: 8208,\r\n\tdiam: 8900,\r\n\tdjcy: 1106,\r\n\tdopf: 120149,\r\n\tdscr: 119993,\r\n\tdscy: 1109,\r\n\tdsol: 10742,\r\n\tdtri: 9663,\r\n\tdzcy: 1119,\r\n\teDot: 8785,\r\n\tecir: 8790,\r\n\tedot: 279,\r\n\temsp: 8195,\r\n\tensp: 8194,\r\n\teopf: 120150,\r\n\tepar: 8917,\r\n\tepsi: 1013,\r\n\tescr: 8495,\r\n\tesim: 8770,\r\n\teuml: 235,\r\n\teuro: 8364,\r\n\texcl: 33,\r\n\tflat: 9837,\r\n\tfnof: 402,\r\n\tfopf: 120151,\r\n\tfork: 8916,\r\n\tfscr: 119995,\r\n\tgdot: 289,\r\n\tgeqq: 8807,\r\n\tgjcy: 1107,\r\n\tgnap: 10890,\r\n\tgneq: 10888,\r\n\tgopf: 120152,\r\n\tgscr: 8458,\r\n\tgsim: 8819,\r\n\tgtcc: 10919,\r\n\thArr: 8660,\r\n\thalf: 189,\r\n\tharr: 8596,\r\n\thbar: 8463,\r\n\thopf: 120153,\r\n\thscr: 119997,\r\n\tiecy: 1077,\r\n\timof: 8887,\r\n\tiocy: 1105,\r\n\tiopf: 120154,\r\n\tiota: 953,\r\n\tiscr: 119998,\r\n\tisin: 8712,\r\n\tiuml: 239,\r\n\tjopf: 120155,\r\n\tjscr: 119999,\r\n\tkhcy: 1093,\r\n\tkjcy: 1116,\r\n\tkopf: 120156,\r\n\tkscr: 120000,\r\n\tlArr: 8656,\r\n\tlHar: 10594,\r\n\tlang: 10216,\r\n\tlarr: 8592,\r\n\tlate: 10925,\r\n\tlcub: 123,\r\n\tldca: 10550,\r\n\tldsh: 8626,\r\n\tleqq: 8806,\r\n\tljcy: 1113,\r\n\tlnap: 10889,\r\n\tlneq: 10887,\r\n\tlopf: 120157,\r\n\tlozf: 10731,\r\n\tlpar: 40,\r\n\tlscr: 120001,\r\n\tlsim: 8818,\r\n\tlsqb: 91,\r\n\tltcc: 10918,\r\n\tltri: 9667,\r\n\tmacr: 175,\r\n\tmale: 9794,\r\n\tmalt: 10016,\r\n\tmlcp: 10971,\r\n\tmldr: 8230,\r\n\tmopf: 120158,\r\n\tmscr: 120002,\r\n\tnbsp: 160,\r\n\tncap: 10819,\r\n\tncup: 10818,\r\n\tngeq: 8817,\r\n\tngtr: 8815,\r\n\tnisd: 8954,\r\n\tnjcy: 1114,\r\n\tnldr: 8229,\r\n\tnleq: 8816,\r\n\tnmid: 8740,\r\n\tnopf: 120159,\r\n\tnpar: 8742,\r\n\tnscr: 120003,\r\n\tnsim: 8769,\r\n\tnsub: 8836,\r\n\tnsup: 8837,\r\n\tntgl: 8825,\r\n\tntlg: 8824,\r\n\toast: 8859,\r\n\tocir: 8858,\r\n\todiv: 10808,\r\n\todot: 8857,\r\n\togon: 731,\r\n\toint: 8750,\r\n\tomid: 10678,\r\n\toopf: 120160,\r\n\topar: 10679,\r\n\tordf: 170,\r\n\tordm: 186,\r\n\toror: 10838,\r\n\toscr: 8500,\r\n\tosol: 8856,\r\n\touml: 246,\r\n\tpara: 182,\r\n\tpart: 8706,\r\n\tperp: 8869,\r\n\tphiv: 966,\r\n\tplus: 43,\r\n\tpopf: 120161,\r\n\tprap: 10935,\r\n\tprec: 8826,\r\n\tprnE: 10933,\r\n\tprod: 8719,\r\n\tprop: 8733,\r\n\tpscr: 120005,\r\n\tqint: 10764,\r\n\tqopf: 120162,\r\n\tqscr: 120006,\r\n\tquot: 34,\r\n\trArr: 8658,\r\n\trHar: 10596,\r\n\trace: 10714,\r\n\trang: 10217,\r\n\trarr: 8594,\r\n\trcub: 125,\r\n\trdca: 10551,\r\n\trdsh: 8627,\r\n\treal: 8476,\r\n\trect: 9645,\r\n\trhov: 1009,\r\n\tring: 730,\r\n\tropf: 120163,\r\n\trpar: 41,\r\n\trscr: 120007,\r\n\trsqb: 93,\r\n\trtri: 9657,\r\n\tscap: 10936,\r\n\tscnE: 10934,\r\n\tsdot: 8901,\r\n\tsect: 167,\r\n\tsemi: 59,\r\n\tsext: 10038,\r\n\tshcy: 1096,\r\n\tsime: 8771,\r\n\tsimg: 10910,\r\n\tsiml: 10909,\r\n\tsmid: 8739,\r\n\tsmte: 10924,\r\n\tsolb: 10692,\r\n\tsopf: 120164,\r\n\tspar: 8741,\r\n\tsquf: 9642,\r\n\tsscr: 120008,\r\n\tstar: 9734,\r\n\tsubE: 10949,\r\n\tsube: 8838,\r\n\tsucc: 8827,\r\n\tsung: 9834,\r\n\tsup1: 185,\r\n\tsup2: 178,\r\n\tsup3: 179,\r\n\tsupE: 10950,\r\n\tsupe: 8839,\r\n\ttbrk: 9140,\r\n\ttdot: 8411,\r\n\ttint: 8749,\r\n\ttoea: 10536,\r\n\ttopf: 120165,\r\n\ttosa: 10537,\r\n\ttrie: 8796,\r\n\ttscr: 120009,\r\n\ttscy: 1094,\r\n\tuArr: 8657,\r\n\tuHar: 10595,\r\n\tuarr: 8593,\r\n\tuopf: 120166,\r\n\tupsi: 965,\r\n\tuscr: 120010,\r\n\tutri: 9653,\r\n\tuuml: 252,\r\n\tvArr: 8661,\r\n\tvBar: 10984,\r\n\tvarr: 8597,\r\n\tvert: 124,\r\n\tvopf: 120167,\r\n\tvscr: 120011,\r\n\twopf: 120168,\r\n\twscr: 120012,\r\n\txcap: 8898,\r\n\txcup: 8899,\r\n\txmap: 10236,\r\n\txnis: 8955,\r\n\txopf: 120169,\r\n\txscr: 120013,\r\n\txvee: 8897,\r\n\tyacy: 1103,\r\n\tyicy: 1111,\r\n\tyopf: 120170,\r\n\tyscr: 120014,\r\n\tyucy: 1102,\r\n\tyuml: 255,\r\n\tzdot: 380,\r\n\tzeta: 950,\r\n\tzhcy: 1078,\r\n\tzopf: 120171,\r\n\tzscr: 120015,\r\n\tzwnj: 8204,\r\n\tAMP: 38,\r\n\tAcy: 1040,\r\n\tAfr: 120068,\r\n\tAnd: 10835,\r\n\tBcy: 1041,\r\n\tBfr: 120069,\r\n\tCap: 8914,\r\n\tCfr: 8493,\r\n\tChi: 935,\r\n\tCup: 8915,\r\n\tDcy: 1044,\r\n\tDel: 8711,\r\n\tDfr: 120071,\r\n\tDot: 168,\r\n\tENG: 330,\r\n\tETH: 208,\r\n\tEcy: 1069,\r\n\tEfr: 120072,\r\n\tEta: 919,\r\n\tFcy: 1060,\r\n\tFfr: 120073,\r\n\tGcy: 1043,\r\n\tGfr: 120074,\r\n\tHat: 94,\r\n\tHfr: 8460,\r\n\tIcy: 1048,\r\n\tIfr: 8465,\r\n\tInt: 8748,\r\n\tJcy: 1049,\r\n\tJfr: 120077,\r\n\tKcy: 1050,\r\n\tKfr: 120078,\r\n\tLcy: 1051,\r\n\tLfr: 120079,\r\n\tLsh: 8624,\r\n\tMap: 10501,\r\n\tMcy: 1052,\r\n\tMfr: 120080,\r\n\tNcy: 1053,\r\n\tNfr: 120081,\r\n\tNot: 10988,\r\n\tOcy: 1054,\r\n\tOfr: 120082,\r\n\tPcy: 1055,\r\n\tPfr: 120083,\r\n\tPhi: 934,\r\n\tPsi: 936,\r\n\tQfr: 120084,\r\n\tREG: 174,\r\n\tRcy: 1056,\r\n\tRfr: 8476,\r\n\tRho: 929,\r\n\tRsh: 8625,\r\n\tScy: 1057,\r\n\tSfr: 120086,\r\n\tSub: 8912,\r\n\tSum: 8721,\r\n\tSup: 8913,\r\n\tTab: 9,\r\n\tTau: 932,\r\n\tTcy: 1058,\r\n\tTfr: 120087,\r\n\tUcy: 1059,\r\n\tUfr: 120088,\r\n\tVcy: 1042,\r\n\tVee: 8897,\r\n\tVfr: 120089,\r\n\tWfr: 120090,\r\n\tXfr: 120091,\r\n\tYcy: 1067,\r\n\tYfr: 120092,\r\n\tZcy: 1047,\r\n\tZfr: 8488,\r\n\tacd: 8767,\r\n\tacy: 1072,\r\n\tafr: 120094,\r\n\tamp: 38,\r\n\tand: 8743,\r\n\tang: 8736,\r\n\tapE: 10864,\r\n\tape: 8778,\r\n\tast: 42,\r\n\tbcy: 1073,\r\n\tbfr: 120095,\r\n\tbot: 8869,\r\n\tcap: 8745,\r\n\tcfr: 120096,\r\n\tchi: 967,\r\n\tcir: 9675,\r\n\tcup: 8746,\r\n\tdcy: 1076,\r\n\tdeg: 176,\r\n\tdfr: 120097,\r\n\tdie: 168,\r\n\tdiv: 247,\r\n\tdot: 729,\r\n\tecy: 1101,\r\n\tefr: 120098,\r\n\tegs: 10902,\r\n\tell: 8467,\r\n\tels: 10901,\r\n\teng: 331,\r\n\teta: 951,\r\n\teth: 240,\r\n\tfcy: 1092,\r\n\tffr: 120099,\r\n\tgEl: 10892,\r\n\tgap: 10886,\r\n\tgcy: 1075,\r\n\tgel: 8923,\r\n\tgeq: 8805,\r\n\tges: 10878,\r\n\tgfr: 120100,\r\n\tggg: 8921,\r\n\tglE: 10898,\r\n\tgla: 10917,\r\n\tglj: 10916,\r\n\tgnE: 8809,\r\n\tgne: 10888,\r\n\thfr: 120101,\r\n\ticy: 1080,\r\n\tiff: 8660,\r\n\tifr: 120102,\r\n\tint: 8747,\r\n\tjcy: 1081,\r\n\tjfr: 120103,\r\n\tkcy: 1082,\r\n\tkfr: 120104,\r\n\tlEg: 10891,\r\n\tlap: 10885,\r\n\tlat: 10923,\r\n\tlcy: 1083,\r\n\tleg: 8922,\r\n\tleq: 8804,\r\n\tles: 10877,\r\n\tlfr: 120105,\r\n\tlgE: 10897,\r\n\tlnE: 8808,\r\n\tlne: 10887,\r\n\tloz: 9674,\r\n\tlrm: 8206,\r\n\tlsh: 8624,\r\n\tmap: 8614,\r\n\tmcy: 1084,\r\n\tmfr: 120106,\r\n\tmho: 8487,\r\n\tmid: 8739,\r\n\tnap: 8777,\r\n\tncy: 1085,\r\n\tnfr: 120107,\r\n\tnge: 8817,\r\n\tngt: 8815,\r\n\tnis: 8956,\r\n\tniv: 8715,\r\n\tnle: 8816,\r\n\tnlt: 8814,\r\n\tnot: 172,\r\n\tnpr: 8832,\r\n\tnsc: 8833,\r\n\tnum: 35,\r\n\tocy: 1086,\r\n\tofr: 120108,\r\n\togt: 10689,\r\n\tohm: 8486,\r\n\tolt: 10688,\r\n\tord: 10845,\r\n\torv: 10843,\r\n\tpar: 8741,\r\n\tpcy: 1087,\r\n\tpfr: 120109,\r\n\tphi: 966,\r\n\tpiv: 982,\r\n\tprE: 10931,\r\n\tpre: 10927,\r\n\tpsi: 968,\r\n\tqfr: 120110,\r\n\trcy: 1088,\r\n\treg: 174,\r\n\trfr: 120111,\r\n\trho: 961,\r\n\trlm: 8207,\r\n\trsh: 8625,\r\n\tscE: 10932,\r\n\tsce: 10928,\r\n\tscy: 1089,\r\n\tsfr: 120112,\r\n\tshy: 173,\r\n\tsim: 8764,\r\n\tsmt: 10922,\r\n\tsol: 47,\r\n\tsqu: 9633,\r\n\tsub: 8834,\r\n\tsum: 8721,\r\n\tsup: 8835,\r\n\ttau: 964,\r\n\ttcy: 1090,\r\n\ttfr: 120113,\r\n\ttop: 8868,\r\n\tucy: 1091,\r\n\tufr: 120114,\r\n\tuml: 168,\r\n\tvcy: 1074,\r\n\tvee: 8744,\r\n\tvfr: 120115,\r\n\twfr: 120116,\r\n\txfr: 120117,\r\n\tycy: 1099,\r\n\tyen: 165,\r\n\tyfr: 120118,\r\n\tzcy: 1079,\r\n\tzfr: 120119,\r\n\tzwj: 8205,\r\n\tDD: 8517,\r\n\tGT: 62,\r\n\tGg: 8921,\r\n\tGt: 8811,\r\n\tIm: 8465,\r\n\tLT: 60,\r\n\tLl: 8920,\r\n\tLt: 8810,\r\n\tMu: 924,\r\n\tNu: 925,\r\n\tOr: 10836,\r\n\tPi: 928,\r\n\tPr: 10939,\r\n\tRe: 8476,\r\n\tSc: 10940,\r\n\tXi: 926,\r\n\tac: 8766,\r\n\taf: 8289,\r\n\tap: 8776,\r\n\tdd: 8518,\r\n\tee: 8519,\r\n\teg: 10906,\r\n\tel: 10905,\r\n\tgE: 8807,\r\n\tge: 8805,\r\n\tgg: 8811,\r\n\tgl: 8823,\r\n\tgt: 62,\r\n\tic: 8291,\r\n\tii: 8520,\r\n\tin: 8712,\r\n\tit: 8290,\r\n\tlE: 8806,\r\n\tle: 8804,\r\n\tlg: 8822,\r\n\tll: 8810,\r\n\tlt: 60,\r\n\tmp: 8723,\r\n\tmu: 956,\r\n\tne: 8800,\r\n\tni: 8715,\r\n\tnu: 957,\r\n\toS: 9416,\r\n\tor: 8744,\r\n\tpi: 960,\r\n\tpm: 177,\r\n\tpr: 8826,\r\n\trx: 8478,\r\n\tsc: 8827,\r\n\twp: 8472,\r\n\twr: 8768,\r\n\txi: 958\r\n};\r\n","import entities from './entities';\r\n\r\nconst windows_1252 = [\r\n\t8364,\r\n\t129,\r\n\t8218,\r\n\t402,\r\n\t8222,\r\n\t8230,\r\n\t8224,\r\n\t8225,\r\n\t710,\r\n\t8240,\r\n\t352,\r\n\t8249,\r\n\t338,\r\n\t141,\r\n\t381,\r\n\t143,\r\n\t144,\r\n\t8216,\r\n\t8217,\r\n\t8220,\r\n\t8221,\r\n\t8226,\r\n\t8211,\r\n\t8212,\r\n\t732,\r\n\t8482,\r\n\t353,\r\n\t8250,\r\n\t339,\r\n\t157,\r\n\t382,\r\n\t376\r\n];\r\n\r\nconst entity_pattern = new RegExp(\r\n\t`&(#?(?:x[\\\\w\\\\d]+|\\\\d+|${Object.keys(entities).join('|')}))(?:;|\\\\b)`,\r\n\t'g'\r\n);\r\n\r\nexport function decode_character_references(html: string) {\r\n\treturn html.replace(entity_pattern, (match, entity) => {\r\n\t\tlet code;\r\n\r\n\t\t// Handle named entities\r\n\t\tif (entity[0] !== '#') {\r\n\t\t\tcode = entities[entity];\r\n\t\t} else if (entity[1] === 'x') {\r\n\t\t\tcode = parseInt(entity.substring(2), 16);\r\n\t\t} else {\r\n\t\t\tcode = parseInt(entity.substring(1), 10);\r\n\t\t}\r\n\r\n\t\tif (!code) {\r\n\t\t\treturn match;\r\n\t\t}\r\n\r\n\t\treturn String.fromCodePoint(validate_code(code));\r\n\t});\r\n}\r\n\r\nconst NUL = 0;\r\n\r\n// some code points are verboten. If we were inserting HTML, the browser would replace the illegal\r\n// code points with alternatives in some cases - since we're bypassing that mechanism, we need\r\n// to replace them ourselves\r\n//\r\n// Source: http://en.wikipedia.org/wiki/Character_encodings_in_HTML#Illegal_characters\r\nfunction validate_code(code: number) {\r\n\t// line feed becomes generic whitespace\r\n\tif (code === 10) {\r\n\t\treturn 32;\r\n\t}\r\n\r\n\t// ASCII range. (Why someone would use HTML entities for ASCII characters I don't know, but...)\r\n\tif (code < 128) {\r\n\t\treturn code;\r\n\t}\r\n\r\n\t// code points 128-159 are dealt with leniently by browsers, but they're incorrect. We need\r\n\t// to correct the mistake or we'll end up with missing € signs and so on\r\n\tif (code <= 159) {\r\n\t\treturn windows_1252[code - 128];\r\n\t}\r\n\r\n\t// basic multilingual plane\r\n\tif (code < 55296) {\r\n\t\treturn code;\r\n\t}\r\n\r\n\t// UTF-16 surrogate halves\r\n\tif (code <= 57343) {\r\n\t\treturn NUL;\r\n\t}\r\n\r\n\t// rest of the basic multilingual plane\r\n\tif (code <= 65535) {\r\n\t\treturn code;\r\n\t}\r\n\r\n\t// supplementary multilingual plane 0x10000 - 0x1ffff\r\n\tif (code >= 65536 && code <= 131071) {\r\n\t\treturn code;\r\n\t}\r\n\r\n\t// supplementary ideographic plane 0x20000 - 0x2ffff\r\n\tif (code >= 131072 && code <= 196607) {\r\n\t\treturn code;\r\n\t}\r\n\r\n\treturn NUL;\r\n}\r\n\r\n// based on http://developers.whatwg.org/syntax.html#syntax-tag-omission\r\nconst disallowed_contents = new Map([\r\n\t['li', new Set(['li'])],\r\n\t['dt', new Set(['dt', 'dd'])],\r\n\t['dd', new Set(['dt', 'dd'])],\r\n\t[\r\n\t\t'p',\r\n\t\tnew Set(\r\n\t\t\t'address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul'.split(\r\n\t\t\t\t' '\r\n\t\t\t)\r\n\t\t)\r\n\t],\r\n\t['rt', new Set(['rt', 'rp'])],\r\n\t['rp', new Set(['rt', 'rp'])],\r\n\t['optgroup', new Set(['optgroup'])],\r\n\t['option', new Set(['option', 'optgroup'])],\r\n\t['thead', new Set(['tbody', 'tfoot'])],\r\n\t['tbody', new Set(['tbody', 'tfoot'])],\r\n\t['tfoot', new Set(['tbody'])],\r\n\t['tr', new Set(['tr', 'tbody'])],\r\n\t['td', new Set(['td', 'th', 'tr'])],\r\n\t['th', new Set(['td', 'th', 'tr'])]\r\n]);\r\n\r\n// can this be a child of the parent element, or does it implicitly\r\n// close it, like `<li>one<li>two`?\r\nexport function closing_tag_omitted(current: string, next?: string) {\r\n\tif (disallowed_contents.has(current)) {\r\n\t\tif (!next || disallowed_contents.get(current).has(next)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\treturn false;\r\n}\r\n","import { Directive, DirectiveType, TemplateNode, Text } from '../../interfaces';\r\nimport { extract_svelte_ignore } from '../../utils/extract_svelte_ignore';\r\nimport fuzzymatch from '../../utils/fuzzymatch';\r\nimport { is_void } from '../../../shared/utils/names';\r\nimport parser_errors from '../errors';\r\nimport { Parser } from '../index';\r\nimport read_expression from '../read/expression';\r\nimport read_script from '../read/script';\r\nimport read_style from '../read/style';\r\nimport { closing_tag_omitted, decode_character_references } from '../utils/html';\r\n\r\n// eslint-disable-next-line no-useless-escape\r\nconst valid_tag_name = /^\\!?[a-zA-Z]{1,}:?[a-zA-Z0-9\\-]*/;\r\n\r\nconst meta_tags = new Map([\r\n\t['svelte:head', 'Head'],\r\n\t['svelte:options', 'Options'],\r\n\t['svelte:window', 'Window'],\r\n\t['svelte:body', 'Body']\r\n]);\r\n\r\nconst valid_meta_tags = Array.from(meta_tags.keys()).concat('svelte:self', 'svelte:component', 'svelte:fragment', 'svelte:element');\r\n\r\nconst specials = new Map([\r\n\t[\r\n\t\t'script',\r\n\t\t{\r\n\t\t\tread: read_script,\r\n\t\t\tproperty: 'js'\r\n\t\t}\r\n\t],\r\n\t[\r\n\t\t'style',\r\n\t\t{\r\n\t\t\tread: read_style,\r\n\t\t\tproperty: 'css'\r\n\t\t}\r\n\t]\r\n]);\r\n\r\nconst SELF = /^svelte:self(?=[\\s/>])/;\r\nconst COMPONENT = /^svelte:component(?=[\\s/>])/;\r\nconst SLOT = /^svelte:fragment(?=[\\s/>])/;\r\nconst ELEMENT = /^svelte:element(?=[\\s/>])/;\r\n\r\nfunction parent_is_head(stack) {\r\n\tlet i = stack.length;\r\n\twhile (i--) {\r\n\t\tconst { type } = stack[i];\r\n\t\tif (type === 'Head') return true;\r\n\t\tif (type === 'Element' || type === 'InlineComponent') return false;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nconst regex_closing_textarea_tag = /^<\\/textarea(\\s[^>]*)?>/i;\r\nconst regex_closing_comment = /-->/;\r\nconst regex_capital_letter = /[A-Z]/;\r\n\r\nexport default function tag(parser: Parser) {\r\n\tconst start = parser.index++;\r\n\r\n\tlet parent = parser.current();\r\n\r\n\tif (parser.eat('!--')) {\r\n\t\tconst data = parser.read_until(regex_closing_comment);\r\n\t\tparser.eat('-->', true, parser_errors.unclosed_comment);\r\n\r\n\t\tparser.current().children.push({\r\n\t\t\tstart,\r\n\t\t\tend: parser.index,\r\n\t\t\ttype: 'Comment',\r\n\t\t\tdata,\r\n\t\t\tignores: extract_svelte_ignore(data)\r\n\t\t});\r\n\r\n\t\treturn;\r\n\t}\r\n\r\n\tconst is_closing_tag = parser.eat('/');\r\n\r\n\tconst name = read_tag_name(parser);\r\n\r\n\tif (meta_tags.has(name)) {\r\n\t\tconst slug = meta_tags.get(name).toLowerCase();\r\n\t\tif (is_closing_tag) {\r\n\t\t\tif (\r\n\t\t\t\t(name === 'svelte:window' || name === 'svelte:body') &&\r\n\t\t\t\tparser.current().children.length\r\n\t\t\t) {\r\n\t\t\t\tparser.error(\r\n\t\t\t\t\tparser_errors.invalid_element_content(slug, name),\r\n\t\t\t\t\tparser.current().children[0].start\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (name in parser.meta_tags) {\r\n\t\t\t\tparser.error(parser_errors.duplicate_element(slug, name), start);\r\n\t\t\t}\r\n\r\n\t\t\tif (parser.stack.length > 1) {\r\n\t\t\t\tparser.error(parser_errors.invalid_element_placement(slug, name), start);\r\n\t\t\t}\r\n\r\n\t\t\tparser.meta_tags[name] = true;\r\n\t\t}\r\n\t}\r\n\r\n\tconst type = meta_tags.has(name)\r\n\t\t? meta_tags.get(name)\r\n\t\t: (regex_capital_letter.test(name[0]) || name === 'svelte:self' || name === 'svelte:component') ? 'InlineComponent'\r\n\t\t\t: name === 'svelte:fragment' ? 'SlotTemplate'\r\n\t\t\t\t: name === 'title' && parent_is_head(parser.stack) ? 'Title'\r\n\t\t\t\t\t: name === 'slot' && !parser.customElement ? 'Slot' : 'Element';\r\n\r\n\tconst element: TemplateNode = {\r\n\t\tstart,\r\n\t\tend: null, // filled in later\r\n\t\ttype,\r\n\t\tname,\r\n\t\tattributes: [],\r\n\t\tchildren: []\r\n\t};\r\n\r\n\tparser.allow_whitespace();\r\n\r\n\tif (is_closing_tag) {\r\n\t\tif (is_void(name)) {\r\n\t\t\tparser.error(parser_errors.invalid_void_content(name), start);\r\n\t\t}\r\n\r\n\t\tparser.eat('>', true);\r\n\r\n\t\t// close any elements that don't have their own closing tags, e.g. <div><p></div>\r\n\t\twhile (parent.name !== name) {\r\n\t\t\tif (parent.type !== 'Element') {\r\n\t\t\t\tconst error = parser.last_auto_closed_tag && parser.last_auto_closed_tag.tag === name\r\n\t\t\t\t\t? parser_errors.invalid_closing_tag_autoclosed(name, parser.last_auto_closed_tag.reason)\r\n\t\t\t\t\t: parser_errors.invalid_closing_tag_unopened(name);\r\n\t\t\t\tparser.error(error, start);\r\n\t\t\t}\r\n\r\n\t\t\tparent.end = start;\r\n\t\t\tparser.stack.pop();\r\n\r\n\t\t\tparent = parser.current();\r\n\t\t}\r\n\r\n\t\tparent.end = parser.index;\r\n\t\tparser.stack.pop();\r\n\r\n\t\tif (parser.last_auto_closed_tag && parser.stack.length < parser.last_auto_closed_tag.depth) {\r\n\t\t\tparser.last_auto_closed_tag = null;\r\n\t\t}\r\n\r\n\t\treturn;\r\n\t} else if (closing_tag_omitted(parent.name, name)) {\r\n\t\tparent.end = start;\r\n\t\tparser.stack.pop();\r\n\t\tparser.last_auto_closed_tag = {\r\n\t\t\ttag: parent.name,\r\n\t\t\treason: name,\r\n\t\t\tdepth: parser.stack.length\r\n\t\t};\r\n\t}\r\n\r\n\tconst unique_names: Set<string> = new Set();\r\n\r\n\tlet attribute;\r\n\twhile ((attribute = read_attribute(parser, unique_names))) {\r\n\t\telement.attributes.push(attribute);\r\n\t\tparser.allow_whitespace();\r\n\t}\r\n\r\n\tif (name === 'svelte:component') {\r\n\t\tconst index = element.attributes.findIndex(attr => attr.type === 'Attribute' && attr.name === 'this');\r\n\t\tif (index === -1) {\r\n\t\t\tparser.error(parser_errors.missing_component_definition, start);\r\n\t\t}\r\n\r\n\t\tconst definition = element.attributes.splice(index, 1)[0];\r\n\t\tif (definition.value === true || definition.value.length !== 1 || definition.value[0].type === 'Text') {\r\n\t\t\tparser.error(parser_errors.invalid_component_definition, definition.start);\r\n\t\t}\r\n\r\n\t\telement.expression = definition.value[0].expression;\r\n\t}\r\n\r\n\tif (name === 'svelte:element') {\r\n\t\tconst index = element.attributes.findIndex(attr => attr.type === 'Attribute' && attr.name === 'this');\r\n\t\tif (index === -1) {\r\n\t\t\tparser.error(parser_errors.missing_element_definition, start);\r\n\t\t}\r\n\r\n\t\tconst definition = element.attributes.splice(index, 1)[0];\r\n\t\tif (definition.value === true) {\r\n\t\t\tparser.error(parser_errors.invalid_element_definition, definition.start);\r\n\t\t}\r\n\t\telement.tag = definition.value[0].data || definition.value[0].expression;\r\n\t}\r\n\r\n\t// special cases – top-level <script> and <style>\r\n\tif (specials.has(name) && parser.stack.length === 1) {\r\n\t\tconst special = specials.get(name);\r\n\r\n\t\tparser.eat('>', true);\r\n\t\tconst content = special.read(parser, start, element.attributes);\r\n\t\tif (content) parser[special.property].push(content);\r\n\t\treturn;\r\n\t}\r\n\r\n\tparser.current().children.push(element);\r\n\r\n\tconst self_closing = parser.eat('/') || is_void(name);\r\n\r\n\tparser.eat('>', true);\r\n\r\n\tif (self_closing) {\r\n\t\t// don't push self-closing elements onto the stack\r\n\t\telement.end = parser.index;\r\n\t} else if (name === 'textarea') {\r\n\t\t// special case\r\n\t\telement.children = read_sequence(\r\n\t\t\tparser,\r\n\t\t\t() => regex_closing_textarea_tag.test(parser.template.slice(parser.index)),\r\n\t\t\t'inside <textarea>'\r\n\t\t);\r\n\t\tparser.read(regex_closing_textarea_tag);\r\n\t\telement.end = parser.index;\r\n\t} else if (name === 'script' || name === 'style') {\r\n\t\t// special case\r\n\t\tconst start = parser.index;\r\n\t\tconst data = parser.read_until(new RegExp(`</${name}>`));\r\n\t\tconst end = parser.index;\r\n\t\telement.children.push({ start, end, type: 'Text', data });\r\n\t\tparser.eat(`</${name}>`, true);\r\n\t\telement.end = parser.index;\r\n\t} else {\r\n\t\tparser.stack.push(element);\r\n\t}\r\n}\r\n\r\nconst regex_whitespace_or_slash_or_closing_tag = /(\\s|\\/|>)/;\r\n\r\nfunction read_tag_name(parser: Parser) {\r\n\tconst start = parser.index;\r\n\r\n\tif (parser.read(SELF)) {\r\n\t\t// check we're inside a block, otherwise this\r\n\t\t// will cause infinite recursion\r\n\t\tlet i = parser.stack.length;\r\n\t\tlet legal = false;\r\n\r\n\t\twhile (i--) {\r\n\t\t\tconst fragment = parser.stack[i];\r\n\t\t\tif (fragment.type === 'IfBlock' || fragment.type === 'EachBlock' || fragment.type === 'InlineComponent') {\r\n\t\t\t\tlegal = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!legal) {\r\n\t\t\tparser.error(parser_errors.invalid_self_placement, start);\r\n\t\t}\r\n\r\n\t\treturn 'svelte:self';\r\n\t}\r\n\r\n\tif (parser.read(COMPONENT)) return 'svelte:component';\r\n\tif (parser.read(ELEMENT)) return 'svelte:element';\r\n\r\n\tif (parser.read(SLOT)) return 'svelte:fragment';\r\n\r\n\tconst name = parser.read_until(regex_whitespace_or_slash_or_closing_tag);\r\n\r\n\tif (meta_tags.has(name)) return name;\r\n\r\n\tif (name.startsWith('svelte:')) {\r\n\t\tconst match = fuzzymatch(name.slice(7), valid_meta_tags);\r\n\r\n\t\tparser.error(\r\n\t\t\tparser_errors.invalid_tag_name_svelte_element(valid_meta_tags, match),\r\n\t\t\tstart\r\n\t\t);\r\n\t}\r\n\r\n\tif (!valid_tag_name.test(name)) {\r\n\t\tparser.error(parser_errors.invalid_tag_name, start);\r\n\t}\r\n\r\n\treturn name;\r\n}\r\n\r\n// eslint-disable-next-line no-useless-escape\r\nconst regex_token_ending_character = /[\\s=\\/>\"']/;\r\nconst regex_quote_characters = /[\"']/;\r\n\r\nfunction read_attribute(parser: Parser, unique_names: Set<string>) {\r\n\tconst start = parser.index;\r\n\r\n\tfunction check_unique(name: string) {\r\n\t\tif (unique_names.has(name)) {\r\n\t\t\tparser.error(parser_errors.duplicate_attribute, start);\r\n\t\t}\r\n\t\tunique_names.add(name);\r\n\t}\r\n\r\n\tif (parser.eat('{')) {\r\n\t\tparser.allow_whitespace();\r\n\r\n\t\tif (parser.eat('...')) {\r\n\t\t\tconst expression = read_expression(parser);\r\n\r\n\t\t\tparser.allow_whitespace();\r\n\t\t\tparser.eat('}', true);\r\n\r\n\t\t\treturn {\r\n\t\t\t\tstart,\r\n\t\t\t\tend: parser.index,\r\n\t\t\t\ttype: 'Spread',\r\n\t\t\t\texpression\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tconst value_start = parser.index;\r\n\r\n\t\t\tconst name = parser.read_identifier();\r\n\t\t\tparser.allow_whitespace();\r\n\t\t\tparser.eat('}', true);\r\n\r\n\t\t\tif (name === null) {\r\n\t\t\t\tparser.error(parser_errors.empty_attribute_shorthand, start);\r\n\t\t\t}\r\n\r\n\t\t\tcheck_unique(name);\r\n\r\n\t\t\treturn {\r\n\t\t\t\tstart,\r\n\t\t\t\tend: parser.index,\r\n\t\t\t\ttype: 'Attribute',\r\n\t\t\t\tname,\r\n\t\t\t\tvalue: [{\r\n\t\t\t\t\tstart: value_start,\r\n\t\t\t\t\tend: value_start + name.length,\r\n\t\t\t\t\ttype: 'AttributeShorthand',\r\n\t\t\t\t\texpression: {\r\n\t\t\t\t\t\tstart: value_start,\r\n\t\t\t\t\t\tend: value_start + name.length,\r\n\t\t\t\t\t\ttype: 'Identifier',\r\n\t\t\t\t\t\tname\r\n\t\t\t\t\t}\r\n\t\t\t\t}]\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\tconst name = parser.read_until(regex_token_ending_character);\r\n\tif (!name) return null;\r\n\r\n\tlet end = parser.index;\r\n\r\n\tparser.allow_whitespace();\r\n\r\n\tconst colon_index = name.indexOf(':');\r\n\tconst type = colon_index !== -1 && get_directive_type(name.slice(0, colon_index));\r\n\r\n\tlet value: any[] | true = true;\r\n\tif (parser.eat('=')) {\r\n\t\tparser.allow_whitespace();\r\n\t\tvalue = read_attribute_value(parser);\r\n\t\tend = parser.index;\r\n\t} else if (parser.match_regex(regex_quote_characters)) {\r\n\t\tparser.error(parser_errors.unexpected_token('='), parser.index);\r\n\t}\r\n\r\n\tif (type) {\r\n\t\tconst [directive_name, ...modifiers] = name.slice(colon_index + 1).split('|');\r\n\r\n\t\tif (directive_name === '') {\r\n\t\t\tparser.error(parser_errors.empty_directive_name(type), start + colon_index + 1);\r\n\t\t}\r\n\r\n\t\tif (type === 'Binding' && directive_name !== 'this') {\r\n\t\t\tcheck_unique(directive_name);\r\n\t\t} else if (type !== 'EventHandler' && type !== 'Action') {\r\n\t\t\tcheck_unique(name);\r\n\t\t}\r\n\r\n\t\tif (type === 'Ref') {\r\n\t\t\tparser.error(parser_errors.invalid_ref_directive(directive_name), start);\r\n\t\t}\r\n\r\n\t\tif (type === 'StyleDirective') {\r\n\t\t\treturn {\r\n\t\t\t\tstart,\r\n\t\t\t\tend,\r\n\t\t\t\ttype,\r\n\t\t\t\tname: directive_name,\r\n\t\t\t\tmodifiers,\r\n\t\t\t\tvalue\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tconst first_value = value[0];\r\n\t\tlet expression = null;\r\n\r\n\t\tif (first_value) {\r\n\t\t\tconst attribute_contains_text = (value as any[]).length > 1 || first_value.type === 'Text';\r\n\t\t\tif (attribute_contains_text) {\r\n\t\t\t\tparser.error(parser_errors.invalid_directive_value, first_value.start);\r\n\t\t\t} else {\r\n\t\t\t\texpression = first_value.expression;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst directive: Directive = {\r\n\t\t\tstart,\r\n\t\t\tend,\r\n\t\t\ttype,\r\n\t\t\tname: directive_name,\r\n\t\t\tmodifiers,\r\n\t\t\texpression\r\n\t\t};\r\n\r\n\t\tif (type === 'Transition') {\r\n\t\t\tconst direction = name.slice(0, colon_index);\r\n\t\t\tdirective.intro = direction === 'in' || direction === 'transition';\r\n\t\t\tdirective.outro = direction === 'out' || direction === 'transition';\r\n\t\t}\r\n\r\n\t\t// Directive name is expression, e.g. <p class:isRed />\r\n\t\tif (!directive.expression && (type === 'Binding' || type === 'Class')) {\r\n\t\t\tdirective.expression = {\r\n\t\t\t\tstart: directive.start + colon_index + 1,\r\n\t\t\t\tend: directive.end,\r\n\t\t\t\ttype: 'Identifier',\r\n\t\t\t\tname: directive.name\r\n\t\t\t} as any;\r\n\t\t}\r\n\r\n\t\treturn directive;\r\n\t}\r\n\r\n\tcheck_unique(name);\r\n\r\n\treturn {\r\n\t\tstart,\r\n\t\tend,\r\n\t\ttype: 'Attribute',\r\n\t\tname,\r\n\t\tvalue\r\n\t};\r\n}\r\n\r\nfunction get_directive_type(name: string): DirectiveType {\r\n\tif (name === 'use') return 'Action';\r\n\tif (name === 'animate') return 'Animation';\r\n\tif (name === 'bind') return 'Binding';\r\n\tif (name === 'class') return 'Class';\r\n\tif (name === 'style') return 'StyleDirective';\r\n\tif (name === 'on') return 'EventHandler';\r\n\tif (name === 'let') return 'Let';\r\n\tif (name === 'ref') return 'Ref';\r\n\tif (name === 'in' || name === 'out' || name === 'transition') return 'Transition';\r\n}\r\n\r\nfunction read_attribute_value(parser: Parser) {\r\n\tconst quote_mark = parser.eat(\"'\") ? \"'\" : parser.eat('\"') ? '\"' : null;\r\n\tif (quote_mark && parser.eat(quote_mark)) {\r\n\t\treturn [{\r\n\t\t\tstart: parser.index - 1,\r\n\t\t\tend: parser.index - 1,\r\n\t\t\ttype: 'Text',\r\n\t\t\traw: '',\r\n\t\t\tdata: ''\r\n\t\t}];\r\n\t}\r\n\r\n\tconst regex = (\r\n\t\tquote_mark === \"'\" ? /'/ :\r\n\t\t\tquote_mark === '\"' ? /\"/ :\r\n\t\t\t\t/(\\/>|[\\s\"'=<>`])/\r\n\t);\r\n\r\n\tlet value;\r\n\ttry {\r\n\t\tvalue = read_sequence(parser, () => !!parser.match_regex(regex), 'in attribute value');\r\n\t} catch (error) {\r\n\t\tif (error.code === 'parse-error') {\r\n\t\t\t// if the attribute value didn't close + self-closing tag\r\n\t\t\t// eg: `<Component test={{a:1} />`\r\n\t\t\t// acorn may throw a `Unterminated regular expression` because of `/>`\r\n\t\t\tif (parser.template.slice(error.pos - 1, error.pos + 1) === '/>') {\r\n\t\t\t\tparser.index = error.pos;\r\n\t\t\t\tparser.error(parser_errors.unclosed_attribute_value(quote_mark || '}'));\r\n\t\t\t}\r\n\t\t}\r\n\t\tthrow error;\r\n\t}\r\n\r\n\tif (value.length === 0 && !quote_mark) {\r\n\t\tparser.error(parser_errors.missing_attribute_value);\r\n\t}\r\n\r\n\tif (quote_mark) parser.index += 1;\r\n\treturn value;\r\n}\r\n\r\nfunction read_sequence(parser: Parser, done: () => boolean, location: string): TemplateNode[] {\r\n\tlet current_chunk: Text = {\r\n\t\tstart: parser.index,\r\n\t\tend: null,\r\n\t\ttype: 'Text',\r\n\t\traw: '',\r\n\t\tdata: null\r\n\t};\r\n\r\n\tconst chunks: TemplateNode[] = [];\r\n\r\n\tfunction flush(end: number) {\r\n\t\tif (current_chunk.raw) {\r\n\t\t\tcurrent_chunk.data = decode_character_references(current_chunk.raw);\r\n\t\t\tcurrent_chunk.end = end;\r\n\t\t\tchunks.push(current_chunk);\r\n\t\t}\r\n\t}\r\n\r\n\twhile (parser.index < parser.template.length) {\r\n\t\tconst index = parser.index;\r\n\r\n\t\tif (done()) {\r\n\t\t\tflush(parser.index);\r\n\t\t\treturn chunks;\r\n\t\t} else if (parser.eat('{')) {\r\n\t\t\tif (parser.match('#')) {\r\n\t\t\t\tconst index = parser.index - 1;\r\n\t\t\t\tparser.eat('#');\r\n\t\t\t\tconst name = parser.read_until(/[^a-z]/);\r\n\t\t\t\tparser.error(parser_errors.invalid_logic_block_placement(location, name), index);\r\n\t\t\t} else if (parser.match('@')) {\r\n\t\t\t\tconst index = parser.index - 1;\r\n\t\t\t\tparser.eat('@');\r\n\t\t\t\tconst name = parser.read_until(/[^a-z]/);\r\n\t\t\t\tparser.error(parser_errors.invalid_tag_placement(location, name), index);\r\n\t\t\t}\r\n\r\n\t\t\tflush(parser.index - 1);\r\n\r\n\t\t\tparser.allow_whitespace();\r\n\t\t\tconst expression = read_expression(parser);\r\n\t\t\tparser.allow_whitespace();\r\n\t\t\tparser.eat('}', true);\r\n\r\n\t\t\tchunks.push({\r\n\t\t\t\tstart: index,\r\n\t\t\t\tend: parser.index,\r\n\t\t\t\ttype: 'MustacheTag',\r\n\t\t\t\texpression\r\n\t\t\t});\r\n\r\n\t\t\tcurrent_chunk = {\r\n\t\t\t\tstart: parser.index,\r\n\t\t\t\tend: null,\r\n\t\t\t\ttype: 'Text',\r\n\t\t\t\traw: '',\r\n\t\t\t\tdata: null\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tcurrent_chunk.raw += parser.template[parser.index++];\r\n\t\t}\r\n\t}\r\n\r\n\tparser.error(parser_errors.unexpected_eof);\r\n}\r\n","// Adapted from https://github.com/acornjs/acorn/blob/6584815dca7440e00de841d1dad152302fdd7ca5/src/tokenize.js\r\n// Reproduced under MIT License https://github.com/acornjs/acorn/blob/master/LICENSE\r\n\r\nexport default function full_char_code_at(str: string, i: number): number {\r\n\tconst code = str.charCodeAt(i);\r\n\tif (code <= 0xd7ff || code >= 0xe000) return code;\r\n\r\n\tconst next = str.charCodeAt(i + 1);\r\n\treturn (code << 10) + next - 0x35fdc00;\r\n}\r\n","const SQUARE_BRACKET_OPEN = '['.charCodeAt(0);\r\nconst SQUARE_BRACKET_CLOSE = ']'.charCodeAt(0);\r\nconst CURLY_BRACKET_OPEN = '{'.charCodeAt(0);\r\nconst CURLY_BRACKET_CLOSE = '}'.charCodeAt(0);\r\n\r\nexport function is_bracket_open(code) {\r\n\treturn code === SQUARE_BRACKET_OPEN || code === CURLY_BRACKET_OPEN;\r\n}\r\n\r\nexport function is_bracket_close(code) {\r\n\treturn code === SQUARE_BRACKET_CLOSE || code === CURLY_BRACKET_CLOSE;\r\n}\r\n\r\nexport function is_bracket_pair(open, close) {\r\n\treturn (\r\n\t\t(open === SQUARE_BRACKET_OPEN && close === SQUARE_BRACKET_CLOSE) ||\r\n\t\t(open === CURLY_BRACKET_OPEN && close === CURLY_BRACKET_CLOSE)\r\n\t);\r\n}\r\n\r\nexport function get_bracket_close(open) {\r\n\tif (open === SQUARE_BRACKET_OPEN) {\r\n\t\treturn SQUARE_BRACKET_CLOSE;\r\n\t}\r\n\tif (open === CURLY_BRACKET_OPEN) {\r\n\t\treturn CURLY_BRACKET_CLOSE;\r\n\t}\r\n}\r\n","import { regex_starts_with_whitespaces, regex_ends_with_whitespaces } from './patterns';\r\n\r\nexport function trim_start(str: string) {\r\n\treturn str.replace(regex_starts_with_whitespaces, '');\r\n}\r\n\r\nexport function trim_end(str: string) {\r\n\treturn str.replace(regex_ends_with_whitespaces, '');\r\n}\r\n","import read_context from '../read/context';\r\nimport read_expression from '../read/expression';\r\nimport { closing_tag_omitted } from '../utils/html';\r\nimport { regex_whitespace } from '../../utils/patterns';\r\nimport { trim_start, trim_end } from '../../utils/trim';\r\nimport { to_string } from '../utils/node';\r\nimport { Parser } from '../index';\r\nimport { TemplateNode } from '../../interfaces';\r\nimport parser_errors from '../errors';\r\n\r\nfunction trim_whitespace(block: TemplateNode, trim_before: boolean, trim_after: boolean) {\r\n\tif (!block.children || block.children.length === 0) return; // AwaitBlock\r\n\r\n\tconst first_child = block.children[0];\r\n\tconst last_child = block.children[block.children.length - 1];\r\n\r\n\tif (first_child.type === 'Text' && trim_before) {\r\n\t\tfirst_child.data = trim_start(first_child.data);\r\n\t\tif (!first_child.data) block.children.shift();\r\n\t}\r\n\r\n\tif (last_child.type === 'Text' && trim_after) {\r\n\t\tlast_child.data = trim_end(last_child.data);\r\n\t\tif (!last_child.data) block.children.pop();\r\n\t}\r\n\r\n\tif (block.else) {\r\n\t\ttrim_whitespace(block.else, trim_before, trim_after);\r\n\t}\r\n\r\n\tif (first_child.elseif) {\r\n\t\ttrim_whitespace(first_child, trim_before, trim_after);\r\n\t}\r\n}\r\n\r\nconst regex_whitespace_with_closing_curly_brace = /\\s*}/;\r\n\r\nexport default function mustache(parser: Parser) {\r\n\tconst start = parser.index;\r\n\tparser.index += 1;\r\n\r\n\tparser.allow_whitespace();\r\n\r\n\t// {/if}, {/each}, {/await} or {/key}\r\n\tif (parser.eat('/')) {\r\n\t\tlet block = parser.current();\r\n\t\tlet expected;\r\n\r\n\t\tif (closing_tag_omitted(block.name)) {\r\n\t\t\tblock.end = start;\r\n\t\t\tparser.stack.pop();\r\n\t\t\tblock = parser.current();\r\n\t\t}\r\n\r\n\t\tif (block.type === 'ElseBlock' || block.type === 'PendingBlock' || block.type === 'ThenBlock' || block.type === 'CatchBlock') {\r\n\t\t\tblock.end = start;\r\n\t\t\tparser.stack.pop();\r\n\t\t\tblock = parser.current();\r\n\r\n\t\t\texpected = 'await';\r\n\t\t}\r\n\r\n\t\tif (block.type === 'IfBlock') {\r\n\t\t\texpected = 'if';\r\n\t\t} else if (block.type === 'EachBlock') {\r\n\t\t\texpected = 'each';\r\n\t\t} else if (block.type === 'AwaitBlock') {\r\n\t\t\texpected = 'await';\r\n\t\t} else if (block.type === 'KeyBlock') {\r\n\t\t\texpected = 'key';\r\n\t\t} else {\r\n\t\t\tparser.error(parser_errors.unexpected_block_close);\r\n\t\t}\r\n\r\n\t\tparser.eat(expected, true);\r\n\t\tparser.allow_whitespace();\r\n\t\tparser.eat('}', true);\r\n\r\n\t\twhile (block.elseif) {\r\n\t\t\tblock.end = parser.index;\r\n\t\t\tparser.stack.pop();\r\n\t\t\tblock = parser.current();\r\n\r\n\t\t\tif (block.else) {\r\n\t\t\t\tblock.else.end = start;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// strip leading/trailing whitespace as necessary\r\n\t\tconst char_before = parser.template[block.start - 1];\r\n\t\tconst char_after = parser.template[parser.index];\r\n\t\tconst trim_before = !char_before || regex_whitespace.test(char_before);\r\n\t\tconst trim_after = !char_after || regex_whitespace.test(char_after);\r\n\r\n\t\ttrim_whitespace(block, trim_before, trim_after);\r\n\r\n\t\tblock.end = parser.index;\r\n\t\tparser.stack.pop();\r\n\t} else if (parser.eat(':else')) {\r\n\t\tif (parser.eat('if')) {\r\n\t\t\tparser.error(parser_errors.invalid_elseif);\r\n\t\t}\r\n\r\n\t\tparser.allow_whitespace();\r\n\r\n\t\t// :else if\r\n\t\tif (parser.eat('if')) {\r\n\t\t\tconst block = parser.current();\r\n\t\t\tif (block.type !== 'IfBlock') {\r\n\t\t\t\tparser.error(\r\n\t\t\t\t\tparser.stack.some(block => block.type === 'IfBlock')\r\n\t\t\t\t\t\t? parser_errors.invalid_elseif_placement_unclosed_block(to_string(block))\r\n\t\t\t\t\t\t: parser_errors.invalid_elseif_placement_outside_if\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tparser.require_whitespace();\r\n\r\n\t\t\tconst expression = read_expression(parser);\r\n\r\n\t\t\tparser.allow_whitespace();\r\n\t\t\tparser.eat('}', true);\r\n\r\n\t\t\tblock.else = {\r\n\t\t\t\tstart: parser.index,\r\n\t\t\t\tend: null,\r\n\t\t\t\ttype: 'ElseBlock',\r\n\t\t\t\tchildren: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstart: parser.index,\r\n\t\t\t\t\t\tend: null,\r\n\t\t\t\t\t\ttype: 'IfBlock',\r\n\t\t\t\t\t\telseif: true,\r\n\t\t\t\t\t\texpression,\r\n\t\t\t\t\t\tchildren: []\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t};\r\n\r\n\t\t\tparser.stack.push(block.else.children[0]);\r\n\t\t} else {\r\n\t\t\t// :else\r\n\t\t\tconst block = parser.current();\r\n\t\t\tif (block.type !== 'IfBlock' && block.type !== 'EachBlock') {\r\n\t\t\t\tparser.error(\r\n\t\t\t\t\tparser.stack.some(block => block.type === 'IfBlock' || block.type === 'EachBlock')\r\n\t\t\t\t\t\t? parser_errors.invalid_else_placement_unclosed_block(to_string(block))\r\n\t\t\t\t\t\t: parser_errors.invalid_else_placement_outside_if\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tparser.allow_whitespace();\r\n\t\t\tparser.eat('}', true);\r\n\r\n\t\t\tblock.else = {\r\n\t\t\t\tstart: parser.index,\r\n\t\t\t\tend: null,\r\n\t\t\t\ttype: 'ElseBlock',\r\n\t\t\t\tchildren: []\r\n\t\t\t};\r\n\r\n\t\t\tparser.stack.push(block.else);\r\n\t\t}\r\n\t} else if (parser.match(':then') || parser.match(':catch')) {\r\n\t\tconst block = parser.current();\r\n\t\tconst is_then = parser.eat(':then') || !parser.eat(':catch');\r\n\r\n\t\tif (is_then) {\r\n\t\t\tif (block.type !== 'PendingBlock') {\r\n\t\t\t\tparser.error(\r\n\t\t\t\t\tparser.stack.some(block => block.type === 'PendingBlock')\r\n\t\t\t\t\t\t? parser_errors.invalid_then_placement_unclosed_block(to_string(block))\r\n\t\t\t\t\t\t: parser_errors.invalid_then_placement_without_await\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (block.type !== 'ThenBlock' && block.type !== 'PendingBlock') {\r\n\t\t\t\tparser.error(parser.stack.some(block => block.type === 'ThenBlock' || block.type === 'PendingBlock')\r\n\t\t\t\t\t? parser_errors.invalid_catch_placement_unclosed_block(to_string(block))\r\n\t\t\t\t\t: parser_errors.invalid_catch_placement_without_await\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tblock.end = start;\r\n\t\tparser.stack.pop();\r\n\t\tconst await_block = parser.current();\r\n\r\n\t\tif (!parser.eat('}')) {\r\n\t\t\tparser.require_whitespace();\r\n\t\t\tawait_block[is_then ? 'value' : 'error'] = read_context(parser);\r\n\t\t\tparser.allow_whitespace();\r\n\t\t\tparser.eat('}', true);\r\n\t\t}\r\n\r\n\t\tconst new_block: TemplateNode = {\r\n\t\t\tstart,\r\n\t\t\tend: null,\r\n\t\t\ttype: is_then ? 'ThenBlock' : 'CatchBlock',\r\n\t\t\tchildren: [],\r\n\t\t\tskip: false\r\n\t\t};\r\n\r\n\t\tawait_block[is_then ? 'then' : 'catch'] = new_block;\r\n\t\tparser.stack.push(new_block);\r\n\t} else if (parser.eat('#')) {\r\n\t\t// {#if foo}, {#each foo} or {#await foo}\r\n\t\tlet type;\r\n\r\n\t\tif (parser.eat('if')) {\r\n\t\t\ttype = 'IfBlock';\r\n\t\t} else if (parser.eat('each')) {\r\n\t\t\ttype = 'EachBlock';\r\n\t\t} else if (parser.eat('await')) {\r\n\t\t\ttype = 'AwaitBlock';\r\n\t\t} else if (parser.eat('key')) {\r\n\t\t\ttype = 'KeyBlock';\r\n\t\t} else {\r\n\t\t\tparser.error(parser_errors.expected_block_type);\r\n\t\t}\r\n\r\n\t\tparser.require_whitespace();\r\n\r\n\t\tconst expression = read_expression(parser);\r\n\r\n\t\tconst block: TemplateNode = type === 'AwaitBlock' ?\r\n\t\t\t{\r\n\t\t\t\tstart,\r\n\t\t\t\tend: null,\r\n\t\t\t\ttype,\r\n\t\t\t\texpression,\r\n\t\t\t\tvalue: null,\r\n\t\t\t\terror: null,\r\n\t\t\t\tpending: {\r\n\t\t\t\t\tstart: null,\r\n\t\t\t\t\tend: null,\r\n\t\t\t\t\ttype: 'PendingBlock',\r\n\t\t\t\t\tchildren: [],\r\n\t\t\t\t\tskip: true\r\n\t\t\t\t},\r\n\t\t\t\tthen: {\r\n\t\t\t\t\tstart: null,\r\n\t\t\t\t\tend: null,\r\n\t\t\t\t\ttype: 'ThenBlock',\r\n\t\t\t\t\tchildren: [],\r\n\t\t\t\t\tskip: true\r\n\t\t\t\t},\r\n\t\t\t\tcatch: {\r\n\t\t\t\t\tstart: null,\r\n\t\t\t\t\tend: null,\r\n\t\t\t\t\ttype: 'CatchBlock',\r\n\t\t\t\t\tchildren: [],\r\n\t\t\t\t\tskip: true\r\n\t\t\t\t}\r\n\t\t\t} :\r\n\t\t\t{\r\n\t\t\t\tstart,\r\n\t\t\t\tend: null,\r\n\t\t\t\ttype,\r\n\t\t\t\texpression,\r\n\t\t\t\tchildren: []\r\n\t\t\t};\r\n\r\n\t\tparser.allow_whitespace();\r\n\r\n\t\t// {#each} blocks must declare a context – {#each list as item}\r\n\t\tif (type === 'EachBlock') {\r\n\t\t\tparser.eat('as', true);\r\n\t\t\tparser.require_whitespace();\r\n\r\n\t\t\tblock.context = read_context(parser);\r\n\r\n\t\t\tparser.allow_whitespace();\r\n\r\n\t\t\tif (parser.eat(',')) {\r\n\t\t\t\tparser.allow_whitespace();\r\n\t\t\t\tblock.index = parser.read_identifier();\r\n\t\t\t\tif (!block.index) parser.error(parser_errors.expected_name);\r\n\r\n\t\t\t\tparser.allow_whitespace();\r\n\t\t\t}\r\n\r\n\t\t\tif (parser.eat('(')) {\r\n\t\t\t\tparser.allow_whitespace();\r\n\r\n\t\t\t\tblock.key = read_expression(parser);\r\n\t\t\t\tparser.allow_whitespace();\r\n\t\t\t\tparser.eat(')', true);\r\n\t\t\t\tparser.allow_whitespace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst await_block_shorthand = type === 'AwaitBlock' && parser.eat('then');\r\n\t\tif (await_block_shorthand) {\r\n\t\t\tif (parser.match_regex(regex_whitespace_with_closing_curly_brace)) {\r\n\t\t\t\tparser.allow_whitespace();\r\n\t\t\t} else {\r\n\t\t\t\tparser.require_whitespace();\r\n\t\t\t\tblock.value = read_context(parser);\r\n\t\t\t\tparser.allow_whitespace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst await_block_catch_shorthand = !await_block_shorthand && type === 'AwaitBlock' && parser.eat('catch');\r\n\t\tif (await_block_catch_shorthand) {\r\n\t\t\tif (parser.match_regex(regex_whitespace_with_closing_curly_brace)) {\r\n\t\t\t\tparser.allow_whitespace();\r\n\t\t\t} else {\r\n\t\t\t\tparser.require_whitespace();\r\n\t\t\t\tblock.error = read_context(parser);\r\n\t\t\t\tparser.allow_whitespace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tparser.eat('}', true);\r\n\r\n\t\tparser.current().children.push(block);\r\n\t\tparser.stack.push(block);\r\n\r\n\t\tif (type === 'AwaitBlock') {\r\n\t\t\tlet child_block;\r\n\t\t\tif (await_block_shorthand) {\r\n\t\t\t\tblock.then.skip = false;\r\n\t\t\t\tchild_block = block.then;\r\n\t\t\t} else if (await_block_catch_shorthand) {\r\n\t\t\t\tblock.catch.skip = false;\r\n\t\t\t\tchild_block = block.catch;\r\n\t\t\t} else {\r\n\t\t\t\tblock.pending.skip = false;\r\n\t\t\t\tchild_block = block.pending;\r\n\t\t\t}\r\n\r\n\t\t\tchild_block.start = parser.index;\r\n\t\t\tparser.stack.push(child_block);\r\n\t\t}\r\n\t} else if (parser.eat('@html')) {\r\n\t\t// {@html content} tag\r\n\t\tparser.require_whitespace();\r\n\r\n\t\tconst expression = read_expression(parser);\r\n\r\n\t\tparser.allow_whitespace();\r\n\t\tparser.eat('}', true);\r\n\r\n\t\tparser.current().children.push({\r\n\t\t\tstart,\r\n\t\t\tend: parser.index,\r\n\t\t\ttype: 'RawMustacheTag',\r\n\t\t\texpression\r\n\t\t});\r\n\t} else if (parser.eat('@debug')) {\r\n\t\tlet identifiers;\r\n\r\n\t\t// Implies {@debug} which indicates \"debug all\"\r\n\t\tif (parser.read(regex_whitespace_with_closing_curly_brace)) {\r\n\t\t\tidentifiers = [];\r\n\t\t} else {\r\n\t\t\tconst expression = read_expression(parser);\r\n\r\n\t\t\tidentifiers = expression.type === 'SequenceExpression'\r\n\t\t\t\t? expression.expressions\r\n\t\t\t\t: [expression];\r\n\r\n\t\t\tidentifiers.forEach(node => {\r\n\t\t\t\tif (node.type !== 'Identifier') {\r\n\t\t\t\t\tparser.error(parser_errors.invalid_debug_args, node.start);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tparser.allow_whitespace();\r\n\t\t\tparser.eat('}', true);\r\n\t\t}\r\n\r\n\t\tparser.current().children.push({\r\n\t\t\tstart,\r\n\t\t\tend: parser.index,\r\n\t\t\ttype: 'DebugTag',\r\n\t\t\tidentifiers\r\n\t\t});\r\n\t} else if (parser.eat('@const')) {\r\n\t\t// {@const a = b}\r\n\t\tparser.require_whitespace();\r\n\r\n\t\tconst expression = read_expression(parser);\r\n\r\n\t\tif (!(expression.type === 'AssignmentExpression' && expression.operator === '=')) {\r\n\t\t\tparser.error({\r\n\t\t\t\tcode: 'invalid-const-args',\r\n\t\t\t\tmessage: '{@const ...} must be an assignment.'\r\n\t\t\t}, start);\r\n\t\t}\r\n\r\n\t\tparser.allow_whitespace();\r\n\t\tparser.eat('}', true);\r\n\r\n\t\tparser.current().children.push({\r\n\t\t\tstart,\r\n\t\t\tend: parser.index,\r\n\t\t\ttype: 'ConstTag',\r\n\t\t\texpression\r\n\t\t});\r\n\t} else {\r\n\t\tconst expression = read_expression(parser);\r\n\r\n\t\tparser.allow_whitespace();\r\n\t\tparser.eat('}', true);\r\n\r\n\t\tparser.current().children.push({\r\n\t\t\tstart,\r\n\t\t\tend: parser.index,\r\n\t\t\ttype: 'MustacheTag',\r\n\t\t\texpression\r\n\t\t});\r\n\t}\r\n}\r\n","import { isIdentifierStart, isIdentifierChar } from 'acorn';\r\nimport full_char_code_at from './full_char_code_at';\r\nimport { regex_starts_with_underscore, regex_ends_with_underscore } from './patterns';\r\n\r\nexport const reserved = new Set([\r\n\t'arguments',\r\n\t'await',\r\n\t'break',\r\n\t'case',\r\n\t'catch',\r\n\t'class',\r\n\t'const',\r\n\t'continue',\r\n\t'debugger',\r\n\t'default',\r\n\t'delete',\r\n\t'do',\r\n\t'else',\r\n\t'enum',\r\n\t'eval',\r\n\t'export',\r\n\t'extends',\r\n\t'false',\r\n\t'finally',\r\n\t'for',\r\n\t'function',\r\n\t'if',\r\n\t'implements',\r\n\t'import',\r\n\t'in',\r\n\t'instanceof',\r\n\t'interface',\r\n\t'let',\r\n\t'new',\r\n\t'null',\r\n\t'package',\r\n\t'private',\r\n\t'protected',\r\n\t'public',\r\n\t'return',\r\n\t'static',\r\n\t'super',\r\n\t'switch',\r\n\t'this',\r\n\t'throw',\r\n\t'true',\r\n\t'try',\r\n\t'typeof',\r\n\t'var',\r\n\t'void',\r\n\t'while',\r\n\t'with',\r\n\t'yield'\r\n]);\r\n\r\nexport function is_valid(str: string): boolean {\r\n\tlet i = 0;\r\n\r\n\twhile (i < str.length) {\r\n\t\tconst code = full_char_code_at(str, i);\r\n\t\tif (!(i === 0 ? isIdentifierStart : isIdentifierChar)(code, true)) return false;\r\n\r\n\t\ti += code <= 0xffff ? 1 : 2;\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\nconst regex_non_standard_characters = /[^a-zA-Z0-9_]+/g;\r\nconst regex_starts_with_number = /^[0-9]/;\r\n\r\nexport function sanitize(name: string) {\r\n\treturn name\r\n\t\t.replace(regex_non_standard_characters, '_')\r\n\t\t.replace(regex_starts_with_underscore, '')\r\n\t\t.replace(regex_ends_with_underscore, '')\r\n\t\t.replace(regex_starts_with_number, '_$&');\r\n}\r\n","function getLocator(source, options) {\n    if (options === void 0) { options = {}; }\n    var offsetLine = options.offsetLine || 0;\n    var offsetColumn = options.offsetColumn || 0;\n    var originalLines = source.split('\\n');\n    var start = 0;\n    var lineRanges = originalLines.map(function (line, i) {\n        var end = start + line.length + 1;\n        var range = { start: start, end: end, line: i };\n        start = end;\n        return range;\n    });\n    var i = 0;\n    function rangeContains(range, index) {\n        return range.start <= index && index < range.end;\n    }\n    function getLocation(range, index) {\n        return { line: offsetLine + range.line, column: offsetColumn + index - range.start, character: index };\n    }\n    function locate(search, startIndex) {\n        if (typeof search === 'string') {\n            search = source.indexOf(search, startIndex || 0);\n        }\n        var range = lineRanges[i];\n        var d = search >= range.end ? 1 : -1;\n        while (range) {\n            if (rangeContains(range, search))\n                return getLocation(range, search);\n            i += d;\n            range = lineRanges[i];\n        }\n    }\n    ;\n    return locate;\n}\nfunction locate(source, search, options) {\n    if (typeof options === 'number') {\n        throw new Error('locate takes a { startIndex, offsetLine, offsetColumn } object as the third argument');\n    }\n    return getLocator(source, options)(search, options && options.startIndex);\n}\n\nexport { getLocator, locate };","const regex_tabs = /^\\t+/;\r\n\r\nfunction tabs_to_spaces(str: string) {\r\n\treturn str.replace(regex_tabs, match => match.split('\\t').join('  '));\r\n}\r\n\r\nexport default function get_code_frame(\r\n\tsource: string,\r\n\tline: number,\r\n\tcolumn: number\r\n) {\r\n\tconst lines = source.split('\\n');\r\n\r\n\tconst frame_start = Math.max(0, line - 2);\r\n\tconst frame_end = Math.min(line + 3, lines.length);\r\n\r\n\tconst digits = String(frame_end + 1).length;\r\n\r\n\treturn lines\r\n\t\t.slice(frame_start, frame_end)\r\n\t\t.map((str, i) => {\r\n\t\t\tconst isErrorLine = frame_start + i === line;\r\n\t\t\tconst line_num = String(i + frame_start + 1).padStart(digits, ' ');\r\n\r\n\t\t\tif (isErrorLine) {\r\n\t\t\t\tconst indicator = ' '.repeat(digits + 2 + tabs_to_spaces(str.slice(0, column)).length) + '^';\r\n\t\t\t\treturn `${line_num}: ${tabs_to_spaces(str)}\\n${indicator}`;\r\n\t\t\t}\r\n\r\n\t\t\treturn `${line_num}: ${tabs_to_spaces(str)}`;\r\n\t\t})\r\n\t\t.join('\\n');\r\n}\r\n","import { locate } from 'locate-character';\r\nimport get_code_frame from './get_code_frame';\r\n\r\nclass CompileError extends Error {\r\n\tcode: string;\r\n\tstart: { line: number; column: number };\r\n\tend: { line: number; column: number };\r\n\tpos: number;\r\n\tfilename: string;\r\n\tframe: string;\r\n\r\n\ttoString() {\r\n\t\treturn `${this.message} (${this.start.line}:${this.start.column})\\n${this.frame}`;\r\n\t}\r\n}\r\n\r\nexport default function error(message: string, props: {\r\n\tname: string;\r\n\tcode: string;\r\n\tsource: string;\r\n\tfilename: string;\r\n\tstart: number;\r\n\tend?: number;\r\n}): never {\r\n\tconst error = new CompileError(message);\r\n\terror.name = props.name;\r\n\r\n\tconst start = locate(props.source, props.start, { offsetLine: 1 });\r\n\tconst end = locate(props.source, props.end || props.start, { offsetLine: 1 });\r\n\r\n\terror.code = props.code;\r\n\terror.start = start;\r\n\terror.end = end;\r\n\terror.pos = props.start;\r\n\terror.filename = props.filename;\r\n\r\n\terror.frame = get_code_frame(props.source, start.line - 1, start.column);\r\n\r\n\tthrow error;\r\n}\r\n","import { isIdentifierStart, isIdentifierChar } from 'acorn';\r\nimport fragment from './state/fragment';\r\nimport { regex_whitespace } from '../utils/patterns';\r\nimport { reserved } from '../utils/names';\r\nimport full_char_code_at from '../utils/full_char_code_at';\r\nimport { TemplateNode, Ast, ParserOptions, Fragment, Style, Script } from '../interfaces';\r\nimport error from '../utils/error';\r\nimport parser_errors from './errors';\r\n\r\ntype ParserState = (parser: Parser) => (ParserState | void);\r\n\r\ninterface LastAutoClosedTag {\r\n\ttag: string;\r\n\treason: string;\r\n\tdepth: number;\r\n}\r\n\r\nconst regex_position_indicator = / \\(\\d+:\\d+\\)$/;\r\n\r\nexport class Parser {\r\n\treadonly template: string;\r\n\treadonly filename?: string;\r\n\treadonly customElement: boolean;\r\n\treadonly css_mode: 'injected' | 'external' | 'none' | boolean;\r\n\r\n\tindex = 0;\r\n\tstack: TemplateNode[] = [];\r\n\r\n\thtml: Fragment;\r\n\tcss: Style[] = [];\r\n\tjs: Script[] = [];\r\n\tmeta_tags = {};\r\n\tlast_auto_closed_tag?: LastAutoClosedTag;\r\n\r\n\tconstructor(template: string, options: ParserOptions) {\r\n\t\tif (typeof template !== 'string') {\r\n\t\t\tthrow new TypeError('Template must be a string');\r\n\t\t}\r\n\r\n\t\tthis.template = template.trimRight();\r\n\t\tthis.filename = options.filename;\r\n\t\tthis.customElement = options.customElement;\r\n\t\tthis.css_mode = options.css;\r\n\r\n\t\tthis.html = {\r\n\t\t\tstart: null,\r\n\t\t\tend: null,\r\n\t\t\ttype: 'Fragment',\r\n\t\t\tchildren: []\r\n\t\t};\r\n\r\n\t\tthis.stack.push(this.html);\r\n\r\n\t\tlet state: ParserState = fragment;\r\n\r\n\t\twhile (this.index < this.template.length) {\r\n\t\t\tstate = state(this) || fragment;\r\n\t\t}\r\n\r\n\t\tif (this.stack.length > 1) {\r\n\t\t\tconst current = this.current();\r\n\r\n\t\t\tconst type = current.type === 'Element' ? `<${current.name}>` : 'Block';\r\n\t\t\tconst slug = current.type === 'Element' ? 'element' : 'block';\r\n\r\n\t\t\tthis.error({\r\n\t\t\t\tcode: `unclosed-${slug}`,\r\n\t\t\t\tmessage: `${type} was left open`\r\n\t\t\t}, current.start);\r\n\t\t}\r\n\r\n\t\tif (state !== fragment) {\r\n\t\t\tthis.error({\r\n\t\t\t\tcode: 'unexpected-eof',\r\n\t\t\t\tmessage: 'Unexpected end of input'\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.html.children.length) {\r\n\t\t\tlet start = this.html.children[0].start;\r\n\t\t\twhile (regex_whitespace.test(template[start])) start += 1;\r\n\r\n\t\t\tlet end = this.html.children[this.html.children.length - 1].end;\r\n\t\t\twhile (regex_whitespace.test(template[end - 1])) end -= 1;\r\n\r\n\t\t\tthis.html.start = start;\r\n\t\t\tthis.html.end = end;\r\n\t\t} else {\r\n\t\t\tthis.html.start = this.html.end = null;\r\n\t\t}\r\n\t}\r\n\r\n\tcurrent() {\r\n\t\treturn this.stack[this.stack.length - 1];\r\n\t}\r\n\r\n\tacorn_error(err: any) {\r\n\t\tthis.error({\r\n\t\t\tcode: 'parse-error',\r\n\t\t\tmessage: err.message.replace(regex_position_indicator, '')\r\n\t\t}, err.pos);\r\n\t}\r\n\r\n\terror({ code, message }: { code: string; message: string }, index = this.index) {\r\n\t\terror(message, {\r\n\t\t\tname: 'ParseError',\r\n\t\t\tcode,\r\n\t\t\tsource: this.template,\r\n\t\t\tstart: index,\r\n\t\t\tfilename: this.filename\r\n\t\t});\r\n\t}\r\n\r\n\teat(str: string, required?: boolean, error?: { code: string, message: string }) {\r\n\t\tif (this.match(str)) {\r\n\t\t\tthis.index += str.length;\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (required) {\r\n\t\t\tthis.error(error ||\r\n\t\t\t\t(this.index === this.template.length\r\n\t\t\t\t\t? parser_errors.unexpected_eof_token(str)\r\n\t\t\t\t\t: parser_errors.unexpected_token(str))\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tmatch(str: string) {\r\n\t\treturn this.template.slice(this.index, this.index + str.length) === str;\r\n\t}\r\n\r\n\tmatch_regex(pattern: RegExp) {\r\n\t\tconst match = pattern.exec(this.template.slice(this.index));\r\n\t\tif (!match || match.index !== 0) return null;\r\n\r\n\t\treturn match[0];\r\n\t}\r\n\r\n\tallow_whitespace() {\r\n\t\twhile (\r\n\t\t\tthis.index < this.template.length &&\r\n\t\t\tregex_whitespace.test(this.template[this.index])\r\n\t\t) {\r\n\t\t\tthis.index++;\r\n\t\t}\r\n\t}\r\n\r\n\tread(pattern: RegExp) {\r\n\t\tconst result = this.match_regex(pattern);\r\n\t\tif (result) this.index += result.length;\r\n\t\treturn result;\r\n\t}\r\n\r\n\tread_identifier(allow_reserved = false) {\r\n\t\tconst start = this.index;\r\n\r\n\t\tlet i = this.index;\r\n\r\n\t\tconst code = full_char_code_at(this.template, i);\r\n\t\tif (!isIdentifierStart(code, true)) return null;\r\n\r\n\t\ti += code <= 0xffff ? 1 : 2;\r\n\r\n\t\twhile (i < this.template.length) {\r\n\t\t\tconst code = full_char_code_at(this.template, i);\r\n\r\n\t\t\tif (!isIdentifierChar(code, true)) break;\r\n\t\t\ti += code <= 0xffff ? 1 : 2;\r\n\t\t}\r\n\r\n\t\tconst identifier = this.template.slice(this.index, this.index = i);\r\n\r\n\t\tif (!allow_reserved && reserved.has(identifier)) {\r\n\t\t\tthis.error({\r\n\t\t\t\tcode: 'unexpected-reserved-word',\r\n\t\t\t\tmessage: `'${identifier}' is a reserved word in JavaScript and cannot be used here`\r\n\t\t\t}, start);\r\n\t\t}\r\n\r\n\t\treturn identifier;\r\n\t}\r\n\r\n\tread_until(pattern: RegExp, error_message?: Parameters<Parser['error']>[0]) {\r\n\t\tif (this.index >= this.template.length) {\r\n\t\t\tthis.error(error_message || {\r\n\t\t\t\tcode: 'unexpected-eof',\r\n\t\t\t\tmessage: 'Unexpected end of input'\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst start = this.index;\r\n\t\tconst match = pattern.exec(this.template.slice(start));\r\n\r\n\t\tif (match) {\r\n\t\t\tthis.index = start + match.index;\r\n\t\t\treturn this.template.slice(start, this.index);\r\n\t\t}\r\n\r\n\t\tthis.index = this.template.length;\r\n\t\treturn this.template.slice(start);\r\n\t}\r\n\r\n\trequire_whitespace() {\r\n\t\tif (!regex_whitespace.test(this.template[this.index])) {\r\n\t\t\tthis.error({\r\n\t\t\t\tcode: 'missing-whitespace',\r\n\t\t\t\tmessage: 'Expected whitespace'\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.allow_whitespace();\r\n\t}\r\n}\r\n\r\nexport default function parse(\r\n\ttemplate: string,\r\n\toptions: ParserOptions = {}\r\n): Ast {\r\n\tconst parser = new Parser(template, options);\r\n\r\n\t// TODO we may want to allow multiple <style> tags —\r\n\t// one scoped, one global. for now, only allow one\r\n\tif (parser.css.length > 1) {\r\n\t\tparser.error(parser_errors.duplicate_style, parser.css[1].start);\r\n\t}\r\n\r\n\tconst instance_scripts = parser.js.filter(script => script.context === 'default');\r\n\tconst module_scripts = parser.js.filter(script => script.context === 'module');\r\n\r\n\tif (instance_scripts.length > 1) {\r\n\t\tparser.error(parser_errors.invalid_script_instance, instance_scripts[1].start);\r\n\t}\r\n\r\n\tif (module_scripts.length > 1) {\r\n\t\tparser.error(parser_errors.invalid_script_module, module_scripts[1].start);\r\n\t}\r\n\r\n\treturn {\r\n\t\thtml: parser.html,\r\n\t\tcss: parser.css[0],\r\n\t\tinstance: instance_scripts[0],\r\n\t\tmodule: module_scripts[0]\r\n\t};\r\n}\r\n","// All compiler warnings should be listed and accessed from here\r\n\r\nimport { ARIAPropertyDefinition } from 'aria-query';\r\n\r\n/**\r\n * @internal\r\n */\r\nexport default {\r\n\tcustom_element_no_tag: {\r\n\t\tcode: 'custom-element-no-tag',\r\n\t\tmessage: 'No custom element \\'tag\\' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. <svelte:options tag=\"my-thing\"/>. To hide this warning, use <svelte:options tag={null}/>'\r\n\t},\r\n\tunused_export_let: (component: string, property: string) => ({\r\n\t\tcode: 'unused-export-let',\r\n\t\tmessage: `${component} has unused export property '${property}'. If it is for external reference only, please consider using \\`export const ${property}\\``\r\n\t}),\r\n\tmodule_script_reactive_declaration: {\r\n\t\tcode: 'module-script-reactive-declaration',\r\n\t\tmessage: '$: has no effect in a module script'\r\n\t},\r\n\tnon_top_level_reactive_declaration: {\r\n\t\tcode: 'non-top-level-reactive-declaration',\r\n\t\tmessage: '$: has no effect outside of the top-level'\r\n\t},\r\n\tmodule_script_variable_reactive_declaration: (names: string[]) => ({\r\n\t\tcode: 'module-script-reactive-declaration',\r\n\t\tmessage: `${names.map(name => `\"${name}\"`).join(', ')} ${names.length > 1 ? 'are' : 'is'} declared in a module script and will not be reactive`\r\n\t}),\r\n\tmissing_declaration: (name: string, has_script: boolean) => ({\r\n\t\tcode: 'missing-declaration',\r\n\t\tmessage: `'${name}' is not defined` + (has_script ? '' : `. Consider adding a <script> block with 'export let ${name}' to declare a prop`)\r\n\t}),\r\n\tmissing_custom_element_compile_options: {\r\n\t\tcode: 'missing-custom-element-compile-options',\r\n\t\tmessage: \"The 'tag' option is used when generating a custom element. Did you forget the 'customElement: true' compile option?\"\r\n\t},\r\n\tcss_unused_selector: (selector: string) => ({\r\n\t\tcode: 'css-unused-selector',\r\n\t\tmessage: `Unused CSS selector \"${selector}\"`\r\n\t}),\r\n\tempty_block: {\r\n\t\tcode: 'empty-block',\r\n\t\tmessage: 'Empty block'\r\n\t},\r\n\treactive_component: (name: string) => ({\r\n\t\tcode: 'reactive-component',\r\n\t\tmessage: `<${name}/> will not be reactive if ${name} changes. Use <svelte:component this={${name}}/> if you want this reactivity.`\r\n\t}),\r\n\tcomponent_name_lowercase: (name: string) => ({\r\n\t\tcode: 'component-name-lowercase',\r\n\t\tmessage: `<${name}> will be treated as an HTML element unless it begins with a capital letter`\r\n\t}),\r\n\tavoid_is: {\r\n\t\tcode: 'avoid-is',\r\n\t\tmessage: 'The \\'is\\' attribute is not supported cross-browser and should be avoided'\r\n\t},\r\n\tinvalid_html_attribute: (name: string, suggestion: string) => ({\r\n\t\tcode: 'invalid-html-attribute',\r\n\t\tmessage: `'${name}' is not a valid HTML attribute. Did you mean '${suggestion}'?`\r\n\t}),\r\n\ta11y_aria_attributes: (name: string) => ({\r\n\t\tcode: 'a11y-aria-attributes',\r\n\t\tmessage: `A11y: <${name}> should not have aria-* attributes`\r\n\t}),\r\n\ta11y_incorrect_attribute_type: (schema: ARIAPropertyDefinition, attribute: string) => {\r\n\t\tlet message;\r\n\t\tswitch (schema.type) {\r\n\t\t\tcase 'boolean':\r\n\t\t\t\tmessage = `The value of '${attribute}' must be exactly one of true or false`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'id':\r\n\t\t\t\tmessage = `The value of '${attribute}' must be a string that represents a DOM element ID`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'idlist':\r\n\t\t\t\tmessage = `The value of '${attribute}' must be a space-separated list of strings that represent DOM element IDs`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'tristate':\r\n\t\t\t\tmessage = `The value of '${attribute}' must be exactly one of true, false, or mixed`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'token':\r\n\t\t\t\tmessage = `The value of '${attribute}' must be exactly one of ${(schema.values || []).join(', ')}`;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'tokenlist':\r\n\t\t\t\tmessage = `The value of '${attribute}' must be a space-separated list of one or more of ${(schema.values || []).join(', ')}`;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tmessage = `The value of '${attribute}' must be of type ${schema.type}`;\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tcode: 'a11y-incorrect-aria-attribute-type',\r\n\t\t\tmessage: `A11y: ${message}`\r\n\t\t};\r\n\t},\r\n\ta11y_unknown_aria_attribute: (attribute: string, suggestion?: string) => ({\r\n\t\tcode: 'a11y-unknown-aria-attribute',\r\n\t\tmessage: `A11y: Unknown aria attribute 'aria-${attribute}'` + (suggestion ? ` (did you mean '${suggestion}'?)` : '')\r\n\t}),\r\n\ta11y_hidden: (name: string) => ({\r\n\t\tcode: 'a11y-hidden',\r\n\t\tmessage: `A11y: <${name}> element should not be hidden`\r\n\t}),\r\n\ta11y_misplaced_role: (name: string) => ({\r\n\t\tcode: 'a11y-misplaced-role',\r\n\t\tmessage: `A11y: <${name}> should not have role attribute`\r\n\t}),\r\n\ta11y_unknown_role: (role: string | boolean, suggestion?: string) => ({\r\n\t\tcode: 'a11y-unknown-role',\r\n\t\tmessage: `A11y: Unknown role '${role}'` + (suggestion ? ` (did you mean '${suggestion}'?)` : '')\r\n\t}),\r\n\ta11y_no_abstract_role: (role: string | boolean) => ({\r\n\t\tcode: 'a11y-no-abstract-role',\r\n\t\tmessage: `A11y: Abstract role '${role}' is forbidden`\r\n\t}),\r\n\ta11y_no_redundant_roles: (role: string | boolean) => ({\r\n\t\tcode: 'a11y-no-redundant-roles',\r\n\t\tmessage: `A11y: Redundant role '${role}'`\r\n\t}),\r\n\ta11y_no_interactive_element_to_noninteractive_role: (role: string | boolean, element: string) => ({\r\n\t\tcode: 'a11y-no-interactive-element-to-noninteractive-role',\r\n\t\tmessage: `A11y: <${element}> cannot have role '${role}'`\r\n\t}),\r\n\ta11y_role_has_required_aria_props: (role: string, props: string[]) => ({\r\n\t\tcode: 'a11y-role-has-required-aria-props',\r\n\t\tmessage: `A11y: Elements with the ARIA role \"${role}\" must have the following attributes defined: ${props.map(name => `\"${name}\"`).join(', ')}`\r\n\t}),\r\n\ta11y_accesskey: {\r\n\t\tcode: 'a11y-accesskey',\r\n\t\tmessage: 'A11y: Avoid using accesskey'\r\n\t},\r\n\ta11y_autofocus: {\r\n\t\tcode: 'a11y-autofocus',\r\n\t\tmessage: 'A11y: Avoid using autofocus'\r\n\t},\r\n\ta11y_misplaced_scope: {\r\n\t\tcode: 'a11y-misplaced-scope',\r\n\t\tmessage: 'A11y: The scope attribute should only be used with <th> elements'\r\n\t},\r\n\ta11y_positive_tabindex: {\r\n\t\tcode: 'a11y-positive-tabindex',\r\n\t\tmessage: 'A11y: avoid tabindex values above zero'\r\n\t},\r\n\ta11y_invalid_attribute: (href_attribute: string, href_value: string) => ({\r\n\t\tcode: 'a11y-invalid-attribute',\r\n\t\tmessage: `A11y: '${href_value}' is not a valid ${href_attribute} attribute`\r\n\t}),\r\n\ta11y_missing_attribute: (name: string, article: string, sequence: string) => ({\r\n\t\tcode: 'a11y-missing-attribute',\r\n\t\tmessage: `A11y: <${name}> element should have ${article} ${sequence} attribute`\r\n\t}),\r\n\ta11y_img_redundant_alt: {\r\n\t\tcode: 'a11y-img-redundant-alt',\r\n\t\tmessage: 'A11y: Screenreaders already announce <img> elements as an image.'\r\n\t},\r\n\ta11y_label_has_associated_control: {\r\n\t\tcode: 'a11y-label-has-associated-control',\r\n\t\tmessage: 'A11y: A form label must be associated with a control.'\r\n\t},\r\n\ta11y_media_has_caption: {\r\n\t\tcode: 'a11y-media-has-caption',\r\n\t\tmessage: 'A11y: <video> elements must have a <track kind=\"captions\">'\r\n\t},\r\n\ta11y_distracting_elements: (name: string) => ({\r\n\t\tcode: 'a11y-distracting-elements',\r\n\t\tmessage: `A11y: Avoid <${name}> elements`\r\n\t}),\r\n\ta11y_structure_immediate: {\r\n\t\tcode: 'a11y-structure',\r\n\t\tmessage: 'A11y: <figcaption> must be an immediate child of <figure>'\r\n\t},\r\n\ta11y_structure_first_or_last: {\r\n\t\tcode: 'a11y-structure',\r\n\t\tmessage: 'A11y: <figcaption> must be first or last child of <figure>'\r\n\t},\r\n\ta11y_mouse_events_have_key_events: (event: string, accompanied_by: string) => ({\r\n\t\tcode: 'a11y-mouse-events-have-key-events',\r\n\t\tmessage: `A11y: on:${event} must be accompanied by on:${accompanied_by}`\r\n\t}),\r\n\ta11y_click_events_have_key_events: () => ({\r\n\t\tcode: 'a11y-click-events-have-key-events',\r\n\t\tmessage: 'A11y: visible, non-interactive elements with an on:click event must be accompanied by an on:keydown, on:keyup, or on:keypress event.'\r\n\t}),\r\n\ta11y_missing_content: (name: string) => ({\r\n\t\tcode: 'a11y-missing-content',\r\n\t\tmessage: `A11y: <${name}> element should have child content`\r\n\t}),\r\n\ta11y_no_noninteractive_tabindex: {\r\n\t\tcode: 'a11y-no-noninteractive-tabindex',\r\n\t\tmessage: 'A11y: noninteractive element cannot have positive tabIndex value'\r\n\t},\r\n\tredundant_event_modifier_for_touch: {\r\n\t\tcode: 'redundant-event-modifier',\r\n\t\tmessage: 'Touch event handlers that don\\'t use the \\'event\\' object are passive by default'\r\n\t},\r\n\tredundant_event_modifier_passive: {\r\n\t\tcode: 'redundant-event-modifier',\r\n\t\tmessage: 'The passive modifier only works with wheel and touch events'\r\n\t},\r\n\tinvalid_rest_eachblock_binding: (rest_element_name: string) => ({\r\n\t\tcode: 'invalid-rest-eachblock-binding',\r\n\t\tmessage: `...${rest_element_name} operator will create a new object and binding propagation with original object will not work`\r\n\t})\r\n};\r\n","import Block from '../../render_dom/Block';\r\nimport Component from '../../Component';\r\nimport Node from './Node';\r\nimport { INode } from '../interfaces';\r\nimport compiler_warnings from '../../compiler_warnings';\r\n\r\nconst regex_non_whitespace_characters = /[^ \\r\\n\\f\\v\\t]/;\r\n\r\nexport default class AbstractBlock extends Node {\r\n\tblock: Block;\r\n\tchildren: INode[];\r\n\r\n\tconstructor(component: Component, parent, scope, info: any) {\r\n\t\tsuper(component, parent, scope, info);\r\n\t}\r\n\r\n\twarn_if_empty_block() {\r\n\t\tif (!this.children || this.children.length > 1) return;\r\n\r\n\t\tconst child = this.children[0];\r\n\r\n\t\tif (!child || (child.type === 'Text' && !regex_non_whitespace_characters.test(child.data))) {\r\n\t\t\tthis.component.warn(this, compiler_warnings.empty_block);\r\n\t\t}\r\n\t}\r\n}\r\n","import { Node, Identifier } from 'estree';\r\n\r\nexport default function flatten_reference(node: Node) {\r\n\tconst nodes = [];\r\n\tconst parts = [];\r\n\t\r\n\twhile (node.type === 'MemberExpression') {\r\n\t\tnodes.unshift(node.property);\r\n\r\n\t\tif (!node.computed) {\r\n\t\t\tparts.unshift((node.property as Identifier).name);\r\n\t\t} else {\r\n\t\t\tconst computed_property = to_string(node.property);\r\n\t\t\tif (computed_property) {\r\n\t\t\t\tparts.unshift(`[${computed_property}]`);\r\n\t\t\t}\r\n\t\t}\r\n\t\tnode = node.object;\r\n\t}\r\n\r\n\tconst name = node.type === 'Identifier'\r\n\t\t? node.name\r\n\t\t: node.type === 'ThisExpression' ? 'this' : null;\r\n\r\n\tnodes.unshift(node);\r\n\r\n\tparts.unshift(name);\r\n\r\n\treturn { name, nodes, parts };\r\n}\r\n\r\nfunction to_string(node: Node) {\r\n\tswitch (node.type) {\r\n\t\tcase 'Literal':\r\n\t\t\treturn String(node.value);\r\n\t\tcase 'Identifier':\r\n\t\t\treturn node.name;\r\n\t}\r\n}\r\n","export const reserved_keywords = new Set(['$$props', '$$restProps', '$$slots']);\r\n\r\nexport function is_reserved_keyword(name) {\r\n\treturn reserved_keywords.has(name);\r\n}\r\n","import { nodes_match } from '../../utils/nodes_match';\r\nimport { Scope } from 'periscopic';\r\nimport { x } from 'code-red';\r\nimport { Node, Expression } from 'estree';\r\nimport Renderer from './Renderer';\r\nimport { Var } from '../../interfaces';\r\n\r\nexport function invalidate(renderer: Renderer, scope: Scope, node: Node, names: Set<string>, main_execution_context: boolean = false) {\r\n\tconst { component } = renderer;\r\n\r\n\tconst [head, ...tail] = Array.from(names)\r\n\t\t.filter(name => {\r\n\t\t\tconst owner = scope.find_owner(name);\r\n\t\t\treturn !owner || owner === component.instance_scope;\r\n\t\t})\r\n\t\t.map(name => component.var_lookup.get(name))\r\n\t\t.filter(variable =>\t{\r\n\t\t\treturn variable && (\r\n\t\t\t\t!variable.hoistable &&\r\n\t\t\t\t!variable.global &&\r\n\t\t\t\t!variable.module &&\r\n\t\t\t\t(\r\n\t\t\t\t\tvariable.referenced ||\r\n\t\t\t\t\tvariable.subscribable ||\r\n\t\t\t\t\tvariable.is_reactive_dependency ||\r\n\t\t\t\t\tvariable.export_name ||\r\n\t\t\t\t\tvariable.name[0] === '$'\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}) as Var[];\r\n\r\n\tfunction get_invalidated(variable: Var, node?: Expression) {\r\n\t\tif (main_execution_context && !variable.subscribable && variable.name[0] !== '$') {\r\n\t\t\treturn node;\r\n\t\t}\r\n\t\treturn renderer_invalidate(renderer, variable.name, undefined, main_execution_context);\r\n\t}\r\n\r\n\tif (!head) {\r\n\t\treturn node;\r\n\t}\r\n\r\n\tcomponent.has_reactive_assignments = true;\r\n\r\n\tif (node.type === 'AssignmentExpression' && node.operator === '=' && nodes_match(node.left, node.right) && tail.length === 0) {\r\n\t\treturn get_invalidated(head, node);\r\n\t}\r\n\r\n\tconst is_store_value = head.name[0] === '$' && head.name[1] !== '$';\r\n\tconst extra_args = tail.map(variable => get_invalidated(variable)).filter(Boolean);\r\n\r\n\tif (is_store_value) {\r\n\t\treturn x`@set_store_value(${head.name.slice(1)}, ${node}, ${head.name}, ${extra_args})`;\r\n\t}\r\n\r\n\tlet invalidate;\r\n\tif (!main_execution_context) {\r\n\t\tconst pass_value = (\r\n\t\t\textra_args.length > 0 ||\r\n\t\t\t(node.type === 'AssignmentExpression' && node.left.type !== 'Identifier') ||\r\n\t\t\t(node.type === 'UpdateExpression' && (!node.prefix || node.argument.type !== 'Identifier'))\r\n\t\t);\r\n\t\tif (pass_value) {\r\n\t\t\textra_args.unshift({\r\n\t\t\t\ttype: 'Identifier',\r\n\t\t\t\tname: head.name\r\n\t\t\t});\r\n\t\t}\r\n\t\tinvalidate = x`$$invalidate(${renderer.context_lookup.get(head.name).index}, ${node}, ${extra_args})`;\r\n\t} else {\r\n\t\t// skip `$$invalidate` if it is in the main execution context\r\n\t\tinvalidate = extra_args.length ? [node, ...extra_args] : node;\r\n\t}\r\n\r\n\tif (head.subscribable && head.reassigned) {\r\n\t\tconst subscribe = `$$subscribe_${head.name}`;\r\n\t\tinvalidate = x`${subscribe}(${invalidate})`;\r\n\t}\r\n\r\n\treturn invalidate;\r\n}\r\n\r\nexport function renderer_invalidate(renderer: Renderer, name: string, value?: unknown, main_execution_context: boolean = false) {\r\n\tconst variable = renderer.component.var_lookup.get(name);\r\n\r\n\tif (variable && (variable.subscribable && (variable.reassigned || variable.export_name))) {\r\n\t\tif (main_execution_context) {\r\n\t\t\treturn x`${`$$subscribe_${name}`}(${value || name})`;\r\n\t\t} else {\r\n\t\t\tconst member = renderer.context_lookup.get(name);\r\n\t\t\treturn x`${`$$subscribe_${name}`}($$invalidate(${member.index}, ${value || name}))`;\r\n\t\t}\r\n\t}\r\n\r\n\tif (name[0] === '$' && name[1] !== '$') {\r\n\t\treturn x`${name.slice(1)}.set(${value || name})`;\r\n\t}\r\n\r\n\tif (\r\n\t\tvariable && (\r\n\t\t\tvariable.module || (\r\n\t\t\t\t!variable.referenced &&\r\n\t\t\t\t!variable.is_reactive_dependency &&\r\n\t\t\t\t!variable.export_name &&\r\n\t\t\t\t!name.startsWith('$$')\r\n\t\t\t)\r\n\t\t)\r\n\t) {\r\n\t\treturn value || name;\r\n\t}\r\n\r\n\tif (value) {\r\n\t\tif (main_execution_context) {\r\n\t\t\treturn x`${value}`;\r\n\t\t} else {\r\n\t\t\tconst member = renderer.context_lookup.get(name);\r\n\t\t\treturn x`$$invalidate(${member.index}, ${value})`;\r\n\t\t}\r\n\t}\r\n\r\n\tif (main_execution_context) return;\r\n\r\n\t// if this is a reactive declaration, invalidate dependencies recursively\r\n\tconst deps = new Set([name]);\r\n\r\n\tdeps.forEach(name => {\r\n\t\tconst reactive_declarations = renderer.component.reactive_declarations.filter(x =>\r\n\t\t\tx.assignees.has(name)\r\n\t\t);\r\n\t\treactive_declarations.forEach(declaration => {\r\n\t\t\tdeclaration.dependencies.forEach(name => {\r\n\t\t\t\tdeps.add(name);\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n\r\n\t// TODO ideally globals etc wouldn't be here in the first place\r\n\tconst filtered = Array.from(deps).filter(n => renderer.context_lookup.has(n));\r\n\tif (!filtered.length) return null;\r\n\r\n\treturn filtered\r\n\t\t.map(n => x`$$invalidate(${renderer.context_lookup.get(n).index}, ${n})`)\r\n\t\t.reduce((lhs, rhs) => x`${lhs}, ${rhs}`);\r\n}\r\n","// adapted from klona v2.0.4 - https://github.com/lukeed/klona\r\n// (c) Luke Edwards, under MIT License\r\n\r\n// The sole modification is to skip function values in objects when cloning, so we don't break tests.\r\n\r\nexport function clone(val) {\r\n\tlet k, out, tmp;\r\n\r\n\tif (Array.isArray(val)) {\r\n\t\tout = Array(k = val.length);\r\n\t\twhile (k--) out[k] = (tmp = val[k]) && typeof tmp === 'object' ? clone(tmp) : tmp;\r\n\t\treturn out;\r\n\t}\r\n\r\n\tif (Object.prototype.toString.call(val) === '[object Object]') {\r\n\t\tout = {}; // null\r\n\t\tfor (k in val) {\r\n\t\t\tif (k === '__proto__') {\r\n\t\t\t\tObject.defineProperty(out, k, {\r\n\t\t\t\t\tvalue: clone(val[k]),\r\n\t\t\t\t\tconfigurable: true,\r\n\t\t\t\t\tenumerable: true,\r\n\t\t\t\t\twritable: true\r\n\t\t\t\t});\r\n\t\t\t} else if (typeof val[k] !== 'function') { // MODIFICATION: skip functions\r\n\t\t\t\tout[k] = (tmp = val[k]) && typeof tmp === 'object' ? clone(tmp) : tmp;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn out;\r\n\t}\r\n\r\n\treturn val;\r\n}\r\n","// All compiler errors should be listed and accessed from here\r\n\r\n/**\r\n * @internal\r\n */\r\nexport default {\r\n\tinvalid_binding_elements: (element: string, binding: string) => ({\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: `'${binding}' is not a valid binding on <${element}> elements`\r\n\t}),\r\n\tinvalid_binding_element_with: (elements: string, binding: string) => ({\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: `'${binding}' binding can only be used with ${elements}`\r\n\t}),\r\n\tinvalid_binding_on: (binding: string, element: string, post?: string) => ({\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: `'${binding}' is not a valid binding on ${element}` + (post || '')\r\n\t}),\r\n\tinvalid_binding_foreign: (binding: string) => ({\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: `'${binding}' is not a valid binding. Foreign elements only support bind:this`\r\n\t}),\r\n\tinvalid_binding_no_checkbox: (binding: string, is_radio: boolean) => ({\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: `'${binding}' binding can only be used with <input type=\"checkbox\">` + (is_radio ? ' — for <input type=\"radio\">, use \\'group\\' binding' : '')\r\n\t}),\r\n\tinvalid_binding: (binding: string) => ({\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: `'${binding}' is not a valid binding`\r\n\t}),\r\n\tinvalid_binding_window: (parts: string[]) => ({\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: `Bindings on <svelte:window> must be to top-level properties, e.g. '${parts[parts.length - 1]}' rather than '${parts.join('.')}'`\r\n\t}),\r\n\tinvalid_binding_let: {\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: 'Cannot bind to a variable declared with the let: directive'\r\n\t},\r\n\tinvalid_binding_await: {\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: 'Cannot bind to a variable declared with {#await ... then} or {:catch} blocks'\r\n\t},\r\n\tinvalid_binding_const: {\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: 'Cannot bind to a variable declared with {@const ...}'\r\n\t},\r\n\tinvalid_binding_writibale: {\r\n\t\tcode: 'invalid-binding',\r\n\t\tmessage: 'Cannot bind to a variable which is not writable'\r\n\t},\r\n\tbinding_undeclared: (name: string) => ({\r\n\t\tcode: 'binding-undeclared',\r\n\t\tmessage: `${name} is not declared`\r\n\t}),\r\n\tinvalid_type: {\r\n\t\tcode: 'invalid-type',\r\n\t\tmessage: '\\'type\\' attribute cannot be dynamic if input uses two-way binding'\r\n\t},\r\n\tmissing_type: {\r\n\t\tcode: 'missing-type',\r\n\t\tmessage: '\\'type\\' attribute must be specified'\r\n\t},\r\n\tdynamic_multiple_attribute: {\r\n\t\tcode: 'dynamic-multiple-attribute',\r\n\t\tmessage: '\\'multiple\\' attribute cannot be dynamic if select uses two-way binding'\r\n\t},\r\n\tmissing_contenteditable_attribute: {\r\n\t\tcode: 'missing-contenteditable-attribute',\r\n\t\tmessage: '\\'contenteditable\\' attribute is required for textContent and innerHTML two-way bindings'\r\n\t},\r\n\tdynamic_contenteditable_attribute: {\r\n\t\tcode: 'dynamic-contenteditable-attribute',\r\n\t\tmessage: '\\'contenteditable\\' attribute cannot be dynamic if element uses two-way binding'\r\n\t},\r\n\tinvalid_event_modifier_combination: (modifier1: string, modifier2: string) => ({\r\n\t\tcode: 'invalid-event-modifier',\r\n\t\tmessage: `The '${modifier1}' and '${modifier2}' modifiers cannot be used together`\r\n\t}),\r\n\tinvalid_event_modifier_legacy: (modifier: string) => ({\r\n\t\tcode: 'invalid-event-modifier',\r\n\t\tmessage: `The '${modifier}' modifier cannot be used in legacy mode`\r\n\t}),\r\n\tinvalid_event_modifier: (valid: string) => ({\r\n\t\tcode: 'invalid-event-modifier',\r\n\t\tmessage: `Valid event modifiers are ${valid}`\r\n\t}),\r\n\tinvalid_event_modifier_component: {\r\n\t\tcode: 'invalid-event-modifier',\r\n\t\tmessage: \"Event modifiers other than 'once' can only be used on DOM elements\"\r\n\t},\r\n\ttextarea_duplicate_value: {\r\n\t\tcode: 'textarea-duplicate-value',\r\n\t\tmessage: 'A <textarea> can have either a value attribute or (equivalently) child content, but not both'\r\n\t},\r\n\tillegal_attribute: (name: string) => ({\r\n\t\tcode: 'illegal-attribute',\r\n\t\tmessage: `'${name}' is not a valid attribute name`\r\n\t}),\r\n\tinvalid_slot_attribute: {\r\n\t\tcode: 'invalid-slot-attribute',\r\n\t\tmessage: 'slot attribute cannot have a dynamic value'\r\n\t},\r\n\tduplicate_slot_attribute: (name: string) => ({\r\n\t\tcode: 'duplicate-slot-attribute',\r\n\t\tmessage: `Duplicate '${name}' slot`\r\n\t}),\r\n\tinvalid_slotted_content: {\r\n\t\tcode: 'invalid-slotted-content',\r\n\t\tmessage: 'Element with a slot=\\'...\\' attribute must be a child of a component or a descendant of a custom element'\r\n\t},\r\n\tinvalid_attribute_head: {\r\n\t\tcode: 'invalid-attribute',\r\n\t\tmessage: '<svelte:head> should not have any attributes or directives'\r\n\t},\r\n\tinvalid_action: {\r\n\t\tcode: 'invalid-action',\r\n\t\tmessage: 'Actions can only be applied to DOM elements, not components'\r\n\t},\r\n\tinvalid_class: {\r\n\t\tcode: 'invalid-class',\r\n\t\tmessage: 'Classes can only be applied to DOM elements, not components'\r\n\t},\r\n\tinvalid_transition: {\r\n\t\tcode: 'invalid-transition',\r\n\t\tmessage: 'Transitions can only be applied to DOM elements, not components'\r\n\t},\r\n\tinvalid_let: {\r\n\t\tcode: 'invalid-let',\r\n\t\tmessage: 'let directive value must be an identifier or an object/array pattern'\r\n\t},\r\n\tinvalid_slot_directive: {\r\n\t\tcode: 'invalid-slot-directive',\r\n\t\tmessage: '<slot> cannot have directives'\r\n\t},\r\n\tdynamic_slot_name: {\r\n\t\tcode: 'dynamic-slot-name',\r\n\t\tmessage: '<slot> name cannot be dynamic'\r\n\t},\r\n\tinvalid_slot_name: {\r\n\t\tcode: 'invalid-slot-name',\r\n\t\tmessage: 'default is a reserved word — it cannot be used as a slot name'\r\n\t},\r\n\tinvalid_slot_attribute_value_missing: {\r\n\t\tcode: 'invalid-slot-attribute',\r\n\t\tmessage: 'slot attribute value is missing'\r\n\t},\r\n\tinvalid_slotted_content_fragment: {\r\n\t\tcode: 'invalid-slotted-content',\r\n\t\tmessage: '<svelte:fragment> must be a child of a component'\r\n\t},\r\n\tillegal_attribute_title: {\r\n\t\tcode: 'illegal-attribute',\r\n\t\tmessage: '<title> cannot have attributes'\r\n\t},\r\n\tillegal_structure_title: {\r\n\t\tcode: 'illegal-structure',\r\n\t\tmessage: '<title> can only contain text and {tags}'\r\n\t},\r\n\tduplicate_transition: (directive: string, parent_directive: string) => {\r\n\t\tfunction describe(_directive: string) {\r\n\t\t\treturn _directive === 'transition'\r\n\t\t\t\t? \"a 'transition'\"\r\n\t\t\t\t: `an '${_directive}'`;\r\n\t\t}\r\n\t\tconst message = directive === parent_directive\r\n\t\t\t? `An element can only have one '${directive}' directive`\r\n\t\t\t: `An element cannot have both ${describe(parent_directive)} directive and ${describe(directive)} directive`;\r\n\t\treturn {\r\n\t\t\tcode: 'duplicate-transition',\r\n\t\t\tmessage\r\n\t\t};\r\n\t},\r\n\tcontextual_store: {\r\n\t\tcode: 'contextual-store',\r\n\t\tmessage: 'Stores must be declared at the top level of the component (this may change in a future version of Svelte)'\r\n\t},\r\n\tdefault_export: {\r\n\t\tcode: 'default-export',\r\n\t\tmessage: 'A component cannot have a default export'\r\n\t},\r\n\tillegal_declaration: {\r\n\t\tcode: 'illegal-declaration',\r\n\t\tmessage: 'The $ prefix is reserved, and cannot be used for variable and import names'\r\n\t},\r\n\tillegal_subscription: {\r\n\t\tcode: 'illegal-subscription',\r\n\t\tmessage: 'Cannot reference store value inside <script context=\"module\">'\r\n\t},\r\n\tillegal_global: (name: string) => ({\r\n\t\tcode: 'illegal-global',\r\n\t\tmessage: `${name} is an illegal variable name`\r\n\t}),\r\n\tillegal_variable_declaration: {\r\n\t\tcode: 'illegal-variable-declaration',\r\n\t\tmessage: 'Cannot declare same variable name which is imported inside <script context=\"module\">'\r\n\t},\r\n\tcyclical_reactive_declaration: (cycle: string[]) => ({\r\n\t\tcode: 'cyclical-reactive-declaration',\r\n\t\tmessage: `Cyclical dependency detected: ${cycle.join(' → ')}`\r\n\t}),\r\n\tinvalid_tag_property: {\r\n\t\tcode: 'invalid-tag-property',\r\n\t\tmessage: \"tag name must be two or more words joined by the '-' character\"\r\n\t},\r\n\tinvalid_tag_attribute: {\r\n\t\tcode: 'invalid-tag-attribute',\r\n\t\tmessage: \"'tag' must be a string literal\"\r\n\t},\r\n\tinvalid_namespace_property: (namespace: string, suggestion?: string) => ({\r\n\t\tcode: 'invalid-namespace-property',\r\n\t\tmessage: `Invalid namespace '${namespace}'` + (suggestion ? ` (did you mean '${suggestion}'?)` : '')\r\n\t}),\r\n\tinvalid_namespace_attribute: {\r\n\t\tcode: 'invalid-namespace-attribute',\r\n\t\tmessage: \"The 'namespace' attribute must be a string literal representing a valid namespace\"\r\n\t},\r\n\tinvalid_attribute_value: (name: string) => ({\r\n\t\tcode: `invalid-${name}-value`,\r\n\t\tmessage: `${name} attribute must be true or false`\r\n\t}),\r\n\tinvalid_options_attribute_unknown: {\r\n\t\tcode: 'invalid-options-attribute',\r\n\t\tmessage: '<svelte:options> unknown attribute'\r\n\t},\r\n\tinvalid_options_attribute: {\r\n\t\tcode: 'invalid-options-attribute',\r\n\t\tmessage: \"<svelte:options> can only have static 'tag', 'namespace', 'accessors', 'immutable' and 'preserveWhitespace' attributes\"\r\n\t},\r\n\tcss_invalid_global: {\r\n\t\tcode: 'css-invalid-global',\r\n\t\tmessage: ':global(...) can be at the start or end of a selector sequence, but not in the middle'\r\n\t},\r\n\tcss_invalid_global_selector: {\r\n\t\tcode: 'css-invalid-global-selector',\r\n\t\tmessage: ':global(...) must contain a single selector'\r\n\t},\r\n\tcss_invalid_selector: (selector: string) => ({\r\n\t\tcode: 'css-invalid-selector',\r\n\t\tmessage: `Invalid selector \"${selector}\"`\r\n\t}),\r\n\tduplicate_animation: {\r\n\t\tcode: 'duplicate-animation',\r\n\t\tmessage: \"An element can only have one 'animate' directive\"\r\n\t},\r\n\tinvalid_animation_immediate: {\r\n\t\tcode: 'invalid-animation',\r\n\t\tmessage: 'An element that uses the animate directive must be the immediate child of a keyed each block'\r\n\t},\r\n\tinvalid_animation_key: {\r\n\t\tcode: 'invalid-animation',\r\n\t\tmessage: 'An element that uses the animate directive must be used inside a keyed each block. Did you forget to add a key to your each block?'\r\n\t},\r\n\tinvalid_animation_sole: {\r\n\t\tcode: 'invalid-animation',\r\n\t\tmessage: 'An element that uses the animate directive must be the sole child of a keyed each block'\r\n\t},\r\n\tinvalid_animation_dynamic_element: {\r\n\t\tcode: 'invalid-animation',\r\n\t\tmessage: '<svelte:element> cannot have a animate directive'\r\n\t},\r\n\tinvalid_directive_value: {\r\n\t\tcode: 'invalid-directive-value',\r\n\t\tmessage: 'Can only bind to an identifier (e.g. `foo`) or a member expression (e.g. `foo.bar` or `foo[baz]`)'\r\n\t},\r\n\tinvalid_const_placement: {\r\n\t\tcode: 'invalid-const-placement',\r\n\t\tmessage: '{@const} must be the immediate child of {#if}, {:else if}, {:else}, {#each}, {:then}, {:catch}, <svelte:fragment> or <Component>'\r\n\t},\r\n\tinvalid_const_declaration: (name: string) => ({\r\n\t\tcode: 'invalid-const-declaration',\r\n\t\tmessage: `'${name}' has already been declared`\r\n\t}),\r\n\tinvalid_const_update: (name: string) => ({\r\n\t\tcode: 'invalid-const-update',\r\n\t\tmessage: `'${name}' is declared using {@const ...} and is read-only`\r\n\t}),\r\n\tcyclical_const_tags: (cycle: string[]) => ({\r\n\t\tcode: 'cyclical-const-tags',\r\n\t\tmessage: `Cyclical dependency detected: ${cycle.join(' → ')}`\r\n\t}),\r\n\tinvalid_component_style_directive: {\r\n\t\tcode: 'invalid-component-style-directive',\r\n\t\tmessage: 'Style directives cannot be used on components'\r\n\t},\r\n\tinvalid_style_directive_modifier: (valid: string) => ({\r\n\t\tcode: 'invalid-style-directive-modifier',\r\n\t\tmessage: `Valid modifiers for style directives are: ${valid}`\r\n\t})\r\n};\r\n","import Component from '../../Component';\r\nimport { walk } from 'estree-walker';\r\nimport is_reference from 'is-reference';\r\nimport flatten_reference from '../../utils/flatten_reference';\r\nimport { create_scopes, Scope, extract_names } from '../../utils/scope';\r\nimport { sanitize } from '../../../utils/names';\r\nimport TemplateScope from './TemplateScope';\r\nimport get_object from '../../utils/get_object';\r\nimport Block from '../../render_dom/Block';\r\nimport is_dynamic from '../../render_dom/wrappers/shared/is_dynamic';\r\nimport { b } from 'code-red';\r\nimport { invalidate } from '../../render_dom/invalidate';\r\nimport { Node, FunctionExpression, Identifier } from 'estree';\r\nimport { INode } from '../interfaces';\r\nimport { is_reserved_keyword } from '../../utils/reserved_keywords';\r\nimport replace_object from '../../utils/replace_object';\r\nimport is_contextual from './is_contextual';\r\nimport EachBlock from '../EachBlock';\r\nimport { clone } from '../../../utils/clone';\r\nimport compiler_errors from '../../compiler_errors';\r\n\r\ntype Owner = INode;\r\n\r\nconst regex_contains_term_function_expression = /FunctionExpression/;\r\n\r\nexport default class Expression {\r\n\ttype: 'Expression' = 'Expression';\r\n\tcomponent: Component;\r\n\towner: Owner;\r\n\tnode: Node;\r\n\treferences: Set<string> = new Set();\r\n\tdependencies: Set<string> = new Set();\r\n\tcontextual_dependencies: Set<string> = new Set();\r\n\r\n\ttemplate_scope: TemplateScope;\r\n\tscope: Scope;\r\n\tscope_map: WeakMap<Node, Scope>;\r\n\r\n\tdeclarations: Array<(Node | Node[])> = [];\r\n\tuses_context = false;\r\n\r\n\tmanipulated: Node;\r\n\r\n\tconstructor(component: Component, owner: Owner, template_scope: TemplateScope, info: Node, lazy?: boolean) {\r\n\t\t// TODO revert to direct property access in prod?\r\n\t\tObject.defineProperties(this, {\r\n\t\t\tcomponent: {\r\n\t\t\t\tvalue: component\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.node = info;\r\n\t\tthis.template_scope = template_scope;\r\n\t\tthis.owner = owner;\r\n\r\n\t\tconst { dependencies, contextual_dependencies, references } = this;\r\n\r\n\t\tlet { map, scope } = create_scopes(info);\r\n\t\tthis.scope = scope;\r\n\t\tthis.scope_map = map;\r\n\r\n\t\tconst expression = this;\r\n\t\tlet function_expression;\r\n\r\n\t\t// discover dependencies, but don't change the code yet\r\n\t\twalk(info, {\r\n\t\t\tenter(node: any, parent: any, key: string) {\r\n\t\t\t\t// don't manipulate shorthand props twice\r\n\t\t\t\tif (key === 'key' && parent.shorthand) return;\r\n\t\t\t\t// don't manipulate `import.meta`, `new.target`\r\n\t\t\t\tif (node.type === 'MetaProperty') return this.skip();\r\n\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = map.get(node);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!function_expression && regex_contains_term_function_expression.test(node.type)) {\r\n\t\t\t\t\tfunction_expression = node;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (is_reference(node, parent)) {\r\n\t\t\t\t\tconst { name, nodes } = flatten_reference(node);\r\n\t\t\t\t\treferences.add(name);\r\n\r\n\t\t\t\t\tif (scope.has(name)) return;\r\n\r\n\t\t\t\t\tif (name[0] === '$') {\r\n\t\t\t\t\t\tconst store_name = name.slice(1);\r\n\t\t\t\t\t\tif (template_scope.names.has(store_name) || scope.has(store_name)) {\r\n\t\t\t\t\t\t\treturn component.error(node, compiler_errors.contextual_store);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (template_scope.is_let(name)) {\r\n\t\t\t\t\t\tif (!lazy) {\r\n\t\t\t\t\t\t\tcontextual_dependencies.add(name);\r\n\t\t\t\t\t\t\tdependencies.add(name);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (template_scope.names.has(name)) {\r\n\t\t\t\t\t\texpression.uses_context = true;\r\n\r\n\t\t\t\t\t\tcontextual_dependencies.add(name);\r\n\r\n\t\t\t\t\t\tconst owner = template_scope.get_owner(name);\r\n\t\t\t\t\t\tconst is_index = owner.type === 'EachBlock' && owner.key && name === owner.index;\r\n\r\n\t\t\t\t\t\tif (!lazy || is_index) {\r\n\t\t\t\t\t\t\ttemplate_scope.dependencies_for_name.get(name).forEach(name => dependencies.add(name));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (!lazy) {\r\n\t\t\t\t\t\t\tdependencies.add(name);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcomponent.add_reference(node, name);\r\n\t\t\t\t\t\tcomponent.warn_if_undefined(name, nodes[0], template_scope);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.skip();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// track any assignments from template expressions as mutable\r\n\t\t\t\tlet names;\r\n\t\t\t\tlet deep = false;\r\n\r\n\t\t\t\tif (function_expression) {\r\n\t\t\t\t\tif (node.type === 'AssignmentExpression') {\r\n\t\t\t\t\t\tdeep = node.left.type === 'MemberExpression';\r\n\t\t\t\t\t\tnames = extract_names(deep ? get_object(node.left) : node.left);\r\n\t\t\t\t\t} else if (node.type === 'UpdateExpression') {\r\n                        deep = node.argument.type === 'MemberExpression';\r\n\t\t\t\t\t\tnames = extract_names(get_object(node.argument));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (names) {\r\n\t\t\t\t\tnames.forEach(name => {\r\n\t\t\t\t\t\tif (template_scope.names.has(name)) {\r\n\t\t\t\t\t\t\tif (template_scope.is_const(name)) {\r\n\t\t\t\t\t\t\t\tcomponent.error(node, compiler_errors.invalid_const_update(name));\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\ttemplate_scope.dependencies_for_name.get(name).forEach(name => {\r\n\t\t\t\t\t\t\t\tconst variable = component.var_lookup.get(name);\r\n\t\t\t\t\t\t\t\tif (variable) variable[deep ? 'mutated' : 'reassigned'] = true;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tconst each_block = template_scope.get_owner(name);\r\n\t\t\t\t\t\t\t(each_block as EachBlock).has_binding = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcomponent.add_reference(node, name);\r\n\r\n\t\t\t\t\t\t\tconst variable = component.var_lookup.get(name);\r\n\r\n\t\t\t\t\t\t\tif (variable) {\r\n\t\t\t\t\t\t\t\tvariable[deep ? 'mutated' : 'reassigned'] = true;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tconst declaration: any = scope.find_owner(name)?.declarations.get(name);\r\n\r\n\t\t\t\t\t\t\tif (declaration) {\r\n\t\t\t\t\t\t\t\tif (declaration.kind === 'const' && !deep) {\r\n\t\t\t\t\t\t\t\t\tcomponent.error(node, {\r\n\t\t\t\t\t\t\t\t\t\tcode: 'assignment-to-const',\r\n\t\t\t\t\t\t\t\t\t\tmessage: 'You are assigning to a const'\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else if (variable && variable.writable === false && !deep) {\r\n\t\t\t\t\t\t\t\tcomponent.error(node, {\r\n\t\t\t\t\t\t\t\t\tcode: 'assignment-to-const',\r\n\t\t\t\t\t\t\t\t\tmessage: 'You are assigning to a const'\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tleave(node: Node) {\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = scope.parent;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (node === function_expression) {\r\n\t\t\t\t\tfunction_expression = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tdynamic_dependencies() {\r\n\t\treturn Array.from(this.dependencies).filter(name => {\r\n\t\t\tif (this.template_scope.is_let(name)) return true;\r\n\t\t\tif (is_reserved_keyword(name)) return true;\r\n\r\n\t\t\tconst variable = this.component.var_lookup.get(name);\r\n\t\t\treturn is_dynamic(variable);\r\n\t\t});\r\n\t}\r\n\r\n\t// TODO move this into a render-dom wrapper?\r\n\tmanipulate(block?: Block, ctx?: string | void) {\r\n\t\t// TODO ideally we wouldn't end up calling this method\r\n\t\t// multiple times\r\n\t\tif (this.manipulated) return this.manipulated;\r\n\r\n\t\tconst {\r\n\t\t\tcomponent,\r\n\t\t\tdeclarations,\r\n\t\t\tscope_map: map,\r\n\t\t\ttemplate_scope,\r\n\t\t\towner\r\n\t\t} = this;\r\n\t\tlet scope = this.scope;\r\n\r\n\t\tlet function_expression;\r\n\r\n\t\tlet dependencies: Set<string>;\r\n\t\tlet contextual_dependencies: Set<string>;\r\n\r\n\t\tconst node = walk(this.node, {\r\n\t\t\tenter(node: any, parent: any) {\r\n\t\t\t\tif (node.type === 'Property' && node.shorthand) {\r\n\t\t\t\t\tnode.value = clone(node.value);\r\n\t\t\t\t\tnode.shorthand = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = map.get(node);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (node.type === 'Identifier' && is_reference(node, parent)) {\r\n\t\t\t\t\tconst { name } = flatten_reference(node);\r\n\r\n\t\t\t\t\tif (scope.has(name)) return;\r\n\r\n\t\t\t\t\tif (function_expression) {\r\n\t\t\t\t\t\tif (template_scope.names.has(name)) {\r\n\t\t\t\t\t\t\tcontextual_dependencies.add(name);\r\n\r\n\t\t\t\t\t\t\ttemplate_scope.dependencies_for_name.get(name).forEach(dependency => {\r\n\t\t\t\t\t\t\t\tdependencies.add(dependency);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tdependencies.add(name);\r\n\t\t\t\t\t\t\tcomponent.add_reference(node, name); // TODO is this redundant/misplaced?\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (is_contextual(component, template_scope, name)) {\r\n\t\t\t\t\t\tconst reference = block.renderer.reference(node, ctx);\r\n\t\t\t\t\t\tthis.replace(reference);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.skip();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!function_expression) {\r\n\t\t\t\t\tif (node.type === 'AssignmentExpression') {\r\n\t\t\t\t\t\t// TODO should this be a warning/error? `<p>{foo = 1}</p>`\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression') {\r\n\t\t\t\t\t\tfunction_expression = node;\r\n\t\t\t\t\t\tdependencies = new Set();\r\n\t\t\t\t\t\tcontextual_dependencies = new Set();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tleave(node: Node, parent: Node) {\r\n\t\t\t\tif (map.has(node)) scope = scope.parent;\r\n\r\n\t\t\t\tif (node === function_expression) {\r\n\t\t\t\t\tconst id = component.get_unique_name(\r\n\t\t\t\t\t\tsanitize(get_function_name(node, owner))\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tconst declaration = b`const ${id} = ${node}`;\r\n\r\n\t\t\t\t\tif (owner.type === 'ConstTag') {\r\n\t\t\t\t\t\tlet child_scope = scope;\r\n\t\t\t\t\t\twalk(node, {\r\n\t\t\t\t\t\t\tenter(node: Node, parent: any) {\r\n\t\t\t\t\t\t\t\tif (map.has(node)) child_scope = map.get(node);\r\n\t\t\t\t\t\t\t\tif (node.type === 'Identifier' && is_reference(node, parent)) {\r\n\t\t\t\t\t\t\t\t\tif (child_scope.has(node.name)) return;\r\n\t\t\t\t\t\t\t\t\tthis.replace(block.renderer.reference(node, ctx));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tleave(node: Node) {\r\n\t\t\t\t\t\t\t\tif (map.has(node)) child_scope = child_scope.parent;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else if (dependencies.size === 0 && contextual_dependencies.size === 0) {\r\n\t\t\t\t\t\t// we can hoist this out of the component completely\r\n\t\t\t\t\t\tcomponent.fully_hoisted.push(declaration);\r\n\r\n\t\t\t\t\t\tthis.replace(id as any);\r\n\r\n\t\t\t\t\t\tcomponent.add_var(node, {\r\n\t\t\t\t\t\t\tname: id.name,\r\n\t\t\t\t\t\t\tinternal: true,\r\n\t\t\t\t\t\t\thoistable: true,\r\n\t\t\t\t\t\t\treferenced: true\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else if (contextual_dependencies.size === 0) {\r\n\t\t\t\t\t\t// function can be hoisted inside the component init\r\n\t\t\t\t\t\tcomponent.partly_hoisted.push(declaration);\r\n\r\n\t\t\t\t\t\tblock.renderer.add_to_context(id.name);\r\n\t\t\t\t\t\tthis.replace(block.renderer.reference(id));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// we need a combo block/init recipe\r\n\t\t\t\t\t\tconst deps = Array.from(contextual_dependencies);\r\n\t\t\t\t\t\tconst function_expression = node as FunctionExpression;\r\n\r\n\t\t\t\t\t\tconst has_args = function_expression.params.length > 0;\r\n\t\t\t\t\t\tfunction_expression.params = [\r\n\t\t\t\t\t\t\t...deps.map(name => ({ type: 'Identifier', name } as Identifier)),\r\n\t\t\t\t\t\t\t...function_expression.params\r\n\t\t\t\t\t\t];\r\n\r\n\t\t\t\t\t\tconst context_args = deps.map(name => block.renderer.reference(name));\r\n\r\n\t\t\t\t\t\tcomponent.partly_hoisted.push(declaration);\r\n\r\n\t\t\t\t\t\tblock.renderer.add_to_context(id.name);\r\n\t\t\t\t\t\tconst callee = block.renderer.reference(id);\r\n\r\n\t\t\t\t\t\tthis.replace(id as any);\r\n\r\n\t\t\t\t\t\tconst func_declaration = has_args\r\n\t\t\t\t\t\t\t? b`function ${id}(...args) {\r\n\t\t\t\t\t\t\t\treturn ${callee}(${context_args}, ...args);\r\n\t\t\t\t\t\t\t}`\r\n\t\t\t\t\t\t\t: b`function ${id}() {\r\n\t\t\t\t\t\t\t\treturn ${callee}(${context_args});\r\n\t\t\t\t\t\t\t}`;\r\n\r\n\t\t\t\t\t\tif (owner.type === 'Attribute' && owner.parent.name === 'slot') {\r\n\t\t\t\t\t\t\tconst dep_scopes = new Set<INode>(deps.map(name => template_scope.get_owner(name)));\r\n\t\t\t\t\t\t\t// find the nearest scopes\r\n\t\t\t\t\t\t\tlet node: INode = owner.parent;\r\n\t\t\t\t\t\t\twhile (node && !dep_scopes.has(node)) {\r\n\t\t\t\t\t\t\t\tnode = node.parent;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tconst func_expression = func_declaration[0];\r\n\r\n\t\t\t\t\t\t\tif (node.type === 'InlineComponent' || node.type === 'SlotTemplate') {\r\n\t\t\t\t\t\t\t\t// <Comp let:data />\r\n\t\t\t\t\t\t\t\tthis.replace(func_expression);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// {#each}, {#await}\r\n\t\t\t\t\t\t\t\tconst func_id = component.get_unique_name(id.name + '_func');\r\n\t\t\t\t\t\t\t\tblock.renderer.add_to_context(func_id.name, true);\r\n\t\t\t\t\t\t\t\t// rename #ctx -> child_ctx;\r\n\t\t\t\t\t\t\t\twalk(func_expression, {\r\n\t\t\t\t\t\t\t\t\tenter(node: Node) {\r\n\t\t\t\t\t\t\t\t\t\tif (node.type === 'Identifier' && node.name === '#ctx') {\r\n\t\t\t\t\t\t\t\t\t\t\tnode.name = 'child_ctx';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t// add to get_xxx_context\r\n\t\t\t\t\t\t\t\t// child_ctx[x] = function () { ... }\r\n\t\t\t\t\t\t\t\t(template_scope.get_owner(deps[0]) as EachBlock).contexts.push({\r\n\t\t\t\t\t\t\t\t\tkey: func_id,\r\n\t\t\t\t\t\t\t\t\tmodifier: () => func_expression,\r\n\t\t\t\t\t\t\t\t\tdefault_modifier: node => node\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\tthis.replace(block.renderer.reference(func_id));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tdeclarations.push(func_declaration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfunction_expression = null;\r\n\t\t\t\t\tdependencies = null;\r\n\t\t\t\t\tcontextual_dependencies = null;\r\n\r\n\t\t\t\t\tif (parent && parent.type === 'Property') {\r\n\t\t\t\t\t\tparent.method = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (node.type === 'AssignmentExpression' || node.type === 'UpdateExpression') {\r\n\t\t\t\t\tconst assignee = node.type === 'AssignmentExpression' ? node.left : node.argument;\r\n\r\n\t\t\t\t\tconst object_name = get_object(assignee).name;\r\n\r\n\t\t\t\t\tif (scope.has(object_name)) return;\r\n\r\n\t\t\t\t\t// normally (`a = 1`, `b.c = 2`), there'll be a single name\r\n\t\t\t\t\t// (a or b). In destructuring cases (`[d, e] = [e, d]`) there\r\n\t\t\t\t\t// may be more, in which case we need to tack the extra ones\r\n\t\t\t\t\t// onto the initial function call\r\n\t\t\t\t\tconst names = new Set(extract_names(assignee as Node));\r\n\r\n\t\t\t\t\tconst traced: Set<string> = new Set();\r\n\t\t\t\t\tnames.forEach(name => {\r\n\t\t\t\t\t\tconst dependencies = template_scope.dependencies_for_name.get(name);\r\n\t\t\t\t\t\tif (dependencies) {\r\n\t\t\t\t\t\t\tdependencies.forEach(name => traced.add(name));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\ttraced.add(name);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tconst context = block.bindings.get(object_name);\r\n\r\n\t\t\t\t\tif (context) {\r\n\t\t\t\t\t\t// for `{#each array as item}`\r\n\t\t\t\t\t\t// replace `item = 1` to `each_array[each_index] = 1`, this allow us to mutate the array\r\n\t\t\t\t\t\t// rather than mutating the local `item` variable\r\n\t\t\t\t\t\tconst { snippet, object, property } = context;\r\n\t\t\t\t\t\tconst replaced: any = replace_object(assignee, snippet);\r\n\t\t\t\t\t\tif (node.type === 'AssignmentExpression') {\r\n\t\t\t\t\t\t\tnode.left = replaced;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tnode.argument = replaced;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcontextual_dependencies.add(object.name);\r\n\t\t\t\t\t\tcontextual_dependencies.add(property.name);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.replace(invalidate(block.renderer, scope, node, traced));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (declarations.length > 0) {\r\n\t\t\tblock.maintain_context = true;\r\n\t\t\tdeclarations.forEach(declaration => {\r\n\t\t\t\tblock.chunks.init.push(declaration);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn (this.manipulated = node as Node);\r\n\t}\r\n}\r\n\r\nfunction get_function_name(_node, parent) {\r\n\tif (parent.type === 'EventHandler') {\r\n\t\treturn `${parent.name}_handler`;\r\n\t}\r\n\r\n\tif (parent.type === 'Action') {\r\n\t\treturn `${parent.name}_function`;\r\n\t}\r\n\r\n\treturn 'func';\r\n}\r\n","import { x } from 'code-red';\r\nimport { Node, Identifier, Expression } from 'estree';\r\nimport { walk } from 'estree-walker';\r\nimport is_reference, { NodeWithPropertyDefinition } from 'is-reference';\r\nimport { clone } from '../../../utils/clone';\r\nimport Component from '../../Component';\r\nimport flatten_reference from '../../utils/flatten_reference';\r\nimport TemplateScope from './TemplateScope';\r\n\r\nexport interface Context {\r\n\tkey: Identifier;\r\n\tname?: string;\r\n\tmodifier: (node: Node) => Node;\r\n\tdefault_modifier: (node: Node, to_ctx: (name: string) => Node) => Node;\r\n}\r\n\r\nexport function unpack_destructuring({\r\n\tcontexts,\r\n\tnode,\r\n\tmodifier = (node) => node,\r\n\tdefault_modifier = (node) => node,\r\n\tscope,\r\n\tcomponent,\r\n\tcontext_rest_properties\r\n}: {\r\n\tcontexts: Context[];\r\n\tnode: Node;\r\n\tmodifier?: Context['modifier'];\r\n\tdefault_modifier?: Context['default_modifier'];\r\n\tscope: TemplateScope;\r\n\tcomponent: Component;\r\n\tcontext_rest_properties: Map<string, Node>;\r\n}) {\r\n\tif (!node) return;\r\n\r\n\tif (node.type === 'Identifier') {\r\n\t\tcontexts.push({\r\n\t\t\tkey: node as Identifier,\r\n\t\t\tmodifier,\r\n\t\t\tdefault_modifier\r\n\t\t});\r\n\t} else if (node.type === 'RestElement') {\r\n\t\tcontexts.push({\r\n\t\t\tkey: node.argument as Identifier,\r\n\t\t\tmodifier,\r\n\t\t\tdefault_modifier\r\n\t\t});\r\n\t\tcontext_rest_properties.set((node.argument as Identifier).name, node);\r\n\t} else if (node.type === 'ArrayPattern') {\r\n\t\tnode.elements.forEach((element, i) => {\r\n\t\t\tif (element && element.type === 'RestElement') {\r\n\t\t\t\tunpack_destructuring({\r\n\t\t\t\t\tcontexts,\r\n\t\t\t\t\tnode: element,\r\n\t\t\t\t\tmodifier: (node) => x`${modifier(node)}.slice(${i})` as Node,\r\n\t\t\t\t\tdefault_modifier,\r\n\t\t\t\t\tscope,\r\n\t\t\t\t\tcomponent,\r\n\t\t\t\t\tcontext_rest_properties\r\n\t\t\t\t});\r\n\t\t\t\tcontext_rest_properties.set((element.argument as Identifier).name, element);\r\n\t\t\t} else if (element && element.type === 'AssignmentPattern') {\r\n\t\t\t\tconst n = contexts.length;\r\n\t\t\t\tmark_referenced(element.right, scope, component);\r\n\r\n\t\t\t\tunpack_destructuring({\r\n\t\t\t\t\tcontexts,\r\n\t\t\t\t\tnode: element.left,\r\n\t\t\t\t\tmodifier: (node) => x`${modifier(node)}[${i}]`,\r\n\t\t\t\t\tdefault_modifier: (node, to_ctx) =>\r\n\t\t\t\t\t\tx`${node} !== undefined ? ${node} : ${update_reference(\r\n\t\t\t\t\t\t\tcontexts,\r\n\t\t\t\t\t\t\tn,\r\n\t\t\t\t\t\t\telement.right,\r\n\t\t\t\t\t\t\tto_ctx\r\n\t\t\t\t\t\t)}` as Node,\r\n\t\t\t\t\tscope,\r\n\t\t\t\t\tcomponent,\r\n\t\t\t\t\tcontext_rest_properties\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tunpack_destructuring({\r\n\t\t\t\t\tcontexts,\r\n\t\t\t\t\tnode: element,\r\n\t\t\t\t\tmodifier: (node) => x`${modifier(node)}[${i}]` as Node,\r\n\t\t\t\t\tdefault_modifier,\r\n\t\t\t\t\tscope,\r\n\t\t\t\t\tcomponent,\r\n\t\t\t\t\tcontext_rest_properties\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t} else if (node.type === 'ObjectPattern') {\r\n\t\tconst used_properties = [];\r\n\r\n\t\tnode.properties.forEach((property) => {\r\n\t\t\tif (property.type === 'RestElement') {\r\n\t\t\t\tunpack_destructuring({\r\n\t\t\t\t\tcontexts,\r\n\t\t\t\t\tnode: property.argument,\r\n\t\t\t\t\tmodifier: (node) =>\r\n\t\t\t\t\t\tx`@object_without_properties(${modifier(\r\n\t\t\t\t\t\t\tnode\r\n\t\t\t\t\t\t)}, [${used_properties}])` as Node,\r\n\t\t\t\t\tdefault_modifier,\r\n\t\t\t\t\tscope,\r\n\t\t\t\t\tcomponent,\r\n\t\t\t\t\tcontext_rest_properties\r\n\t\t\t\t});\r\n\t\t\t\tcontext_rest_properties.set((property.argument as Identifier).name, property);\r\n\t\t\t} else {\r\n\t\t\t\tconst key = property.key as Identifier;\r\n\t\t\t\tconst value = property.value;\r\n\r\n\t\t\t\tused_properties.push(x`\"${key.name}\"`);\r\n\t\t\t\tif (value.type === 'AssignmentPattern') {\r\n\t\t\t\t\tconst n = contexts.length;\r\n\r\n\t\t\t\t\tmark_referenced(value.right, scope, component);\r\n\r\n\t\t\t\t\tunpack_destructuring({\r\n\t\t\t\t\t\tcontexts,\r\n\t\t\t\t\t\tnode: value.left,\r\n\t\t\t\t\t\tmodifier: (node) => x`${modifier(node)}.${key.name}`,\r\n\t\t\t\t\t\tdefault_modifier: (node, to_ctx) =>\r\n\t\t\t\t\t\t\tx`${node} !== undefined ? ${node} : ${update_reference(\r\n\t\t\t\t\t\t\t\tcontexts,\r\n\t\t\t\t\t\t\t\tn,\r\n\t\t\t\t\t\t\t\tvalue.right,\r\n\t\t\t\t\t\t\t\tto_ctx\r\n\t\t\t\t\t\t\t)}` as Node,\r\n\t\t\t\t\t\tscope,\r\n\t\t\t\t\t\tcomponent,\r\n\t\t\t\t\t\tcontext_rest_properties\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tunpack_destructuring({\r\n\t\t\t\t\t\tcontexts,\r\n\t\t\t\t\t\tnode: value,\r\n\t\t\t\t\t\tmodifier: (node) => x`${modifier(node)}.${key.name}` as Node,\r\n\t\t\t\t\t\tdefault_modifier,\r\n\t\t\t\t\t\tscope,\r\n\t\t\t\t\t\tcomponent,\r\n\t\t\t\t\t\tcontext_rest_properties\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nfunction update_reference(\r\n\tcontexts: Context[],\r\n\tn: number,\r\n\texpression: Expression,\r\n\tto_ctx: (name: string) => Node\r\n): Node {\r\n\tconst find_from_context = (node: Identifier) => {\r\n\t\tfor (let i = n; i < contexts.length; i++) {\r\n\t\t\tconst { key } = contexts[i];\r\n\t\t\tif (node.name === key.name) {\r\n\t\t\t\tthrow new Error(`Cannot access '${node.name}' before initialization`);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn to_ctx(node.name);\r\n\t};\r\n\r\n\tif (expression.type === 'Identifier') {\r\n\t\treturn find_from_context(expression);\r\n\t}\r\n\r\n\t// NOTE: avoid unnecessary deep clone?\r\n\texpression = clone(expression) as Expression;\r\n\twalk(expression, {\r\n\t\tenter(node, parent: Node) {\r\n\t\t\tif (\r\n\t\t\t\tis_reference(\r\n\t\t\t\t\tnode as NodeWithPropertyDefinition,\r\n\t\t\t\t\tparent as NodeWithPropertyDefinition\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\t\t\t\tthis.replace(find_from_context(node as Identifier));\r\n\t\t\t\tthis.skip();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\treturn expression;\r\n}\r\n\r\nfunction mark_referenced(\r\n\tnode: Node,\r\n\tscope: TemplateScope,\r\n\tcomponent: Component\r\n) {\r\n\twalk(node, {\r\n\t\tenter(node: any, parent: any) {\r\n\t\t\tif (is_reference(node, parent)) {\r\n\t\t\t\tconst { name } = flatten_reference(node);\r\n\t\t\t\tif (!scope.is_let(name) && !scope.names.has(name)) {\r\n\t\t\t\t\tcomponent.add_reference(node, name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}\r\n","import Node from './shared/Node';\r\nimport Expression from './shared/Expression';\r\nimport Component from '../Component';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { Context, unpack_destructuring } from './shared/Context';\r\nimport { ConstTag as ConstTagType } from '../../interfaces';\r\nimport { INodeAllowConstTag } from './interfaces';\r\nimport { walk } from 'estree-walker';\r\nimport { extract_identifiers } from 'periscopic';\r\nimport is_reference, { NodeWithPropertyDefinition } from 'is-reference';\r\nimport get_object from '../utils/get_object';\r\nimport compiler_errors from '../compiler_errors';\r\nimport { Node as ESTreeNode } from 'estree';\r\n\r\nconst allowed_parents = new Set(['EachBlock', 'CatchBlock', 'ThenBlock', 'InlineComponent', 'SlotTemplate', 'IfBlock', 'ElseBlock']);\r\n\r\nexport default class ConstTag extends Node {\r\n\ttype: 'ConstTag';\r\n\texpression: Expression;\r\n\tcontexts: Context[] = [];\r\n\tnode: ConstTagType;\r\n\tscope: TemplateScope;\r\n\tcontext_rest_properties: Map<string, ESTreeNode> = new Map();\r\n\r\n\tassignees: Set<string> = new Set();\r\n  dependencies: Set<string> = new Set();\r\n\r\n\tconstructor(component: Component, parent: INodeAllowConstTag, scope: TemplateScope, info: ConstTagType) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tif (!allowed_parents.has(parent.type)) {\r\n\t\t\tcomponent.error(info, compiler_errors.invalid_const_placement);\r\n\t\t}\r\n\t\tthis.node = info;\r\n\t\tthis.scope = scope;\r\n\r\n\t\tconst { assignees, dependencies } = this;\r\n\r\n\t\textract_identifiers(info.expression.left).forEach(({ name }) => {\r\n      assignees.add(name);\r\n\t\t\tconst owner = this.scope.get_owner(name);\r\n\t\t\tif (owner === parent) {\r\n\t\t\t\tcomponent.error(info, compiler_errors.invalid_const_declaration(name));\r\n\t\t\t}\r\n    });\r\n\r\n    walk(info.expression.right, {\r\n      enter(node, parent) {\r\n        if (is_reference(node as NodeWithPropertyDefinition, parent as NodeWithPropertyDefinition)) {\r\n          const identifier = get_object(node as any);\r\n          const { name } = identifier;\r\n          dependencies.add(name);\r\n        }\r\n      }\r\n    });\r\n\t}\r\n\r\n\tparse_expression() {\r\n\t\tunpack_destructuring({\r\n\t\t\tcontexts: this.contexts,\r\n\t\t\tnode: this.node.expression.left,\r\n\t\t\tscope: this.scope,\r\n\t\t\tcomponent: this.component,\r\n\t\t\tcontext_rest_properties: this.context_rest_properties\r\n\t\t});\r\n\t\tthis.expression = new Expression(this.component, this, this.scope, this.node.expression.right);\r\n\t\tthis.contexts.forEach(context => {\r\n\t\t\tconst owner = this.scope.get_owner(context.key.name);\r\n\t\t\tif (owner && owner.type === 'ConstTag' && owner.parent === this.parent) {\r\n\t\t\t\tthis.component.error(this.node, compiler_errors.invalid_const_declaration(context.key.name));\r\n\t\t\t}\r\n\t\t\tthis.scope.add(context.key.name, this.expression.dependencies, this);\r\n\t\t});\r\n\t}\r\n}\r\n","import Node from './shared/Node';\r\nimport PendingBlock from './PendingBlock';\r\nimport ThenBlock from './ThenBlock';\r\nimport CatchBlock from './CatchBlock';\r\nimport Expression from './shared/Expression';\r\nimport Component from '../Component';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { TemplateNode } from '../../interfaces';\r\nimport { Context, unpack_destructuring } from './shared/Context';\r\nimport { Node as ESTreeNode } from 'estree';\r\n\r\nexport default class AwaitBlock extends Node {\r\n\ttype: 'AwaitBlock';\r\n\texpression: Expression;\r\n\r\n\tthen_contexts: Context[];\r\n\tcatch_contexts: Context[];\r\n\r\n\tthen_node: ESTreeNode | null;\r\n\tcatch_node: ESTreeNode | null;\r\n\r\n\tpending: PendingBlock;\r\n\tthen: ThenBlock;\r\n\tcatch: CatchBlock;\r\n\r\n\tcontext_rest_properties: Map<string, ESTreeNode> = new Map();\r\n\r\n\tconstructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tthis.expression = new Expression(component, this, scope, info.expression);\r\n\r\n\t\tthis.then_node = info.value;\r\n\t\tthis.catch_node = info.error;\r\n\r\n\t\tif (this.then_node) {\r\n\t\t\tthis.then_contexts = [];\r\n\t\t\tunpack_destructuring({ contexts: this.then_contexts, node: info.value, scope, component, context_rest_properties: this.context_rest_properties });\r\n\t\t}\r\n\r\n\t\tif (this.catch_node) {\r\n\t\t\tthis.catch_contexts = [];\r\n\t\t\tunpack_destructuring({ contexts: this.catch_contexts, node: info.error, scope, component, context_rest_properties: this.context_rest_properties });\r\n\t\t}\r\n\r\n\t\tthis.pending = new PendingBlock(component, this, scope, info.pending);\r\n\t\tthis.then = new ThenBlock(component, this, scope, info.then);\r\n\t\tthis.catch = new CatchBlock(component, this, scope, info.catch);\r\n\t}\r\n}\r\n","import Node from './shared/Node';\r\nimport Expression from './shared/Expression';\r\nimport Component from '../Component';\r\nimport { sanitize } from '../../utils/names';\r\nimport { Identifier } from 'estree';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { TemplateNode } from '../../interfaces';\r\n\r\nconst regex_contains_term_function_expression = /FunctionExpression/;\r\n\r\nexport default class EventHandler extends Node {\r\n\ttype: 'EventHandler';\r\n\tname: string;\r\n\tmodifiers: Set<string>;\r\n\texpression: Expression;\r\n\thandler_name: Identifier;\r\n\tuses_context = false;\r\n\tcan_make_passive = false;\r\n\r\n\tconstructor(component: Component, parent: Node, template_scope: TemplateScope, info: TemplateNode) {\r\n\t\tsuper(component, parent, template_scope, info);\r\n\r\n\t\tthis.name = info.name;\r\n\t\tthis.modifiers = new Set(info.modifiers);\r\n\r\n\t\tif (info.expression) {\r\n\t\t\tthis.expression = new Expression(component, this, template_scope, info.expression);\r\n\t\t\tthis.uses_context = this.expression.uses_context;\r\n\r\n\t\t\tif (regex_contains_term_function_expression.test(info.expression.type) && info.expression.params.length === 0) {\r\n\t\t\t\t// TODO make this detection more accurate — if `event.preventDefault` isn't called, and\r\n\t\t\t\t// `event` is passed to another function, we can make it passive\r\n\t\t\t\tthis.can_make_passive = true;\r\n\t\t\t} else if (info.expression.type === 'Identifier') {\r\n\t\t\t\tlet node = component.node_for_declaration.get(info.expression.name);\r\n\r\n\t\t\t\tif (node) {\r\n\t\t\t\t\tif (node.type === 'VariableDeclaration') {\r\n\t\t\t\t\t\t// for `const handleClick = () => {...}`, we want the [arrow] function expression node\r\n\t\t\t\t\t\tconst declarator = node.declarations.find(d => (d.id as Identifier).name === info.expression.name);\r\n\t\t\t\t\t\tnode = declarator && declarator.init;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (node && (node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration' || node.type === 'ArrowFunctionExpression') && node.params.length === 0) {\r\n\t\t\t\t\t\tthis.can_make_passive = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.handler_name = component.get_unique_name(`${sanitize(this.name)}_handler`);\r\n\t\t}\r\n\t}\r\n\r\n\tget reassigned(): boolean {\r\n\t\tif (!this.expression) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tconst node = this.expression.node;\r\n\r\n\t\tif (regex_contains_term_function_expression.test(node.type)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn this.expression.dynamic_dependencies().length > 0;\r\n\t}\r\n}\r\n","import Node from './shared/Node';\r\nimport EventHandler from './EventHandler';\r\nimport Action from './Action';\r\nimport Component from '../Component';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { Element } from '../../interfaces';\r\n\r\nexport default class Body extends Node {\r\n\ttype: 'Body';\r\n\thandlers: EventHandler[] = [];\r\n\tactions: Action[] = [];\r\n\r\n\tconstructor(component: Component, parent: Node, scope: TemplateScope, info: Element) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tinfo.attributes.forEach((node) => {\r\n\t\t\tif (node.type === 'EventHandler') {\r\n\t\t\t\tthis.handlers.push(new EventHandler(component, this, scope, node));\r\n\t\t\t} else if (node.type === 'Action') {\r\n\t\t\t\tthis.actions.push(new Action(component, this, scope, node));\r\n\t\t\t} else {\r\n\t\t\t\t// TODO there shouldn't be anything else here...\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n","import ElseBlock from './ElseBlock';\r\nimport Expression from './shared/Expression';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport AbstractBlock from './shared/AbstractBlock';\r\nimport Element from './Element';\r\nimport ConstTag from './ConstTag';\r\nimport { Context, unpack_destructuring } from './shared/Context';\r\nimport { Node } from 'estree';\r\nimport Component from '../Component';\r\nimport { TemplateNode } from '../../interfaces';\r\nimport compiler_errors from '../compiler_errors';\r\nimport { INode } from './interfaces';\r\nimport get_const_tags from './shared/get_const_tags';\r\n\r\nexport default class EachBlock extends AbstractBlock {\r\n\ttype: 'EachBlock';\r\n\r\n\texpression: Expression;\r\n\tcontext_node: Node;\r\n\r\n\titerations: string;\r\n\tindex: string;\r\n\tcontext: string;\r\n\tkey: Expression;\r\n\tscope: TemplateScope;\r\n\tcontexts: Context[];\r\n\tconst_tags: ConstTag[];\r\n\thas_animation: boolean;\r\n\thas_binding = false;\r\n\thas_index_binding = false;\r\n\tcontext_rest_properties: Map<string, Node>;\r\n\telse?: ElseBlock;\r\n\r\n\tconstructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tthis.expression = new Expression(component, this, scope, info.expression);\r\n\t\tthis.context = info.context.name || 'each'; // TODO this is used to facilitate binding; currently fails with destructuring\r\n\t\tthis.context_node = info.context;\r\n\t\tthis.index = info.index;\r\n\r\n\t\tthis.scope = scope.child();\r\n\t\tthis.context_rest_properties = new Map();\r\n\t\tthis.contexts = [];\r\n\t\tunpack_destructuring({ contexts: this.contexts, node: info.context, scope, component, context_rest_properties: this.context_rest_properties });\r\n\r\n\t\tthis.contexts.forEach(context => {\r\n\t\t\tthis.scope.add(context.key.name, this.expression.dependencies, this);\r\n\t\t});\r\n\r\n\t\tif (this.index) {\r\n\t\t\t// index can only change if this is a keyed each block\r\n\t\t\tconst dependencies = info.key ? this.expression.dependencies : new Set([]);\r\n\t\t\tthis.scope.add(this.index, dependencies, this);\r\n\t\t}\r\n\r\n\t\tthis.key = info.key\r\n\t\t\t? new Expression(component, this, this.scope, info.key)\r\n\t\t\t: null;\r\n\r\n\t\tthis.has_animation = false;\r\n\r\n\t\t([this.const_tags, this.children] = get_const_tags(info.children, component, this, this));\r\n\r\n\t\tif (this.has_animation) {\r\n\t\t\tthis.children = this.children.filter(child => !isEmptyNode(child) && !isCommentNode(child));\r\n\r\n\t\t\tif (this.children.length !== 1) {\r\n\t\t\t\tconst child = this.children.find(child => !!(child as Element).animation);\r\n\t\t\t\tcomponent.error((child as Element).animation, compiler_errors.invalid_animation_sole);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.warn_if_empty_block();\r\n\r\n\t\tthis.else = info.else\r\n\t\t\t? new ElseBlock(component, this, this.scope, info.else)\r\n\t\t\t: null;\r\n\t}\r\n}\r\n\r\nfunction isEmptyNode(node: INode) {\r\n\treturn node.type === 'Text' && node.data.trim() === '';\r\n}\r\nfunction isCommentNode(node: INode) {\r\n\treturn node.type === 'Comment';\r\n}\r\n","export function string_literal(data: string) {\r\n\treturn {\r\n\t\ttype: 'Literal',\r\n\t\tvalue: data\r\n\t};\r\n}\r\n\r\nexport function escape(data: string, { only_escape_at_symbol = false } = {}) {\r\n\treturn data.replace(only_escape_at_symbol ? /@+/g : /(@+|#+)/g, (match: string) => {\r\n\t\treturn match + match[0];\r\n\t});\r\n}\r\n\r\nconst escaped = {\r\n\t'\"': '&quot;',\r\n\t\"'\": '&#39;',\r\n\t'&': '&amp;',\r\n\t'<': '&lt;',\r\n\t'>': '&gt;'\r\n};\r\n\r\nconst regex_html_characters_to_escape = /[\"'&<>]/g;\r\n\r\nexport function escape_html(html) {\r\n\treturn String(html).replace(regex_html_characters_to_escape, match => escaped[match]);\r\n}\r\n\r\nconst regex_template_characters_to_escape = /(\\${|`|\\\\)/g;\r\n\r\nexport function escape_template(str) {\r\n\treturn str.replace(regex_template_characters_to_escape, '\\\\$1');\r\n}\r\n","import Node from './shared/Node';\r\nimport get_object from '../utils/get_object';\r\nimport Expression from './shared/Expression';\r\nimport Component from '../Component';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { regex_dimensions } from '../../utils/patterns';\r\nimport { Node as ESTreeNode } from 'estree';\r\nimport { TemplateNode } from '../../interfaces';\r\nimport Element from './Element';\r\nimport InlineComponent from './InlineComponent';\r\nimport Window from './Window';\r\nimport { clone } from '../../utils/clone';\r\nimport compiler_errors from '../compiler_errors';\r\nimport compiler_warnings from '../compiler_warnings';\r\n\r\n// TODO this should live in a specific binding\r\nconst read_only_media_attributes = new Set([\r\n\t'duration',\r\n\t'buffered',\r\n\t'seekable',\r\n\t'played',\r\n\t'seeking',\r\n\t'ended',\r\n\t'videoHeight',\r\n\t'videoWidth'\r\n]);\r\n\r\nexport default class Binding extends Node {\r\n\ttype: 'Binding';\r\n\tname: string;\r\n\texpression: Expression;\r\n\traw_expression: ESTreeNode; // TODO exists only for bind:this — is there a more elegant solution?\r\n\tis_contextual: boolean;\r\n\tis_readonly: boolean;\r\n\r\n\tconstructor(component: Component, parent: Element | InlineComponent | Window, scope: TemplateScope, info: TemplateNode) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tif (info.expression.type !== 'Identifier' && info.expression.type !== 'MemberExpression') {\r\n\t\t\tcomponent.error(info, compiler_errors.invalid_directive_value);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.name = info.name;\r\n\t\tthis.expression = new Expression(component, this, scope, info.expression);\r\n\t\tthis.raw_expression = clone(info.expression);\r\n\r\n\t\tconst { name } = get_object(this.expression.node);\r\n\r\n\t\tthis.is_contextual = Array.from(this.expression.references).some(name => scope.names.has(name));\r\n\t\tif (this.is_contextual) this.validate_binding_rest_properties(scope);\r\n\r\n\t\t// make sure we track this as a mutable ref\r\n\t\tif (scope.is_let(name)) {\r\n\t\t\tcomponent.error(this, compiler_errors.invalid_binding_let);\r\n\t\t\treturn;\r\n\t\t} else if (scope.names.has(name)) {\r\n\t\t\tif (scope.is_await(name)) {\r\n\t\t\t\tcomponent.error(this, compiler_errors.invalid_binding_await);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (scope.is_const(name)) {\r\n\t\t\t\tcomponent.error(this, compiler_errors.invalid_binding_const);\r\n\t\t\t}\r\n\r\n\t\t\tscope.dependencies_for_name.get(name).forEach(name => {\r\n\t\t\t\tconst variable = component.var_lookup.get(name);\r\n\t\t\t\tif (variable) {\r\n\t\t\t\t\tvariable.mutated = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconst variable = component.var_lookup.get(name);\r\n\r\n\t\t\tif (!variable || variable.global) {\r\n\t\t\t\tcomponent.error(this.expression.node as any, compiler_errors.binding_undeclared(name));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvariable[this.expression.node.type === 'MemberExpression' ? 'mutated' : 'reassigned'] = true;\r\n\r\n\t\t\tif (info.expression.type === 'Identifier' && !variable.writable) {\r\n\t\t\t\tcomponent.error(this.expression.node as any, compiler_errors.invalid_binding_writibale);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst type = parent.get_static_attribute_value('type');\r\n\r\n\t\tthis.is_readonly =\r\n\t\t\tregex_dimensions.test(this.name) ||\r\n\t\t\t(isElement(parent) &&\r\n\t\t\t\t((parent.is_media_node() && read_only_media_attributes.has(this.name)) ||\r\n\t\t\t\t\t(parent.name === 'input' && type === 'file')) /* TODO others? */);\r\n\t}\r\n\r\n\tis_readonly_media_attribute() {\r\n\t\treturn read_only_media_attributes.has(this.name);\r\n\t}\r\n\r\n\tvalidate_binding_rest_properties(scope: TemplateScope) {\r\n\t\tthis.expression.references.forEach(name => {\r\n\t\t\tconst each_block = scope.get_owner(name);\r\n\t\t\tif (each_block && each_block.type === 'EachBlock') {\r\n\t\t\t\tconst rest_node = each_block.context_rest_properties.get(name);\r\n\t\t\t\tif (rest_node) {\r\n\t\t\t\t\tthis.component.warn(rest_node as any, compiler_warnings.invalid_rest_eachblock_binding(name));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nfunction isElement(node: Node): node is Element {\r\n\treturn !!(node as any).is_media_node;\r\n}\r\n","import { TemplateElement, TemplateLiteral } from 'estree';\r\nimport { MustacheTag, Text } from '../../interfaces';\r\n\r\n/**\r\n * Transforms a list of Text and MustacheTags into a TemplateLiteral expression.\r\n * Start/End positions on the elements of the expression are not set.\r\n */\r\nexport function nodes_to_template_literal(value: Array<Text | MustacheTag>): TemplateLiteral {\r\n    const literal: TemplateLiteral  = {\r\n        type: 'TemplateLiteral',\r\n        expressions: [],\r\n        quasis: []\r\n    };\r\n\r\n    let quasi: TemplateElement  = {\r\n        type: 'TemplateElement',\r\n        value: { raw: '', cooked: null },\r\n        tail: false\r\n    };\r\n\r\n    value.forEach((node) => {\r\n        if (node.type === 'Text') {\r\n            quasi.value.raw += node.raw;\r\n        } else if (node.type === 'MustacheTag') {\r\n            literal.quasis.push(quasi);\r\n            literal.expressions.push(node.expression as any);\r\n            quasi = {\r\n                type: 'TemplateElement',\r\n                value: { raw: '', cooked: null },\r\n                tail: false\r\n            };\r\n        }\r\n    });\r\n    quasi.tail = true;\r\n    literal.quasis.push(quasi);\r\n    return literal;\r\n}\r\n","import { TemplateNode } from '../../interfaces';\r\nimport list from '../../utils/list';\r\nimport compiler_errors from '../compiler_errors';\r\nimport Component from '../Component';\r\nimport { nodes_to_template_literal } from '../utils/nodes_to_template_literal';\r\nimport Expression from './shared/Expression';\r\nimport Node from './shared/Node';\r\nimport TemplateScope from './shared/TemplateScope';\r\n\r\nconst valid_modifiers = new Set(['important']);\r\n\r\nexport default class StyleDirective extends Node {\r\n\ttype: 'StyleDirective';\r\n\tname: string;\r\n\tmodifiers: Set<string>;\r\n\texpression: Expression;\r\n\tshould_cache: boolean;\r\n\r\n\tconstructor(\r\n\t\tcomponent: Component,\r\n\t\tparent: Node,\r\n\t\tscope: TemplateScope,\r\n\t\tinfo: TemplateNode\r\n\t) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tthis.name = info.name;\r\n\t\tthis.modifiers = new Set(info.modifiers);\r\n\r\n\t\tfor (const modifier of this.modifiers) {\r\n\t\t\tif (!valid_modifiers.has(modifier)) {\r\n\t\t\t\tcomponent.error(\r\n\t\t\t\t\tthis,\r\n\t\t\t\t\tcompiler_errors.invalid_style_directive_modifier(\r\n\t\t\t\t\t\tlist([...valid_modifiers])\r\n\t\t\t\t\t)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Convert the value array to an expression so it's easier to handle\r\n\t\t// the StyleDirective going forward.\r\n\t\tif (info.value === true || (info.value.length === 1 && info.value[0].type === 'MustacheTag')) {\r\n\t\t\tconst identifier = info.value === true\r\n\t\t\t\t? {\r\n\t\t\t\t\ttype: 'Identifier',\r\n\t\t\t\t\tstart: info.end - info.name.length,\r\n\t\t\t\t\tend: info.end,\r\n\t\t\t\t\tname: info.name\r\n\t\t\t\t} as any\r\n\t\t\t\t: info.value[0].expression;\r\n\t\t\tthis.expression = new Expression(component, this, scope, identifier);\r\n\t\t\tthis.should_cache = false;\r\n\t\t} else {\r\n\t\t\tconst raw_expression = nodes_to_template_literal(info.value);\r\n\t\t\tthis.expression = new Expression(component, this, scope, raw_expression);\r\n\t\t\tthis.should_cache = raw_expression.expressions.length > 0;\r\n\t\t}\r\n\t}\r\n\r\n\tget important() {\r\n\t\treturn this.modifiers.has('important');\r\n\t}\r\n}\r\n","import Node from './shared/Node';\r\nimport Component from '../Component';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { INode } from './interfaces';\r\nimport { TemplateNode } from '../../interfaces';\r\nimport { regex_non_whitespace_character } from '../../utils/patterns';\r\n\r\n// Whitespace inside one of these elements will not result in\r\n// a whitespace node being created in any circumstances. (This\r\n// list is almost certainly very incomplete)\r\nconst elements_without_text = new Set([\r\n\t'audio',\r\n\t'datalist',\r\n\t'dl',\r\n\t'optgroup',\r\n\t'select',\r\n\t'video'\r\n]);\r\n\r\nconst regex_ends_with_svg = /svg$/;\r\n\r\nexport default class Text extends Node {\r\n\ttype: 'Text';\r\n\tdata: string;\r\n\tsynthetic: boolean;\r\n\r\n\tconstructor(component: Component, parent: INode, scope: TemplateScope, info: TemplateNode) {\r\n\t\tsuper(component, parent, scope, info);\r\n\t\tthis.data = info.data;\r\n\t\tthis.synthetic = info.synthetic || false;\r\n\t}\r\n\r\n\tshould_skip() {\r\n\t\tif (regex_non_whitespace_character.test(this.data)) return false;\r\n\r\n\t\tconst parent_element = this.find_nearest(/(?:Element|InlineComponent|SlotTemplate|Head)/);\r\n\t\tif (!parent_element) return false;\r\n\r\n\t\tif (parent_element.type === 'Head') return true;\r\n\t\tif (parent_element.type === 'InlineComponent') return parent_element.children.length === 1 && this === parent_element.children[0];\r\n\r\n\t\t// svg namespace exclusions\r\n\t\tif (regex_ends_with_svg.test(parent_element.namespace)) {\r\n\t\t\tif (this.prev && this.prev.type === 'Element' && this.prev.name === 'tspan') return false;\r\n\t\t}\r\n\r\n\t\treturn parent_element.namespace || elements_without_text.has(parent_element.name);\r\n\t}\r\n\r\n\tkeep_space(): boolean {\r\n\t\tif (this.component.component_options.preserveWhitespace) return true;\r\n\t\treturn this.within_pre();\r\n\t}\r\n\r\n\twithin_pre(): boolean {\r\n\t\tlet node = this.parent;\r\n\t\twhile (node) {\r\n\t\t\tif (node.type === 'Element' && node.name === 'pre') {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tnode = node.parent;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n}\r\n","// The `foreign` namespace covers all DOM implementations that aren't HTML5.\r\n// It opts out of HTML5-specific a11y checks and case-insensitive attribute names.\r\nexport const foreign = 'https://svelte.dev/docs#template-syntax-svelte-options';\r\nexport const html = 'http://www.w3.org/1999/xhtml';\r\nexport const mathml = 'http://www.w3.org/1998/Math/MathML';\r\nexport const svg = 'http://www.w3.org/2000/svg';\r\nexport const xlink = 'http://www.w3.org/1999/xlink';\r\nexport const xml = 'http://www.w3.org/XML/1998/namespace';\r\nexport const xmlns = 'http://www.w3.org/2000/xmlns';\r\n\r\nexport const valid_namespaces = [\r\n\t'foreign',\r\n\t'html',\r\n\t'mathml',\r\n\t'svg',\r\n\t'xlink',\r\n\t'xml',\r\n\t'xmlns',\r\n\tforeign,\r\n\thtml,\r\n\tmathml,\r\n\tsvg,\r\n\txlink,\r\n\txml,\r\n\txmlns\r\n];\r\n\r\nexport const namespaces = { foreign, html, mathml, svg, xlink, xml, xmlns } as const;\r\n","import Node from './shared/Node';\r\nimport Component from '../Component';\r\nimport { walk } from 'estree-walker';\r\nimport { BasePattern, Identifier } from 'estree';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { TemplateNode } from '../../interfaces';\r\nimport compiler_errors from '../compiler_errors';\r\n\r\nconst applicable = new Set(['Identifier', 'ObjectExpression', 'ArrayExpression', 'Property']);\r\n\r\nexport default class Let extends Node {\r\n\ttype: 'Let';\r\n\tname: Identifier;\r\n\tvalue: Identifier;\r\n\tnames: string[] = [];\r\n\r\n\tconstructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tthis.name = { type: 'Identifier', name: info.name };\r\n\r\n\t\tconst { names } = this;\r\n\r\n\t\tif (info.expression) {\r\n\t\t\tthis.value = info.expression;\r\n\r\n\t\t\twalk(info.expression, {\r\n\t\t\t\tenter(node: Identifier | BasePattern) {\r\n\t\t\t\t\tif (!applicable.has(node.type)) {\r\n\t\t\t\t\t\treturn component.error(node as any, compiler_errors.invalid_let);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (node.type === 'Identifier') {\r\n\t\t\t\t\t\tnames.push((node as Identifier).name);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// slightly unfortunate hack\r\n\t\t\t\t\tif (node.type === 'ArrayExpression') {\r\n\t\t\t\t\t\tnode.type = 'ArrayPattern';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (node.type === 'ObjectExpression') {\r\n\t\t\t\t\t\tnode.type = 'ObjectPattern';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tnames.push(this.name.name);\r\n\t\t}\r\n\t}\r\n}\r\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nfunction iteratorProxy() {\n  var values = this;\n  var index = 0;\n  var iter = {\n    '@@iterator': function iterator() {\n      return iter;\n    },\n    next: function next() {\n      if (index < values.length) {\n        var value = values[index];\n        index = index + 1;\n        return {\n          done: false,\n          value: value\n        };\n      } else {\n        return {\n          done: true\n        };\n      }\n    }\n  };\n  return iter;\n}\n\nvar _default = iteratorProxy;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = iterationDecorator;\n\nvar _iteratorProxy = _interopRequireDefault(require(\"./iteratorProxy\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction iterationDecorator(collection, entries) {\n  if (typeof Symbol === 'function' && _typeof(Symbol.iterator) === 'symbol') {\n    Object.defineProperty(collection, Symbol.iterator, {\n      value: _iteratorProxy.default.bind(entries)\n    });\n  }\n\n  return collection;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _iterationDecorator = _interopRequireDefault(require(\"./util/iterationDecorator\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar properties = [['aria-activedescendant', {\n  'type': 'id'\n}], ['aria-atomic', {\n  'type': 'boolean'\n}], ['aria-autocomplete', {\n  'type': 'token',\n  'values': ['inline', 'list', 'both', 'none']\n}], ['aria-busy', {\n  'type': 'boolean'\n}], ['aria-checked', {\n  'type': 'tristate'\n}], ['aria-colcount', {\n  type: 'integer'\n}], ['aria-colindex', {\n  type: 'integer'\n}], ['aria-colspan', {\n  type: 'integer'\n}], ['aria-controls', {\n  'type': 'idlist'\n}], ['aria-current', {\n  type: 'token',\n  values: ['page', 'step', 'location', 'date', 'time', true, false]\n}], ['aria-describedby', {\n  'type': 'idlist'\n}], ['aria-details', {\n  'type': 'id'\n}], ['aria-disabled', {\n  'type': 'boolean'\n}], ['aria-dropeffect', {\n  'type': 'tokenlist',\n  'values': ['copy', 'execute', 'link', 'move', 'none', 'popup']\n}], ['aria-errormessage', {\n  'type': 'id'\n}], ['aria-expanded', {\n  'type': 'boolean',\n  'allowundefined': true\n}], ['aria-flowto', {\n  'type': 'idlist'\n}], ['aria-grabbed', {\n  'type': 'boolean',\n  'allowundefined': true\n}], ['aria-haspopup', {\n  'type': 'token',\n  'values': [false, true, 'menu', 'listbox', 'tree', 'grid', 'dialog']\n}], ['aria-hidden', {\n  'type': 'boolean',\n  'allowundefined': true\n}], ['aria-invalid', {\n  'type': 'token',\n  'values': ['grammar', false, 'spelling', true]\n}], ['aria-keyshortcuts', {\n  type: 'string'\n}], ['aria-label', {\n  'type': 'string'\n}], ['aria-labelledby', {\n  'type': 'idlist'\n}], ['aria-level', {\n  'type': 'integer'\n}], ['aria-live', {\n  'type': 'token',\n  'values': ['assertive', 'off', 'polite']\n}], ['aria-modal', {\n  type: 'boolean'\n}], ['aria-multiline', {\n  'type': 'boolean'\n}], ['aria-multiselectable', {\n  'type': 'boolean'\n}], ['aria-orientation', {\n  'type': 'token',\n  'values': ['vertical', 'undefined', 'horizontal']\n}], ['aria-owns', {\n  'type': 'idlist'\n}], ['aria-placeholder', {\n  type: 'string'\n}], ['aria-posinset', {\n  'type': 'integer'\n}], ['aria-pressed', {\n  'type': 'tristate'\n}], ['aria-readonly', {\n  'type': 'boolean'\n}], ['aria-relevant', {\n  'type': 'tokenlist',\n  'values': ['additions', 'all', 'removals', 'text']\n}], ['aria-required', {\n  'type': 'boolean'\n}], ['aria-roledescription', {\n  type: 'string'\n}], ['aria-rowcount', {\n  type: 'integer'\n}], ['aria-rowindex', {\n  type: 'integer'\n}], ['aria-rowspan', {\n  type: 'integer'\n}], ['aria-selected', {\n  'type': 'boolean',\n  'allowundefined': true\n}], ['aria-setsize', {\n  'type': 'integer'\n}], ['aria-sort', {\n  'type': 'token',\n  'values': ['ascending', 'descending', 'none', 'other']\n}], ['aria-valuemax', {\n  'type': 'number'\n}], ['aria-valuemin', {\n  'type': 'number'\n}], ['aria-valuenow', {\n  'type': 'number'\n}], ['aria-valuetext', {\n  'type': 'string'\n}]];\nvar ariaPropsMap = {\n  entries: function entries() {\n    return properties;\n  },\n  forEach: function forEach(fn) {\n    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n    var _iterator = _createForOfIteratorHelper(properties),\n        _step;\n\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var _step$value = _slicedToArray(_step.value, 2),\n            key = _step$value[0],\n            values = _step$value[1];\n\n        fn.call(thisArg, values, key, properties);\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n  },\n  get: function get(key) {\n    var item = properties.find(function (tuple) {\n      return tuple[0] === key ? true : false;\n    });\n    return item && item[1];\n  },\n  has: function has(key) {\n    return !!this.get(key);\n  },\n  keys: function keys() {\n    return properties.map(function (_ref) {\n      var _ref2 = _slicedToArray(_ref, 1),\n          key = _ref2[0];\n\n      return key;\n    });\n  },\n  values: function values() {\n    return properties.map(function (_ref3) {\n      var _ref4 = _slicedToArray(_ref3, 2),\n          values = _ref4[1];\n\n      return values;\n    });\n  }\n};\n\nvar _default = (0, _iterationDecorator.default)(ariaPropsMap, ariaPropsMap.entries());\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _iterationDecorator = _interopRequireDefault(require(\"./util/iterationDecorator\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar dom = [['a', {\n  reserved: false\n}], ['abbr', {\n  reserved: false\n}], ['acronym', {\n  reserved: false\n}], ['address', {\n  reserved: false\n}], ['applet', {\n  reserved: false\n}], ['area', {\n  reserved: false\n}], ['article', {\n  reserved: false\n}], ['aside', {\n  reserved: false\n}], ['audio', {\n  reserved: false\n}], ['b', {\n  reserved: false\n}], ['base', {\n  reserved: true\n}], ['bdi', {\n  reserved: false\n}], ['bdo', {\n  reserved: false\n}], ['big', {\n  reserved: false\n}], ['blink', {\n  reserved: false\n}], ['blockquote', {\n  reserved: false\n}], ['body', {\n  reserved: false\n}], ['br', {\n  reserved: false\n}], ['button', {\n  reserved: false\n}], ['canvas', {\n  reserved: false\n}], ['caption', {\n  reserved: false\n}], ['center', {\n  reserved: false\n}], ['cite', {\n  reserved: false\n}], ['code', {\n  reserved: false\n}], ['col', {\n  reserved: true\n}], ['colgroup', {\n  reserved: true\n}], ['content', {\n  reserved: false\n}], ['data', {\n  reserved: false\n}], ['datalist', {\n  reserved: false\n}], ['dd', {\n  reserved: false\n}], ['del', {\n  reserved: false\n}], ['details', {\n  reserved: false\n}], ['dfn', {\n  reserved: false\n}], ['dialog', {\n  reserved: false\n}], ['dir', {\n  reserved: false\n}], ['div', {\n  reserved: false\n}], ['dl', {\n  reserved: false\n}], ['dt', {\n  reserved: false\n}], ['em', {\n  reserved: false\n}], ['embed', {\n  reserved: false\n}], ['fieldset', {\n  reserved: false\n}], ['figcaption', {\n  reserved: false\n}], ['figure', {\n  reserved: false\n}], ['font', {\n  reserved: false\n}], ['footer', {\n  reserved: false\n}], ['form', {\n  reserved: false\n}], ['frame', {\n  reserved: false\n}], ['frameset', {\n  reserved: false\n}], ['h1', {\n  reserved: false\n}], ['h2', {\n  reserved: false\n}], ['h3', {\n  reserved: false\n}], ['h4', {\n  reserved: false\n}], ['h5', {\n  reserved: false\n}], ['h6', {\n  reserved: false\n}], ['head', {\n  reserved: true\n}], ['header', {\n  reserved: false\n}], ['hgroup', {\n  reserved: false\n}], ['hr', {\n  reserved: false\n}], ['html', {\n  reserved: true\n}], ['i', {\n  reserved: false\n}], ['iframe', {\n  reserved: false\n}], ['img', {\n  reserved: false\n}], ['input', {\n  reserved: false\n}], ['ins', {\n  reserved: false\n}], ['kbd', {\n  reserved: false\n}], ['keygen', {\n  reserved: false\n}], ['label', {\n  reserved: false\n}], ['legend', {\n  reserved: false\n}], ['li', {\n  reserved: false\n}], ['link', {\n  reserved: true\n}], ['main', {\n  reserved: false\n}], ['map', {\n  reserved: false\n}], ['mark', {\n  reserved: false\n}], ['marquee', {\n  reserved: false\n}], ['menu', {\n  reserved: false\n}], ['menuitem', {\n  reserved: false\n}], ['meta', {\n  reserved: true\n}], ['meter', {\n  reserved: false\n}], ['nav', {\n  reserved: false\n}], ['noembed', {\n  reserved: true\n}], ['noscript', {\n  reserved: true\n}], ['object', {\n  reserved: false\n}], ['ol', {\n  reserved: false\n}], ['optgroup', {\n  reserved: false\n}], ['option', {\n  reserved: false\n}], ['output', {\n  reserved: false\n}], ['p', {\n  reserved: false\n}], ['param', {\n  reserved: true\n}], ['picture', {\n  reserved: true\n}], ['pre', {\n  reserved: false\n}], ['progress', {\n  reserved: false\n}], ['q', {\n  reserved: false\n}], ['rp', {\n  reserved: false\n}], ['rt', {\n  reserved: false\n}], ['rtc', {\n  reserved: false\n}], ['ruby', {\n  reserved: false\n}], ['s', {\n  reserved: false\n}], ['samp', {\n  reserved: false\n}], ['script', {\n  reserved: true\n}], ['section', {\n  reserved: false\n}], ['select', {\n  reserved: false\n}], ['small', {\n  reserved: false\n}], ['source', {\n  reserved: true\n}], ['spacer', {\n  reserved: false\n}], ['span', {\n  reserved: false\n}], ['strike', {\n  reserved: false\n}], ['strong', {\n  reserved: false\n}], ['style', {\n  reserved: true\n}], ['sub', {\n  reserved: false\n}], ['summary', {\n  reserved: false\n}], ['sup', {\n  reserved: false\n}], ['table', {\n  reserved: false\n}], ['tbody', {\n  reserved: false\n}], ['td', {\n  reserved: false\n}], ['textarea', {\n  reserved: false\n}], ['tfoot', {\n  reserved: false\n}], ['th', {\n  reserved: false\n}], ['thead', {\n  reserved: false\n}], ['time', {\n  reserved: false\n}], ['title', {\n  reserved: true\n}], ['tr', {\n  reserved: false\n}], ['track', {\n  reserved: true\n}], ['tt', {\n  reserved: false\n}], ['u', {\n  reserved: false\n}], ['ul', {\n  reserved: false\n}], ['var', {\n  reserved: false\n}], ['video', {\n  reserved: false\n}], ['wbr', {\n  reserved: false\n}], ['xmp', {\n  reserved: false\n}]];\nvar domMap = {\n  entries: function entries() {\n    return dom;\n  },\n  forEach: function forEach(fn) {\n    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n    var _iterator = _createForOfIteratorHelper(dom),\n        _step;\n\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var _step$value = _slicedToArray(_step.value, 2),\n            key = _step$value[0],\n            values = _step$value[1];\n\n        fn.call(thisArg, values, key, dom);\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n  },\n  get: function get(key) {\n    var item = dom.find(function (tuple) {\n      return tuple[0] === key ? true : false;\n    });\n    return item && item[1];\n  },\n  has: function has(key) {\n    return !!this.get(key);\n  },\n  keys: function keys() {\n    return dom.map(function (_ref) {\n      var _ref2 = _slicedToArray(_ref, 1),\n          key = _ref2[0];\n\n      return key;\n    });\n  },\n  values: function values() {\n    return dom.map(function (_ref3) {\n      var _ref4 = _slicedToArray(_ref3, 2),\n          values = _ref4[1];\n\n      return values;\n    });\n  }\n};\n\nvar _default = (0, _iterationDecorator.default)(domMap, domMap.entries());\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar commandRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'menuitem'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget']]\n};\nvar _default = commandRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar compositeRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-activedescendant': null,\n    'aria-disabled': null\n  },\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget']]\n};\nvar _default = compositeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar inputRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'input'\n    },\n    module: 'XForms'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget']]\n};\nvar _default = inputRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar landmarkRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = landmarkRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar rangeRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-valuemax': null,\n    'aria-valuemin': null,\n    'aria-valuenow': null\n  },\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure']]\n};\nvar _default = rangeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar roletypeRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: [],\n  prohibitedProps: [],\n  props: {\n    'aria-atomic': null,\n    'aria-busy': null,\n    'aria-controls': null,\n    'aria-current': null,\n    'aria-describedby': null,\n    'aria-details': null,\n    'aria-dropeffect': null,\n    'aria-flowto': null,\n    'aria-grabbed': null,\n    'aria-hidden': null,\n    'aria-keyshortcuts': null,\n    'aria-label': null,\n    'aria-labelledby': null,\n    'aria-live': null,\n    'aria-owns': null,\n    'aria-relevant': null,\n    'aria-roledescription': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'rel'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'role'\n    },\n    module: 'XHTML'\n  }, {\n    concept: {\n      name: 'type'\n    },\n    module: 'Dublin Core'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: []\n};\nvar _default = roletypeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar sectionRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: [],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'frontmatter'\n    },\n    module: 'DTB'\n  }, {\n    concept: {\n      name: 'level'\n    },\n    module: 'DTB'\n  }, {\n    concept: {\n      name: 'level'\n    },\n    module: 'SMIL'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure']]\n};\nvar _default = sectionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar sectionheadRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure']]\n};\nvar _default = sectionheadRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar selectRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-orientation': null\n  },\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite'], ['roletype', 'structure', 'section', 'group']]\n};\nvar _default = selectRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar structureRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: [],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype']]\n};\nvar _default = structureRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar widgetRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: [],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype']]\n};\nvar _default = widgetRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar windowRole = {\n  abstract: true,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-modal': null\n  },\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype']]\n};\nvar _default = windowRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _commandRole = _interopRequireDefault(require(\"./abstract/commandRole\"));\n\nvar _compositeRole = _interopRequireDefault(require(\"./abstract/compositeRole\"));\n\nvar _inputRole = _interopRequireDefault(require(\"./abstract/inputRole\"));\n\nvar _landmarkRole = _interopRequireDefault(require(\"./abstract/landmarkRole\"));\n\nvar _rangeRole = _interopRequireDefault(require(\"./abstract/rangeRole\"));\n\nvar _roletypeRole = _interopRequireDefault(require(\"./abstract/roletypeRole\"));\n\nvar _sectionRole = _interopRequireDefault(require(\"./abstract/sectionRole\"));\n\nvar _sectionheadRole = _interopRequireDefault(require(\"./abstract/sectionheadRole\"));\n\nvar _selectRole = _interopRequireDefault(require(\"./abstract/selectRole\"));\n\nvar _structureRole = _interopRequireDefault(require(\"./abstract/structureRole\"));\n\nvar _widgetRole = _interopRequireDefault(require(\"./abstract/widgetRole\"));\n\nvar _windowRole = _interopRequireDefault(require(\"./abstract/windowRole\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ariaAbstractRoles = [['command', _commandRole.default], ['composite', _compositeRole.default], ['input', _inputRole.default], ['landmark', _landmarkRole.default], ['range', _rangeRole.default], ['roletype', _roletypeRole.default], ['section', _sectionRole.default], ['sectionhead', _sectionheadRole.default], ['select', _selectRole.default], ['structure', _structureRole.default], ['widget', _widgetRole.default], ['window', _windowRole.default]];\nvar _default = ariaAbstractRoles;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar alertRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-atomic': 'true',\n    'aria-live': 'assertive'\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'alert'\n    },\n    module: 'XForms'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = alertRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar alertdialogRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'alert'\n    },\n    module: 'XForms'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'alert'], ['roletype', 'window', 'dialog']]\n};\nvar _default = alertdialogRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar applicationRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-activedescendant': null,\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'Device Independence Delivery Unit'\n    }\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure']]\n};\nvar _default = applicationRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar articleRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-posinset': null,\n    'aria-setsize': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'article'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'document']]\n};\nvar _default = articleRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar bannerRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      constraints: ['direct descendant of document'],\n      name: 'header'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = bannerRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar blockquoteRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = blockquoteRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar buttonRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-pressed': null\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'aria-pressed'\n      }, {\n        name: 'type',\n        value: 'checkbox'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'aria-expanded',\n        value: 'false'\n      }],\n      name: 'summary'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'aria-expanded',\n        value: 'true'\n      }],\n      constraints: ['direct descendant of details element with the open attribute defined'],\n      name: 'summary'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'type',\n        value: 'button'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'type',\n        value: 'image'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'type',\n        value: 'reset'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'type',\n        value: 'submit'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'button'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'trigger'\n    },\n    module: 'XForms'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'command']]\n};\nvar _default = buttonRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar captionRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: ['figure', 'grid', 'table'],\n  requiredContextRole: ['figure', 'grid', 'table'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = captionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar cellRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-colindex': null,\n    'aria-colspan': null,\n    'aria-rowindex': null,\n    'aria-rowspan': null\n  },\n  relatedConcepts: [{\n    concept: {\n      constraints: ['descendant of table'],\n      name: 'td'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: ['row'],\n  requiredContextRole: ['row'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = cellRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar checkboxRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-checked': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-invalid': null,\n    'aria-readonly': null,\n    'aria-required': null\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        name: 'type',\n        value: 'checkbox'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'option'\n    },\n    module: 'ARIA'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-checked': null\n  },\n  superClass: [['roletype', 'widget', 'input']]\n};\nvar _default = checkboxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar codeRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = codeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar columnheaderRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-sort': null\n  },\n  relatedConcepts: [{\n    attributes: [{\n      name: 'scope',\n      value: 'col'\n    }],\n    concept: {\n      name: 'th'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: ['row'],\n  requiredContextRole: ['row'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'cell'], ['roletype', 'structure', 'section', 'cell', 'gridcell'], ['roletype', 'widget', 'gridcell'], ['roletype', 'structure', 'sectionhead']]\n};\nvar _default = columnheaderRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar comboboxRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-activedescendant': null,\n    'aria-autocomplete': null,\n    'aria-errormessage': null,\n    'aria-invalid': null,\n    'aria-readonly': null,\n    'aria-required': null,\n    'aria-expanded': 'false',\n    'aria-haspopup': 'listbox'\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'email'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'search'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'tel'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'text'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'url'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'url'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['undefined'],\n        name: 'multiple'\n      }, {\n        constraints: ['undefined'],\n        name: 'size'\n      }],\n      name: 'select'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['undefined'],\n        name: 'multiple'\n      }, {\n        name: 'size',\n        value: 1\n      }],\n      name: 'select'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'select'\n    },\n    module: 'XForms'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-controls': null,\n    'aria-expanded': 'false'\n  },\n  superClass: [['roletype', 'widget', 'input']]\n};\nvar _default = comboboxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar complementaryRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'aside'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = complementaryRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar contentinfoRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      constraints: ['direct descendant of document'],\n      name: 'footer'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = contentinfoRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar definitionRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'dd'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = definitionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar deletionRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = deletionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar dialogRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'dialog'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'window']]\n};\nvar _default = dialogRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar directoryRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    module: 'DAISY Guide'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'list']]\n};\nvar _default = directoryRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar documentRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'Device Independence Delivery Unit'\n    }\n  }, {\n    concept: {\n      name: 'body'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure']]\n};\nvar _default = documentRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar emphasisRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = emphasisRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar feedRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['article']],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'list']]\n};\nvar _default = feedRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar figureRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'figure'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = figureRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar formRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'aria-label'\n      }],\n      name: 'form'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'aria-labelledby'\n      }],\n      name: 'form'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'name'\n      }],\n      name: 'form'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = formRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar genericRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'span'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'div'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure']]\n};\nvar _default = genericRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar gridRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-multiselectable': null,\n    'aria-readonly': null\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        name: 'role',\n        value: 'grid'\n      }],\n      name: 'table'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['row'], ['row', 'rowgroup']],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite'], ['roletype', 'structure', 'section', 'table']]\n};\nvar _default = gridRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar gridcellRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null,\n    'aria-readonly': null,\n    'aria-required': null,\n    'aria-selected': null\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        name: 'role',\n        value: 'gridcell'\n      }],\n      name: 'td'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: ['row'],\n  requiredContextRole: ['row'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'cell'], ['roletype', 'widget']]\n};\nvar _default = gridcellRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar groupRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-activedescendant': null,\n    'aria-disabled': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'details'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'fieldset'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'optgroup'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = groupRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar headingRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-level': '2'\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'h1'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'h2'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'h3'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'h4'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'h5'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'h6'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-level': '2'\n  },\n  superClass: [['roletype', 'structure', 'sectionhead']]\n};\nvar _default = headingRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar imgRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'alt'\n      }],\n      name: 'img'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['undefined'],\n        name: 'alt'\n      }],\n      name: 'img'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'imggroup'\n    },\n    module: 'DTB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = imgRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar insertionRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = insertionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar linkRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-expanded': null,\n    'aria-haspopup': null\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        name: 'href'\n      }],\n      name: 'a'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'href'\n      }],\n      name: 'area'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'href'\n      }],\n      name: 'link'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'command']]\n};\nvar _default = linkRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar listRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'menu'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'ol'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'ul'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['listitem']],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = listRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar listboxRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-invalid': null,\n    'aria-multiselectable': null,\n    'aria-readonly': null,\n    'aria-required': null,\n    'aria-orientation': 'vertical'\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        constraints: ['>1'],\n        name: 'size'\n      }, {\n        name: 'multiple'\n      }],\n      name: 'select'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['>1'],\n        name: 'size'\n      }],\n      name: 'select'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'multiple'\n      }],\n      name: 'select'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'datalist'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'list'\n    },\n    module: 'ARIA'\n  }, {\n    concept: {\n      name: 'select'\n    },\n    module: 'XForms'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['option', 'group'], ['option']],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite', 'select'], ['roletype', 'structure', 'section', 'group', 'select']]\n};\nvar _default = listboxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar listitemRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-level': null,\n    'aria-posinset': null,\n    'aria-setsize': null\n  },\n  relatedConcepts: [{\n    concept: {\n      constraints: ['direct descendant of ol, ul or menu'],\n      name: 'li'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'item'\n    },\n    module: 'XForms'\n  }],\n  requireContextRole: ['directory', 'list'],\n  requiredContextRole: ['directory', 'list'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = listitemRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar logRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-live': 'polite'\n  },\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = logRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar mainRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'main'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = mainRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar marqueeRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = marqueeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar mathRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'math'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = mathRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar menuRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-orientation': 'vertical'\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'MENU'\n    },\n    module: 'JAPI'\n  }, {\n    concept: {\n      name: 'list'\n    },\n    module: 'ARIA'\n  }, {\n    concept: {\n      name: 'select'\n    },\n    module: 'XForms'\n  }, {\n    concept: {\n      name: 'sidebar'\n    },\n    module: 'DTB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['menuitem', 'group'], ['menuitemradio', 'group'], ['menuitemcheckbox', 'group'], ['menuitem'], ['menuitemcheckbox'], ['menuitemradio']],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite', 'select'], ['roletype', 'structure', 'section', 'group', 'select']]\n};\nvar _default = menuRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar menubarRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-orientation': 'horizontal'\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'toolbar'\n    },\n    module: 'ARIA'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['menuitem', 'group'], ['menuitemradio', 'group'], ['menuitemcheckbox', 'group'], ['menuitem'], ['menuitemcheckbox'], ['menuitemradio']],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite', 'select', 'menu'], ['roletype', 'structure', 'section', 'group', 'select', 'menu']]\n};\nvar _default = menubarRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar menuitemRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-posinset': null,\n    'aria-setsize': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'MENU_ITEM'\n    },\n    module: 'JAPI'\n  }, {\n    concept: {\n      name: 'listitem'\n    },\n    module: 'ARIA'\n  }, {\n    concept: {\n      name: 'menuitem'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'option'\n    },\n    module: 'ARIA'\n  }],\n  requireContextRole: ['group', 'menu', 'menubar'],\n  requiredContextRole: ['group', 'menu', 'menubar'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'command']]\n};\nvar _default = menuitemRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar menuitemcheckboxRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'menuitem'\n    },\n    module: 'ARIA'\n  }],\n  requireContextRole: ['group', 'menu', 'menubar'],\n  requiredContextRole: ['group', 'menu', 'menubar'],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-checked': null\n  },\n  superClass: [['roletype', 'widget', 'input', 'checkbox'], ['roletype', 'widget', 'command', 'menuitem']]\n};\nvar _default = menuitemcheckboxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar menuitemradioRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'menuitem'\n    },\n    module: 'ARIA'\n  }],\n  requireContextRole: ['group', 'menu', 'menubar'],\n  requiredContextRole: ['group', 'menu', 'menubar'],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-checked': null\n  },\n  superClass: [['roletype', 'widget', 'input', 'checkbox', 'menuitemcheckbox'], ['roletype', 'widget', 'command', 'menuitem', 'menuitemcheckbox'], ['roletype', 'widget', 'input', 'radio']]\n};\nvar _default = menuitemradioRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar meterRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-valuetext': null,\n    'aria-valuemax': '100',\n    'aria-valuemin': '0'\n  },\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-valuenow': null\n  },\n  superClass: [['roletype', 'structure', 'range']]\n};\nvar _default = meterRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar navigationRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'nav'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = navigationRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar noneRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: [],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: []\n};\nvar _default = noneRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar noteRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = noteRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar optionRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-checked': null,\n    'aria-posinset': null,\n    'aria-setsize': null,\n    'aria-selected': 'false'\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'item'\n    },\n    module: 'XForms'\n  }, {\n    concept: {\n      name: 'listitem'\n    },\n    module: 'ARIA'\n  }, {\n    concept: {\n      name: 'option'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-selected': 'false'\n  },\n  superClass: [['roletype', 'widget', 'input']]\n};\nvar _default = optionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar paragraphRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = paragraphRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar presentationRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure']]\n};\nvar _default = presentationRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar progressbarRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-valuetext': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'progress'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'status'\n    },\n    module: 'ARIA'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'range'], ['roletype', 'widget']]\n};\nvar _default = progressbarRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar radioRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-checked': null,\n    'aria-posinset': null,\n    'aria-setsize': null\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        name: 'type',\n        value: 'radio'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-checked': null\n  },\n  superClass: [['roletype', 'widget', 'input']]\n};\nvar _default = radioRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar radiogroupRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-invalid': null,\n    'aria-readonly': null,\n    'aria-required': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'list'\n    },\n    module: 'ARIA'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['radio']],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite', 'select'], ['roletype', 'structure', 'section', 'group', 'select']]\n};\nvar _default = radiogroupRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar regionRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'aria-label'\n      }],\n      name: 'section'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['set'],\n        name: 'aria-labelledby'\n      }],\n      name: 'section'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'Device Independence Glossart perceivable unit'\n    }\n  }, {\n    concept: {\n      name: 'frame'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = regionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar rowRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-colindex': null,\n    'aria-expanded': null,\n    'aria-level': null,\n    'aria-posinset': null,\n    'aria-rowindex': null,\n    'aria-selected': null,\n    'aria-setsize': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'tr'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: ['grid', 'rowgroup', 'table', 'treegrid'],\n  requiredContextRole: ['grid', 'rowgroup', 'table', 'treegrid'],\n  requiredOwnedElements: [['cell'], ['columnheader'], ['gridcell'], ['rowheader']],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'group'], ['roletype', 'widget']]\n};\nvar _default = rowRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar rowgroupRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'tbody'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'tfoot'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'thead'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: ['grid', 'table', 'treegrid'],\n  requiredContextRole: ['grid', 'table', 'treegrid'],\n  requiredOwnedElements: [['row']],\n  requiredProps: {},\n  superClass: [['roletype', 'structure']]\n};\nvar _default = rowgroupRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar rowheaderRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-sort': null\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        name: 'scope',\n        value: 'row'\n      }],\n      name: 'th'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        name: 'scope',\n        value: 'rowgroup'\n      }],\n      name: 'th'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: ['row', 'rowgroup'],\n  requiredContextRole: ['row', 'rowgroup'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'cell'], ['roletype', 'structure', 'section', 'cell', 'gridcell'], ['roletype', 'widget', 'gridcell'], ['roletype', 'structure', 'sectionhead']]\n};\nvar _default = rowheaderRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar scrollbarRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-valuetext': null,\n    'aria-orientation': 'vertical',\n    'aria-valuemax': '100',\n    'aria-valuemin': '0'\n  },\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-controls': null,\n    'aria-valuenow': null\n  },\n  superClass: [['roletype', 'structure', 'range'], ['roletype', 'widget']]\n};\nvar _default = scrollbarRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar searchRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = searchRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar searchboxRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        constraints: ['undefined'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'search'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'input', 'textbox']]\n};\nvar _default = searchboxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar separatorRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-orientation': 'horizontal',\n    'aria-valuemax': '100',\n    'aria-valuemin': '0',\n    'aria-valuenow': null,\n    'aria-valuetext': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'hr'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure']]\n};\nvar _default = separatorRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar sliderRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-haspopup': null,\n    'aria-invalid': null,\n    'aria-readonly': null,\n    'aria-valuetext': null,\n    'aria-orientation': 'horizontal',\n    'aria-valuemax': '100',\n    'aria-valuemin': '0'\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        name: 'type',\n        value: 'range'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-valuenow': null\n  },\n  superClass: [['roletype', 'widget', 'input'], ['roletype', 'structure', 'range']]\n};\nvar _default = sliderRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar spinbuttonRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-invalid': null,\n    'aria-readonly': null,\n    'aria-required': null,\n    'aria-valuetext': null,\n    'aria-valuenow': '0'\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        name: 'type',\n        value: 'number'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite'], ['roletype', 'widget', 'input'], ['roletype', 'structure', 'range']]\n};\nvar _default = spinbuttonRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar statusRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-atomic': 'true',\n    'aria-live': 'polite'\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'output'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = statusRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar strongRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = strongRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar subscriptRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = subscriptRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar superscriptRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['prohibited'],\n  prohibitedProps: ['aria-label', 'aria-labelledby'],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = superscriptRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar switchRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'button'\n    },\n    module: 'ARIA'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-checked': null\n  },\n  superClass: [['roletype', 'widget', 'input', 'checkbox']]\n};\nvar _default = switchRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar tabRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-posinset': null,\n    'aria-setsize': null,\n    'aria-selected': 'false'\n  },\n  relatedConcepts: [],\n  requireContextRole: ['tablist'],\n  requiredContextRole: ['tablist'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'sectionhead'], ['roletype', 'widget']]\n};\nvar _default = tabRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar tableRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-colcount': null,\n    'aria-rowcount': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'table'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['row'], ['row', 'rowgroup']],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = tableRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar tablistRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-level': null,\n    'aria-multiselectable': null,\n    'aria-orientation': 'horizontal'\n  },\n  relatedConcepts: [{\n    module: 'DAISY',\n    concept: {\n      name: 'guide'\n    }\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['tab']],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite']]\n};\nvar _default = tablistRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar tabpanelRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = tabpanelRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar termRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'dfn'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'dt'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = termRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar textboxRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-activedescendant': null,\n    'aria-autocomplete': null,\n    'aria-errormessage': null,\n    'aria-haspopup': null,\n    'aria-invalid': null,\n    'aria-multiline': null,\n    'aria-placeholder': null,\n    'aria-readonly': null,\n    'aria-required': null\n  },\n  relatedConcepts: [{\n    concept: {\n      attributes: [{\n        constraints: ['undefined'],\n        name: 'type'\n      }, {\n        constraints: ['undefined'],\n        name: 'list'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['undefined'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'email'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['undefined'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'tel'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['undefined'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'text'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      attributes: [{\n        constraints: ['undefined'],\n        name: 'list'\n      }, {\n        name: 'type',\n        value: 'url'\n      }],\n      name: 'input'\n    },\n    module: 'HTML'\n  }, {\n    concept: {\n      name: 'input'\n    },\n    module: 'XForms'\n  }, {\n    concept: {\n      name: 'textarea'\n    },\n    module: 'HTML'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'input']]\n};\nvar _default = textboxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar timeRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = timeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar timerRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'status']]\n};\nvar _default = timerRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar toolbarRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-orientation': 'horizontal'\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'menubar'\n    },\n    module: 'ARIA'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'group']]\n};\nvar _default = toolbarRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar tooltipRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = tooltipRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar treeRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-invalid': null,\n    'aria-multiselectable': null,\n    'aria-required': null,\n    'aria-orientation': 'vertical'\n  },\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['treeitem', 'group'], ['treeitem']],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite', 'select'], ['roletype', 'structure', 'section', 'group', 'select']]\n};\nvar _default = treeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar treegridRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['row'], ['row', 'rowgroup']],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'composite', 'grid'], ['roletype', 'structure', 'section', 'table', 'grid'], ['roletype', 'widget', 'composite', 'select', 'tree'], ['roletype', 'structure', 'section', 'group', 'select', 'tree']]\n};\nvar _default = treegridRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar treeitemRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-expanded': null,\n    'aria-haspopup': null\n  },\n  relatedConcepts: [],\n  requireContextRole: ['group', 'tree'],\n  requiredContextRole: ['group', 'tree'],\n  requiredOwnedElements: [],\n  requiredProps: {\n    'aria-selected': null\n  },\n  superClass: [['roletype', 'structure', 'section', 'listitem'], ['roletype', 'widget', 'input', 'option']]\n};\nvar _default = treeitemRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _alertRole = _interopRequireDefault(require(\"./literal/alertRole\"));\n\nvar _alertdialogRole = _interopRequireDefault(require(\"./literal/alertdialogRole\"));\n\nvar _applicationRole = _interopRequireDefault(require(\"./literal/applicationRole\"));\n\nvar _articleRole = _interopRequireDefault(require(\"./literal/articleRole\"));\n\nvar _bannerRole = _interopRequireDefault(require(\"./literal/bannerRole\"));\n\nvar _blockquoteRole = _interopRequireDefault(require(\"./literal/blockquoteRole\"));\n\nvar _buttonRole = _interopRequireDefault(require(\"./literal/buttonRole\"));\n\nvar _captionRole = _interopRequireDefault(require(\"./literal/captionRole\"));\n\nvar _cellRole = _interopRequireDefault(require(\"./literal/cellRole\"));\n\nvar _checkboxRole = _interopRequireDefault(require(\"./literal/checkboxRole\"));\n\nvar _codeRole = _interopRequireDefault(require(\"./literal/codeRole\"));\n\nvar _columnheaderRole = _interopRequireDefault(require(\"./literal/columnheaderRole\"));\n\nvar _comboboxRole = _interopRequireDefault(require(\"./literal/comboboxRole\"));\n\nvar _complementaryRole = _interopRequireDefault(require(\"./literal/complementaryRole\"));\n\nvar _contentinfoRole = _interopRequireDefault(require(\"./literal/contentinfoRole\"));\n\nvar _definitionRole = _interopRequireDefault(require(\"./literal/definitionRole\"));\n\nvar _deletionRole = _interopRequireDefault(require(\"./literal/deletionRole\"));\n\nvar _dialogRole = _interopRequireDefault(require(\"./literal/dialogRole\"));\n\nvar _directoryRole = _interopRequireDefault(require(\"./literal/directoryRole\"));\n\nvar _documentRole = _interopRequireDefault(require(\"./literal/documentRole\"));\n\nvar _emphasisRole = _interopRequireDefault(require(\"./literal/emphasisRole\"));\n\nvar _feedRole = _interopRequireDefault(require(\"./literal/feedRole\"));\n\nvar _figureRole = _interopRequireDefault(require(\"./literal/figureRole\"));\n\nvar _formRole = _interopRequireDefault(require(\"./literal/formRole\"));\n\nvar _genericRole = _interopRequireDefault(require(\"./literal/genericRole\"));\n\nvar _gridRole = _interopRequireDefault(require(\"./literal/gridRole\"));\n\nvar _gridcellRole = _interopRequireDefault(require(\"./literal/gridcellRole\"));\n\nvar _groupRole = _interopRequireDefault(require(\"./literal/groupRole\"));\n\nvar _headingRole = _interopRequireDefault(require(\"./literal/headingRole\"));\n\nvar _imgRole = _interopRequireDefault(require(\"./literal/imgRole\"));\n\nvar _insertionRole = _interopRequireDefault(require(\"./literal/insertionRole\"));\n\nvar _linkRole = _interopRequireDefault(require(\"./literal/linkRole\"));\n\nvar _listRole = _interopRequireDefault(require(\"./literal/listRole\"));\n\nvar _listboxRole = _interopRequireDefault(require(\"./literal/listboxRole\"));\n\nvar _listitemRole = _interopRequireDefault(require(\"./literal/listitemRole\"));\n\nvar _logRole = _interopRequireDefault(require(\"./literal/logRole\"));\n\nvar _mainRole = _interopRequireDefault(require(\"./literal/mainRole\"));\n\nvar _marqueeRole = _interopRequireDefault(require(\"./literal/marqueeRole\"));\n\nvar _mathRole = _interopRequireDefault(require(\"./literal/mathRole\"));\n\nvar _menuRole = _interopRequireDefault(require(\"./literal/menuRole\"));\n\nvar _menubarRole = _interopRequireDefault(require(\"./literal/menubarRole\"));\n\nvar _menuitemRole = _interopRequireDefault(require(\"./literal/menuitemRole\"));\n\nvar _menuitemcheckboxRole = _interopRequireDefault(require(\"./literal/menuitemcheckboxRole\"));\n\nvar _menuitemradioRole = _interopRequireDefault(require(\"./literal/menuitemradioRole\"));\n\nvar _meterRole = _interopRequireDefault(require(\"./literal/meterRole\"));\n\nvar _navigationRole = _interopRequireDefault(require(\"./literal/navigationRole\"));\n\nvar _noneRole = _interopRequireDefault(require(\"./literal/noneRole\"));\n\nvar _noteRole = _interopRequireDefault(require(\"./literal/noteRole\"));\n\nvar _optionRole = _interopRequireDefault(require(\"./literal/optionRole\"));\n\nvar _paragraphRole = _interopRequireDefault(require(\"./literal/paragraphRole\"));\n\nvar _presentationRole = _interopRequireDefault(require(\"./literal/presentationRole\"));\n\nvar _progressbarRole = _interopRequireDefault(require(\"./literal/progressbarRole\"));\n\nvar _radioRole = _interopRequireDefault(require(\"./literal/radioRole\"));\n\nvar _radiogroupRole = _interopRequireDefault(require(\"./literal/radiogroupRole\"));\n\nvar _regionRole = _interopRequireDefault(require(\"./literal/regionRole\"));\n\nvar _rowRole = _interopRequireDefault(require(\"./literal/rowRole\"));\n\nvar _rowgroupRole = _interopRequireDefault(require(\"./literal/rowgroupRole\"));\n\nvar _rowheaderRole = _interopRequireDefault(require(\"./literal/rowheaderRole\"));\n\nvar _scrollbarRole = _interopRequireDefault(require(\"./literal/scrollbarRole\"));\n\nvar _searchRole = _interopRequireDefault(require(\"./literal/searchRole\"));\n\nvar _searchboxRole = _interopRequireDefault(require(\"./literal/searchboxRole\"));\n\nvar _separatorRole = _interopRequireDefault(require(\"./literal/separatorRole\"));\n\nvar _sliderRole = _interopRequireDefault(require(\"./literal/sliderRole\"));\n\nvar _spinbuttonRole = _interopRequireDefault(require(\"./literal/spinbuttonRole\"));\n\nvar _statusRole = _interopRequireDefault(require(\"./literal/statusRole\"));\n\nvar _strongRole = _interopRequireDefault(require(\"./literal/strongRole\"));\n\nvar _subscriptRole = _interopRequireDefault(require(\"./literal/subscriptRole\"));\n\nvar _superscriptRole = _interopRequireDefault(require(\"./literal/superscriptRole\"));\n\nvar _switchRole = _interopRequireDefault(require(\"./literal/switchRole\"));\n\nvar _tabRole = _interopRequireDefault(require(\"./literal/tabRole\"));\n\nvar _tableRole = _interopRequireDefault(require(\"./literal/tableRole\"));\n\nvar _tablistRole = _interopRequireDefault(require(\"./literal/tablistRole\"));\n\nvar _tabpanelRole = _interopRequireDefault(require(\"./literal/tabpanelRole\"));\n\nvar _termRole = _interopRequireDefault(require(\"./literal/termRole\"));\n\nvar _textboxRole = _interopRequireDefault(require(\"./literal/textboxRole\"));\n\nvar _timeRole = _interopRequireDefault(require(\"./literal/timeRole\"));\n\nvar _timerRole = _interopRequireDefault(require(\"./literal/timerRole\"));\n\nvar _toolbarRole = _interopRequireDefault(require(\"./literal/toolbarRole\"));\n\nvar _tooltipRole = _interopRequireDefault(require(\"./literal/tooltipRole\"));\n\nvar _treeRole = _interopRequireDefault(require(\"./literal/treeRole\"));\n\nvar _treegridRole = _interopRequireDefault(require(\"./literal/treegridRole\"));\n\nvar _treeitemRole = _interopRequireDefault(require(\"./literal/treeitemRole\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ariaLiteralRoles = [['alert', _alertRole.default], ['alertdialog', _alertdialogRole.default], ['application', _applicationRole.default], ['article', _articleRole.default], ['banner', _bannerRole.default], ['blockquote', _blockquoteRole.default], ['button', _buttonRole.default], ['caption', _captionRole.default], ['cell', _cellRole.default], ['checkbox', _checkboxRole.default], ['code', _codeRole.default], ['columnheader', _columnheaderRole.default], ['combobox', _comboboxRole.default], ['complementary', _complementaryRole.default], ['contentinfo', _contentinfoRole.default], ['definition', _definitionRole.default], ['deletion', _deletionRole.default], ['dialog', _dialogRole.default], ['directory', _directoryRole.default], ['document', _documentRole.default], ['emphasis', _emphasisRole.default], ['feed', _feedRole.default], ['figure', _figureRole.default], ['form', _formRole.default], ['generic', _genericRole.default], ['grid', _gridRole.default], ['gridcell', _gridcellRole.default], ['group', _groupRole.default], ['heading', _headingRole.default], ['img', _imgRole.default], ['insertion', _insertionRole.default], ['link', _linkRole.default], ['list', _listRole.default], ['listbox', _listboxRole.default], ['listitem', _listitemRole.default], ['log', _logRole.default], ['main', _mainRole.default], ['marquee', _marqueeRole.default], ['math', _mathRole.default], ['menu', _menuRole.default], ['menubar', _menubarRole.default], ['menuitem', _menuitemRole.default], ['menuitemcheckbox', _menuitemcheckboxRole.default], ['menuitemradio', _menuitemradioRole.default], ['meter', _meterRole.default], ['navigation', _navigationRole.default], ['none', _noneRole.default], ['note', _noteRole.default], ['option', _optionRole.default], ['paragraph', _paragraphRole.default], ['presentation', _presentationRole.default], ['progressbar', _progressbarRole.default], ['radio', _radioRole.default], ['radiogroup', _radiogroupRole.default], ['region', _regionRole.default], ['row', _rowRole.default], ['rowgroup', _rowgroupRole.default], ['rowheader', _rowheaderRole.default], ['scrollbar', _scrollbarRole.default], ['search', _searchRole.default], ['searchbox', _searchboxRole.default], ['separator', _separatorRole.default], ['slider', _sliderRole.default], ['spinbutton', _spinbuttonRole.default], ['status', _statusRole.default], ['strong', _strongRole.default], ['subscript', _subscriptRole.default], ['superscript', _superscriptRole.default], ['switch', _switchRole.default], ['tab', _tabRole.default], ['table', _tableRole.default], ['tablist', _tablistRole.default], ['tabpanel', _tabpanelRole.default], ['term', _termRole.default], ['textbox', _textboxRole.default], ['time', _timeRole.default], ['timer', _timerRole.default], ['toolbar', _toolbarRole.default], ['tooltip', _tooltipRole.default], ['tree', _treeRole.default], ['treegrid', _treegridRole.default], ['treeitem', _treeitemRole.default]];\nvar _default = ariaLiteralRoles;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docAbstractRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'abstract [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = docAbstractRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docAcknowledgmentsRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'acknowledgments [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docAcknowledgmentsRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docAfterwordRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'afterword [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docAfterwordRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docAppendixRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'appendix [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docAppendixRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docBacklinkRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'content'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'referrer [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'command', 'link']]\n};\nvar _default = docBacklinkRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docBiblioentryRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'EPUB biblioentry [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: ['doc-bibliography'],\n  requiredContextRole: ['doc-bibliography'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'listitem']]\n};\nvar _default = docBiblioentryRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docBibliographyRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'bibliography [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['doc-biblioentry']],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docBibliographyRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docBibliorefRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'biblioref [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'command', 'link']]\n};\nvar _default = docBibliorefRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docChapterRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'chapter [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docChapterRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docColophonRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'colophon [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = docColophonRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docConclusionRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'conclusion [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docConclusionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docCoverRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'cover [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'img']]\n};\nvar _default = docCoverRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docCreditRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'credit [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = docCreditRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docCreditsRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'credits [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docCreditsRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docDedicationRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'dedication [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = docDedicationRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docEndnoteRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'rearnote [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: ['doc-endnotes'],\n  requiredContextRole: ['doc-endnotes'],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'listitem']]\n};\nvar _default = docEndnoteRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docEndnotesRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'rearnotes [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['doc-endnote']],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docEndnotesRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docEpigraphRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'epigraph [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = docEpigraphRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docEpilogueRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'epilogue [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docEpilogueRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docErrataRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'errata [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docErrataRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docExampleRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = docExampleRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docFootnoteRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'footnote [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = docFootnoteRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docForewordRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'foreword [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docForewordRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docGlossaryRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'glossary [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [['definition'], ['term']],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docGlossaryRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docGlossrefRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'glossref [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'command', 'link']]\n};\nvar _default = docGlossrefRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docIndexRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'index [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark', 'navigation']]\n};\nvar _default = docIndexRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docIntroductionRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'introduction [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docIntroductionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docNoterefRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author', 'contents'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'noteref [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'widget', 'command', 'link']]\n};\nvar _default = docNoterefRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docNoticeRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'notice [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'note']]\n};\nvar _default = docNoticeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docPagebreakRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: true,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'pagebreak [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'separator']]\n};\nvar _default = docPagebreakRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docPagelistRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'page-list [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark', 'navigation']]\n};\nvar _default = docPagelistRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docPartRole = {\n  abstract: false,\n  accessibleNameRequired: true,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'part [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docPartRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docPrefaceRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'preface [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docPrefaceRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docPrologueRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'prologue [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark']]\n};\nvar _default = docPrologueRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docPullquoteRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {},\n  relatedConcepts: [{\n    concept: {\n      name: 'pullquote [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['none']]\n};\nvar _default = docPullquoteRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docQnaRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'qna [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section']]\n};\nvar _default = docQnaRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docSubtitleRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'subtitle [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'sectionhead']]\n};\nvar _default = docSubtitleRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docTipRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'help [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'note']]\n};\nvar _default = docTipRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar docTocRole = {\n  abstract: false,\n  accessibleNameRequired: false,\n  baseConcepts: [],\n  childrenPresentational: false,\n  nameFrom: ['author'],\n  prohibitedProps: [],\n  props: {\n    'aria-disabled': null,\n    'aria-errormessage': null,\n    'aria-expanded': null,\n    'aria-haspopup': null,\n    'aria-invalid': null\n  },\n  relatedConcepts: [{\n    concept: {\n      name: 'toc [EPUB-SSV]'\n    },\n    module: 'EPUB'\n  }],\n  requireContextRole: [],\n  requiredContextRole: [],\n  requiredOwnedElements: [],\n  requiredProps: {},\n  superClass: [['roletype', 'structure', 'section', 'landmark', 'navigation']]\n};\nvar _default = docTocRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _docAbstractRole = _interopRequireDefault(require(\"./dpub/docAbstractRole\"));\n\nvar _docAcknowledgmentsRole = _interopRequireDefault(require(\"./dpub/docAcknowledgmentsRole\"));\n\nvar _docAfterwordRole = _interopRequireDefault(require(\"./dpub/docAfterwordRole\"));\n\nvar _docAppendixRole = _interopRequireDefault(require(\"./dpub/docAppendixRole\"));\n\nvar _docBacklinkRole = _interopRequireDefault(require(\"./dpub/docBacklinkRole\"));\n\nvar _docBiblioentryRole = _interopRequireDefault(require(\"./dpub/docBiblioentryRole\"));\n\nvar _docBibliographyRole = _interopRequireDefault(require(\"./dpub/docBibliographyRole\"));\n\nvar _docBibliorefRole = _interopRequireDefault(require(\"./dpub/docBibliorefRole\"));\n\nvar _docChapterRole = _interopRequireDefault(require(\"./dpub/docChapterRole\"));\n\nvar _docColophonRole = _interopRequireDefault(require(\"./dpub/docColophonRole\"));\n\nvar _docConclusionRole = _interopRequireDefault(require(\"./dpub/docConclusionRole\"));\n\nvar _docCoverRole = _interopRequireDefault(require(\"./dpub/docCoverRole\"));\n\nvar _docCreditRole = _interopRequireDefault(require(\"./dpub/docCreditRole\"));\n\nvar _docCreditsRole = _interopRequireDefault(require(\"./dpub/docCreditsRole\"));\n\nvar _docDedicationRole = _interopRequireDefault(require(\"./dpub/docDedicationRole\"));\n\nvar _docEndnoteRole = _interopRequireDefault(require(\"./dpub/docEndnoteRole\"));\n\nvar _docEndnotesRole = _interopRequireDefault(require(\"./dpub/docEndnotesRole\"));\n\nvar _docEpigraphRole = _interopRequireDefault(require(\"./dpub/docEpigraphRole\"));\n\nvar _docEpilogueRole = _interopRequireDefault(require(\"./dpub/docEpilogueRole\"));\n\nvar _docErrataRole = _interopRequireDefault(require(\"./dpub/docErrataRole\"));\n\nvar _docExampleRole = _interopRequireDefault(require(\"./dpub/docExampleRole\"));\n\nvar _docFootnoteRole = _interopRequireDefault(require(\"./dpub/docFootnoteRole\"));\n\nvar _docForewordRole = _interopRequireDefault(require(\"./dpub/docForewordRole\"));\n\nvar _docGlossaryRole = _interopRequireDefault(require(\"./dpub/docGlossaryRole\"));\n\nvar _docGlossrefRole = _interopRequireDefault(require(\"./dpub/docGlossrefRole\"));\n\nvar _docIndexRole = _interopRequireDefault(require(\"./dpub/docIndexRole\"));\n\nvar _docIntroductionRole = _interopRequireDefault(require(\"./dpub/docIntroductionRole\"));\n\nvar _docNoterefRole = _interopRequireDefault(require(\"./dpub/docNoterefRole\"));\n\nvar _docNoticeRole = _interopRequireDefault(require(\"./dpub/docNoticeRole\"));\n\nvar _docPagebreakRole = _interopRequireDefault(require(\"./dpub/docPagebreakRole\"));\n\nvar _docPagelistRole = _interopRequireDefault(require(\"./dpub/docPagelistRole\"));\n\nvar _docPartRole = _interopRequireDefault(require(\"./dpub/docPartRole\"));\n\nvar _docPrefaceRole = _interopRequireDefault(require(\"./dpub/docPrefaceRole\"));\n\nvar _docPrologueRole = _interopRequireDefault(require(\"./dpub/docPrologueRole\"));\n\nvar _docPullquoteRole = _interopRequireDefault(require(\"./dpub/docPullquoteRole\"));\n\nvar _docQnaRole = _interopRequireDefault(require(\"./dpub/docQnaRole\"));\n\nvar _docSubtitleRole = _interopRequireDefault(require(\"./dpub/docSubtitleRole\"));\n\nvar _docTipRole = _interopRequireDefault(require(\"./dpub/docTipRole\"));\n\nvar _docTocRole = _interopRequireDefault(require(\"./dpub/docTocRole\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ariaDpubRoles = [['doc-abstract', _docAbstractRole.default], ['doc-acknowledgments', _docAcknowledgmentsRole.default], ['doc-afterword', _docAfterwordRole.default], ['doc-appendix', _docAppendixRole.default], ['doc-backlink', _docBacklinkRole.default], ['doc-biblioentry', _docBiblioentryRole.default], ['doc-bibliography', _docBibliographyRole.default], ['doc-biblioref', _docBibliorefRole.default], ['doc-chapter', _docChapterRole.default], ['doc-colophon', _docColophonRole.default], ['doc-conclusion', _docConclusionRole.default], ['doc-cover', _docCoverRole.default], ['doc-credit', _docCreditRole.default], ['doc-credits', _docCreditsRole.default], ['doc-dedication', _docDedicationRole.default], ['doc-endnote', _docEndnoteRole.default], ['doc-endnotes', _docEndnotesRole.default], ['doc-epigraph', _docEpigraphRole.default], ['doc-epilogue', _docEpilogueRole.default], ['doc-errata', _docErrataRole.default], ['doc-example', _docExampleRole.default], ['doc-footnote', _docFootnoteRole.default], ['doc-foreword', _docForewordRole.default], ['doc-glossary', _docGlossaryRole.default], ['doc-glossref', _docGlossrefRole.default], ['doc-index', _docIndexRole.default], ['doc-introduction', _docIntroductionRole.default], ['doc-noteref', _docNoterefRole.default], ['doc-notice', _docNoticeRole.default], ['doc-pagebreak', _docPagebreakRole.default], ['doc-pagelist', _docPagelistRole.default], ['doc-part', _docPartRole.default], ['doc-preface', _docPrefaceRole.default], ['doc-prologue', _docPrologueRole.default], ['doc-pullquote', _docPullquoteRole.default], ['doc-qna', _docQnaRole.default], ['doc-subtitle', _docSubtitleRole.default], ['doc-tip', _docTipRole.default], ['doc-toc', _docTocRole.default]];\nvar _default = ariaDpubRoles;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _ariaAbstractRoles = _interopRequireDefault(require(\"./etc/roles/ariaAbstractRoles\"));\n\nvar _ariaLiteralRoles = _interopRequireDefault(require(\"./etc/roles/ariaLiteralRoles\"));\n\nvar _ariaDpubRoles = _interopRequireDefault(require(\"./etc/roles/ariaDpubRoles\"));\n\nvar _iterationDecorator = _interopRequireDefault(require(\"./util/iterationDecorator\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nvar roles = [].concat(_ariaAbstractRoles.default, _ariaLiteralRoles.default, _ariaDpubRoles.default);\nroles.forEach(function (_ref) {\n  var _ref2 = _slicedToArray(_ref, 2),\n      roleDefinition = _ref2[1];\n\n  // Conglomerate the properties\n  var _iterator = _createForOfIteratorHelper(roleDefinition.superClass),\n      _step;\n\n  try {\n    for (_iterator.s(); !(_step = _iterator.n()).done;) {\n      var superClassIter = _step.value;\n\n      var _iterator2 = _createForOfIteratorHelper(superClassIter),\n          _step2;\n\n      try {\n        var _loop = function _loop() {\n          var superClassName = _step2.value;\n          var superClassRoleTuple = roles.find(function (_ref3) {\n            var _ref4 = _slicedToArray(_ref3, 1),\n                name = _ref4[0];\n\n            return name === superClassName;\n          });\n\n          if (superClassRoleTuple) {\n            var superClassDefinition = superClassRoleTuple[1];\n\n            for (var _i2 = 0, _Object$keys = Object.keys(superClassDefinition.props); _i2 < _Object$keys.length; _i2++) {\n              var prop = _Object$keys[_i2];\n\n              if ( // $FlowIssue Accessing the hasOwnProperty on the Object prototype is fine.\n              !Object.prototype.hasOwnProperty.call(roleDefinition.props, prop)) {\n                Object.assign(roleDefinition.props, _defineProperty({}, prop, superClassDefinition.props[prop]));\n              }\n            }\n          }\n        };\n\n        for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n          _loop();\n        }\n      } catch (err) {\n        _iterator2.e(err);\n      } finally {\n        _iterator2.f();\n      }\n    }\n  } catch (err) {\n    _iterator.e(err);\n  } finally {\n    _iterator.f();\n  }\n});\nvar rolesMap = {\n  entries: function entries() {\n    return roles;\n  },\n  forEach: function forEach(fn) {\n    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n    var _iterator3 = _createForOfIteratorHelper(roles),\n        _step3;\n\n    try {\n      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n        var _step3$value = _slicedToArray(_step3.value, 2),\n            key = _step3$value[0],\n            values = _step3$value[1];\n\n        fn.call(thisArg, values, key, roles);\n      }\n    } catch (err) {\n      _iterator3.e(err);\n    } finally {\n      _iterator3.f();\n    }\n  },\n  get: function get(key) {\n    var item = roles.find(function (tuple) {\n      return tuple[0] === key ? true : false;\n    });\n    return item && item[1];\n  },\n  has: function has(key) {\n    return !!this.get(key);\n  },\n  keys: function keys() {\n    return roles.map(function (_ref5) {\n      var _ref6 = _slicedToArray(_ref5, 1),\n          key = _ref6[0];\n\n      return key;\n    });\n  },\n  values: function values() {\n    return roles.map(function (_ref7) {\n      var _ref8 = _slicedToArray(_ref7, 2),\n          values = _ref8[1];\n\n      return values;\n    });\n  }\n};\n\nvar _default = (0, _iterationDecorator.default)(rolesMap, rolesMap.entries());\n\nexports.default = _default;","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n    var target = this;\n    if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n        throw new TypeError(ERROR_MESSAGE + target);\n    }\n    var args = slice.call(arguments, 1);\n\n    var bound;\n    var binder = function () {\n        if (this instanceof bound) {\n            var result = target.apply(\n                this,\n                args.concat(slice.call(arguments))\n            );\n            if (Object(result) === result) {\n                return result;\n            }\n            return this;\n        } else {\n            return target.apply(\n                that,\n                args.concat(slice.call(arguments))\n            );\n        }\n    };\n\n    var boundLength = Math.max(0, target.length - args.length);\n    var boundArgs = [];\n    for (var i = 0; i < boundLength; i++) {\n        boundArgs.push('$' + i);\n    }\n\n    bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n    if (target.prototype) {\n        var Empty = function Empty() {};\n        Empty.prototype = target.prototype;\n        bound.prototype = new Empty();\n        Empty.prototype = null;\n    }\n\n    return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\n\nvar getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\n\nvar isStandardArguments = function isArguments(value) {\n\tif (hasToStringTag && value && typeof value === 'object' && Symbol.toStringTag in value) {\n\t\treturn false;\n\t}\n\treturn $toString(value) === '[object Arguments]';\n};\n\nvar isLegacyArguments = function isArguments(value) {\n\tif (isStandardArguments(value)) {\n\t\treturn true;\n\t}\n\treturn value !== null &&\n\t\ttypeof value === 'object' &&\n\t\ttypeof value.length === 'number' &&\n\t\tvalue.length >= 0 &&\n\t\t$toString(value) !== '[object Array]' &&\n\t\t$toString(value.callee) === '[object Function]';\n};\n\nvar supportsStandardArguments = (function () {\n\treturn isStandardArguments(arguments);\n}());\n\nisStandardArguments.isLegacyArguments = isLegacyArguments; // for tests\n\nmodule.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar origDefineProperty = Object.defineProperty;\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar supportsDescriptors = origDefineProperty && hasPropertyDescriptors;\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object && (!isFunction(predicate) || !predicate())) {\n\t\treturn;\n\t}\n\tif (supportsDescriptors) {\n\t\torigDefineProperty(object, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: value,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\tobject[name] = value; // eslint-disable-line no-param-reassign\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar numberIsNaN = function (value) {\n\treturn value !== value;\n};\n\nmodule.exports = function is(a, b) {\n\tif (a === 0 && b === 0) {\n\t\treturn 1 / a === 1 / b;\n\t}\n\tif (a === b) {\n\t\treturn true;\n\t}\n\tif (numberIsNaN(a) && numberIsNaN(b)) {\n\t\treturn true;\n\t}\n\treturn false;\n};\n\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\treturn typeof Object.is === 'function' ? Object.is : implementation;\n};\n","'use strict';\n\nvar getPolyfill = require('./polyfill');\nvar define = require('define-properties');\n\nmodule.exports = function shimObjectIs() {\n\tvar polyfill = getPolyfill();\n\tdefine(Object, { is: polyfill }, {\n\t\tis: function testObjectIs() {\n\t\t\treturn Object.is !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind(getPolyfill(), Object);\n\ndefine(polyfill, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = polyfill;\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar functionsHaveNames = function functionsHaveNames() {\n\treturn typeof function f() {}.name === 'string';\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\nif (gOPD) {\n\ttry {\n\t\tgOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\tgOPD = null;\n\t}\n}\n\nfunctionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {\n\tif (!functionsHaveNames() || !gOPD) {\n\t\treturn false;\n\t}\n\tvar desc = gOPD(function () {}, 'name');\n\treturn !!desc && !!desc.configurable;\n};\n\nvar $bind = Function.prototype.bind;\n\nfunctionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {\n\treturn functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';\n};\n\nmodule.exports = functionsHaveNames;\n","'use strict';\n\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n};\n\nif (functionsHaveConfigurableNames && Object.defineProperty) {\n\tObject.defineProperty(module.exports, 'name', { value: 'get flags' });\n}\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(getPolyfill());\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n  return toString.call(arr) == '[object Array]';\n};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nvar strValue = String.prototype.valueOf;\nvar tryStringObject = function tryStringObject(value) {\n\ttry {\n\t\tstrValue.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar strClass = '[object String]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isString(value) {\n\tif (typeof value === 'string') {\n\t\treturn true;\n\t}\n\tif (typeof value !== 'object') {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass;\n};\n","'use strict';\n\nvar numToStr = Number.prototype.toString;\nvar tryNumberObject = function tryNumberObject(value) {\n\ttry {\n\t\tnumToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar numClass = '[object Number]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isNumberObject(value) {\n\tif (typeof value === 'number') {\n\t\treturn true;\n\t}\n\tif (typeof value !== 'object') {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryNumberObject(value) : toStr.call(value) === numClass;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar $boolToStr = callBound('Boolean.prototype.toString');\nvar $toString = callBound('Object.prototype.toString');\n\nvar tryBooleanObject = function booleanBrandCheck(value) {\n\ttry {\n\t\t$boolToStr(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar boolClass = '[object Boolean]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isBoolean(value) {\n\tif (typeof value === 'boolean') {\n\t\treturn true;\n\t}\n\tif (value === null || typeof value !== 'object') {\n\t\treturn false;\n\t}\n\treturn hasToStringTag && Symbol.toStringTag in value ? tryBooleanObject(value) : $toString(value) === boolClass;\n};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar hasSymbols = require('has-symbols')();\n\nif (hasSymbols) {\n\tvar symToStr = Symbol.prototype.toString;\n\tvar symStringRegex = /^Symbol\\(.*\\)$/;\n\tvar isSymbolObject = function isRealSymbolObject(value) {\n\t\tif (typeof value.valueOf() !== 'symbol') {\n\t\t\treturn false;\n\t\t}\n\t\treturn symStringRegex.test(symToStr.call(value));\n\t};\n\n\tmodule.exports = function isSymbol(value) {\n\t\tif (typeof value === 'symbol') {\n\t\t\treturn true;\n\t\t}\n\t\tif (toStr.call(value) !== '[object Symbol]') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\treturn isSymbolObject(value);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n} else {\n\n\tmodule.exports = function isSymbol(value) {\n\t\t// this environment does not support Symbols.\n\t\treturn false && value;\n\t};\n}\n","'use strict';\n\nvar $BigInt = typeof BigInt !== 'undefined' && BigInt;\n\nmodule.exports = function hasNativeBigInts() {\n\treturn typeof $BigInt === 'function'\n\t\t&& typeof BigInt === 'function'\n\t\t&& typeof $BigInt(42) === 'bigint' // eslint-disable-line no-magic-numbers\n\t\t&& typeof BigInt(42) === 'bigint'; // eslint-disable-line no-magic-numbers\n};\n","'use strict';\n\nvar hasBigInts = require('has-bigints')();\n\nif (hasBigInts) {\n\tvar bigIntValueOf = BigInt.prototype.valueOf;\n\tvar tryBigInt = function tryBigIntObject(value) {\n\t\ttry {\n\t\t\tbigIntValueOf.call(value);\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t}\n\t\treturn false;\n\t};\n\n\tmodule.exports = function isBigInt(value) {\n\t\tif (\n\t\t\tvalue === null\n\t\t\t|| typeof value === 'undefined'\n\t\t\t|| typeof value === 'boolean'\n\t\t\t|| typeof value === 'string'\n\t\t\t|| typeof value === 'number'\n\t\t\t|| typeof value === 'symbol'\n\t\t\t|| typeof value === 'function'\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t\tif (typeof value === 'bigint') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn tryBigInt(value);\n\t};\n} else {\n\tmodule.exports = function isBigInt(value) {\n\t\treturn false && value;\n\t};\n}\n","'use strict';\n\nvar isString = require('is-string');\nvar isNumber = require('is-number-object');\nvar isBoolean = require('is-boolean-object');\nvar isSymbol = require('is-symbol');\nvar isBigInt = require('is-bigint');\n\n// eslint-disable-next-line consistent-return\nmodule.exports = function whichBoxedPrimitive(value) {\n\t// eslint-disable-next-line eqeqeq\n\tif (value == null || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\treturn null;\n\t}\n\tif (isString(value)) {\n\t\treturn 'String';\n\t}\n\tif (isNumber(value)) {\n\t\treturn 'Number';\n\t}\n\tif (isBoolean(value)) {\n\t\treturn 'Boolean';\n\t}\n\tif (isSymbol(value)) {\n\t\treturn 'Symbol';\n\t}\n\tif (isBigInt(value)) {\n\t\treturn 'BigInt';\n\t}\n};\n","'use strict';\n\nvar $Map = typeof Map === 'function' && Map.prototype ? Map : null;\nvar $Set = typeof Set === 'function' && Set.prototype ? Set : null;\n\nvar exported;\n\nif (!$Map) {\n\t// eslint-disable-next-line no-unused-vars\n\texported = function isMap(x) {\n\t\t// `Map` is not present in this environment.\n\t\treturn false;\n\t};\n}\n\nvar $mapHas = $Map ? Map.prototype.has : null;\nvar $setHas = $Set ? Set.prototype.has : null;\nif (!exported && !$mapHas) {\n\t// eslint-disable-next-line no-unused-vars\n\texported = function isMap(x) {\n\t\t// `Map` does not have a `has` method\n\t\treturn false;\n\t};\n}\n\nmodule.exports = exported || function isMap(x) {\n\tif (!x || typeof x !== 'object') {\n\t\treturn false;\n\t}\n\ttry {\n\t\t$mapHas.call(x);\n\t\tif ($setHas) {\n\t\t\ttry {\n\t\t\t\t$setHas.call(x);\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn x instanceof $Map; // core-js workaround, pre-v2.5.0\n\t} catch (e) {}\n\treturn false;\n};\n","'use strict';\n\nvar $Map = typeof Map === 'function' && Map.prototype ? Map : null;\nvar $Set = typeof Set === 'function' && Set.prototype ? Set : null;\n\nvar exported;\n\nif (!$Set) {\n\t// eslint-disable-next-line no-unused-vars\n\texported = function isSet(x) {\n\t\t// `Set` is not present in this environment.\n\t\treturn false;\n\t};\n}\n\nvar $mapHas = $Map ? Map.prototype.has : null;\nvar $setHas = $Set ? Set.prototype.has : null;\nif (!exported && !$setHas) {\n\t// eslint-disable-next-line no-unused-vars\n\texported = function isSet(x) {\n\t\t// `Set` does not have a `has` method\n\t\treturn false;\n\t};\n}\n\nmodule.exports = exported || function isSet(x) {\n\tif (!x || typeof x !== 'object') {\n\t\treturn false;\n\t}\n\ttry {\n\t\t$setHas.call(x);\n\t\tif ($mapHas) {\n\t\t\ttry {\n\t\t\t\t$mapHas.call(x);\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn x instanceof $Set; // core-js workaround, pre-v2.5.0\n\t} catch (e) {}\n\treturn false;\n};\n","'use strict';\n\nvar $WeakMap = typeof WeakMap === 'function' && WeakMap.prototype ? WeakMap : null;\nvar $WeakSet = typeof WeakSet === 'function' && WeakSet.prototype ? WeakSet : null;\n\nvar exported;\n\nif (!$WeakMap) {\n\t// eslint-disable-next-line no-unused-vars\n\texported = function isWeakMap(x) {\n\t\t// `WeakMap` is not present in this environment.\n\t\treturn false;\n\t};\n}\n\nvar $mapHas = $WeakMap ? $WeakMap.prototype.has : null;\nvar $setHas = $WeakSet ? $WeakSet.prototype.has : null;\nif (!exported && !$mapHas) {\n\t// eslint-disable-next-line no-unused-vars\n\texported = function isWeakMap(x) {\n\t\t// `WeakMap` does not have a `has` method\n\t\treturn false;\n\t};\n}\n\nmodule.exports = exported || function isWeakMap(x) {\n\tif (!x || typeof x !== 'object') {\n\t\treturn false;\n\t}\n\ttry {\n\t\t$mapHas.call(x, $mapHas);\n\t\tif ($setHas) {\n\t\t\ttry {\n\t\t\t\t$setHas.call(x, $setHas);\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn x instanceof $WeakMap; // core-js workaround, pre-v3\n\t} catch (e) {}\n\treturn false;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\n\nvar $WeakSet = GetIntrinsic('%WeakSet%', true);\n\nvar $setHas = callBound('WeakSet.prototype.has', true);\n\nif ($setHas) {\n\tvar $mapHas = callBound('WeakMap.prototype.has', true);\n\n\tmodule.exports = function isWeakSet(x) {\n\t\tif (!x || typeof x !== 'object') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\t$setHas(x, $setHas);\n\t\t\tif ($mapHas) {\n\t\t\t\ttry {\n\t\t\t\t\t$mapHas(x, $mapHas);\n\t\t\t\t} catch (e) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn x instanceof $WeakSet; // core-js workaround, pre-v3\n\t\t} catch (e) {}\n\t\treturn false;\n\t};\n} else {\n\t// eslint-disable-next-line no-unused-vars\n\tmodule.exports = function isWeakSet(x) {\n\t\t// `WeakSet` does not exist, or does not have a `has` method\n\t\treturn false;\n\t};\n}\n","'use strict';\n\nvar isMap = require('is-map');\nvar isSet = require('is-set');\nvar isWeakMap = require('is-weakmap');\nvar isWeakSet = require('is-weakset');\n\nmodule.exports = function whichCollection(value) {\n\tif (value && typeof value === 'object') {\n\t\tif (isMap(value)) {\n\t\t\treturn 'Map';\n\t\t}\n\t\tif (isSet(value)) {\n\t\t\treturn 'Set';\n\t\t}\n\t\tif (isWeakMap(value)) {\n\t\t\treturn 'WeakMap';\n\t\t}\n\t\tif (isWeakSet(value)) {\n\t\t\treturn 'WeakSet';\n\t\t}\n\t}\n\treturn false;\n};\n","// this should only run in node >= 13.7, so it\n// does not need any of the intense fallbacks that old node/browsers do\n\nvar $iterator = Symbol.iterator;\n\nexport default function getIterator(iterable) {\n\t// alternatively, `iterable[$iterator]?.()`\n\tif (iterable != null && iterable[$iterator] !== undefined) {\n\t\treturn iterable[$iterator]();\n\t}\n}\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar fnToStr = Function.prototype.toString;\nvar isFnRegex = /^\\s*(?:function)?\\*/;\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar getProto = Object.getPrototypeOf;\nvar getGeneratorFunc = function () { // eslint-disable-line consistent-return\n\tif (!hasToStringTag) {\n\t\treturn false;\n\t}\n\ttry {\n\t\treturn Function('return function*() {}')();\n\t} catch (e) {\n\t}\n};\nvar GeneratorFunction;\n\nmodule.exports = function isGeneratorFunction(fn) {\n\tif (typeof fn !== 'function') {\n\t\treturn false;\n\t}\n\tif (isFnRegex.test(fnToStr.call(fn))) {\n\t\treturn true;\n\t}\n\tif (!hasToStringTag) {\n\t\tvar str = toStr.call(fn);\n\t\treturn str === '[object GeneratorFunction]';\n\t}\n\tif (!getProto) {\n\t\treturn false;\n\t}\n\tif (typeof GeneratorFunction === 'undefined') {\n\t\tvar generatorFunc = getGeneratorFunc();\n\t\tGeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;\n\t}\n\treturn getProto(fn) === GeneratorFunction;\n};\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n    for (var i = 0, len = array.length; i < len; i++) {\n        if (hasOwnProperty.call(array, i)) {\n            if (receiver == null) {\n                iterator(array[i], i, array);\n            } else {\n                iterator.call(receiver, array[i], i, array);\n            }\n        }\n    }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n    for (var i = 0, len = string.length; i < len; i++) {\n        // no such thing as a sparse string.\n        if (receiver == null) {\n            iterator(string.charAt(i), i, string);\n        } else {\n            iterator.call(receiver, string.charAt(i), i, string);\n        }\n    }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n    for (var k in object) {\n        if (hasOwnProperty.call(object, k)) {\n            if (receiver == null) {\n                iterator(object[k], k, object);\n            } else {\n                iterator.call(receiver, object[k], k, object);\n            }\n        }\n    }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n    if (!isCallable(iterator)) {\n        throw new TypeError('iterator must be a function');\n    }\n\n    var receiver;\n    if (arguments.length >= 3) {\n        receiver = thisArg;\n    }\n\n    if (toStr.call(list) === '[object Array]') {\n        forEachArray(list, iterator, receiver);\n    } else if (typeof list === 'string') {\n        forEachString(list, iterator, receiver);\n    } else {\n        forEachObject(list, iterator, receiver);\n    }\n};\n\nmodule.exports = forEach;\n","'use strict';\n\nvar possibleNames = [\n\t'BigInt64Array',\n\t'BigUint64Array',\n\t'Float32Array',\n\t'Float64Array',\n\t'Int16Array',\n\t'Int32Array',\n\t'Int8Array',\n\t'Uint16Array',\n\t'Uint32Array',\n\t'Uint8Array',\n\t'Uint8ClampedArray'\n];\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\n\nmodule.exports = function availableTypedArrays() {\n\tvar out = [];\n\tfor (var i = 0; i < possibleNames.length; i++) {\n\t\tif (typeof g[possibleNames[i]] === 'function') {\n\t\t\tout[out.length] = possibleNames[i];\n\t\t}\n\t}\n\treturn out;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar forEach = require('for-each');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\nvar typedArrays = availableTypedArrays();\n\nvar $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tif (array[i] === value) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\nvar $slice = callBound('String.prototype.slice');\nvar toStrTags = {};\nvar gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tvar arr = new g[typedArray]();\n\t\tif (Symbol.toStringTag in arr) {\n\t\t\tvar proto = getPrototypeOf(arr);\n\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\tif (!descriptor) {\n\t\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t}\n\t\t\ttoStrTags[typedArray] = descriptor.get;\n\t\t}\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar anyTrue = false;\n\tforEach(toStrTags, function (getter, typedArray) {\n\t\tif (!anyTrue) {\n\t\t\ttry {\n\t\t\t\tanyTrue = getter.call(value) === typedArray;\n\t\t\t} catch (e) { /**/ }\n\t\t}\n\t});\n\treturn anyTrue;\n};\n\nmodule.exports = function isTypedArray(value) {\n\tif (!value || typeof value !== 'object') { return false; }\n\tif (!hasToStringTag || !(Symbol.toStringTag in value)) {\n\t\tvar tag = $slice($toString(value), 8, -1);\n\t\treturn $indexOf(typedArrays, tag) > -1;\n\t}\n\tif (!gOPD) { return false; }\n\treturn tryTypedArrays(value);\n};\n","'use strict';\n\nvar forEach = require('for-each');\nvar availableTypedArrays = require('available-typed-arrays');\nvar callBound = require('call-bind/callBound');\n\nvar $toString = callBound('Object.prototype.toString');\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nvar g = typeof globalThis === 'undefined' ? global : globalThis;\nvar typedArrays = availableTypedArrays();\n\nvar $slice = callBound('String.prototype.slice');\nvar toStrTags = {};\nvar gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor');\nvar getPrototypeOf = Object.getPrototypeOf; // require('getprototypeof');\nif (hasToStringTag && gOPD && getPrototypeOf) {\n\tforEach(typedArrays, function (typedArray) {\n\t\tif (typeof g[typedArray] === 'function') {\n\t\t\tvar arr = new g[typedArray]();\n\t\t\tif (Symbol.toStringTag in arr) {\n\t\t\t\tvar proto = getPrototypeOf(arr);\n\t\t\t\tvar descriptor = gOPD(proto, Symbol.toStringTag);\n\t\t\t\tif (!descriptor) {\n\t\t\t\t\tvar superProto = getPrototypeOf(proto);\n\t\t\t\t\tdescriptor = gOPD(superProto, Symbol.toStringTag);\n\t\t\t\t}\n\t\t\t\ttoStrTags[typedArray] = descriptor.get;\n\t\t\t}\n\t\t}\n\t});\n}\n\nvar tryTypedArrays = function tryAllTypedArrays(value) {\n\tvar foundName = false;\n\tforEach(toStrTags, function (getter, typedArray) {\n\t\tif (!foundName) {\n\t\t\ttry {\n\t\t\t\tvar name = getter.call(value);\n\t\t\t\tif (name === typedArray) {\n\t\t\t\t\tfoundName = name;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\t\t}\n\t});\n\treturn foundName;\n};\n\nvar isTypedArray = require('is-typed-array');\n\nmodule.exports = function whichTypedArray(value) {\n\tif (!isTypedArray(value)) { return false; }\n\tif (!hasToStringTag || !(Symbol.toStringTag in value)) { return $slice($toString(value), 8, -1); }\n\treturn tryTypedArrays(value);\n};\n","// Currently in sync with Node.js lib/internal/util/types.js\n// https://github.com/nodejs/node/commit/112cc7c27551254aa2b17098fb774867f05ed0d9\n\n'use strict';\n\nvar isArgumentsObject = require('is-arguments');\nvar isGeneratorFunction = require('is-generator-function');\nvar whichTypedArray = require('which-typed-array');\nvar isTypedArray = require('is-typed-array');\n\nfunction uncurryThis(f) {\n  return f.call.bind(f);\n}\n\nvar BigIntSupported = typeof BigInt !== 'undefined';\nvar SymbolSupported = typeof Symbol !== 'undefined';\n\nvar ObjectToString = uncurryThis(Object.prototype.toString);\n\nvar numberValue = uncurryThis(Number.prototype.valueOf);\nvar stringValue = uncurryThis(String.prototype.valueOf);\nvar booleanValue = uncurryThis(Boolean.prototype.valueOf);\n\nif (BigIntSupported) {\n  var bigIntValue = uncurryThis(BigInt.prototype.valueOf);\n}\n\nif (SymbolSupported) {\n  var symbolValue = uncurryThis(Symbol.prototype.valueOf);\n}\n\nfunction checkBoxedPrimitive(value, prototypeValueOf) {\n  if (typeof value !== 'object') {\n    return false;\n  }\n  try {\n    prototypeValueOf(value);\n    return true;\n  } catch(e) {\n    return false;\n  }\n}\n\nexports.isArgumentsObject = isArgumentsObject;\nexports.isGeneratorFunction = isGeneratorFunction;\nexports.isTypedArray = isTypedArray;\n\n// Taken from here and modified for better browser support\n// https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js\nfunction isPromise(input) {\n\treturn (\n\t\t(\n\t\t\ttypeof Promise !== 'undefined' &&\n\t\t\tinput instanceof Promise\n\t\t) ||\n\t\t(\n\t\t\tinput !== null &&\n\t\t\ttypeof input === 'object' &&\n\t\t\ttypeof input.then === 'function' &&\n\t\t\ttypeof input.catch === 'function'\n\t\t)\n\t);\n}\nexports.isPromise = isPromise;\n\nfunction isArrayBufferView(value) {\n  if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n    return ArrayBuffer.isView(value);\n  }\n\n  return (\n    isTypedArray(value) ||\n    isDataView(value)\n  );\n}\nexports.isArrayBufferView = isArrayBufferView;\n\n\nfunction isUint8Array(value) {\n  return whichTypedArray(value) === 'Uint8Array';\n}\nexports.isUint8Array = isUint8Array;\n\nfunction isUint8ClampedArray(value) {\n  return whichTypedArray(value) === 'Uint8ClampedArray';\n}\nexports.isUint8ClampedArray = isUint8ClampedArray;\n\nfunction isUint16Array(value) {\n  return whichTypedArray(value) === 'Uint16Array';\n}\nexports.isUint16Array = isUint16Array;\n\nfunction isUint32Array(value) {\n  return whichTypedArray(value) === 'Uint32Array';\n}\nexports.isUint32Array = isUint32Array;\n\nfunction isInt8Array(value) {\n  return whichTypedArray(value) === 'Int8Array';\n}\nexports.isInt8Array = isInt8Array;\n\nfunction isInt16Array(value) {\n  return whichTypedArray(value) === 'Int16Array';\n}\nexports.isInt16Array = isInt16Array;\n\nfunction isInt32Array(value) {\n  return whichTypedArray(value) === 'Int32Array';\n}\nexports.isInt32Array = isInt32Array;\n\nfunction isFloat32Array(value) {\n  return whichTypedArray(value) === 'Float32Array';\n}\nexports.isFloat32Array = isFloat32Array;\n\nfunction isFloat64Array(value) {\n  return whichTypedArray(value) === 'Float64Array';\n}\nexports.isFloat64Array = isFloat64Array;\n\nfunction isBigInt64Array(value) {\n  return whichTypedArray(value) === 'BigInt64Array';\n}\nexports.isBigInt64Array = isBigInt64Array;\n\nfunction isBigUint64Array(value) {\n  return whichTypedArray(value) === 'BigUint64Array';\n}\nexports.isBigUint64Array = isBigUint64Array;\n\nfunction isMapToString(value) {\n  return ObjectToString(value) === '[object Map]';\n}\nisMapToString.working = (\n  typeof Map !== 'undefined' &&\n  isMapToString(new Map())\n);\n\nfunction isMap(value) {\n  if (typeof Map === 'undefined') {\n    return false;\n  }\n\n  return isMapToString.working\n    ? isMapToString(value)\n    : value instanceof Map;\n}\nexports.isMap = isMap;\n\nfunction isSetToString(value) {\n  return ObjectToString(value) === '[object Set]';\n}\nisSetToString.working = (\n  typeof Set !== 'undefined' &&\n  isSetToString(new Set())\n);\nfunction isSet(value) {\n  if (typeof Set === 'undefined') {\n    return false;\n  }\n\n  return isSetToString.working\n    ? isSetToString(value)\n    : value instanceof Set;\n}\nexports.isSet = isSet;\n\nfunction isWeakMapToString(value) {\n  return ObjectToString(value) === '[object WeakMap]';\n}\nisWeakMapToString.working = (\n  typeof WeakMap !== 'undefined' &&\n  isWeakMapToString(new WeakMap())\n);\nfunction isWeakMap(value) {\n  if (typeof WeakMap === 'undefined') {\n    return false;\n  }\n\n  return isWeakMapToString.working\n    ? isWeakMapToString(value)\n    : value instanceof WeakMap;\n}\nexports.isWeakMap = isWeakMap;\n\nfunction isWeakSetToString(value) {\n  return ObjectToString(value) === '[object WeakSet]';\n}\nisWeakSetToString.working = (\n  typeof WeakSet !== 'undefined' &&\n  isWeakSetToString(new WeakSet())\n);\nfunction isWeakSet(value) {\n  return isWeakSetToString(value);\n}\nexports.isWeakSet = isWeakSet;\n\nfunction isArrayBufferToString(value) {\n  return ObjectToString(value) === '[object ArrayBuffer]';\n}\nisArrayBufferToString.working = (\n  typeof ArrayBuffer !== 'undefined' &&\n  isArrayBufferToString(new ArrayBuffer())\n);\nfunction isArrayBuffer(value) {\n  if (typeof ArrayBuffer === 'undefined') {\n    return false;\n  }\n\n  return isArrayBufferToString.working\n    ? isArrayBufferToString(value)\n    : value instanceof ArrayBuffer;\n}\nexports.isArrayBuffer = isArrayBuffer;\n\nfunction isDataViewToString(value) {\n  return ObjectToString(value) === '[object DataView]';\n}\nisDataViewToString.working = (\n  typeof ArrayBuffer !== 'undefined' &&\n  typeof DataView !== 'undefined' &&\n  isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1))\n);\nfunction isDataView(value) {\n  if (typeof DataView === 'undefined') {\n    return false;\n  }\n\n  return isDataViewToString.working\n    ? isDataViewToString(value)\n    : value instanceof DataView;\n}\nexports.isDataView = isDataView;\n\n// Store a copy of SharedArrayBuffer in case it's deleted elsewhere\nvar SharedArrayBufferCopy = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined;\nfunction isSharedArrayBufferToString(value) {\n  return ObjectToString(value) === '[object SharedArrayBuffer]';\n}\nfunction isSharedArrayBuffer(value) {\n  if (typeof SharedArrayBufferCopy === 'undefined') {\n    return false;\n  }\n\n  if (typeof isSharedArrayBufferToString.working === 'undefined') {\n    isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());\n  }\n\n  return isSharedArrayBufferToString.working\n    ? isSharedArrayBufferToString(value)\n    : value instanceof SharedArrayBufferCopy;\n}\nexports.isSharedArrayBuffer = isSharedArrayBuffer;\n\nfunction isAsyncFunction(value) {\n  return ObjectToString(value) === '[object AsyncFunction]';\n}\nexports.isAsyncFunction = isAsyncFunction;\n\nfunction isMapIterator(value) {\n  return ObjectToString(value) === '[object Map Iterator]';\n}\nexports.isMapIterator = isMapIterator;\n\nfunction isSetIterator(value) {\n  return ObjectToString(value) === '[object Set Iterator]';\n}\nexports.isSetIterator = isSetIterator;\n\nfunction isGeneratorObject(value) {\n  return ObjectToString(value) === '[object Generator]';\n}\nexports.isGeneratorObject = isGeneratorObject;\n\nfunction isWebAssemblyCompiledModule(value) {\n  return ObjectToString(value) === '[object WebAssembly.Module]';\n}\nexports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;\n\nfunction isNumberObject(value) {\n  return checkBoxedPrimitive(value, numberValue);\n}\nexports.isNumberObject = isNumberObject;\n\nfunction isStringObject(value) {\n  return checkBoxedPrimitive(value, stringValue);\n}\nexports.isStringObject = isStringObject;\n\nfunction isBooleanObject(value) {\n  return checkBoxedPrimitive(value, booleanValue);\n}\nexports.isBooleanObject = isBooleanObject;\n\nfunction isBigIntObject(value) {\n  return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);\n}\nexports.isBigIntObject = isBigIntObject;\n\nfunction isSymbolObject(value) {\n  return SymbolSupported && checkBoxedPrimitive(value, symbolValue);\n}\nexports.isSymbolObject = isSymbolObject;\n\nfunction isBoxedPrimitive(value) {\n  return (\n    isNumberObject(value) ||\n    isStringObject(value) ||\n    isBooleanObject(value) ||\n    isBigIntObject(value) ||\n    isSymbolObject(value)\n  );\n}\nexports.isBoxedPrimitive = isBoxedPrimitive;\n\nfunction isAnyArrayBuffer(value) {\n  return typeof Uint8Array !== 'undefined' && (\n    isArrayBuffer(value) ||\n    isSharedArrayBuffer(value)\n  );\n}\nexports.isAnyArrayBuffer = isAnyArrayBuffer;\n\n['isProxy', 'isExternal', 'isModuleNamespaceObject'].forEach(function(method) {\n  Object.defineProperty(exports, method, {\n    enumerable: false,\n    value: function() {\n      throw new Error(method + ' is not supported in userland');\n    }\n  });\n});\n","module.exports = function isBuffer(arg) {\n  return arg instanceof Buffer;\n}\n","if (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    if (superCtor) {\n      ctor.super_ = superCtor\n      ctor.prototype = Object.create(superCtor.prototype, {\n        constructor: {\n          value: ctor,\n          enumerable: false,\n          writable: true,\n          configurable: true\n        }\n      })\n    }\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    if (superCtor) {\n      ctor.super_ = superCtor\n      var TempCtor = function () {}\n      TempCtor.prototype = superCtor.prototype\n      ctor.prototype = new TempCtor()\n      ctor.prototype.constructor = ctor\n    }\n  }\n}\n","try {\n  var util = require('util');\n  /* istanbul ignore next */\n  if (typeof util.inherits !== 'function') throw '';\n  module.exports = util.inherits;\n} catch (e) {\n  /* istanbul ignore next */\n  module.exports = require('./inherits_browser.js');\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors ||\n  function getOwnPropertyDescriptors(obj) {\n    var keys = Object.keys(obj);\n    var descriptors = {};\n    for (var i = 0; i < keys.length; i++) {\n      descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]);\n    }\n    return descriptors;\n  };\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n  if (!isString(f)) {\n    var objects = [];\n    for (var i = 0; i < arguments.length; i++) {\n      objects.push(inspect(arguments[i]));\n    }\n    return objects.join(' ');\n  }\n\n  var i = 1;\n  var args = arguments;\n  var len = args.length;\n  var str = String(f).replace(formatRegExp, function(x) {\n    if (x === '%%') return '%';\n    if (i >= len) return x;\n    switch (x) {\n      case '%s': return String(args[i++]);\n      case '%d': return Number(args[i++]);\n      case '%j':\n        try {\n          return JSON.stringify(args[i++]);\n        } catch (_) {\n          return '[Circular]';\n        }\n      default:\n        return x;\n    }\n  });\n  for (var x = args[i]; i < len; x = args[++i]) {\n    if (isNull(x) || !isObject(x)) {\n      str += ' ' + x;\n    } else {\n      str += ' ' + inspect(x);\n    }\n  }\n  return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n  if (typeof process !== 'undefined' && process.noDeprecation === true) {\n    return fn;\n  }\n\n  // Allow for deprecating things in the process of starting up.\n  if (typeof process === 'undefined') {\n    return function() {\n      return exports.deprecate(fn, msg).apply(this, arguments);\n    };\n  }\n\n  var warned = false;\n  function deprecated() {\n    if (!warned) {\n      if (process.throwDeprecation) {\n        throw new Error(msg);\n      } else if (process.traceDeprecation) {\n        console.trace(msg);\n      } else {\n        console.error(msg);\n      }\n      warned = true;\n    }\n    return fn.apply(this, arguments);\n  }\n\n  return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnvRegex = /^$/;\n\nif (process.env.NODE_DEBUG) {\n  var debugEnv = process.env.NODE_DEBUG;\n  debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+?.]/g, '\\\\$&')\n    .replace(/\\*/g, '.*')\n    .replace(/,/g, '$|^')\n    .toUpperCase();\n  debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');\n}\nexports.debuglog = function(set) {\n  set = set.toUpperCase();\n  if (!debugs[set]) {\n    if (debugEnvRegex.test(set)) {\n      var pid = process.pid;\n      debugs[set] = function() {\n        var msg = exports.format.apply(exports, arguments);\n        console.error('%s %d: %s', set, pid, msg);\n      };\n    } else {\n      debugs[set] = function() {};\n    }\n  }\n  return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n  // default options\n  var ctx = {\n    seen: [],\n    stylize: stylizeNoColor\n  };\n  // legacy...\n  if (arguments.length >= 3) ctx.depth = arguments[2];\n  if (arguments.length >= 4) ctx.colors = arguments[3];\n  if (isBoolean(opts)) {\n    // legacy...\n    ctx.showHidden = opts;\n  } else if (opts) {\n    // got an \"options\" object\n    exports._extend(ctx, opts);\n  }\n  // set default options\n  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n  if (isUndefined(ctx.depth)) ctx.depth = 2;\n  if (isUndefined(ctx.colors)) ctx.colors = false;\n  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n  if (ctx.colors) ctx.stylize = stylizeWithColor;\n  return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n  'bold' : [1, 22],\n  'italic' : [3, 23],\n  'underline' : [4, 24],\n  'inverse' : [7, 27],\n  'white' : [37, 39],\n  'grey' : [90, 39],\n  'black' : [30, 39],\n  'blue' : [34, 39],\n  'cyan' : [36, 39],\n  'green' : [32, 39],\n  'magenta' : [35, 39],\n  'red' : [31, 39],\n  'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n  'special': 'cyan',\n  'number': 'yellow',\n  'boolean': 'yellow',\n  'undefined': 'grey',\n  'null': 'bold',\n  'string': 'green',\n  'date': 'magenta',\n  // \"name\": intentionally not styling\n  'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n  var style = inspect.styles[styleType];\n\n  if (style) {\n    return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n           '\\u001b[' + inspect.colors[style][1] + 'm';\n  } else {\n    return str;\n  }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n  return str;\n}\n\n\nfunction arrayToHash(array) {\n  var hash = {};\n\n  array.forEach(function(val, idx) {\n    hash[val] = true;\n  });\n\n  return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n  // Provide a hook for user-specified inspect functions.\n  // Check that value is an object with an inspect function on it\n  if (ctx.customInspect &&\n      value &&\n      isFunction(value.inspect) &&\n      // Filter out the util module, it's inspect function is special\n      value.inspect !== exports.inspect &&\n      // Also filter out any prototype objects using the circular check.\n      !(value.constructor && value.constructor.prototype === value)) {\n    var ret = value.inspect(recurseTimes, ctx);\n    if (!isString(ret)) {\n      ret = formatValue(ctx, ret, recurseTimes);\n    }\n    return ret;\n  }\n\n  // Primitive types cannot have properties\n  var primitive = formatPrimitive(ctx, value);\n  if (primitive) {\n    return primitive;\n  }\n\n  // Look up the keys of the object.\n  var keys = Object.keys(value);\n  var visibleKeys = arrayToHash(keys);\n\n  if (ctx.showHidden) {\n    keys = Object.getOwnPropertyNames(value);\n  }\n\n  // IE doesn't make error fields non-enumerable\n  // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n  if (isError(value)\n      && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n    return formatError(value);\n  }\n\n  // Some type of object without properties can be shortcutted.\n  if (keys.length === 0) {\n    if (isFunction(value)) {\n      var name = value.name ? ': ' + value.name : '';\n      return ctx.stylize('[Function' + name + ']', 'special');\n    }\n    if (isRegExp(value)) {\n      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n    }\n    if (isDate(value)) {\n      return ctx.stylize(Date.prototype.toString.call(value), 'date');\n    }\n    if (isError(value)) {\n      return formatError(value);\n    }\n  }\n\n  var base = '', array = false, braces = ['{', '}'];\n\n  // Make Array say that they are Array\n  if (isArray(value)) {\n    array = true;\n    braces = ['[', ']'];\n  }\n\n  // Make functions say that they are functions\n  if (isFunction(value)) {\n    var n = value.name ? ': ' + value.name : '';\n    base = ' [Function' + n + ']';\n  }\n\n  // Make RegExps say that they are RegExps\n  if (isRegExp(value)) {\n    base = ' ' + RegExp.prototype.toString.call(value);\n  }\n\n  // Make dates with properties first say the date\n  if (isDate(value)) {\n    base = ' ' + Date.prototype.toUTCString.call(value);\n  }\n\n  // Make error with message first say the error\n  if (isError(value)) {\n    base = ' ' + formatError(value);\n  }\n\n  if (keys.length === 0 && (!array || value.length == 0)) {\n    return braces[0] + base + braces[1];\n  }\n\n  if (recurseTimes < 0) {\n    if (isRegExp(value)) {\n      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n    } else {\n      return ctx.stylize('[Object]', 'special');\n    }\n  }\n\n  ctx.seen.push(value);\n\n  var output;\n  if (array) {\n    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n  } else {\n    output = keys.map(function(key) {\n      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n    });\n  }\n\n  ctx.seen.pop();\n\n  return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n  if (isUndefined(value))\n    return ctx.stylize('undefined', 'undefined');\n  if (isString(value)) {\n    var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n                                             .replace(/'/g, \"\\\\'\")\n                                             .replace(/\\\\\"/g, '\"') + '\\'';\n    return ctx.stylize(simple, 'string');\n  }\n  if (isNumber(value))\n    return ctx.stylize('' + value, 'number');\n  if (isBoolean(value))\n    return ctx.stylize('' + value, 'boolean');\n  // For some reason typeof null is \"object\", so special case here.\n  if (isNull(value))\n    return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n  return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n  var output = [];\n  for (var i = 0, l = value.length; i < l; ++i) {\n    if (hasOwnProperty(value, String(i))) {\n      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n          String(i), true));\n    } else {\n      output.push('');\n    }\n  }\n  keys.forEach(function(key) {\n    if (!key.match(/^\\d+$/)) {\n      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n          key, true));\n    }\n  });\n  return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n  var name, str, desc;\n  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n  if (desc.get) {\n    if (desc.set) {\n      str = ctx.stylize('[Getter/Setter]', 'special');\n    } else {\n      str = ctx.stylize('[Getter]', 'special');\n    }\n  } else {\n    if (desc.set) {\n      str = ctx.stylize('[Setter]', 'special');\n    }\n  }\n  if (!hasOwnProperty(visibleKeys, key)) {\n    name = '[' + key + ']';\n  }\n  if (!str) {\n    if (ctx.seen.indexOf(desc.value) < 0) {\n      if (isNull(recurseTimes)) {\n        str = formatValue(ctx, desc.value, null);\n      } else {\n        str = formatValue(ctx, desc.value, recurseTimes - 1);\n      }\n      if (str.indexOf('\\n') > -1) {\n        if (array) {\n          str = str.split('\\n').map(function(line) {\n            return '  ' + line;\n          }).join('\\n').slice(2);\n        } else {\n          str = '\\n' + str.split('\\n').map(function(line) {\n            return '   ' + line;\n          }).join('\\n');\n        }\n      }\n    } else {\n      str = ctx.stylize('[Circular]', 'special');\n    }\n  }\n  if (isUndefined(name)) {\n    if (array && key.match(/^\\d+$/)) {\n      return str;\n    }\n    name = JSON.stringify('' + key);\n    if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n      name = name.slice(1, -1);\n      name = ctx.stylize(name, 'name');\n    } else {\n      name = name.replace(/'/g, \"\\\\'\")\n                 .replace(/\\\\\"/g, '\"')\n                 .replace(/(^\"|\"$)/g, \"'\");\n      name = ctx.stylize(name, 'string');\n    }\n  }\n\n  return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n  var numLinesEst = 0;\n  var length = output.reduce(function(prev, cur) {\n    numLinesEst++;\n    if (cur.indexOf('\\n') >= 0) numLinesEst++;\n    return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n  }, 0);\n\n  if (length > 60) {\n    return braces[0] +\n           (base === '' ? '' : base + '\\n ') +\n           ' ' +\n           output.join(',\\n  ') +\n           ' ' +\n           braces[1];\n  }\n\n  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexports.types = require('./support/types');\n\nfunction isArray(ar) {\n  return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n  return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n  return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n  return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n  return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n  return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n  return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n  return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n  return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\nexports.types.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n  return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n  return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\nexports.types.isDate = isDate;\n\nfunction isError(e) {\n  return isObject(e) &&\n      (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\nexports.types.isNativeError = isError;\n\nfunction isFunction(arg) {\n  return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n  return arg === null ||\n         typeof arg === 'boolean' ||\n         typeof arg === 'number' ||\n         typeof arg === 'string' ||\n         typeof arg === 'symbol' ||  // ES6 symbol\n         typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n  return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n  return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n              'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n  var d = new Date();\n  var time = [pad(d.getHours()),\n              pad(d.getMinutes()),\n              pad(d.getSeconds())].join(':');\n  return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n *     prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n  // Don't do anything if add isn't an object\n  if (!add || !isObject(add)) return origin;\n\n  var keys = Object.keys(add);\n  var i = keys.length;\n  while (i--) {\n    origin[keys[i]] = add[keys[i]];\n  }\n  return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n  return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nvar kCustomPromisifiedSymbol = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined;\n\nexports.promisify = function promisify(original) {\n  if (typeof original !== 'function')\n    throw new TypeError('The \"original\" argument must be of type Function');\n\n  if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n    var fn = original[kCustomPromisifiedSymbol];\n    if (typeof fn !== 'function') {\n      throw new TypeError('The \"util.promisify.custom\" argument must be of type Function');\n    }\n    Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n      value: fn, enumerable: false, writable: false, configurable: true\n    });\n    return fn;\n  }\n\n  function fn() {\n    var promiseResolve, promiseReject;\n    var promise = new Promise(function (resolve, reject) {\n      promiseResolve = resolve;\n      promiseReject = reject;\n    });\n\n    var args = [];\n    for (var i = 0; i < arguments.length; i++) {\n      args.push(arguments[i]);\n    }\n    args.push(function (err, value) {\n      if (err) {\n        promiseReject(err);\n      } else {\n        promiseResolve(value);\n      }\n    });\n\n    try {\n      original.apply(this, args);\n    } catch (err) {\n      promiseReject(err);\n    }\n\n    return promise;\n  }\n\n  Object.setPrototypeOf(fn, Object.getPrototypeOf(original));\n\n  if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n    value: fn, enumerable: false, writable: false, configurable: true\n  });\n  return Object.defineProperties(\n    fn,\n    getOwnPropertyDescriptors(original)\n  );\n}\n\nexports.promisify.custom = kCustomPromisifiedSymbol\n\nfunction callbackifyOnRejected(reason, cb) {\n  // `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).\n  // Because `null` is a special error value in callbacks which means \"no error\n  // occurred\", we error-wrap so the callback consumer can distinguish between\n  // \"the promise rejected with null\" or \"the promise fulfilled with undefined\".\n  if (!reason) {\n    var newReason = new Error('Promise was rejected with a falsy value');\n    newReason.reason = reason;\n    reason = newReason;\n  }\n  return cb(reason);\n}\n\nfunction callbackify(original) {\n  if (typeof original !== 'function') {\n    throw new TypeError('The \"original\" argument must be of type Function');\n  }\n\n  // We DO NOT return the promise as it gives the user a false sense that\n  // the promise is actually somehow related to the callback's execution\n  // and that the callback throwing will reject the promise.\n  function callbackified() {\n    var args = [];\n    for (var i = 0; i < arguments.length; i++) {\n      args.push(arguments[i]);\n    }\n\n    var maybeCb = args.pop();\n    if (typeof maybeCb !== 'function') {\n      throw new TypeError('The last argument must be of type Function');\n    }\n    var self = this;\n    var cb = function() {\n      return maybeCb.apply(self, arguments);\n    };\n    // In true node style we process the callback on `nextTick` with all the\n    // implications (stack, `uncaughtException`, `async_hooks`)\n    original.apply(this, args)\n      .then(function(ret) { process.nextTick(cb.bind(null, null, ret)) },\n            function(rej) { process.nextTick(callbackifyOnRejected.bind(null, rej, cb)) });\n  }\n\n  Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));\n  Object.defineProperties(callbackified,\n                          getOwnPropertyDescriptors(original));\n  return callbackified;\n}\nexports.callbackify = callbackify;\n","module.exports = require('util').inspect;\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n    ? Symbol.toStringTag\n    : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n    [].__proto__ === Array.prototype // eslint-disable-line no-proto\n        ? function (O) {\n            return O.__proto__; // eslint-disable-line no-proto\n        }\n        : null\n);\n\nfunction addNumericSeparator(num, str) {\n    if (\n        num === Infinity\n        || num === -Infinity\n        || num !== num\n        || (num && num > -1000 && num < 1000)\n        || $test.call(/e/, str)\n    ) {\n        return str;\n    }\n    var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n    if (typeof num === 'number') {\n        var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n        if (int !== num) {\n            var intStr = String(int);\n            var dec = $slice.call(str, intStr.length + 1);\n            return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n        }\n    }\n    return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n    var opts = options || {};\n\n    if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n        throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n    }\n    if (\n        has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n            ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n            : opts.maxStringLength !== null\n        )\n    ) {\n        throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n    }\n    var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n    if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n        throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n    }\n\n    if (\n        has(opts, 'indent')\n        && opts.indent !== null\n        && opts.indent !== '\\t'\n        && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n    ) {\n        throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n    }\n    if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n        throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n    }\n    var numericSeparator = opts.numericSeparator;\n\n    if (typeof obj === 'undefined') {\n        return 'undefined';\n    }\n    if (obj === null) {\n        return 'null';\n    }\n    if (typeof obj === 'boolean') {\n        return obj ? 'true' : 'false';\n    }\n\n    if (typeof obj === 'string') {\n        return inspectString(obj, opts);\n    }\n    if (typeof obj === 'number') {\n        if (obj === 0) {\n            return Infinity / obj > 0 ? '0' : '-0';\n        }\n        var str = String(obj);\n        return numericSeparator ? addNumericSeparator(obj, str) : str;\n    }\n    if (typeof obj === 'bigint') {\n        var bigIntStr = String(obj) + 'n';\n        return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n    }\n\n    var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n    if (typeof depth === 'undefined') { depth = 0; }\n    if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n        return isArray(obj) ? '[Array]' : '[Object]';\n    }\n\n    var indent = getIndent(opts, depth);\n\n    if (typeof seen === 'undefined') {\n        seen = [];\n    } else if (indexOf(seen, obj) >= 0) {\n        return '[Circular]';\n    }\n\n    function inspect(value, from, noIndent) {\n        if (from) {\n            seen = $arrSlice.call(seen);\n            seen.push(from);\n        }\n        if (noIndent) {\n            var newOpts = {\n                depth: opts.depth\n            };\n            if (has(opts, 'quoteStyle')) {\n                newOpts.quoteStyle = opts.quoteStyle;\n            }\n            return inspect_(value, newOpts, depth + 1, seen);\n        }\n        return inspect_(value, opts, depth + 1, seen);\n    }\n\n    if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n        var name = nameOf(obj);\n        var keys = arrObjKeys(obj, inspect);\n        return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n    }\n    if (isSymbol(obj)) {\n        var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n        return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n    }\n    if (isElement(obj)) {\n        var s = '<' + $toLowerCase.call(String(obj.nodeName));\n        var attrs = obj.attributes || [];\n        for (var i = 0; i < attrs.length; i++) {\n            s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n        }\n        s += '>';\n        if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n        s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';\n        return s;\n    }\n    if (isArray(obj)) {\n        if (obj.length === 0) { return '[]'; }\n        var xs = arrObjKeys(obj, inspect);\n        if (indent && !singleLineValues(xs)) {\n            return '[' + indentedJoin(xs, indent) + ']';\n        }\n        return '[ ' + $join.call(xs, ', ') + ' ]';\n    }\n    if (isError(obj)) {\n        var parts = arrObjKeys(obj, inspect);\n        if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n            return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n        }\n        if (parts.length === 0) { return '[' + String(obj) + ']'; }\n        return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n    }\n    if (typeof obj === 'object' && customInspect) {\n        if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n            return utilInspect(obj, { depth: maxDepth - depth });\n        } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n            return obj.inspect();\n        }\n    }\n    if (isMap(obj)) {\n        var mapParts = [];\n        mapForEach.call(obj, function (value, key) {\n            mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n        });\n        return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n    }\n    if (isSet(obj)) {\n        var setParts = [];\n        setForEach.call(obj, function (value) {\n            setParts.push(inspect(value, obj));\n        });\n        return collectionOf('Set', setSize.call(obj), setParts, indent);\n    }\n    if (isWeakMap(obj)) {\n        return weakCollectionOf('WeakMap');\n    }\n    if (isWeakSet(obj)) {\n        return weakCollectionOf('WeakSet');\n    }\n    if (isWeakRef(obj)) {\n        return weakCollectionOf('WeakRef');\n    }\n    if (isNumber(obj)) {\n        return markBoxed(inspect(Number(obj)));\n    }\n    if (isBigInt(obj)) {\n        return markBoxed(inspect(bigIntValueOf.call(obj)));\n    }\n    if (isBoolean(obj)) {\n        return markBoxed(booleanValueOf.call(obj));\n    }\n    if (isString(obj)) {\n        return markBoxed(inspect(String(obj)));\n    }\n    if (!isDate(obj) && !isRegExp(obj)) {\n        var ys = arrObjKeys(obj, inspect);\n        var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n        var protoTag = obj instanceof Object ? '' : 'null prototype';\n        var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n        var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n        var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n        if (ys.length === 0) { return tag + '{}'; }\n        if (indent) {\n            return tag + '{' + indentedJoin(ys, indent) + '}';\n        }\n        return tag + '{ ' + $join.call(ys, ', ') + ' }';\n    }\n    return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n    var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n    return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n    return $replace.call(String(s), /\"/g, '&quot;');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n    if (hasShammedSymbols) {\n        return obj && typeof obj === 'object' && obj instanceof Symbol;\n    }\n    if (typeof obj === 'symbol') {\n        return true;\n    }\n    if (!obj || typeof obj !== 'object' || !symToString) {\n        return false;\n    }\n    try {\n        symToString.call(obj);\n        return true;\n    } catch (e) {}\n    return false;\n}\n\nfunction isBigInt(obj) {\n    if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n        return false;\n    }\n    try {\n        bigIntValueOf.call(obj);\n        return true;\n    } catch (e) {}\n    return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n    return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n    return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n    if (f.name) { return f.name; }\n    var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n    if (m) { return m[1]; }\n    return null;\n}\n\nfunction indexOf(xs, x) {\n    if (xs.indexOf) { return xs.indexOf(x); }\n    for (var i = 0, l = xs.length; i < l; i++) {\n        if (xs[i] === x) { return i; }\n    }\n    return -1;\n}\n\nfunction isMap(x) {\n    if (!mapSize || !x || typeof x !== 'object') {\n        return false;\n    }\n    try {\n        mapSize.call(x);\n        try {\n            setSize.call(x);\n        } catch (s) {\n            return true;\n        }\n        return x instanceof Map; // core-js workaround, pre-v2.5.0\n    } catch (e) {}\n    return false;\n}\n\nfunction isWeakMap(x) {\n    if (!weakMapHas || !x || typeof x !== 'object') {\n        return false;\n    }\n    try {\n        weakMapHas.call(x, weakMapHas);\n        try {\n            weakSetHas.call(x, weakSetHas);\n        } catch (s) {\n            return true;\n        }\n        return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n    } catch (e) {}\n    return false;\n}\n\nfunction isWeakRef(x) {\n    if (!weakRefDeref || !x || typeof x !== 'object') {\n        return false;\n    }\n    try {\n        weakRefDeref.call(x);\n        return true;\n    } catch (e) {}\n    return false;\n}\n\nfunction isSet(x) {\n    if (!setSize || !x || typeof x !== 'object') {\n        return false;\n    }\n    try {\n        setSize.call(x);\n        try {\n            mapSize.call(x);\n        } catch (m) {\n            return true;\n        }\n        return x instanceof Set; // core-js workaround, pre-v2.5.0\n    } catch (e) {}\n    return false;\n}\n\nfunction isWeakSet(x) {\n    if (!weakSetHas || !x || typeof x !== 'object') {\n        return false;\n    }\n    try {\n        weakSetHas.call(x, weakSetHas);\n        try {\n            weakMapHas.call(x, weakMapHas);\n        } catch (s) {\n            return true;\n        }\n        return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n    } catch (e) {}\n    return false;\n}\n\nfunction isElement(x) {\n    if (!x || typeof x !== 'object') { return false; }\n    if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n        return true;\n    }\n    return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n    if (str.length > opts.maxStringLength) {\n        var remaining = str.length - opts.maxStringLength;\n        var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n        return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n    }\n    // eslint-disable-next-line no-control-regex\n    var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n    return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n    var n = c.charCodeAt(0);\n    var x = {\n        8: 'b',\n        9: 't',\n        10: 'n',\n        12: 'f',\n        13: 'r'\n    }[n];\n    if (x) { return '\\\\' + x; }\n    return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n    return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n    return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n    var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n    return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n    for (var i = 0; i < xs.length; i++) {\n        if (indexOf(xs[i], '\\n') >= 0) {\n            return false;\n        }\n    }\n    return true;\n}\n\nfunction getIndent(opts, depth) {\n    var baseIndent;\n    if (opts.indent === '\\t') {\n        baseIndent = '\\t';\n    } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n        baseIndent = $join.call(Array(opts.indent + 1), ' ');\n    } else {\n        return null;\n    }\n    return {\n        base: baseIndent,\n        prev: $join.call(Array(depth + 1), baseIndent)\n    };\n}\n\nfunction indentedJoin(xs, indent) {\n    if (xs.length === 0) { return ''; }\n    var lineJoiner = '\\n' + indent.prev + indent.base;\n    return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n    var isArr = isArray(obj);\n    var xs = [];\n    if (isArr) {\n        xs.length = obj.length;\n        for (var i = 0; i < obj.length; i++) {\n            xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n        }\n    }\n    var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n    var symMap;\n    if (hasShammedSymbols) {\n        symMap = {};\n        for (var k = 0; k < syms.length; k++) {\n            symMap['$' + syms[k]] = syms[k];\n        }\n    }\n\n    for (var key in obj) { // eslint-disable-line no-restricted-syntax\n        if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n        if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n        if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n            // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n            continue; // eslint-disable-line no-restricted-syntax, no-continue\n        } else if ($test.call(/[^\\w$]/, key)) {\n            xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n        } else {\n            xs.push(key + ': ' + inspect(obj[key], obj));\n        }\n    }\n    if (typeof gOPS === 'function') {\n        for (var j = 0; j < syms.length; j++) {\n            if (isEnumerable.call(obj, syms[j])) {\n                xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n            }\n        }\n    }\n    return xs;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\n// modified from https://github.com/es-shims/es6-shim\nvar objectKeys = require('object-keys');\nvar hasSymbols = require('has-symbols/shams')();\nvar callBound = require('call-bind/callBound');\nvar toObject = Object;\nvar $push = callBound('Array.prototype.push');\nvar $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');\nvar originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function assign(target, source1) {\n\tif (target == null) { throw new TypeError('target must be an object'); }\n\tvar to = toObject(target); // step 1\n\tif (arguments.length === 1) {\n\t\treturn to; // step 2\n\t}\n\tfor (var s = 1; s < arguments.length; ++s) {\n\t\tvar from = toObject(arguments[s]); // step 3.a.i\n\n\t\t// step 3.a.ii:\n\t\tvar keys = objectKeys(from);\n\t\tvar getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);\n\t\tif (getSymbols) {\n\t\t\tvar syms = getSymbols(from);\n\t\t\tfor (var j = 0; j < syms.length; ++j) {\n\t\t\t\tvar key = syms[j];\n\t\t\t\tif ($propIsEnumerable(from, key)) {\n\t\t\t\t\t$push(keys, key);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// step 3.a.iii:\n\t\tfor (var i = 0; i < keys.length; ++i) {\n\t\t\tvar nextKey = keys[i];\n\t\t\tif ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2\n\t\t\t\tvar propValue = from[nextKey]; // step 3.a.iii.2.a\n\t\t\t\tto[nextKey] = propValue; // step 3.a.iii.2.b\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to; // step 4\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar lacksProperEnumerationOrder = function () {\n\tif (!Object.assign) {\n\t\treturn false;\n\t}\n\t/*\n\t * v8, specifically in node 4.x, has a bug with incorrect property enumeration order\n\t * note: this does not detect the bug unless there's 20 characters\n\t */\n\tvar str = 'abcdefghijklmnopqrst';\n\tvar letters = str.split('');\n\tvar map = {};\n\tfor (var i = 0; i < letters.length; ++i) {\n\t\tmap[letters[i]] = letters[i];\n\t}\n\tvar obj = Object.assign({}, map);\n\tvar actual = '';\n\tfor (var k in obj) {\n\t\tactual += k;\n\t}\n\treturn str !== actual;\n};\n\nvar assignHasPendingExceptions = function () {\n\tif (!Object.assign || !Object.preventExtensions) {\n\t\treturn false;\n\t}\n\t/*\n\t * Firefox 37 still has \"pending exception\" logic in its Object.assign implementation,\n\t * which is 72% slower than our shim, and Firefox 40's native implementation.\n\t */\n\tvar thrower = Object.preventExtensions({ 1: 2 });\n\ttry {\n\t\tObject.assign(thrower, 'xy');\n\t} catch (e) {\n\t\treturn thrower[1] === 'y';\n\t}\n\treturn false;\n};\n\nmodule.exports = function getPolyfill() {\n\tif (!Object.assign) {\n\t\treturn implementation;\n\t}\n\tif (lacksProperEnumerationOrder()) {\n\t\treturn implementation;\n\t}\n\tif (assignHasPendingExceptions()) {\n\t\treturn implementation;\n\t}\n\treturn Object.assign;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimAssign() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tObject,\n\t\t{ assign: polyfill },\n\t\t{ assign: function () { return Object.assign !== polyfill; } }\n\t);\n\treturn polyfill;\n};\n","'use strict';\n\nvar defineProperties = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar polyfill = callBind.apply(getPolyfill());\n// eslint-disable-next-line no-unused-vars\nvar bound = function assign(target, source1) {\n\treturn polyfill(Object, arguments);\n};\n\ndefineProperties(bound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = bound;\n","'use strict';\n\nvar objectKeys = require('object-keys');\nvar isArguments = require('is-arguments');\nvar is = require('object-is');\nvar isRegex = require('is-regex');\nvar flags = require('regexp.prototype.flags');\nvar isArray = require('isarray');\nvar isDate = require('is-date-object');\nvar whichBoxedPrimitive = require('which-boxed-primitive');\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar whichCollection = require('which-collection');\nvar getIterator = require('es-get-iterator');\nvar getSideChannel = require('side-channel');\nvar whichTypedArray = require('which-typed-array');\nvar assign = require('object.assign');\n\nvar $getTime = callBound('Date.prototype.getTime');\nvar gPO = Object.getPrototypeOf;\nvar $objToString = callBound('Object.prototype.toString');\n\nvar $Set = GetIntrinsic('%Set%', true);\nvar $mapHas = callBound('Map.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSize = callBound('Map.prototype.size', true);\nvar $setAdd = callBound('Set.prototype.add', true);\nvar $setDelete = callBound('Set.prototype.delete', true);\nvar $setHas = callBound('Set.prototype.has', true);\nvar $setSize = callBound('Set.prototype.size', true);\n\n// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L401-L414\nfunction setHasEqualElement(set, val1, opts, channel) {\n  var i = getIterator(set);\n  var result;\n  while ((result = i.next()) && !result.done) {\n    if (internalDeepEqual(val1, result.value, opts, channel)) { // eslint-disable-line no-use-before-define\n      // Remove the matching element to make sure we do not check that again.\n      $setDelete(set, result.value);\n      return true;\n    }\n  }\n\n  return false;\n}\n\n// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L416-L439\nfunction findLooseMatchingPrimitives(prim) {\n  if (typeof prim === 'undefined') {\n    return null;\n  }\n  if (typeof prim === 'object') { // Only pass in null as object!\n    return void 0;\n  }\n  if (typeof prim === 'symbol') {\n    return false;\n  }\n  if (typeof prim === 'string' || typeof prim === 'number') {\n    // Loose equal entries exist only if the string is possible to convert to a regular number and not NaN.\n    return +prim === +prim; // eslint-disable-line no-implicit-coercion\n  }\n  return true;\n}\n\n// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L449-L460\nfunction mapMightHaveLoosePrim(a, b, prim, item, opts, channel) {\n  var altValue = findLooseMatchingPrimitives(prim);\n  if (altValue != null) {\n    return altValue;\n  }\n  var curB = $mapGet(b, altValue);\n  var looseOpts = assign({}, opts, { strict: false });\n  if (\n    (typeof curB === 'undefined' && !$mapHas(b, altValue))\n    // eslint-disable-next-line no-use-before-define\n    || !internalDeepEqual(item, curB, looseOpts, channel)\n  ) {\n    return false;\n  }\n  // eslint-disable-next-line no-use-before-define\n  return !$mapHas(a, altValue) && internalDeepEqual(item, curB, looseOpts, channel);\n}\n\n// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L441-L447\nfunction setMightHaveLoosePrim(a, b, prim) {\n  var altValue = findLooseMatchingPrimitives(prim);\n  if (altValue != null) {\n    return altValue;\n  }\n\n  return $setHas(b, altValue) && !$setHas(a, altValue);\n}\n\n// taken from https://github.com/browserify/commonjs-assert/blob/bba838e9ba9e28edf3127ce6974624208502f6bc/internal/util/comparisons.js#L518-L533\nfunction mapHasEqualEntry(set, map, key1, item1, opts, channel) {\n  var i = getIterator(set);\n  var result;\n  var key2;\n  while ((result = i.next()) && !result.done) {\n    key2 = result.value;\n    if (\n      // eslint-disable-next-line no-use-before-define\n      internalDeepEqual(key1, key2, opts, channel)\n      // eslint-disable-next-line no-use-before-define\n      && internalDeepEqual(item1, $mapGet(map, key2), opts, channel)\n    ) {\n      $setDelete(set, key2);\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction internalDeepEqual(actual, expected, options, channel) {\n  var opts = options || {};\n\n  // 7.1. All identical values are equivalent, as determined by ===.\n  if (opts.strict ? is(actual, expected) : actual === expected) {\n    return true;\n  }\n\n  var actualBoxed = whichBoxedPrimitive(actual);\n  var expectedBoxed = whichBoxedPrimitive(expected);\n  if (actualBoxed !== expectedBoxed) {\n    return false;\n  }\n\n  // 7.3. Other pairs that do not both pass typeof value == 'object', equivalence is determined by ==.\n  if (!actual || !expected || (typeof actual !== 'object' && typeof expected !== 'object')) {\n    return opts.strict ? is(actual, expected) : actual == expected; // eslint-disable-line eqeqeq\n  }\n\n  /*\n   * 7.4. For all other Object pairs, including Array objects, equivalence is\n   * determined by having the same number of owned properties (as verified\n   * with Object.prototype.hasOwnProperty.call), the same set of keys\n   * (although not necessarily the same order), equivalent values for every\n   * corresponding key, and an identical 'prototype' property. Note: this\n   * accounts for both named and indexed properties on Arrays.\n   */\n  // see https://github.com/nodejs/node/commit/d3aafd02efd3a403d646a3044adcf14e63a88d32 for memos/channel inspiration\n\n  var hasActual = channel.has(actual);\n  var hasExpected = channel.has(expected);\n  var sentinel;\n  if (hasActual && hasExpected) {\n    if (channel.get(actual) === channel.get(expected)) {\n      return true;\n    }\n  } else {\n    sentinel = {};\n  }\n  if (!hasActual) { channel.set(actual, sentinel); }\n  if (!hasExpected) { channel.set(expected, sentinel); }\n\n  // eslint-disable-next-line no-use-before-define\n  return objEquiv(actual, expected, opts, channel);\n}\n\nfunction isBuffer(x) {\n  if (!x || typeof x !== 'object' || typeof x.length !== 'number') {\n    return false;\n  }\n  if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n    return false;\n  }\n  if (x.length > 0 && typeof x[0] !== 'number') {\n    return false;\n  }\n\n  return !!(x.constructor && x.constructor.isBuffer && x.constructor.isBuffer(x));\n}\n\nfunction setEquiv(a, b, opts, channel) {\n  if ($setSize(a) !== $setSize(b)) {\n    return false;\n  }\n  var iA = getIterator(a);\n  var iB = getIterator(b);\n  var resultA;\n  var resultB;\n  var set;\n  while ((resultA = iA.next()) && !resultA.done) {\n    if (resultA.value && typeof resultA.value === 'object') {\n      if (!set) { set = new $Set(); }\n      $setAdd(set, resultA.value);\n    } else if (!$setHas(b, resultA.value)) {\n      if (opts.strict) { return false; }\n      if (!setMightHaveLoosePrim(a, b, resultA.value)) {\n        return false;\n      }\n      if (!set) { set = new $Set(); }\n      $setAdd(set, resultA.value);\n    }\n  }\n  if (set) {\n    while ((resultB = iB.next()) && !resultB.done) {\n      // We have to check if a primitive value is already matching and only if it's not, go hunting for it.\n      if (resultB.value && typeof resultB.value === 'object') {\n        if (!setHasEqualElement(set, resultB.value, opts.strict, channel)) {\n          return false;\n        }\n      } else if (\n        !opts.strict\n        && !$setHas(a, resultB.value)\n        && !setHasEqualElement(set, resultB.value, opts.strict, channel)\n      ) {\n        return false;\n      }\n    }\n    return $setSize(set) === 0;\n  }\n  return true;\n}\n\nfunction mapEquiv(a, b, opts, channel) {\n  if ($mapSize(a) !== $mapSize(b)) {\n    return false;\n  }\n  var iA = getIterator(a);\n  var iB = getIterator(b);\n  var resultA;\n  var resultB;\n  var set;\n  var key;\n  var item1;\n  var item2;\n  while ((resultA = iA.next()) && !resultA.done) {\n    key = resultA.value[0];\n    item1 = resultA.value[1];\n    if (key && typeof key === 'object') {\n      if (!set) { set = new $Set(); }\n      $setAdd(set, key);\n    } else {\n      item2 = $mapGet(b, key);\n      if ((typeof item2 === 'undefined' && !$mapHas(b, key)) || !internalDeepEqual(item1, item2, opts, channel)) {\n        if (opts.strict) {\n          return false;\n        }\n        if (!mapMightHaveLoosePrim(a, b, key, item1, opts, channel)) {\n          return false;\n        }\n        if (!set) { set = new $Set(); }\n        $setAdd(set, key);\n      }\n    }\n  }\n\n  if (set) {\n    while ((resultB = iB.next()) && !resultB.done) {\n      key = resultB.value[0];\n      item2 = resultB.value[1];\n      if (key && typeof key === 'object') {\n        if (!mapHasEqualEntry(set, a, key, item2, opts, channel)) {\n          return false;\n        }\n      } else if (\n        !opts.strict\n        && (!a.has(key) || !internalDeepEqual($mapGet(a, key), item2, opts, channel))\n        && !mapHasEqualEntry(set, a, key, item2, assign({}, opts, { strict: false }), channel)\n      ) {\n        return false;\n      }\n    }\n    return $setSize(set) === 0;\n  }\n  return true;\n}\n\nfunction objEquiv(a, b, opts, channel) {\n  /* eslint max-statements: [2, 100], max-lines-per-function: [2, 120], max-depth: [2, 5] */\n  var i, key;\n\n  if (typeof a !== typeof b) { return false; }\n  if (a == null || b == null) { return false; }\n\n  if ($objToString(a) !== $objToString(b)) { return false; }\n\n  if (isArguments(a) !== isArguments(b)) { return false; }\n\n  var aIsArray = isArray(a);\n  var bIsArray = isArray(b);\n  if (aIsArray !== bIsArray) { return false; }\n\n  // TODO: replace when a cross-realm brand check is available\n  var aIsError = a instanceof Error;\n  var bIsError = b instanceof Error;\n  if (aIsError !== bIsError) { return false; }\n  if (aIsError || bIsError) {\n    if (a.name !== b.name || a.message !== b.message) { return false; }\n  }\n\n  var aIsRegex = isRegex(a);\n  var bIsRegex = isRegex(b);\n  if (aIsRegex !== bIsRegex) { return false; }\n  if ((aIsRegex || bIsRegex) && (a.source !== b.source || flags(a) !== flags(b))) {\n    return false;\n  }\n\n  var aIsDate = isDate(a);\n  var bIsDate = isDate(b);\n  if (aIsDate !== bIsDate) { return false; }\n  if (aIsDate || bIsDate) { // && would work too, because both are true or both false here\n    if ($getTime(a) !== $getTime(b)) { return false; }\n  }\n  if (opts.strict && gPO && gPO(a) !== gPO(b)) { return false; }\n\n  if (whichTypedArray(a) !== whichTypedArray(b)) {\n    return false;\n  }\n\n  var aIsBuffer = isBuffer(a);\n  var bIsBuffer = isBuffer(b);\n  if (aIsBuffer !== bIsBuffer) { return false; }\n  if (aIsBuffer || bIsBuffer) { // && would work too, because both are true or both false here\n    if (a.length !== b.length) { return false; }\n    for (i = 0; i < a.length; i++) {\n      if (a[i] !== b[i]) { return false; }\n    }\n    return true;\n  }\n\n  if (typeof a !== typeof b) { return false; }\n\n  var ka = objectKeys(a);\n  var kb = objectKeys(b);\n  // having the same number of owned properties (keys incorporates hasOwnProperty)\n  if (ka.length !== kb.length) { return false; }\n\n  // the same set of keys (although not necessarily the same order),\n  ka.sort();\n  kb.sort();\n  // ~~~cheap key test\n  for (i = ka.length - 1; i >= 0; i--) {\n    if (ka[i] != kb[i]) { return false; } // eslint-disable-line eqeqeq\n  }\n\n  // equivalent values for every corresponding key, and ~~~possibly expensive deep test\n  for (i = ka.length - 1; i >= 0; i--) {\n    key = ka[i];\n    if (!internalDeepEqual(a[key], b[key], opts, channel)) { return false; }\n  }\n\n  var aCollection = whichCollection(a);\n  var bCollection = whichCollection(b);\n  if (aCollection !== bCollection) {\n    return false;\n  }\n  if (aCollection === 'Set' || bCollection === 'Set') { // aCollection === bCollection\n    return setEquiv(a, b, opts, channel);\n  }\n  if (aCollection === 'Map') { // aCollection === bCollection\n    return mapEquiv(a, b, opts, channel);\n  }\n\n  return true;\n}\n\nmodule.exports = function deepEqual(a, b, opts) {\n  return internalDeepEqual(a, b, opts, getSideChannel());\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _deepEqual = _interopRequireDefault(require(\"deep-equal\"));\n\nvar _iterationDecorator = _interopRequireDefault(require(\"./util/iterationDecorator\"));\n\nvar _rolesMap = _interopRequireDefault(require(\"./rolesMap\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar elementRoles = [];\n\nvar keys = _rolesMap.default.keys();\n\nfor (var i = 0; i < keys.length; i++) {\n  var key = keys[i];\n\n  var role = _rolesMap.default.get(key);\n\n  if (role) {\n    var concepts = [].concat(role.baseConcepts, role.relatedConcepts);\n\n    for (var k = 0; k < concepts.length; k++) {\n      var relation = concepts[k];\n\n      if (relation.module === 'HTML') {\n        var concept = relation.concept;\n\n        if (concept) {\n          (function () {\n            var conceptStr = JSON.stringify(concept);\n            var elementRoleRelation = elementRoles.find(function (relation) {\n              return JSON.stringify(relation[0]) === conceptStr;\n            });\n            var roles = void 0;\n\n            if (elementRoleRelation) {\n              roles = elementRoleRelation[1];\n            } else {\n              roles = [];\n            }\n\n            var isUnique = true;\n\n            for (var _i = 0; _i < roles.length; _i++) {\n              if (roles[_i] === key) {\n                isUnique = false;\n                break;\n              }\n            }\n\n            if (isUnique) {\n              roles.push(key);\n            }\n\n            elementRoles.push([concept, roles]);\n          })();\n        }\n      }\n    }\n  }\n}\n\nvar elementRoleMap = {\n  entries: function entries() {\n    return elementRoles;\n  },\n  forEach: function forEach(fn) {\n    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n    var _iterator = _createForOfIteratorHelper(elementRoles),\n        _step;\n\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var _step$value = _slicedToArray(_step.value, 2),\n            _key = _step$value[0],\n            values = _step$value[1];\n\n        fn.call(thisArg, values, _key, elementRoles);\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n  },\n  get: function get(key) {\n    var item = elementRoles.find(function (tuple) {\n      return (0, _deepEqual.default)(key, tuple[0]);\n    });\n    return item && item[1];\n  },\n  has: function has(key) {\n    return !!this.get(key);\n  },\n  keys: function keys() {\n    return elementRoles.map(function (_ref) {\n      var _ref2 = _slicedToArray(_ref, 1),\n          key = _ref2[0];\n\n      return key;\n    });\n  },\n  values: function values() {\n    return elementRoles.map(function (_ref3) {\n      var _ref4 = _slicedToArray(_ref3, 2),\n          values = _ref4[1];\n\n      return values;\n    });\n  }\n};\n\nvar _default = (0, _iterationDecorator.default)(elementRoleMap, elementRoleMap.entries());\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _iterationDecorator = _interopRequireDefault(require(\"./util/iterationDecorator\"));\n\nvar _rolesMap = _interopRequireDefault(require(\"./rolesMap\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar roleElement = [];\n\nvar keys = _rolesMap.default.keys();\n\nvar _loop = function _loop(i) {\n  var key = keys[i];\n\n  var role = _rolesMap.default.get(key);\n\n  if (role) {\n    var concepts = [].concat(role.baseConcepts, role.relatedConcepts);\n\n    for (var k = 0; k < concepts.length; k++) {\n      var relation = concepts[k];\n\n      if (relation.module === 'HTML') {\n        var concept = relation.concept;\n\n        if (concept) {\n          var roleElementRelation = roleElement.find(function (item) {\n            return item[0] === key;\n          });\n          var relationConcepts = void 0;\n\n          if (roleElementRelation) {\n            relationConcepts = roleElementRelation[1];\n          } else {\n            relationConcepts = [];\n          }\n\n          relationConcepts.push(concept);\n          roleElement.push([key, relationConcepts]);\n        }\n      }\n    }\n  }\n};\n\nfor (var i = 0; i < keys.length; i++) {\n  _loop(i);\n}\n\nvar roleElementMap = {\n  entries: function entries() {\n    return roleElement;\n  },\n  forEach: function forEach(fn) {\n    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n    var _iterator = _createForOfIteratorHelper(roleElement),\n        _step;\n\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var _step$value = _slicedToArray(_step.value, 2),\n            key = _step$value[0],\n            values = _step$value[1];\n\n        fn.call(thisArg, values, key, roleElement);\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n  },\n  get: function get(key) {\n    var item = roleElement.find(function (tuple) {\n      return tuple[0] === key ? true : false;\n    });\n    return item && item[1];\n  },\n  has: function has(key) {\n    return !!this.get(key);\n  },\n  keys: function keys() {\n    return roleElement.map(function (_ref) {\n      var _ref2 = _slicedToArray(_ref, 1),\n          key = _ref2[0];\n\n      return key;\n    });\n  },\n  values: function values() {\n    return roleElement.map(function (_ref3) {\n      var _ref4 = _slicedToArray(_ref3, 2),\n          values = _ref4[1];\n\n      return values;\n    });\n  }\n};\n\nvar _default = (0, _iterationDecorator.default)(roleElementMap, roleElementMap.entries());\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.roles = exports.roleElements = exports.elementRoles = exports.dom = exports.aria = void 0;\n\nvar _ariaPropsMap = _interopRequireDefault(require(\"./ariaPropsMap\"));\n\nvar _domMap = _interopRequireDefault(require(\"./domMap\"));\n\nvar _rolesMap = _interopRequireDefault(require(\"./rolesMap\"));\n\nvar _elementRoleMap = _interopRequireDefault(require(\"./elementRoleMap\"));\n\nvar _roleElementMap = _interopRequireDefault(require(\"./roleElementMap\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar aria = _ariaPropsMap.default;\nexports.aria = aria;\nvar dom = _domMap.default;\nexports.dom = dom;\nvar roles = _rolesMap.default;\nexports.roles = roles;\nvar elementRoles = _elementRoleMap.default;\nexports.elementRoles = elementRoles;\nvar roleElements = _roleElementMap.default;\nexports.roleElements = roleElements;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nfunction iteratorProxy() {\n  var values = this;\n  var index = 0;\n  var iter = {\n    '@@iterator': function iterator() {\n      return iter;\n    },\n    next: function next() {\n      if (index < values.length) {\n        var value = values[index];\n        index = index + 1;\n        return {\n          done: false,\n          value: value\n        };\n      } else {\n        return {\n          done: true\n        };\n      }\n    }\n  };\n  return iter;\n}\n\nvar _default = iteratorProxy;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = iterationDecorator;\n\nvar _iteratorProxy = _interopRequireDefault(require(\"./iteratorProxy\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction iterationDecorator(collection, entries) {\n  if (typeof Symbol === 'function' && _typeof(Symbol.iterator) === 'symbol') {\n    Object.defineProperty(collection, Symbol.iterator, {\n      value: _iteratorProxy.default.bind(entries)\n    });\n  }\n\n  return collection;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar AbbrRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'abbr'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = AbbrRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar AlertDialogRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'alertdialog'\n    }\n  }],\n  type: 'window'\n};\nvar _default = AlertDialogRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar AlertRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'alert'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = AlertRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar AnnotationRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = AnnotationRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ApplicationRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'application'\n    }\n  }],\n  type: 'window'\n};\nvar _default = ApplicationRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ArticleRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'article'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'article'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ArticleRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar AudioRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'audio'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = AudioRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar BannerRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'banner'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = BannerRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar BlockquoteRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'blockquote'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = BlockquoteRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar BusyIndicatorRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      attributes: [{\n        name: 'aria-busy',\n        value: 'true'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = BusyIndicatorRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ButtonRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'button'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'button'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = ButtonRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar CanvasRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'canvas'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = CanvasRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar CaptionRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'caption'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = CaptionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar CellRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'cell'\n    }\n  }, {\n    module: 'ARIA',\n    concept: {\n      name: 'gridcell'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'td'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = CellRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar CheckBoxRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'checkbox'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'checkbox'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = CheckBoxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ColorWellRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'color'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = ColorWellRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ColumnHeaderRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'columnheader'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'th'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = ColumnHeaderRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ColumnRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = ColumnRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ComboBoxRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'combobox'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'select'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = ComboBoxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ComplementaryRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'complementary'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ComplementaryRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ContentInfoRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'structureinfo'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ContentInfoRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DateRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'date'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = DateRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DateTimeRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'datetime'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = DateTimeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DefinitionRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'dfn'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = DefinitionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DescriptionListDetailRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'dd'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = DescriptionListDetailRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DescriptionListRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'dl'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = DescriptionListRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DescriptionListTermRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'dt'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = DescriptionListTermRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DetailsRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'details'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = DetailsRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DialogRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'dialog'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'dialog'\n    }\n  }],\n  type: 'window'\n};\nvar _default = DialogRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DirectoryRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'directory'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'dir'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = DirectoryRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DisclosureTriangleRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'summary'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = DisclosureTriangleRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DivRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'div'\n    }\n  }],\n  type: 'generic'\n};\nvar _default = DivRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar DocumentRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'document'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = DocumentRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar EmbeddedObjectRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'embed'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = EmbeddedObjectRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar FeedRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'feed'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = FeedRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar FigcaptionRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'figcaption'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = FigcaptionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar FigureRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'figure'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'figure'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = FigureRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar FooterRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'footer'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = FooterRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar FormRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'form'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'form'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = FormRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar GridRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'grid'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = GridRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar GroupRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'group'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = GroupRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar HeadingRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'heading'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'h1'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'h2'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'h3'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'h4'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'h5'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'h6'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = HeadingRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar IframePresentationalRole = {\n  relatedConcepts: [],\n  type: 'window'\n};\nvar _default = IframePresentationalRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar IframeRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'iframe'\n    }\n  }],\n  type: 'window'\n};\nvar _default = IframeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar IgnoredRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = IgnoredRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ImageMapLinkRole = {\n  relatedConcepts: [],\n  type: 'widget'\n};\nvar _default = ImageMapLinkRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ImageMapRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'img',\n      attributes: [{\n        name: 'usemap'\n      }]\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ImageMapRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ImageRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'img'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'img'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ImageRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar InlineTextBoxRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'input'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = InlineTextBoxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar InputTimeRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'time'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = InputTimeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar LabelRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'label'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = LabelRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar LegendRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'legend'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = LegendRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar LineBreakRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'br'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = LineBreakRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar LinkRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'link'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'a',\n      attributes: [{\n        name: 'href'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = LinkRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ListBoxOptionRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'option'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'option'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = ListBoxOptionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ListBoxRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'listbox'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'datalist'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'select'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = ListBoxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ListItemRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'listitem'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'li'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ListItemRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ListMarkerRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = ListMarkerRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ListRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'list'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'ul'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'ol'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ListRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar LogRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'log'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = LogRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MainRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'main'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'main'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = MainRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MarkRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'mark'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = MarkRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MarqueeRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'marquee'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'marquee'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = MarqueeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MathRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'math'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = MathRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MenuBarRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'menubar'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = MenuBarRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MenuButtonRole = {\n  relatedConcepts: [],\n  type: 'widget'\n};\nvar _default = MenuButtonRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MenuItemRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'menuitem'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'menuitem'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = MenuItemRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MenuItemCheckBoxRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'menuitemcheckbox'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = MenuItemCheckBoxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MenuItemRadioRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'menuitemradio'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = MenuItemRadioRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MenuListOptionRole = {\n  relatedConcepts: [],\n  type: 'widget'\n};\nvar _default = MenuListOptionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MenuListPopupRole = {\n  relatedConcepts: [],\n  type: 'widget'\n};\nvar _default = MenuListPopupRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MenuRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'menu'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'menu'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = MenuRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar MeterRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'meter'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = MeterRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar NavigationRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'navigation'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'nav'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = NavigationRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar NoneRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'none'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = NoneRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar NoteRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'note'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = NoteRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar OutlineRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = OutlineRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ParagraphRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'p'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ParagraphRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar PopUpButtonRole = {\n  relatedConcepts: [],\n  type: 'widget'\n};\nvar _default = PopUpButtonRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar PreRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'pre'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = PreRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar PresentationalRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'presentation'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = PresentationalRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ProgressIndicatorRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'progressbar'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'progress'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ProgressIndicatorRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar RadioButtonRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'radio'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'radio'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = RadioButtonRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar RadioGroupRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'radiogroup'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = RadioGroupRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar RegionRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'region'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = RegionRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar RootWebAreaRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = RootWebAreaRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar RowHeaderRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'rowheader'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'th',\n      attributes: [{\n        name: 'scope',\n        value: 'row'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = RowHeaderRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar RowRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'row'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'tr'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = RowRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar RubyRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'ruby'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = RubyRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar RulerRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = RulerRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ScrollAreaRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = ScrollAreaRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ScrollBarRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'scrollbar'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = ScrollBarRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SeamlessWebAreaRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = SeamlessWebAreaRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SearchRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'search'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = SearchRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SearchBoxRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'searchbox'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'search'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = SearchBoxRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SliderRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'slider'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'range'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = SliderRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SliderThumbRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = SliderThumbRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SpinButtonRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'spinbutton'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'number'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = SpinButtonRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SpinButtonPartRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = SpinButtonPartRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SplitterRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'separator'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = SplitterRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar StaticTextRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = StaticTextRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar StatusRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'status'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = StatusRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SVGRootRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = SVGRootRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar SwitchRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'switch'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'checkbox'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = SwitchRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TabGroupRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'tablist'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = TabGroupRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TabRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'tab'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = TabRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TableHeaderContainerRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = TableHeaderContainerRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TableRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'table'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'table'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = TableRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TabListRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'tablist'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = TabListRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TabPanelRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'tabpanel'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = TabPanelRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TermRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'term'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = TermRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TextFieldRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'textbox'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'input'\n    }\n  }, {\n    module: 'HTML',\n    concept: {\n      name: 'input',\n      attributes: [{\n        name: 'type',\n        value: 'text'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = TextFieldRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TimeRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'time'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = TimeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TimerRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'timer'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = TimerRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ToggleButtonRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      attributes: [{\n        name: 'aria-pressed'\n      }]\n    }\n  }],\n  type: 'widget'\n};\nvar _default = ToggleButtonRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar ToolbarRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'toolbar'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = ToolbarRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TreeRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'tree'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = TreeRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TreeGridRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'treegrid'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = TreeGridRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar TreeItemRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'treeitem'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = TreeItemRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar UserInterfaceTooltipRole = {\n  relatedConcepts: [{\n    module: 'ARIA',\n    concept: {\n      name: 'tooltip'\n    }\n  }],\n  type: 'structure'\n};\nvar _default = UserInterfaceTooltipRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar VideoRole = {\n  relatedConcepts: [{\n    module: 'HTML',\n    concept: {\n      name: 'video'\n    }\n  }],\n  type: 'widget'\n};\nvar _default = VideoRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar WebAreaRole = {\n  relatedConcepts: [],\n  type: 'structure'\n};\nvar _default = WebAreaRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\nvar WindowRole = {\n  relatedConcepts: [],\n  type: 'window'\n};\nvar _default = WindowRole;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _iterationDecorator = _interopRequireDefault(require(\"./util/iterationDecorator\"));\n\nvar _AbbrRole = _interopRequireDefault(require(\"./etc/objects/AbbrRole\"));\n\nvar _AlertDialogRole = _interopRequireDefault(require(\"./etc/objects/AlertDialogRole\"));\n\nvar _AlertRole = _interopRequireDefault(require(\"./etc/objects/AlertRole\"));\n\nvar _AnnotationRole = _interopRequireDefault(require(\"./etc/objects/AnnotationRole\"));\n\nvar _ApplicationRole = _interopRequireDefault(require(\"./etc/objects/ApplicationRole\"));\n\nvar _ArticleRole = _interopRequireDefault(require(\"./etc/objects/ArticleRole\"));\n\nvar _AudioRole = _interopRequireDefault(require(\"./etc/objects/AudioRole\"));\n\nvar _BannerRole = _interopRequireDefault(require(\"./etc/objects/BannerRole\"));\n\nvar _BlockquoteRole = _interopRequireDefault(require(\"./etc/objects/BlockquoteRole\"));\n\nvar _BusyIndicatorRole = _interopRequireDefault(require(\"./etc/objects/BusyIndicatorRole\"));\n\nvar _ButtonRole = _interopRequireDefault(require(\"./etc/objects/ButtonRole\"));\n\nvar _CanvasRole = _interopRequireDefault(require(\"./etc/objects/CanvasRole\"));\n\nvar _CaptionRole = _interopRequireDefault(require(\"./etc/objects/CaptionRole\"));\n\nvar _CellRole = _interopRequireDefault(require(\"./etc/objects/CellRole\"));\n\nvar _CheckBoxRole = _interopRequireDefault(require(\"./etc/objects/CheckBoxRole\"));\n\nvar _ColorWellRole = _interopRequireDefault(require(\"./etc/objects/ColorWellRole\"));\n\nvar _ColumnHeaderRole = _interopRequireDefault(require(\"./etc/objects/ColumnHeaderRole\"));\n\nvar _ColumnRole = _interopRequireDefault(require(\"./etc/objects/ColumnRole\"));\n\nvar _ComboBoxRole = _interopRequireDefault(require(\"./etc/objects/ComboBoxRole\"));\n\nvar _ComplementaryRole = _interopRequireDefault(require(\"./etc/objects/ComplementaryRole\"));\n\nvar _ContentInfoRole = _interopRequireDefault(require(\"./etc/objects/ContentInfoRole\"));\n\nvar _DateRole = _interopRequireDefault(require(\"./etc/objects/DateRole\"));\n\nvar _DateTimeRole = _interopRequireDefault(require(\"./etc/objects/DateTimeRole\"));\n\nvar _DefinitionRole = _interopRequireDefault(require(\"./etc/objects/DefinitionRole\"));\n\nvar _DescriptionListDetailRole = _interopRequireDefault(require(\"./etc/objects/DescriptionListDetailRole\"));\n\nvar _DescriptionListRole = _interopRequireDefault(require(\"./etc/objects/DescriptionListRole\"));\n\nvar _DescriptionListTermRole = _interopRequireDefault(require(\"./etc/objects/DescriptionListTermRole\"));\n\nvar _DetailsRole = _interopRequireDefault(require(\"./etc/objects/DetailsRole\"));\n\nvar _DialogRole = _interopRequireDefault(require(\"./etc/objects/DialogRole\"));\n\nvar _DirectoryRole = _interopRequireDefault(require(\"./etc/objects/DirectoryRole\"));\n\nvar _DisclosureTriangleRole = _interopRequireDefault(require(\"./etc/objects/DisclosureTriangleRole\"));\n\nvar _DivRole = _interopRequireDefault(require(\"./etc/objects/DivRole\"));\n\nvar _DocumentRole = _interopRequireDefault(require(\"./etc/objects/DocumentRole\"));\n\nvar _EmbeddedObjectRole = _interopRequireDefault(require(\"./etc/objects/EmbeddedObjectRole\"));\n\nvar _FeedRole = _interopRequireDefault(require(\"./etc/objects/FeedRole\"));\n\nvar _FigcaptionRole = _interopRequireDefault(require(\"./etc/objects/FigcaptionRole\"));\n\nvar _FigureRole = _interopRequireDefault(require(\"./etc/objects/FigureRole\"));\n\nvar _FooterRole = _interopRequireDefault(require(\"./etc/objects/FooterRole\"));\n\nvar _FormRole = _interopRequireDefault(require(\"./etc/objects/FormRole\"));\n\nvar _GridRole = _interopRequireDefault(require(\"./etc/objects/GridRole\"));\n\nvar _GroupRole = _interopRequireDefault(require(\"./etc/objects/GroupRole\"));\n\nvar _HeadingRole = _interopRequireDefault(require(\"./etc/objects/HeadingRole\"));\n\nvar _IframePresentationalRole = _interopRequireDefault(require(\"./etc/objects/IframePresentationalRole\"));\n\nvar _IframeRole = _interopRequireDefault(require(\"./etc/objects/IframeRole\"));\n\nvar _IgnoredRole = _interopRequireDefault(require(\"./etc/objects/IgnoredRole\"));\n\nvar _ImageMapLinkRole = _interopRequireDefault(require(\"./etc/objects/ImageMapLinkRole\"));\n\nvar _ImageMapRole = _interopRequireDefault(require(\"./etc/objects/ImageMapRole\"));\n\nvar _ImageRole = _interopRequireDefault(require(\"./etc/objects/ImageRole\"));\n\nvar _InlineTextBoxRole = _interopRequireDefault(require(\"./etc/objects/InlineTextBoxRole\"));\n\nvar _InputTimeRole = _interopRequireDefault(require(\"./etc/objects/InputTimeRole\"));\n\nvar _LabelRole = _interopRequireDefault(require(\"./etc/objects/LabelRole\"));\n\nvar _LegendRole = _interopRequireDefault(require(\"./etc/objects/LegendRole\"));\n\nvar _LineBreakRole = _interopRequireDefault(require(\"./etc/objects/LineBreakRole\"));\n\nvar _LinkRole = _interopRequireDefault(require(\"./etc/objects/LinkRole\"));\n\nvar _ListBoxOptionRole = _interopRequireDefault(require(\"./etc/objects/ListBoxOptionRole\"));\n\nvar _ListBoxRole = _interopRequireDefault(require(\"./etc/objects/ListBoxRole\"));\n\nvar _ListItemRole = _interopRequireDefault(require(\"./etc/objects/ListItemRole\"));\n\nvar _ListMarkerRole = _interopRequireDefault(require(\"./etc/objects/ListMarkerRole\"));\n\nvar _ListRole = _interopRequireDefault(require(\"./etc/objects/ListRole\"));\n\nvar _LogRole = _interopRequireDefault(require(\"./etc/objects/LogRole\"));\n\nvar _MainRole = _interopRequireDefault(require(\"./etc/objects/MainRole\"));\n\nvar _MarkRole = _interopRequireDefault(require(\"./etc/objects/MarkRole\"));\n\nvar _MarqueeRole = _interopRequireDefault(require(\"./etc/objects/MarqueeRole\"));\n\nvar _MathRole = _interopRequireDefault(require(\"./etc/objects/MathRole\"));\n\nvar _MenuBarRole = _interopRequireDefault(require(\"./etc/objects/MenuBarRole\"));\n\nvar _MenuButtonRole = _interopRequireDefault(require(\"./etc/objects/MenuButtonRole\"));\n\nvar _MenuItemRole = _interopRequireDefault(require(\"./etc/objects/MenuItemRole\"));\n\nvar _MenuItemCheckBoxRole = _interopRequireDefault(require(\"./etc/objects/MenuItemCheckBoxRole\"));\n\nvar _MenuItemRadioRole = _interopRequireDefault(require(\"./etc/objects/MenuItemRadioRole\"));\n\nvar _MenuListOptionRole = _interopRequireDefault(require(\"./etc/objects/MenuListOptionRole\"));\n\nvar _MenuListPopupRole = _interopRequireDefault(require(\"./etc/objects/MenuListPopupRole\"));\n\nvar _MenuRole = _interopRequireDefault(require(\"./etc/objects/MenuRole\"));\n\nvar _MeterRole = _interopRequireDefault(require(\"./etc/objects/MeterRole\"));\n\nvar _NavigationRole = _interopRequireDefault(require(\"./etc/objects/NavigationRole\"));\n\nvar _NoneRole = _interopRequireDefault(require(\"./etc/objects/NoneRole\"));\n\nvar _NoteRole = _interopRequireDefault(require(\"./etc/objects/NoteRole\"));\n\nvar _OutlineRole = _interopRequireDefault(require(\"./etc/objects/OutlineRole\"));\n\nvar _ParagraphRole = _interopRequireDefault(require(\"./etc/objects/ParagraphRole\"));\n\nvar _PopUpButtonRole = _interopRequireDefault(require(\"./etc/objects/PopUpButtonRole\"));\n\nvar _PreRole = _interopRequireDefault(require(\"./etc/objects/PreRole\"));\n\nvar _PresentationalRole = _interopRequireDefault(require(\"./etc/objects/PresentationalRole\"));\n\nvar _ProgressIndicatorRole = _interopRequireDefault(require(\"./etc/objects/ProgressIndicatorRole\"));\n\nvar _RadioButtonRole = _interopRequireDefault(require(\"./etc/objects/RadioButtonRole\"));\n\nvar _RadioGroupRole = _interopRequireDefault(require(\"./etc/objects/RadioGroupRole\"));\n\nvar _RegionRole = _interopRequireDefault(require(\"./etc/objects/RegionRole\"));\n\nvar _RootWebAreaRole = _interopRequireDefault(require(\"./etc/objects/RootWebAreaRole\"));\n\nvar _RowHeaderRole = _interopRequireDefault(require(\"./etc/objects/RowHeaderRole\"));\n\nvar _RowRole = _interopRequireDefault(require(\"./etc/objects/RowRole\"));\n\nvar _RubyRole = _interopRequireDefault(require(\"./etc/objects/RubyRole\"));\n\nvar _RulerRole = _interopRequireDefault(require(\"./etc/objects/RulerRole\"));\n\nvar _ScrollAreaRole = _interopRequireDefault(require(\"./etc/objects/ScrollAreaRole\"));\n\nvar _ScrollBarRole = _interopRequireDefault(require(\"./etc/objects/ScrollBarRole\"));\n\nvar _SeamlessWebAreaRole = _interopRequireDefault(require(\"./etc/objects/SeamlessWebAreaRole\"));\n\nvar _SearchRole = _interopRequireDefault(require(\"./etc/objects/SearchRole\"));\n\nvar _SearchBoxRole = _interopRequireDefault(require(\"./etc/objects/SearchBoxRole\"));\n\nvar _SliderRole = _interopRequireDefault(require(\"./etc/objects/SliderRole\"));\n\nvar _SliderThumbRole = _interopRequireDefault(require(\"./etc/objects/SliderThumbRole\"));\n\nvar _SpinButtonRole = _interopRequireDefault(require(\"./etc/objects/SpinButtonRole\"));\n\nvar _SpinButtonPartRole = _interopRequireDefault(require(\"./etc/objects/SpinButtonPartRole\"));\n\nvar _SplitterRole = _interopRequireDefault(require(\"./etc/objects/SplitterRole\"));\n\nvar _StaticTextRole = _interopRequireDefault(require(\"./etc/objects/StaticTextRole\"));\n\nvar _StatusRole = _interopRequireDefault(require(\"./etc/objects/StatusRole\"));\n\nvar _SVGRootRole = _interopRequireDefault(require(\"./etc/objects/SVGRootRole\"));\n\nvar _SwitchRole = _interopRequireDefault(require(\"./etc/objects/SwitchRole\"));\n\nvar _TabGroupRole = _interopRequireDefault(require(\"./etc/objects/TabGroupRole\"));\n\nvar _TabRole = _interopRequireDefault(require(\"./etc/objects/TabRole\"));\n\nvar _TableHeaderContainerRole = _interopRequireDefault(require(\"./etc/objects/TableHeaderContainerRole\"));\n\nvar _TableRole = _interopRequireDefault(require(\"./etc/objects/TableRole\"));\n\nvar _TabListRole = _interopRequireDefault(require(\"./etc/objects/TabListRole\"));\n\nvar _TabPanelRole = _interopRequireDefault(require(\"./etc/objects/TabPanelRole\"));\n\nvar _TermRole = _interopRequireDefault(require(\"./etc/objects/TermRole\"));\n\nvar _TextFieldRole = _interopRequireDefault(require(\"./etc/objects/TextFieldRole\"));\n\nvar _TimeRole = _interopRequireDefault(require(\"./etc/objects/TimeRole\"));\n\nvar _TimerRole = _interopRequireDefault(require(\"./etc/objects/TimerRole\"));\n\nvar _ToggleButtonRole = _interopRequireDefault(require(\"./etc/objects/ToggleButtonRole\"));\n\nvar _ToolbarRole = _interopRequireDefault(require(\"./etc/objects/ToolbarRole\"));\n\nvar _TreeRole = _interopRequireDefault(require(\"./etc/objects/TreeRole\"));\n\nvar _TreeGridRole = _interopRequireDefault(require(\"./etc/objects/TreeGridRole\"));\n\nvar _TreeItemRole = _interopRequireDefault(require(\"./etc/objects/TreeItemRole\"));\n\nvar _UserInterfaceTooltipRole = _interopRequireDefault(require(\"./etc/objects/UserInterfaceTooltipRole\"));\n\nvar _VideoRole = _interopRequireDefault(require(\"./etc/objects/VideoRole\"));\n\nvar _WebAreaRole = _interopRequireDefault(require(\"./etc/objects/WebAreaRole\"));\n\nvar _WindowRole = _interopRequireDefault(require(\"./etc/objects/WindowRole\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar AXObjects = [['AbbrRole', _AbbrRole.default], ['AlertDialogRole', _AlertDialogRole.default], ['AlertRole', _AlertRole.default], ['AnnotationRole', _AnnotationRole.default], ['ApplicationRole', _ApplicationRole.default], ['ArticleRole', _ArticleRole.default], ['AudioRole', _AudioRole.default], ['BannerRole', _BannerRole.default], ['BlockquoteRole', _BlockquoteRole.default], ['BusyIndicatorRole', _BusyIndicatorRole.default], ['ButtonRole', _ButtonRole.default], ['CanvasRole', _CanvasRole.default], ['CaptionRole', _CaptionRole.default], ['CellRole', _CellRole.default], ['CheckBoxRole', _CheckBoxRole.default], ['ColorWellRole', _ColorWellRole.default], ['ColumnHeaderRole', _ColumnHeaderRole.default], ['ColumnRole', _ColumnRole.default], ['ComboBoxRole', _ComboBoxRole.default], ['ComplementaryRole', _ComplementaryRole.default], ['ContentInfoRole', _ContentInfoRole.default], ['DateRole', _DateRole.default], ['DateTimeRole', _DateTimeRole.default], ['DefinitionRole', _DefinitionRole.default], ['DescriptionListDetailRole', _DescriptionListDetailRole.default], ['DescriptionListRole', _DescriptionListRole.default], ['DescriptionListTermRole', _DescriptionListTermRole.default], ['DetailsRole', _DetailsRole.default], ['DialogRole', _DialogRole.default], ['DirectoryRole', _DirectoryRole.default], ['DisclosureTriangleRole', _DisclosureTriangleRole.default], ['DivRole', _DivRole.default], ['DocumentRole', _DocumentRole.default], ['EmbeddedObjectRole', _EmbeddedObjectRole.default], ['FeedRole', _FeedRole.default], ['FigcaptionRole', _FigcaptionRole.default], ['FigureRole', _FigureRole.default], ['FooterRole', _FooterRole.default], ['FormRole', _FormRole.default], ['GridRole', _GridRole.default], ['GroupRole', _GroupRole.default], ['HeadingRole', _HeadingRole.default], ['IframePresentationalRole', _IframePresentationalRole.default], ['IframeRole', _IframeRole.default], ['IgnoredRole', _IgnoredRole.default], ['ImageMapLinkRole', _ImageMapLinkRole.default], ['ImageMapRole', _ImageMapRole.default], ['ImageRole', _ImageRole.default], ['InlineTextBoxRole', _InlineTextBoxRole.default], ['InputTimeRole', _InputTimeRole.default], ['LabelRole', _LabelRole.default], ['LegendRole', _LegendRole.default], ['LineBreakRole', _LineBreakRole.default], ['LinkRole', _LinkRole.default], ['ListBoxOptionRole', _ListBoxOptionRole.default], ['ListBoxRole', _ListBoxRole.default], ['ListItemRole', _ListItemRole.default], ['ListMarkerRole', _ListMarkerRole.default], ['ListRole', _ListRole.default], ['LogRole', _LogRole.default], ['MainRole', _MainRole.default], ['MarkRole', _MarkRole.default], ['MarqueeRole', _MarqueeRole.default], ['MathRole', _MathRole.default], ['MenuBarRole', _MenuBarRole.default], ['MenuButtonRole', _MenuButtonRole.default], ['MenuItemRole', _MenuItemRole.default], ['MenuItemCheckBoxRole', _MenuItemCheckBoxRole.default], ['MenuItemRadioRole', _MenuItemRadioRole.default], ['MenuListOptionRole', _MenuListOptionRole.default], ['MenuListPopupRole', _MenuListPopupRole.default], ['MenuRole', _MenuRole.default], ['MeterRole', _MeterRole.default], ['NavigationRole', _NavigationRole.default], ['NoneRole', _NoneRole.default], ['NoteRole', _NoteRole.default], ['OutlineRole', _OutlineRole.default], ['ParagraphRole', _ParagraphRole.default], ['PopUpButtonRole', _PopUpButtonRole.default], ['PreRole', _PreRole.default], ['PresentationalRole', _PresentationalRole.default], ['ProgressIndicatorRole', _ProgressIndicatorRole.default], ['RadioButtonRole', _RadioButtonRole.default], ['RadioGroupRole', _RadioGroupRole.default], ['RegionRole', _RegionRole.default], ['RootWebAreaRole', _RootWebAreaRole.default], ['RowHeaderRole', _RowHeaderRole.default], ['RowRole', _RowRole.default], ['RubyRole', _RubyRole.default], ['RulerRole', _RulerRole.default], ['ScrollAreaRole', _ScrollAreaRole.default], ['ScrollBarRole', _ScrollBarRole.default], ['SeamlessWebAreaRole', _SeamlessWebAreaRole.default], ['SearchRole', _SearchRole.default], ['SearchBoxRole', _SearchBoxRole.default], ['SliderRole', _SliderRole.default], ['SliderThumbRole', _SliderThumbRole.default], ['SpinButtonRole', _SpinButtonRole.default], ['SpinButtonPartRole', _SpinButtonPartRole.default], ['SplitterRole', _SplitterRole.default], ['StaticTextRole', _StaticTextRole.default], ['StatusRole', _StatusRole.default], ['SVGRootRole', _SVGRootRole.default], ['SwitchRole', _SwitchRole.default], ['TabGroupRole', _TabGroupRole.default], ['TabRole', _TabRole.default], ['TableHeaderContainerRole', _TableHeaderContainerRole.default], ['TableRole', _TableRole.default], ['TabListRole', _TabListRole.default], ['TabPanelRole', _TabPanelRole.default], ['TermRole', _TermRole.default], ['TextFieldRole', _TextFieldRole.default], ['TimeRole', _TimeRole.default], ['TimerRole', _TimerRole.default], ['ToggleButtonRole', _ToggleButtonRole.default], ['ToolbarRole', _ToolbarRole.default], ['TreeRole', _TreeRole.default], ['TreeGridRole', _TreeGridRole.default], ['TreeItemRole', _TreeItemRole.default], ['UserInterfaceTooltipRole', _UserInterfaceTooltipRole.default], ['VideoRole', _VideoRole.default], ['WebAreaRole', _WebAreaRole.default], ['WindowRole', _WindowRole.default]];\nvar AXObjectsMap = {\n  entries: function entries() {\n    return AXObjects;\n  },\n  forEach: function forEach(fn) {\n    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n    var _iterator = _createForOfIteratorHelper(AXObjects),\n        _step;\n\n    try {\n      for (_iterator.s(); !(_step = _iterator.n()).done;) {\n        var _step$value = _slicedToArray(_step.value, 2),\n            key = _step$value[0],\n            values = _step$value[1];\n\n        fn.call(thisArg, values, key, AXObjects);\n      }\n    } catch (err) {\n      _iterator.e(err);\n    } finally {\n      _iterator.f();\n    }\n  },\n  get: function get(key) {\n    var item = AXObjects.find(function (tuple) {\n      return tuple[0] === key ? true : false;\n    });\n    return item && item[1];\n  },\n  has: function has(key) {\n    return !!this.get(key);\n  },\n  keys: function keys() {\n    return AXObjects.map(function (_ref) {\n      var _ref2 = _slicedToArray(_ref, 1),\n          key = _ref2[0];\n\n      return key;\n    });\n  },\n  values: function values() {\n    return AXObjects.map(function (_ref3) {\n      var _ref4 = _slicedToArray(_ref3, 2),\n          values = _ref4[1];\n\n      return values;\n    });\n  }\n};\n\nvar _default = (0, _iterationDecorator.default)(AXObjectsMap, AXObjectsMap.entries());\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _iterationDecorator = _interopRequireDefault(require(\"./util/iterationDecorator\"));\n\nvar _AXObjectsMap = _interopRequireDefault(require(\"./AXObjectsMap\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar AXObjectElements = [];\n\nvar _iterator = _createForOfIteratorHelper(_AXObjectsMap.default.entries()),\n    _step;\n\ntry {\n  var _loop = function _loop() {\n    var _step$value = _slicedToArray(_step.value, 2),\n        name = _step$value[0],\n        def = _step$value[1];\n\n    var relatedConcepts = def.relatedConcepts;\n\n    if (Array.isArray(relatedConcepts)) {\n      relatedConcepts.forEach(function (relation) {\n        if (relation.module === 'HTML') {\n          var concept = relation.concept;\n\n          if (concept) {\n            var index = AXObjectElements.findIndex(function (_ref5) {\n              var _ref6 = _slicedToArray(_ref5, 1),\n                  key = _ref6[0];\n\n              return key === name;\n            });\n\n            if (index === -1) {\n              AXObjectElements.push([name, []]);\n              index = AXObjectElements.length - 1;\n            }\n\n            AXObjectElements[index][1].push(concept);\n          }\n        }\n      });\n    }\n  };\n\n  for (_iterator.s(); !(_step = _iterator.n()).done;) {\n    _loop();\n  }\n} catch (err) {\n  _iterator.e(err);\n} finally {\n  _iterator.f();\n}\n\nvar AXObjectElementMap = {\n  entries: function entries() {\n    return AXObjectElements;\n  },\n  forEach: function forEach(fn) {\n    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n    var _iterator2 = _createForOfIteratorHelper(AXObjectElements),\n        _step2;\n\n    try {\n      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n        var _step2$value = _slicedToArray(_step2.value, 2),\n            key = _step2$value[0],\n            values = _step2$value[1];\n\n        fn.call(thisArg, values, key, AXObjectElements);\n      }\n    } catch (err) {\n      _iterator2.e(err);\n    } finally {\n      _iterator2.f();\n    }\n  },\n  get: function get(key) {\n    var item = AXObjectElements.find(function (tuple) {\n      return tuple[0] === key ? true : false;\n    });\n    return item && item[1];\n  },\n  has: function has(key) {\n    return !!this.get(key);\n  },\n  keys: function keys() {\n    return AXObjectElements.map(function (_ref) {\n      var _ref2 = _slicedToArray(_ref, 1),\n          key = _ref2[0];\n\n      return key;\n    });\n  },\n  values: function values() {\n    return AXObjectElements.map(function (_ref3) {\n      var _ref4 = _slicedToArray(_ref3, 2),\n          values = _ref4[1];\n\n      return values;\n    });\n  }\n};\n\nvar _default = (0, _iterationDecorator.default)(AXObjectElementMap, AXObjectElementMap.entries());\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _iterationDecorator = _interopRequireDefault(require(\"./util/iterationDecorator\"));\n\nvar _AXObjectsMap = _interopRequireDefault(require(\"./AXObjectsMap\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar AXObjectRoleElements = [];\n\nvar _iterator = _createForOfIteratorHelper(_AXObjectsMap.default.entries()),\n    _step;\n\ntry {\n  var _loop = function _loop() {\n    var _step$value = _slicedToArray(_step.value, 2),\n        name = _step$value[0],\n        def = _step$value[1];\n\n    var relatedConcepts = def.relatedConcepts;\n\n    if (Array.isArray(relatedConcepts)) {\n      relatedConcepts.forEach(function (relation) {\n        if (relation.module === 'ARIA') {\n          var concept = relation.concept;\n\n          if (concept) {\n            var index = AXObjectRoleElements.findIndex(function (_ref5) {\n              var _ref6 = _slicedToArray(_ref5, 1),\n                  key = _ref6[0];\n\n              return key === name;\n            });\n\n            if (index === -1) {\n              AXObjectRoleElements.push([name, []]);\n              index = AXObjectRoleElements.length - 1;\n            }\n\n            AXObjectRoleElements[index][1].push(concept);\n          }\n        }\n      });\n    }\n  };\n\n  for (_iterator.s(); !(_step = _iterator.n()).done;) {\n    _loop();\n  }\n} catch (err) {\n  _iterator.e(err);\n} finally {\n  _iterator.f();\n}\n\nvar AXObjectRoleMap = {\n  entries: function entries() {\n    return AXObjectRoleElements;\n  },\n  forEach: function forEach(fn) {\n    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n    var _iterator2 = _createForOfIteratorHelper(AXObjectRoleElements),\n        _step2;\n\n    try {\n      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n        var _step2$value = _slicedToArray(_step2.value, 2),\n            key = _step2$value[0],\n            values = _step2$value[1];\n\n        fn.call(thisArg, values, key, AXObjectRoleElements);\n      }\n    } catch (err) {\n      _iterator2.e(err);\n    } finally {\n      _iterator2.f();\n    }\n  },\n  get: function get(key) {\n    var item = AXObjectRoleElements.find(function (tuple) {\n      return tuple[0] === key ? true : false;\n    });\n    return item && item[1];\n  },\n  has: function has(key) {\n    return !!this.get(key);\n  },\n  keys: function keys() {\n    return AXObjectRoleElements.map(function (_ref) {\n      var _ref2 = _slicedToArray(_ref, 1),\n          key = _ref2[0];\n\n      return key;\n    });\n  },\n  values: function values() {\n    return AXObjectRoleElements.map(function (_ref3) {\n      var _ref4 = _slicedToArray(_ref3, 2),\n          values = _ref4[1];\n\n      return values;\n    });\n  }\n};\n\nvar _default = (0, _iterationDecorator.default)(AXObjectRoleMap, AXObjectRoleMap.entries());\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _AXObjectsMap = _interopRequireDefault(require(\"./AXObjectsMap\"));\n\nvar _deepEqual = _interopRequireDefault(require(\"deep-equal\"));\n\nvar _iterationDecorator = _interopRequireDefault(require(\"./util/iterationDecorator\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nvar elementAXObjects = [];\n\nvar _iterator = _createForOfIteratorHelper(_AXObjectsMap.default.entries()),\n    _step;\n\ntry {\n  var _loop = function _loop() {\n    var _step$value = _slicedToArray(_step.value, 2),\n        name = _step$value[0],\n        def = _step$value[1];\n\n    var relatedConcepts = def.relatedConcepts;\n\n    if (Array.isArray(relatedConcepts)) {\n      relatedConcepts.forEach(function (relation) {\n        if (relation.module === 'HTML') {\n          var concept = relation.concept;\n\n          if (concept != null) {\n            var conceptStr = JSON.stringify(concept);\n            var axObjects;\n            var index = 0;\n\n            for (; index < elementAXObjects.length; index++) {\n              var key = elementAXObjects[index][0];\n\n              if (JSON.stringify(key) === conceptStr) {\n                axObjects = elementAXObjects[index][1];\n                break;\n              }\n            }\n\n            if (!Array.isArray(axObjects)) {\n              axObjects = [];\n            }\n\n            var loc = axObjects.findIndex(function (item) {\n              return item === name;\n            });\n\n            if (loc === -1) {\n              axObjects.push(name);\n            }\n\n            if (index < elementAXObjects.length) {\n              elementAXObjects.splice(index, 1, [concept, axObjects]);\n            } else {\n              elementAXObjects.push([concept, axObjects]);\n            }\n          }\n        }\n      });\n    }\n  };\n\n  for (_iterator.s(); !(_step = _iterator.n()).done;) {\n    _loop();\n  }\n} catch (err) {\n  _iterator.e(err);\n} finally {\n  _iterator.f();\n}\n\nvar elementAXObjectMap = {\n  entries: function entries() {\n    return elementAXObjects;\n  },\n  forEach: function forEach(fn) {\n    var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n    var _iterator2 = _createForOfIteratorHelper(elementAXObjects),\n        _step2;\n\n    try {\n      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n        var _step2$value = _slicedToArray(_step2.value, 2),\n            key = _step2$value[0],\n            values = _step2$value[1];\n\n        fn.call(thisArg, values, key, elementAXObjects);\n      }\n    } catch (err) {\n      _iterator2.e(err);\n    } finally {\n      _iterator2.f();\n    }\n  },\n  get: function get(key) {\n    var item = elementAXObjects.find(function (tuple) {\n      return (0, _deepEqual.default)(key, tuple[0]) ? true : false;\n    });\n    return item && item[1];\n  },\n  has: function has(key) {\n    return !!this.get(key);\n  },\n  keys: function keys() {\n    return elementAXObjects.map(function (_ref) {\n      var _ref2 = _slicedToArray(_ref, 1),\n          key = _ref2[0];\n\n      return key;\n    });\n  },\n  values: function values() {\n    return elementAXObjects.map(function (_ref3) {\n      var _ref4 = _slicedToArray(_ref3, 2),\n          values = _ref4[1];\n\n      return values;\n    });\n  }\n};\n\nvar _default = (0, _iterationDecorator.default)(elementAXObjectMap, elementAXObjectMap.entries());\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.elementAXObjects = exports.AXObjects = exports.AXObjectRoles = exports.AXObjectElements = void 0;\n\nvar _AXObjectElementMap = _interopRequireDefault(require(\"./AXObjectElementMap\"));\n\nvar _AXObjectRoleMap = _interopRequireDefault(require(\"./AXObjectRoleMap\"));\n\nvar _AXObjectsMap = _interopRequireDefault(require(\"./AXObjectsMap\"));\n\nvar _elementAXObjectMap = _interopRequireDefault(require(\"./elementAXObjectMap\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar AXObjectElements = _AXObjectElementMap.default;\nexports.AXObjectElements = AXObjectElements;\nvar AXObjectRoles = _AXObjectRoleMap.default;\nexports.AXObjectRoles = AXObjectRoles;\nvar AXObjects = _AXObjectsMap.default;\nexports.AXObjects = AXObjects;\nvar elementAXObjects = _elementAXObjectMap.default;\nexports.elementAXObjects = elementAXObjects;","import {\r\n\tARIARoleDefintionKey,\r\n\troles as roles_map,\r\n\telementRoles,\r\n\tARIARoleRelationConcept\r\n} from 'aria-query';\r\nimport { AXObjects, AXObjectRoles, elementAXObjects } from 'axobject-query';\r\nimport Attribute from '../nodes/Attribute';\r\n\r\nconst roles = [...roles_map.keys()];\r\n\r\nconst non_interactive_roles = new Set(\r\n\troles\r\n\t\t.filter((name) => {\r\n\t\t\tconst role = roles_map.get(name);\r\n\t\t\treturn (\r\n\t\t\t\t!roles_map.get(name).abstract &&\r\n\t\t\t\t// 'toolbar' does not descend from widget, but it does support\r\n\t\t\t\t// aria-activedescendant, thus in practice we treat it as a widget.\r\n\t\t\t\tname !== 'toolbar' &&\r\n\t\t\t\t!role.superClass.some((classes) => classes.includes('widget'))\r\n\t\t\t);\r\n\t\t})\r\n\t\t.concat(\r\n\t\t\t// The `progressbar` is descended from `widget`, but in practice, its\r\n\t\t\t// value is always `readonly`, so we treat it as a non-interactive role.\r\n\t\t\t'progressbar'\r\n\t\t)\r\n);\r\n\r\nconst interactive_roles = new Set(\r\n\troles\r\n\t\t.filter((name) => {\r\n\t\t\tconst role = roles_map.get(name);\r\n\t\t\treturn (\r\n\t\t\t\t!role.abstract &&\r\n\t\t\t\t// The `progressbar` is descended from `widget`, but in practice, its\r\n\t\t\t\t// value is always `readonly`, so we treat it as a non-interactive role.\r\n\t\t\t\tname !== 'progressbar' &&\r\n\t\t\t\trole.superClass.some((classes) => classes.includes('widget'))\r\n\t\t\t);\r\n\t\t})\r\n\t\t.concat(\r\n\t\t\t// 'toolbar' does not descend from widget, but it does support\r\n\t\t\t// aria-activedescendant, thus in practice we treat it as a widget.\r\n\t\t\t'toolbar'\r\n\t\t)\r\n);\r\n\r\nexport function is_non_interactive_roles(role: ARIARoleDefintionKey) {\r\n\treturn non_interactive_roles.has(role);\r\n}\r\n\r\nexport function is_interactive_roles(role: ARIARoleDefintionKey) {\r\n\treturn interactive_roles.has(role);\r\n}\r\n\r\nconst presentation_roles = new Set(['presentation', 'none']);\r\n\r\nexport function is_presentation_role(role: ARIARoleDefintionKey) {\r\n\treturn presentation_roles.has(role);\r\n}\r\n\r\nexport function is_hidden_from_screen_reader(tag_name: string, attribute_map: Map<string, Attribute>) {\r\n\tif (tag_name === 'input') {\r\n\t\tconst type = attribute_map.get('type')?.get_static_value();\r\n\r\n\t\tif (type && type === 'hidden') {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\tconst aria_hidden = attribute_map.get('aria-hidden');\r\n\tif (!aria_hidden) return false;\r\n\tif (!aria_hidden.is_static) return true;\r\n\tconst aria_hidden_value = aria_hidden.get_static_value();\r\n\treturn aria_hidden_value === true || aria_hidden_value === 'true';\r\n}\r\n\r\nconst non_interactive_element_role_schemas: ARIARoleRelationConcept[] = [];\r\n\r\nelementRoles.entries().forEach(([schema, roles]) => {\r\n\tif ([...roles].every((role) => non_interactive_roles.has(role))) {\r\n\t\tnon_interactive_element_role_schemas.push(schema);\r\n\t}\r\n});\r\n\r\nconst interactive_element_role_schemas: ARIARoleRelationConcept[] = [];\r\n\r\nelementRoles.entries().forEach(([schema, roles]) => {\r\n\tif ([...roles].every((role) => interactive_roles.has(role))) {\r\n\t\tinteractive_element_role_schemas.push(schema);\r\n\t}\r\n});\r\n\r\nconst interactive_ax_objects = new Set(\r\n\t[...AXObjects.keys()].filter((name) => AXObjects.get(name).type === 'widget')\r\n);\r\n\r\nconst interactive_element_ax_object_schemas: ARIARoleRelationConcept[] = [];\r\n\r\nelementAXObjects.entries().forEach(([schema, ax_object]) => {\r\n\tif ([...ax_object].every((role) => interactive_ax_objects.has(role))) {\r\n\t\tinteractive_element_ax_object_schemas.push(schema);\r\n\t}\r\n});\r\n\r\nfunction match_schema(\r\n\tschema: ARIARoleRelationConcept,\r\n\ttag_name: string,\r\n\tattribute_map: Map<string, Attribute>\r\n) {\r\n\tif (schema.name !== tag_name) return false;\r\n\tif (!schema.attributes) return true;\r\n\treturn schema.attributes.every((schema_attribute) => {\r\n\t\tconst attribute = attribute_map.get(schema_attribute.name);\r\n\t\tif (!attribute) return false;\r\n\t\tif (\r\n\t\t\tschema_attribute.value &&\r\n\t\t\tschema_attribute.value !== attribute.get_static_value()\r\n\t\t) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n}\r\n\r\nexport function is_interactive_element(\r\n\ttag_name: string,\r\n\tattribute_map: Map<string, Attribute>\r\n): boolean {\r\n\tif (\r\n\t\tinteractive_element_role_schemas.some((schema) =>\r\n\t\t\tmatch_schema(schema, tag_name, attribute_map)\r\n\t\t)\r\n\t) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\tif (\r\n\t\tnon_interactive_element_role_schemas.some((schema) =>\r\n\t\t\tmatch_schema(schema, tag_name, attribute_map)\r\n\t\t)\r\n\t) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif (\r\n\t\tinteractive_element_ax_object_schemas.some((schema) =>\r\n\t\t\tmatch_schema(schema, tag_name, attribute_map)\r\n\t\t)\r\n\t) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn false;\r\n}\r\n\r\nexport function is_semantic_role_element(role: ARIARoleDefintionKey, tag_name: string, attribute_map: Map<string, Attribute>) {\r\n\tfor (const [schema, ax_object] of elementAXObjects.entries()) {\r\n\t\tif (schema.name === tag_name && (!schema.attributes || schema.attributes.every(\r\n\t\t\t(attr) => attribute_map.has(attr.name) && attribute_map.get(attr.name).get_static_value() === attr.value\r\n\t\t))) {\r\n\t\t\tfor (const name of ax_object) {\r\n\t\t\t\tconst roles = AXObjectRoles.get(name);\r\n\t\t\t\tif (roles) {\r\n\t\t\t\t\tfor (const { name } of roles) {\r\n\t\t\t\t\t\tif (name === role) {\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n","import { is_html, is_svg, is_void } from '../../../shared/utils/names';\r\nimport Node from './shared/Node';\r\nimport Attribute from './Attribute';\r\nimport Binding from './Binding';\r\nimport EventHandler from './EventHandler';\r\nimport Transition from './Transition';\r\nimport Animation from './Animation';\r\nimport Action from './Action';\r\nimport Class from './Class';\r\nimport StyleDirective from './StyleDirective';\r\nimport Text from './Text';\r\nimport { namespaces } from '../../utils/namespaces';\r\nimport map_children from './shared/map_children';\r\nimport { regex_dimensions, regex_starts_with_newline, regex_non_whitespace_character } from '../../utils/patterns';\r\nimport fuzzymatch from '../../utils/fuzzymatch';\r\nimport list from '../../utils/list';\r\nimport Let from './Let';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { INode } from './interfaces';\r\nimport Component from '../Component';\r\nimport Expression from './shared/Expression';\r\nimport { string_literal } from '../utils/stringify';\r\nimport { Literal } from 'estree';\r\nimport compiler_warnings from '../compiler_warnings';\r\nimport compiler_errors from '../compiler_errors';\r\nimport { ARIARoleDefintionKey, roles, aria, ARIAPropertyDefinition, ARIAProperty } from 'aria-query';\r\nimport { is_interactive_element, is_non_interactive_roles, is_presentation_role, is_interactive_roles, is_hidden_from_screen_reader, is_semantic_role_element } from '../utils/a11y';\r\n\r\nconst aria_attributes = 'activedescendant atomic autocomplete busy checked colcount colindex colspan controls current describedby description details disabled dropeffect errormessage expanded flowto grabbed haspopup hidden invalid keyshortcuts label labelledby level live modal multiline multiselectable orientation owns placeholder posinset pressed readonly relevant required roledescription rowcount rowindex rowspan selected setsize sort valuemax valuemin valuenow valuetext'.split(' ');\r\nconst aria_attribute_set = new Set(aria_attributes);\r\n\r\nconst aria_roles = roles.keys();\r\nconst aria_role_set = new Set(aria_roles);\r\nconst aria_role_abstract_set = new Set(roles.keys().filter(role => roles.get(role).abstract));\r\n\r\nconst a11y_required_attributes = {\r\n\ta: ['href'],\r\n\tarea: ['alt', 'aria-label', 'aria-labelledby'],\r\n\r\n\t// html-has-lang\r\n\thtml: ['lang'],\r\n\r\n\t// iframe-has-title\r\n\tiframe: ['title'],\r\n\timg: ['alt'],\r\n\tobject: ['title', 'aria-label', 'aria-labelledby']\r\n};\r\n\r\nconst a11y_distracting_elements = new Set([\r\n\t'blink',\r\n\t'marquee'\r\n]);\r\n\r\nconst a11y_required_content = new Set([\r\n\t// anchor-has-content\r\n\t'a',\r\n\r\n\t// heading-has-content\r\n\t'h1',\r\n\t'h2',\r\n\t'h3',\r\n\t'h4',\r\n\t'h5',\r\n\t'h6'\r\n]);\r\n\r\nconst a11y_labelable = new Set([\r\n\t'button',\r\n\t'input',\r\n\t'keygen',\r\n\t'meter',\r\n\t'output',\r\n\t'progress',\r\n\t'select',\r\n\t'textarea'\r\n]);\r\n\r\nconst a11y_nested_implicit_semantics = new Map([\r\n\t['header', 'banner'],\r\n\t['footer', 'contentinfo']\r\n]);\r\n\r\nconst a11y_implicit_semantics = new Map([\r\n\t['a', 'link'],\r\n\t['aside', 'complementary'],\r\n\t['body', 'document'],\r\n\t['datalist', 'listbox'],\r\n\t['dd', 'definition'],\r\n\t['dfn', 'term'],\r\n\t['details', 'group'],\r\n\t['dt', 'term'],\r\n\t['fieldset', 'group'],\r\n\t['form', 'form'],\r\n\t['h1', 'heading'],\r\n\t['h2', 'heading'],\r\n\t['h3', 'heading'],\r\n\t['h4', 'heading'],\r\n\t['h5', 'heading'],\r\n\t['h6', 'heading'],\r\n\t['hr', 'separator'],\r\n\t['li', 'listitem'],\r\n\t['menu', 'list'],\r\n\t['nav', 'navigation'],\r\n\t['ol', 'list'],\r\n\t['optgroup', 'group'],\r\n\t['output', 'status'],\r\n\t['progress', 'progressbar'],\r\n\t['section', 'region'],\r\n\t['summary', 'button'],\r\n\t['tbody', 'rowgroup'],\r\n\t['textarea', 'textbox'],\r\n\t['tfoot', 'rowgroup'],\r\n\t['thead', 'rowgroup'],\r\n\t['tr', 'row'],\r\n\t['ul', 'list']\r\n]);\r\n\r\nconst invisible_elements = new Set(['meta', 'html', 'script', 'style']);\r\n\r\nconst valid_modifiers = new Set([\r\n\t'preventDefault',\r\n\t'stopPropagation',\r\n\t'capture',\r\n\t'once',\r\n\t'passive',\r\n\t'nonpassive',\r\n\t'self',\r\n\t'trusted'\r\n]);\r\n\r\nconst passive_events = new Set([\r\n\t'wheel',\r\n\t'touchstart',\r\n\t'touchmove',\r\n\t'touchend',\r\n\t'touchcancel'\r\n]);\r\n\r\nconst react_attributes = new Map([\r\n\t['className', 'class'],\r\n\t['htmlFor', 'for']\r\n]);\r\n\r\nconst attributes_to_compact_whitespace = ['class', 'style'];\r\n\r\nfunction is_parent(parent: INode, elements: string[]) {\r\n\tlet check = false;\r\n\r\n\twhile (parent) {\r\n\t\tconst parent_name = (parent as Element).name;\r\n\t\tif (elements.includes(parent_name)) {\r\n\t\t\tcheck = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif (parent.type === 'Element') {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tparent = parent.parent;\r\n\t}\r\n\treturn check;\r\n}\r\n\r\nfunction get_namespace(parent: Element, element: Element, explicit_namespace: string) {\r\n\tconst parent_element = parent.find_nearest(/^Element/);\r\n\r\n\tif (!parent_element) {\r\n\t\treturn explicit_namespace || (is_svg(element.name)\r\n\t\t\t? namespaces.svg\r\n\t\t\t: null);\r\n\t}\r\n\r\n\tif (parent_element.namespace !== namespaces.foreign) {\r\n\t\tif (is_svg(element.name.toLowerCase())) return namespaces.svg;\r\n\t\tif (parent_element.name.toLowerCase() === 'foreignobject') return null;\r\n\t}\r\n\r\n\treturn parent_element.namespace;\r\n}\r\n\r\nfunction is_valid_aria_attribute_value(schema: ARIAPropertyDefinition, value: string | boolean): boolean {\r\n\tswitch (schema.type) {\r\n\t\tcase 'boolean':\r\n\t\t\treturn typeof value === 'boolean';\r\n\t\tcase 'string':\r\n\t\tcase 'id':\r\n\t\t\treturn typeof value === 'string';\r\n\t\tcase 'tristate':\r\n\t\t\treturn typeof value === 'boolean' || value === 'mixed';\r\n\t\tcase 'integer':\r\n\t\tcase 'number':\r\n\t\t\treturn typeof value !== 'boolean' && isNaN(Number(value)) === false;\r\n\t\tcase 'token': // single token\r\n\t\t\treturn (schema.values || [])\r\n\t\t\t\t.indexOf(typeof value === 'string' ? value.toLowerCase() : value) > -1;\r\n\t\tcase 'idlist': // if list of ids, split each\r\n\t\t\treturn typeof value === 'string'\r\n\t\t\t\t&& value.split(' ').every((id) => typeof id === 'string');\r\n\t\tcase 'tokenlist': // if list of tokens, split each\r\n\t\t\treturn typeof value === 'string'\r\n\t\t\t\t&& value.split(' ').every((token) => (schema.values || []).indexOf(token.toLowerCase()) > -1);\r\n\t\tdefault:\r\n\t\t\treturn false;\r\n\t}\r\n}\r\n\r\nconst regex_any_repeated_whitespaces = /[\\s]+/g;\r\nconst regex_heading_tags = /^h[1-6]$/;\r\nconst regex_illegal_attribute_character = /(^[0-9-.])|[\\^$@%&#?!|()[\\]{}^*+~;]/;\r\n\r\nexport default class Element extends Node {\r\n\ttype: 'Element';\r\n\tname: string;\r\n\tscope: TemplateScope;\r\n\tattributes: Attribute[] = [];\r\n\tactions: Action[] = [];\r\n\tbindings: Binding[] = [];\r\n\tclasses: Class[] = [];\r\n\tstyles: StyleDirective[] = [];\r\n\thandlers: EventHandler[] = [];\r\n\tlets: Let[] = [];\r\n\tintro?: Transition = null;\r\n\toutro?: Transition = null;\r\n\tanimation?: Animation = null;\r\n\tchildren: INode[];\r\n\tnamespace: string;\r\n\tneeds_manual_style_scoping: boolean;\r\n\ttag_expr: Expression;\r\n\r\n\tget is_dynamic_element() {\r\n\t\treturn this.name === 'svelte:element';\r\n\t}\r\n\r\n\tconstructor(component: Component, parent: Node, scope: TemplateScope, info: any) {\r\n\t\tsuper(component, parent, scope, info);\r\n\t\tthis.name = info.name;\r\n\r\n\t\tif (info.name === 'svelte:element') {\r\n\t\t\tif (typeof info.tag !== 'string') {\r\n\t\t\t\tthis.tag_expr = new Expression(component, this, scope, info.tag);\r\n\t\t\t} else {\r\n\t\t\t\tthis.tag_expr = new Expression(component, this, scope, string_literal(info.tag) as Literal);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.tag_expr = new Expression(component, this, scope, string_literal(this.name) as Literal);\r\n\t\t}\r\n\r\n\t\tthis.namespace = get_namespace(parent as Element, this, component.namespace);\r\n\r\n\t\tif (this.namespace !== namespaces.foreign) {\r\n\t\t\tif (this.name === 'pre' || this.name === 'textarea') {\r\n\t\t\t\tconst first = info.children[0];\r\n\t\t\t\tif (first && first.type === 'Text') {\r\n\t\t\t\t\t// The leading newline character needs to be stripped because of a quirk,\r\n\t\t\t\t\t// it is ignored by browsers if the tag and its contents are set through\r\n\t\t\t\t\t// innerHTML (NOT if set through the innerHTML of the tag or dynamically).\r\n\t\t\t\t\t// Therefore strip it here but add it back in the appropriate\r\n\t\t\t\t\t// places if there's another newline afterwards.\r\n\t\t\t\t\t// see https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions\r\n\t\t\t\t\t// see https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element\r\n\t\t\t\t\tfirst.data = first.data.replace(regex_starts_with_newline, '');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.name === 'textarea') {\r\n\t\t\t\tif (info.children.length > 0) {\r\n\t\t\t\t\tconst value_attribute = info.attributes.find(node => node.name === 'value');\r\n\t\t\t\t\tif (value_attribute) {\r\n\t\t\t\t\t\tcomponent.error(value_attribute, compiler_errors.textarea_duplicate_value);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// this is an egregious hack, but it's the easiest way to get <textarea>\r\n\t\t\t\t\t// children treated the same way as a value attribute\r\n\t\t\t\t\tinfo.attributes.push({\r\n\t\t\t\t\t\ttype: 'Attribute',\r\n\t\t\t\t\t\tname: 'value',\r\n\t\t\t\t\t\tvalue: info.children\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tinfo.children = [];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.name === 'option') {\r\n\t\t\t\t// Special case — treat these the same way:\r\n\t\t\t\t//   <option>{foo}</option>\r\n\t\t\t\t//   <option value={foo}>{foo}</option>\r\n\t\t\t\tconst value_attribute = info.attributes.find(attribute => attribute.name === 'value');\r\n\r\n\t\t\t\tif (!value_attribute) {\r\n\t\t\t\t\tinfo.attributes.push({\r\n\t\t\t\t\t\ttype: 'Attribute',\r\n\t\t\t\t\t\tname: 'value',\r\n\t\t\t\t\t\tvalue: info.children,\r\n\t\t\t\t\t\tsynthetic: true\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tconst has_let = info.attributes.some(node => node.type === 'Let');\r\n\t\tif (has_let) {\r\n\t\t\tscope = scope.child();\r\n\t\t}\r\n\r\n\t\t// Binding relies on Attribute, defer its evaluation\r\n\t\tconst order = ['Binding']; // everything else is -1\r\n\t\tinfo.attributes.sort((a, b) => order.indexOf(a.type) - order.indexOf(b.type));\r\n\r\n\t\tinfo.attributes.forEach(node => {\r\n\t\t\tswitch (node.type) {\r\n\t\t\t\tcase 'Action':\r\n\t\t\t\t\tthis.actions.push(new Action(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'Attribute':\r\n\t\t\t\tcase 'Spread':\r\n\t\t\t\t\t// special case\r\n\t\t\t\t\tif (node.name === 'xmlns') this.namespace = node.value[0].data;\r\n\r\n\t\t\t\t\tthis.attributes.push(new Attribute(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'Binding':\r\n\t\t\t\t\tthis.bindings.push(new Binding(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'Class':\r\n\t\t\t\t\tthis.classes.push(new Class(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'StyleDirective':\r\n\t\t\t\t\tthis.styles.push(new StyleDirective(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'EventHandler':\r\n\t\t\t\t\tthis.handlers.push(new EventHandler(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'Let': {\r\n\t\t\t\t\tconst l = new Let(component, this, scope, node);\r\n\t\t\t\t\tthis.lets.push(l);\r\n\t\t\t\t\tconst dependencies = new Set([l.name.name]);\r\n\r\n\t\t\t\t\tl.names.forEach(name => {\r\n\t\t\t\t\t\tscope.add(name, dependencies, this);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcase 'Transition':\r\n\t\t\t\t{\r\n\t\t\t\t\tconst transition = new Transition(component, this, scope, node);\r\n\t\t\t\t\tif (node.intro) this.intro = transition;\r\n\t\t\t\t\tif (node.outro) this.outro = transition;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcase 'Animation':\r\n\t\t\t\t\tthis.animation = new Animation(component, this, scope, node);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error(`Not implemented: ${node.type}`);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.scope = scope;\r\n\t\tthis.children = map_children(component, this, this.scope, info.children);\r\n\r\n\t\tthis.validate();\r\n\r\n\t\tthis.optimise();\r\n\r\n\t\tcomponent.apply_stylesheet(this);\r\n\t}\r\n\r\n\tvalidate() {\r\n\t\tif (this.component.var_lookup.has(this.name) && this.component.var_lookup.get(this.name).imported && !is_svg(this.name) && !is_html(this.name)) {\r\n\t\t\tthis.component.warn(this, compiler_warnings.component_name_lowercase(this.name));\r\n\t\t}\r\n\r\n\t\tthis.validate_attributes();\r\n\t\tthis.validate_event_handlers();\r\n\t\tif (this.namespace === namespaces.foreign) {\r\n\t\t\tthis.validate_bindings_foreign();\r\n\t\t} else {\r\n\t\t\tthis.validate_attributes_a11y();\r\n\t\t\tthis.validate_special_cases();\r\n\t\t\tthis.validate_bindings();\r\n\t\t\tthis.validate_content();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tvalidate_attributes() {\r\n\t\tconst { component, parent } = this;\r\n\r\n\t\tthis.attributes.forEach(attribute => {\r\n\t\t\tif (attribute.is_spread) return;\r\n\r\n\t\t\tconst name = attribute.name.toLowerCase();\r\n\r\n\t\t\t// Errors\r\n\r\n\t\t\tif (regex_illegal_attribute_character.test(name)) {\r\n\t\t\t\treturn component.error(attribute, compiler_errors.illegal_attribute(name));\r\n\t\t\t}\r\n\r\n\t\t\tif (name === 'slot') {\r\n\t\t\t\tif (!attribute.is_static) {\r\n\t\t\t\t\treturn component.error(attribute, compiler_errors.invalid_slot_attribute);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (component.slot_outlets.has(name)) {\r\n\t\t\t\t\treturn component.error(attribute, compiler_errors.duplicate_slot_attribute(name));\r\n\r\n\t\t\t\t\t// this code was unreachable. Still needed?\r\n\t\t\t\t\t// component.slot_outlets.add(name);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!(parent.type === 'SlotTemplate' || within_custom_element(parent))) {\r\n\t\t\t\t\treturn component.error(attribute, compiler_errors.invalid_slotted_content);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Warnings\r\n\r\n\t\t\tif (this.namespace !== namespaces.foreign) {\r\n\t\t\t\tif (name === 'is') {\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.avoid_is);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (react_attributes.has(attribute.name)) {\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.invalid_html_attribute(attribute.name, react_attributes.get(attribute.name)));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tvalidate_attributes_a11y() {\r\n\t\tconst { component, attributes, handlers } = this;\r\n\r\n\t\tconst attribute_map = new Map<string, Attribute>();\r\n\t\tconst handlers_map = new Map();\r\n\r\n\t\tattributes.forEach(attribute => (\r\n\t\t\tattribute_map.set(attribute.name, attribute)\r\n\t\t));\r\n\t\thandlers.forEach(handler => (\r\n\t\t\thandlers_map.set(handler.name, handler)\r\n\t\t));\r\n\r\n\t\tattributes.forEach(attribute => {\r\n\t\t\tif (attribute.is_spread) return;\r\n\r\n\t\t\tconst name = attribute.name.toLowerCase();\r\n\r\n\t\t\t// aria-props\r\n\t\t\tif (name.startsWith('aria-')) {\r\n\t\t\t\tif (invisible_elements.has(this.name)) {\r\n\t\t\t\t\t// aria-unsupported-elements\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_aria_attributes(this.name));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst type = name.slice(5);\r\n\t\t\t\tif (!aria_attribute_set.has(type)) {\r\n\t\t\t\t\tconst match = fuzzymatch(type, aria_attributes);\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_unknown_aria_attribute(type, match));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (name === 'aria-hidden' && regex_heading_tags.test(this.name)) {\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_hidden(this.name));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// aria-proptypes\r\n\t\t\t\tlet value = attribute.get_static_value();\r\n\t\t\t\tif (value === 'true') value = true;\r\n\t\t\t\tif (value === 'false') value = false;\r\n\r\n\t\t\t\tif (value !== null && value !== undefined && aria.has(name as ARIAProperty)) {\r\n\t\t\t\t\tconst schema = aria.get(name as ARIAProperty);\r\n\t\t\t\t\tif (!is_valid_aria_attribute_value(schema, value)) {\r\n\t\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_incorrect_attribute_type(schema, name));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// aria-role\r\n\t\t\tif (name === 'role') {\r\n\t\t\t\tif (invisible_elements.has(this.name)) {\r\n\t\t\t\t\t// aria-unsupported-elements\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_misplaced_role(this.name));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst value = attribute.get_static_value() as ARIARoleDefintionKey;\r\n\r\n\t\t\t\tif (value && aria_role_abstract_set.has(value)) {\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_no_abstract_role(value));\r\n\t\t\t\t} else if (value && !aria_role_set.has(value)) {\r\n\t\t\t\t\tconst match = fuzzymatch(value, aria_roles);\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_unknown_role(value, match));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// no-redundant-roles\r\n\t\t\t\tconst has_redundant_role = value === a11y_implicit_semantics.get(this.name);\r\n\r\n\t\t\t\tif (this.name === value || has_redundant_role) {\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Footers and headers are special cases, and should not have redundant roles unless they are the children of sections or articles.\r\n\t\t\t\tconst is_parent_section_or_article = is_parent(this.parent, ['section', 'article']);\r\n\t\t\t\tif (!is_parent_section_or_article) {\r\n\t\t\t\t\tconst has_nested_redundant_role = value === a11y_nested_implicit_semantics.get(this.name);\r\n\t\t\t\t\tif (has_nested_redundant_role) {\r\n\t\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_no_redundant_roles(value));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// role-has-required-aria-props\r\n\t\t\t\tif (!is_semantic_role_element(value, this.name, attribute_map)) {\r\n\t\t\t\t\tconst role = roles.get(value);\r\n\t\t\t\t\tif (role) {\r\n\t\t\t\t\t\tconst required_role_props = Object.keys(role.requiredProps);\r\n\t\t\t\t\t\tconst has_missing_props = required_role_props.some(prop => !attributes.find(a => a.name === prop));\r\n\r\n\t\t\t\t\t\tif (has_missing_props) {\r\n\t\t\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_role_has_required_aria_props(value as string, required_role_props));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// no-interactive-element-to-noninteractive-role\r\n\t\t\t\tif (is_interactive_element(this.name, attribute_map) && (is_non_interactive_roles(value) || is_presentation_role(value))) {\r\n\t\t\t\t\tcomponent.warn(this, compiler_warnings.a11y_no_interactive_element_to_noninteractive_role(value, this.name));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// no-access-key\r\n\t\t\tif (name === 'accesskey') {\r\n\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_accesskey);\r\n\t\t\t}\r\n\r\n\t\t\t// no-autofocus\r\n\t\t\tif (name === 'autofocus') {\r\n\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_autofocus);\r\n\t\t\t}\r\n\r\n\t\t\t// scope\r\n\t\t\tif (name === 'scope' && this.name !== 'th') {\r\n\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_misplaced_scope);\r\n\t\t\t}\r\n\r\n\t\t\t// tabindex-no-positive\r\n\t\t\tif (name === 'tabindex') {\r\n\t\t\t\tconst value = attribute.get_static_value();\r\n\t\t\t\t// @ts-ignore todo is tabindex=true correct case?\r\n\t\t\t\tif (!isNaN(value) && +value > 0) {\r\n\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.a11y_positive_tabindex);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// click-events-have-key-events\r\n\t\tif (handlers_map.has('click')) {\r\n\t\t\tconst role = attribute_map.get('role');\r\n\t\t\tconst is_non_presentation_role = role?.is_static && !is_presentation_role(role.get_static_value() as ARIARoleDefintionKey);\r\n\r\n\t\t\tif (\r\n\t\t\t\t!is_hidden_from_screen_reader(this.name, attribute_map) &&\r\n\t\t\t\t(!role || is_non_presentation_role) &&\r\n\t\t\t\t!is_interactive_element(this.name, attribute_map) &&\r\n\t\t\t\t!this.attributes.find(attr => attr.is_spread)\r\n\t\t\t) {\r\n\t\t\t\tconst has_key_event =\r\n\t\t\t\t\thandlers_map.has('keydown') ||\r\n\t\t\t\t\thandlers_map.has('keyup') ||\r\n\t\t\t\t\thandlers_map.has('keypress');\r\n\r\n\t\t\t\tif (!has_key_event) {\r\n\t\t\t\t\tcomponent.warn(\r\n\t\t\t\t\t\tthis,\r\n\t\t\t\t\t\tcompiler_warnings.a11y_click_events_have_key_events()\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// no-noninteractive-tabindex\r\n\t\tif (!is_interactive_element(this.name, attribute_map) && !is_interactive_roles(attribute_map.get('role')?.get_static_value() as ARIARoleDefintionKey)) {\r\n\t\t\tconst tab_index = attribute_map.get('tabindex');\r\n\t\t\tif (tab_index && (!tab_index.is_static || Number(tab_index.get_static_value()) >= 0)) {\r\n\t\t\t\tcomponent.warn(this, compiler_warnings.a11y_no_noninteractive_tabindex);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvalidate_special_cases() {\r\n\t\tconst { component, attributes, handlers } = this;\r\n\r\n\t\tconst attribute_map = new Map();\r\n\t\tconst handlers_map = new Map();\r\n\r\n\t\tattributes.forEach(attribute => (\r\n\t\t\tattribute_map.set(attribute.name, attribute)\r\n\t\t));\r\n\r\n\t\thandlers.forEach(handler => (\r\n\t\t\thandlers_map.set(handler.name, handler)\r\n\t\t));\r\n\r\n\t\tif (this.name === 'a') {\r\n\t\t\tconst href_attribute = attribute_map.get('href') || attribute_map.get('xlink:href');\r\n\t\t\tconst id_attribute = attribute_map.get('id');\r\n\t\t\tconst name_attribute = attribute_map.get('name');\r\n\t\t\tconst target_attribute = attribute_map.get('target');\r\n\r\n\t\t\tif (target_attribute && target_attribute.get_static_value() === '_blank' && href_attribute) {\r\n\t\t\t\tconst href_static_value = href_attribute.get_static_value() ? href_attribute.get_static_value().toLowerCase() : null;\r\n\r\n\t\t\t\tif (href_static_value === null || href_static_value.match(/^(https?:)?\\/\\//i)) {\r\n\t\t\t\t\tconst rel = attribute_map.get('rel');\r\n\t\t\t\t\tif (rel == null || rel.is_static) {\r\n\t\t\t\t\t\tconst rel_values = rel ? rel.get_static_value().split(' ') : [];\r\n\t\t\t\t\t\tconst expected_values = ['noreferrer'];\r\n\t\t\t\t\t\texpected_values.forEach(expected_value => {\r\n\t\t\t\t\t\t\tif (!rel || rel && rel_values.indexOf(expected_value) < 0) {\r\n\t\t\t\t\t\t\t\tcomponent.warn(this, {\r\n\t\t\t\t\t\t\t\t\tcode: `security-anchor-rel-${expected_value}`,\r\n\t\t\t\t\t\t\t\t\tmessage: `Security: Anchor with \"target=_blank\" should have rel attribute containing the value \"${expected_value}\"`\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (href_attribute) {\r\n\t\t\t\tconst href_value = href_attribute.get_static_value();\r\n\r\n\t\t\t\tif (href_value === '' || href_value === '#' || /^\\W*javascript:/i.test(href_value)) {\r\n\t\t\t\t\tcomponent.warn(href_attribute, compiler_warnings.a11y_invalid_attribute(href_attribute.name, href_value));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst id_attribute_valid = id_attribute && id_attribute.get_static_value() !== '';\r\n\t\t\t\tconst name_attribute_valid = name_attribute && name_attribute.get_static_value() !== '';\r\n\r\n\t\t\t\tif (!id_attribute_valid && !name_attribute_valid) {\r\n\t\t\t\t\tcomponent.warn(this, compiler_warnings.a11y_missing_attribute('a', 'an', 'href'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst required_attributes = a11y_required_attributes[this.name];\r\n\t\t\tif (required_attributes) {\r\n\t\t\t\tconst has_attribute = required_attributes.some(name => attribute_map.has(name));\r\n\r\n\t\t\t\tif (!has_attribute) {\r\n\t\t\t\t\tshould_have_attribute(this, required_attributes);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.name === 'input') {\r\n\t\t\tconst type = attribute_map.get('type');\r\n\t\t\tif (type && type.get_static_value() === 'image') {\r\n\t\t\t\tconst required_attributes = ['alt', 'aria-label', 'aria-labelledby'];\r\n\t\t\t\tconst has_attribute = required_attributes.some(name => attribute_map.has(name));\r\n\r\n\t\t\t\tif (!has_attribute) {\r\n\t\t\t\t\tshould_have_attribute(this, required_attributes, 'input type=\"image\"');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.name === 'img') {\r\n\t\t\tconst alt_attribute = attribute_map.get('alt');\r\n\t\t\tconst aria_hidden_attribute = attribute_map.get('aria-hidden');\r\n\r\n\t\t\tconst aria_hidden_exist = aria_hidden_attribute && aria_hidden_attribute.get_static_value();\r\n\r\n\t\t\tif (alt_attribute && !aria_hidden_exist) {\r\n\t\t\t\tconst alt_value = alt_attribute.get_static_value();\r\n\r\n\t\t\t\tif (/\\b(image|picture|photo)\\b/i.test(alt_value)) {\r\n\t\t\t\t\tcomponent.warn(this, compiler_warnings.a11y_img_redundant_alt);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.name === 'label') {\r\n\t\t\tconst has_input_child = (children: INode[]) => {\r\n\t\t\t\tif (children.some(child => (child instanceof Element && (a11y_labelable.has(child.name) || child.name === 'slot')))) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (const child of children) {\r\n\t\t\t\t\tif (!('children' in child) || child.children.length === 0) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (has_input_child(child.children)) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn false;\r\n\t\t\t};\r\n\r\n\t\t\tif (!attribute_map.has('for') && !has_input_child(this.children)) {\r\n\t\t\t\tcomponent.warn(this, compiler_warnings.a11y_label_has_associated_control);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.name === 'video') {\r\n\t\t\tif (attribute_map.has('muted')) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tlet has_caption;\r\n\t\t\tconst track = this.children.find((i: Element) => i.name === 'track');\r\n\t\t\tif (track) {\r\n\t\t\t\thas_caption = track.attributes.find(a => a.name === 'kind' && a.get_static_value() === 'captions');\r\n\t\t\t}\r\n\r\n\t\t\tif (!has_caption) {\r\n\t\t\t\tcomponent.warn(this, compiler_warnings.a11y_media_has_caption);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (a11y_distracting_elements.has(this.name)) {\r\n\t\t\t// no-distracting-elements\r\n\t\t\tcomponent.warn(this, compiler_warnings.a11y_distracting_elements(this.name));\r\n\t\t}\r\n\r\n\t\tif (this.name === 'figcaption') {\r\n\t\t\tlet { parent } = this;\r\n\t\t\tlet is_figure_parent = false;\r\n\r\n\t\t\twhile (parent) {\r\n\t\t\t\tif ((parent as Element).name === 'figure') {\r\n\t\t\t\t\tis_figure_parent = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (parent.type === 'Element') {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tparent = parent.parent;\r\n\t\t\t}\r\n\r\n\t\t\tif (!is_figure_parent) {\r\n\t\t\t\tcomponent.warn(this, compiler_warnings.a11y_structure_immediate);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.name === 'figure') {\r\n\t\t\tconst children = this.children.filter(node => {\r\n\t\t\t\tif (node.type === 'Comment') return false;\r\n\t\t\t\tif (node.type === 'Text') return regex_non_whitespace_character.test(node.data);\r\n\t\t\t\treturn true;\r\n\t\t\t});\r\n\r\n\t\t\tconst index = children.findIndex(child => (child as Element).name === 'figcaption');\r\n\r\n\t\t\tif (index !== -1 && (index !== 0 && index !== children.length - 1)) {\r\n\t\t\t\tcomponent.warn(children[index], compiler_warnings.a11y_structure_first_or_last);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (handlers_map.has('mouseover') && !handlers_map.has('focus')) {\r\n\t\t\tcomponent.warn(this, compiler_warnings.a11y_mouse_events_have_key_events('mouseover', 'focus'));\r\n\t\t}\r\n\r\n\t\tif (handlers_map.has('mouseout') && !handlers_map.has('blur')) {\r\n\t\t\tcomponent.warn(this, compiler_warnings.a11y_mouse_events_have_key_events('mouseout', 'blur'));\r\n\t\t}\r\n\t}\r\n\r\n\tvalidate_bindings_foreign() {\r\n\t\tthis.bindings.forEach(binding => {\r\n\t\t\tif (binding.name !== 'this') {\r\n\t\t\t\treturn this.component.error(binding, compiler_errors.invalid_binding_foreign(binding.name));\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tvalidate_bindings() {\r\n\t\tconst { component } = this;\r\n\r\n\t\tconst check_type_attribute = () => {\r\n\t\t\tconst attribute = this.attributes.find(\r\n\t\t\t\t(attribute: Attribute) => attribute.name === 'type'\r\n\t\t\t);\r\n\r\n\t\t\tif (!attribute) return null;\r\n\r\n\t\t\tif (!attribute.is_static) {\r\n\t\t\t\treturn component.error(attribute, compiler_errors.invalid_type);\r\n\t\t\t}\r\n\r\n\t\t\tconst value = attribute.get_static_value();\r\n\r\n\t\t\tif (value === true) {\r\n\t\t\t\treturn component.error(attribute, compiler_errors.missing_type);\r\n\t\t\t}\r\n\r\n\t\t\treturn value;\r\n\t\t};\r\n\r\n\t\tthis.bindings.forEach(binding => {\r\n\t\t\tconst { name } = binding;\r\n\r\n\t\t\tif (name === 'value') {\r\n\t\t\t\tif (\r\n\t\t\t\t\tthis.name !== 'input' &&\r\n\t\t\t\t\tthis.name !== 'textarea' &&\r\n\t\t\t\t\tthis.name !== 'select'\r\n\t\t\t\t) {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_elements(this.name, 'value'));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.name === 'select') {\r\n\t\t\t\t\tconst attribute = this.attributes.find(\r\n\t\t\t\t\t\t(attribute: Attribute) => attribute.name === 'multiple'\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tif (attribute && !attribute.is_static) {\r\n\t\t\t\t\t\treturn component.error(attribute, compiler_errors.dynamic_multiple_attribute);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcheck_type_attribute();\r\n\t\t\t\t}\r\n\t\t\t} else if (name === 'checked' || name === 'indeterminate') {\r\n\t\t\t\tif (this.name !== 'input') {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_elements(this.name, name));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst type = check_type_attribute();\r\n\r\n\t\t\t\tif (type !== 'checkbox') {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_no_checkbox(name, type === 'radio'));\r\n\t\t\t\t}\r\n\t\t\t} else if (name === 'group') {\r\n\t\t\t\tif (this.name !== 'input') {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_elements(this.name, 'group'));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst type = check_type_attribute();\r\n\r\n\t\t\t\tif (type !== 'checkbox' && type !== 'radio') {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_element_with('<input type=\"checkbox\"> or <input type=\"radio\">', 'group'));\r\n\t\t\t\t}\r\n\t\t\t} else if (name === 'files') {\r\n\t\t\t\tif (this.name !== 'input') {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_elements(this.name, 'files'));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst type = check_type_attribute();\r\n\r\n\t\t\t\tif (type !== 'file') {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_element_with('<input type=\"file\">', 'files'));\r\n\t\t\t\t}\r\n\r\n\t\t\t} else if (name === 'open') {\r\n\t\t\t\tif (this.name !== 'details') {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_element_with('<details>', name));\r\n\t\t\t\t}\r\n\t\t\t} else if (\r\n\t\t\t\tname === 'currentTime' ||\r\n\t\t\t\tname === 'duration' ||\r\n\t\t\t\tname === 'paused' ||\r\n\t\t\t\tname === 'buffered' ||\r\n\t\t\t\tname === 'seekable' ||\r\n\t\t\t\tname === 'played' ||\r\n\t\t\t\tname === 'volume' ||\r\n\t\t\t\tname === 'muted' ||\r\n\t\t\t\tname === 'playbackRate' ||\r\n\t\t\t\tname === 'seeking' ||\r\n\t\t\t\tname === 'ended'\r\n\t\t\t) {\r\n\t\t\t\tif (this.name !== 'audio' && this.name !== 'video') {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_element_with('audio> or <video>', name));\r\n\t\t\t\t}\r\n\t\t\t} else if (\r\n\t\t\t\tname === 'videoHeight' ||\r\n\t\t\t\tname === 'videoWidth'\r\n\t\t\t) {\r\n\t\t\t\tif (this.name !== 'video') {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_element_with('<video>', name));\r\n\t\t\t\t}\r\n\t\t\t} else if (regex_dimensions.test(name)) {\r\n\t\t\t\tif (this.name === 'svg' && (name === 'offsetWidth' || name === 'offsetHeight')) {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_on(binding.name, `<svg>. Use '${name.replace('offset', 'client')}' instead`));\r\n\t\t\t\t} else if (is_svg(this.name)) {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_on(binding.name, 'SVG elements'));\r\n\t\t\t\t} else if (is_void(this.name)) {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding_on(binding.name, `void elements like <${this.name}>. Use a wrapper element instead`));\r\n\t\t\t\t}\r\n\t\t\t} else if (\r\n\t\t\t\tname === 'textContent' ||\r\n\t\t\t\tname === 'innerHTML'\r\n\t\t\t) {\r\n\t\t\t\tconst contenteditable = this.attributes.find(\r\n\t\t\t\t\t(attribute: Attribute) => attribute.name === 'contenteditable'\r\n\t\t\t\t);\r\n\r\n\t\t\t\tif (!contenteditable) {\r\n\t\t\t\t\treturn component.error(binding, compiler_errors.missing_contenteditable_attribute);\r\n\t\t\t\t} else if (contenteditable && !contenteditable.is_static) {\r\n\t\t\t\t\treturn component.error(contenteditable, compiler_errors.dynamic_contenteditable_attribute);\r\n\t\t\t\t}\r\n\t\t\t} else if (name !== 'this') {\r\n\t\t\t\treturn component.error(binding, compiler_errors.invalid_binding(binding.name));\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tvalidate_content() {\r\n\t\tif (!a11y_required_content.has(this.name)) return;\r\n\t\tif (\r\n\t\t\tthis.bindings\r\n\t\t\t\t.some((binding) => ['textContent', 'innerHTML'].includes(binding.name))\r\n\t\t) return;\r\n\r\n\t\tif (this.children.length === 0) {\r\n\t\t\tthis.component.warn(this, compiler_warnings.a11y_missing_content(this.name));\r\n\t\t}\r\n\t}\r\n\r\n\tvalidate_event_handlers() {\r\n\t\tconst { component } = this;\r\n\r\n\t\tthis.handlers.forEach(handler => {\r\n\t\t\tif (handler.modifiers.has('passive') && handler.modifiers.has('preventDefault')) {\r\n\t\t\t\treturn component.error(handler, compiler_errors.invalid_event_modifier_combination('passive', 'preventDefault'));\r\n\t\t\t}\r\n\r\n\t\t\tif (handler.modifiers.has('passive') && handler.modifiers.has('nonpassive')) {\r\n\t\t\t\treturn component.error(handler, compiler_errors.invalid_event_modifier_combination('passive', 'nonpassive'));\r\n\t\t\t}\r\n\r\n\t\t\thandler.modifiers.forEach(modifier => {\r\n\t\t\t\tif (!valid_modifiers.has(modifier)) {\r\n\t\t\t\t\treturn component.error(handler, compiler_errors.invalid_event_modifier(list(Array.from(valid_modifiers))));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (modifier === 'passive') {\r\n\t\t\t\t\tif (passive_events.has(handler.name)) {\r\n\t\t\t\t\t\tif (handler.can_make_passive) {\r\n\t\t\t\t\t\t\tcomponent.warn(handler, compiler_warnings.redundant_event_modifier_for_touch);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcomponent.warn(handler, compiler_warnings.redundant_event_modifier_passive);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (component.compile_options.legacy && (modifier === 'once' || modifier === 'passive')) {\r\n\t\t\t\t\t// TODO this could be supported, but it would need a few changes to\r\n\t\t\t\t\t// how event listeners work\r\n\t\t\t\t\treturn component.error(handler, compiler_errors.invalid_event_modifier_legacy(modifier));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (passive_events.has(handler.name) && handler.can_make_passive && !handler.modifiers.has('preventDefault') && !handler.modifiers.has('nonpassive')) {\r\n\t\t\t\t// touch/wheel events should be passive by default\r\n\t\t\t\thandler.modifiers.add('passive');\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tis_media_node() {\r\n\t\treturn this.name === 'audio' || this.name === 'video';\r\n\t}\r\n\r\n\tadd_css_class() {\r\n\t\tif (this.attributes.some(attr => attr.is_spread)) {\r\n\t\t\tthis.needs_manual_style_scoping = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst { id } = this.component.stylesheet;\r\n\r\n\t\tconst class_attribute = this.attributes.find(a => a.name === 'class');\r\n\r\n\t\tif (class_attribute && !class_attribute.is_true) {\r\n\t\t\tif (class_attribute.chunks.length === 1 && class_attribute.chunks[0].type === 'Text') {\r\n\t\t\t\t(class_attribute.chunks[0] as Text).data += ` ${id}`;\r\n\t\t\t} else {\r\n\t\t\t\t(class_attribute.chunks as Node[]).push(\r\n\t\t\t\t\tnew Text(this.component, this, this.scope, {\r\n\t\t\t\t\t\ttype: 'Text',\r\n\t\t\t\t\t\tdata: ` ${id}`,\r\n\t\t\t\t\t\tsynthetic: true\r\n\t\t\t\t\t} as any)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.attributes.push(\r\n\t\t\t\tnew Attribute(this.component, this, this.scope, {\r\n\t\t\t\t\ttype: 'Attribute',\r\n\t\t\t\t\tname: 'class',\r\n\t\t\t\t\tvalue: [{ type: 'Text', data: id, synthetic: true }]\r\n\t\t\t\t} as any)\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tget slot_template_name() {\r\n\t\treturn this.attributes.find(attribute => attribute.name === 'slot').get_static_value() as string;\r\n\t}\r\n\r\n\toptimise() {\r\n\t\tattributes_to_compact_whitespace.forEach(attribute_name => {\r\n\t\t\tconst attribute = this.attributes.find(a => a.name === attribute_name);\r\n\t\t\tif (attribute && !attribute.is_true) {\r\n\t\t\t\tattribute.chunks.forEach((chunk, index) => {\r\n\t\t\t\t\tif (chunk.type === 'Text') {\r\n\t\t\t\t\t\tlet data = chunk.data.replace(regex_any_repeated_whitespaces, ' ');\r\n\t\t\t\t\t\tif (index === 0) {\r\n\t\t\t\t\t\t\tdata = data.trimLeft();\r\n\t\t\t\t\t\t} else if (index === attribute.chunks.length - 1) {\r\n\t\t\t\t\t\t\tdata = data.trimRight();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tchunk.data = data;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n\r\nconst regex_starts_with_vovel = /^[aeiou]/;\r\n\r\nfunction should_have_attribute(\r\n\tnode,\r\n\tattributes: string[],\r\n\tname = node.name\r\n) {\r\n\tconst article = regex_starts_with_vovel.test(attributes[0]) ? 'an' : 'a';\r\n\tconst sequence = attributes.length > 1 ?\r\n\t\tattributes.slice(0, -1).join(', ') + ` or ${attributes[attributes.length - 1]}` :\r\n\t\tattributes[0];\r\n\r\n\tnode.component.warn(node, compiler_warnings.a11y_missing_attribute(name, article, sequence));\r\n}\r\n\r\nconst regex_minus_sign = /-/;\r\n\r\nfunction within_custom_element(parent: INode) {\r\n\twhile (parent) {\r\n\t\tif (parent.type === 'InlineComponent') return false;\r\n\t\tif (parent.type === 'Element' && regex_minus_sign.test(parent.name)) return true;\r\n\t\tparent = parent.parent;\r\n\t}\r\n\treturn false;\r\n}\r\n","// https://github.com/darkskyapp/string-hash/blob/master/index.js\r\n\r\nconst regex_return_characters = /\\r/g;\r\n\r\nexport default function hash(str: string): string {\r\n\tstr = str.replace(regex_return_characters, '');\r\n\tlet hash = 5381;\r\n\tlet i = str.length;\r\n\r\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\r\n\treturn (hash >>> 0).toString(36);\r\n}\r\n","import Node from './shared/Node';\r\nimport Attribute from './Attribute';\r\nimport map_children from './shared/map_children';\r\nimport Binding from './Binding';\r\nimport EventHandler from './EventHandler';\r\nimport Expression from './shared/Expression';\r\nimport Component from '../Component';\r\nimport Let from './Let';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { INode } from './interfaces';\r\nimport { TemplateNode } from '../../interfaces';\r\nimport compiler_errors from '../compiler_errors';\r\nimport { regex_only_whitespaces } from '../../utils/patterns';\r\n\r\nexport default class InlineComponent extends Node {\r\n\ttype: 'InlineComponent';\r\n\tname: string;\r\n\texpression: Expression;\r\n\tattributes: Attribute[] = [];\r\n\tbindings: Binding[] = [];\r\n\thandlers: EventHandler[] = [];\r\n\tlets: Let[] = [];\r\n\tcss_custom_properties: Attribute[] = [];\r\n\tchildren: INode[];\r\n\tscope: TemplateScope;\r\n\tnamespace: string;\r\n\r\n\tconstructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tif (info.name !== 'svelte:component' && info.name !== 'svelte:self') {\r\n\t\t\tconst name = info.name.split('.')[0]; // accommodate namespaces\r\n\t\t\tcomponent.warn_if_undefined(name, info, scope);\r\n\t\t\tcomponent.add_reference(this as any, name);\r\n\t\t}\r\n\r\n\t\tthis.name = info.name;\r\n\t\tthis.namespace = get_namespace(parent, component.namespace);\r\n\r\n\t\tthis.expression = this.name === 'svelte:component'\r\n\t\t\t? new Expression(component, this, scope, info.expression)\r\n\t\t\t: null;\r\n\r\n\t\tinfo.attributes.forEach(node => {\r\n\t\t\t/* eslint-disable no-fallthrough */\r\n\t\t\tswitch (node.type) {\r\n\t\t\t\tcase 'Action':\r\n\t\t\t\t\treturn component.error(node, compiler_errors.invalid_action);\r\n\r\n\t\t\t\tcase 'Attribute':\r\n\t\t\t\t\tif (node.name.startsWith('--')) {\r\n\t\t\t\t\t\tthis.css_custom_properties.push(new Attribute(component, this, scope, node));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// fallthrough\r\n\t\t\t\tcase 'Spread':\r\n\t\t\t\t\tthis.attributes.push(new Attribute(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'Binding':\r\n\t\t\t\t\tthis.bindings.push(new Binding(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'Class':\r\n\t\t\t\t\treturn component.error(node, compiler_errors.invalid_class);\r\n\r\n\t\t\t\tcase 'EventHandler':\r\n\t\t\t\t\tthis.handlers.push(new EventHandler(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'Let':\r\n\t\t\t\t\tthis.lets.push(new Let(component, this, scope, node));\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'Transition':\r\n\t\t\t\t\treturn component.error(node, compiler_errors.invalid_transition);\r\n\r\n\t\t\t\tcase 'StyleDirective':\r\n\t\t\t\t\treturn component.error(node, compiler_errors.invalid_component_style_directive);\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error(`Not implemented: ${node.type}`);\r\n\t\t\t}\r\n\t\t\t/* eslint-enable no-fallthrough */\r\n\t\t});\r\n\r\n\t\tif (this.lets.length > 0) {\r\n\t\t\tthis.scope = scope.child();\r\n\r\n\t\t\tthis.lets.forEach(l => {\r\n\t\t\t\tconst dependencies = new Set([l.name.name]);\r\n\r\n\t\t\t\tl.names.forEach(name => {\r\n\t\t\t\t\tthis.scope.add(name, dependencies, this);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.scope = scope;\r\n\t\t}\r\n\r\n\t\tthis.handlers.forEach(handler => {\r\n\t\t\thandler.modifiers.forEach(modifier => {\r\n\t\t\t\tif (modifier !== 'once') {\r\n\t\t\t\t\treturn component.error(handler, compiler_errors.invalid_event_modifier_component);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tconst children = [];\r\n\t\tfor (let i = info.children.length - 1; i >= 0; i--) {\r\n\t\t\tconst child = info.children[i];\r\n\t\t\tif (child.type === 'SlotTemplate') {\r\n\t\t\t\tchildren.push(child);\r\n\t\t\t\tinfo.children.splice(i, 1);\r\n\t\t\t} else if ((child.type === 'Element' || child.type === 'InlineComponent' || child.type === 'Slot') && child.attributes.find(attribute => attribute.name === 'slot')) {\r\n\t\t\t\tconst slot_template = {\r\n\t\t\t\t\tstart: child.start,\r\n\t\t\t\t\tend: child.end,\r\n\t\t\t\t\ttype: 'SlotTemplate',\r\n\t\t\t\t\tname: 'svelte:fragment',\r\n\t\t\t\t\tattributes: [],\r\n\t\t\t\t\tchildren: [child]\r\n\t\t\t\t};\r\n\r\n\t\t\t\t// transfer attributes\r\n\t\t\t\tfor (let i = child.attributes.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tconst attribute = child.attributes[i];\r\n\t\t\t\t\tif (attribute.type === 'Let') {\r\n\t\t\t\t\t\tslot_template.attributes.push(attribute);\r\n\t\t\t\t\t\tchild.attributes.splice(i, 1);\r\n\t\t\t\t\t} else if (attribute.type === 'Attribute' && attribute.name === 'slot') {\r\n\t\t\t\t\t\tslot_template.attributes.push(attribute);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// transfer const\r\n\t\t\t\tfor (let i = child.children.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tconst child_child = child.children[i];\r\n\t\t\t\t\tif (child_child.type === 'ConstTag') {\r\n\t\t\t\t\t\tslot_template.children.push(child_child);\r\n\t\t\t\t\t\tchild.children.splice(i, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tchildren.push(slot_template);\r\n\t\t\t\tinfo.children.splice(i, 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (info.children.some(node => not_whitespace_text(node))) {\r\n\t\t\tchildren.push({\r\n\t\t\t\tstart: info.start,\r\n\t\t\t\tend: info.end,\r\n\t\t\t\ttype: 'SlotTemplate',\r\n\t\t\t\tname: 'svelte:fragment',\r\n\t\t\t\tattributes: [],\r\n\t\t\t\tchildren: info.children\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.children = map_children(component, this, this.scope, children);\r\n\t}\r\n\r\n\tget slot_template_name() {\r\n\t\treturn this.attributes.find(attribute => attribute.name === 'slot').get_static_value() as string;\r\n\t}\r\n}\r\n\r\nfunction not_whitespace_text(node) {\r\n\treturn !(node.type === 'Text' && regex_only_whitespaces.test(node.data));\r\n}\r\n\r\nfunction get_namespace(parent: Node, explicit_namespace: string) {\r\n\tconst parent_element = parent.find_nearest(/^Element/);\r\n\r\n\tif (!parent_element) {\r\n\t\treturn explicit_namespace;\r\n\t}\r\n\r\n\treturn parent_element.namespace;\r\n}\r\n","import Element from './Element';\r\nimport Attribute from './Attribute';\r\nimport Component from '../Component';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { INode } from './interfaces';\r\nimport { TemplateNode } from '../../interfaces';\r\nimport compiler_errors from '../compiler_errors';\r\n\r\nexport default class Slot extends Element {\r\n\ttype: 'Element';\r\n\tname: string;\r\n\tchildren: INode[];\r\n\tslot_name: string;\r\n\tvalues: Map<string, Attribute> = new Map();\r\n\r\n\tconstructor(component: Component, parent: INode, scope: TemplateScope, info: TemplateNode) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tinfo.attributes.forEach(attr => {\r\n\t\t\tif (attr.type !== 'Attribute' && attr.type !== 'Spread') {\r\n\t\t\t\treturn component.error(attr, compiler_errors.invalid_slot_directive);\r\n\t\t\t}\r\n\r\n\t\t\tif (attr.name === 'name') {\r\n\t\t\t\tif (attr.value.length !== 1 || attr.value[0].type !== 'Text') {\r\n\t\t\t\t\treturn component.error(attr, compiler_errors.dynamic_slot_name);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.slot_name = attr.value[0].data;\r\n\t\t\t\tif (this.slot_name === 'default') {\r\n\t\t\t\t\treturn component.error(attr, compiler_errors.invalid_slot_name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.values.set(attr.name, new Attribute(component, this, scope, attr));\r\n\t\t});\r\n\r\n\t\tif (!this.slot_name) this.slot_name = 'default';\r\n\r\n\t\tif (this.slot_name === 'default') {\r\n\t\t\t// if this is the default slot, add our dependencies to any\r\n\t\t\t// other slots (which inherit our slot values) that were\r\n\t\t\t// previously encountered\r\n\t\t\tcomponent.slots.forEach((slot) => {\r\n\t\t\t\tthis.values.forEach((attribute, name) => {\r\n\t\t\t\t\tif (!slot.values.has(name)) {\r\n\t\t\t\t\t\tslot.values.set(name, attribute);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t} else if (component.slots.has('default')) {\r\n\t\t\t// otherwise, go the other way — inherit values from\r\n\t\t\t// a previously encountered default slot\r\n\t\t\tconst default_slot = component.slots.get('default');\r\n\t\t\tdefault_slot.values.forEach((attribute, name) => {\r\n\t\t\t\tif (!this.values.has(name)) {\r\n\t\t\t\t\tthis.values.set(name, attribute);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tcomponent.slots.set(this.slot_name, this);\r\n\t}\r\n}\r\n","import Component from '../Component';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport Node from './shared/Node';\r\nimport Let from './Let';\r\nimport Attribute from './Attribute';\r\nimport { INode } from './interfaces';\r\nimport compiler_errors from '../compiler_errors';\r\nimport get_const_tags from './shared/get_const_tags';\r\nimport ConstTag from './ConstTag';\r\n\r\nexport default class SlotTemplate extends Node {\r\n\ttype: 'SlotTemplate';\r\n\tscope: TemplateScope;\r\n\tchildren: INode[];\r\n\tlets: Let[] = [];\r\n\tconst_tags: ConstTag[];\r\n\tslot_attribute: Attribute;\r\n\tslot_template_name: string = 'default';\r\n\r\n\tconstructor(\r\n\t\tcomponent: Component,\r\n\t\tparent: INode,\r\n\t\tscope: TemplateScope,\r\n\t\tinfo: any\r\n\t) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tthis.validate_slot_template_placement();\r\n\r\n\t\tscope = scope.child();\r\n\r\n\t\tinfo.attributes.forEach((node) => {\r\n\t\t\tswitch (node.type) {\r\n\t\t\t\tcase 'Let': {\r\n\t\t\t\t\tconst l = new Let(component, this, scope, node);\r\n\t\t\t\t\tthis.lets.push(l);\r\n\t\t\t\t\tconst dependencies = new Set([l.name.name]);\r\n\r\n\t\t\t\t\tl.names.forEach((name) => {\r\n\t\t\t\t\t\tscope.add(name, dependencies, this);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tcase 'Attribute': {\r\n\t\t\t\t\tif (node.name === 'slot') {\r\n\t\t\t\t\t\tthis.slot_attribute = new Attribute(component, this, scope, node);\r\n\t\t\t\t\t\tif (!this.slot_attribute.is_static) {\r\n\t\t\t\t\t\t\treturn component.error(node, compiler_errors.invalid_slot_attribute);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconst value = this.slot_attribute.get_static_value();\r\n\t\t\t\t\t\tif (typeof value === 'boolean') {\r\n\t\t\t\t\t\t\treturn component.error(node, compiler_errors.invalid_slot_attribute_value_missing);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.slot_template_name = value as string;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthrow new Error(`Invalid attribute '${node.name}' in <svelte:fragment>`);\r\n\t\t\t\t}\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error(`Not implemented: ${node.type}`);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.scope = scope;\r\n\t\t([this.const_tags, this.children] = get_const_tags(info.children, component, this, this));\r\n\t}\r\n\r\n\tvalidate_slot_template_placement() {\r\n\t\tif (this.parent.type !== 'InlineComponent') {\r\n\t\t\treturn this.component.error(this, compiler_errors.invalid_slotted_content_fragment);\r\n\t\t}\r\n\t}\r\n}\r\n","import Node from './shared/Node';\r\nimport Binding from './Binding';\r\nimport EventHandler from './EventHandler';\r\nimport flatten_reference from '../utils/flatten_reference';\r\nimport fuzzymatch from '../../utils/fuzzymatch';\r\nimport list from '../../utils/list';\r\nimport Action from './Action';\r\nimport Component from '../Component';\r\nimport TemplateScope from './shared/TemplateScope';\r\nimport { TemplateNode } from '../../interfaces';\r\nimport compiler_errors from '../compiler_errors';\r\n\r\nconst valid_bindings = [\r\n\t'innerWidth',\r\n\t'innerHeight',\r\n\t'outerWidth',\r\n\t'outerHeight',\r\n\t'scrollX',\r\n\t'scrollY',\r\n\t'online'\r\n];\r\n\r\nexport default class Window extends Node {\r\n\ttype: 'Window';\r\n\thandlers: EventHandler[] = [];\r\n\tbindings: Binding[] = [];\r\n\tactions: Action[] = [];\r\n\r\n\tconstructor(component: Component, parent: Node, scope: TemplateScope, info: TemplateNode) {\r\n\t\tsuper(component, parent, scope, info);\r\n\r\n\t\tinfo.attributes.forEach(node => {\r\n\t\t\tif (node.type === 'EventHandler') {\r\n\t\t\t\tthis.handlers.push(new EventHandler(component, this, scope, node));\r\n\t\t\t} else if (node.type === 'Binding') {\r\n\t\t\t\tif (node.expression.type !== 'Identifier') {\r\n\t\t\t\t\tconst { parts } = flatten_reference(node.expression);\r\n\r\n\t\t\t\t\t// TODO is this constraint necessary?\r\n\t\t\t\t\treturn component.error(node.expression, compiler_errors.invalid_binding_window(parts));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!~valid_bindings.indexOf(node.name)) {\r\n\t\t\t\t\tconst match = (\r\n\t\t\t\t\t\tnode.name === 'width' ? 'innerWidth' :\r\n\t\t\t\t\t\t\tnode.name === 'height' ? 'innerHeight' :\r\n\t\t\t\t\t\t\t\tfuzzymatch(node.name, valid_bindings)\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tif (match) {\r\n\t\t\t\t\t\treturn component.error(node, compiler_errors.invalid_binding_on(node.name, '<svelte:window>', ` (did you mean '${match}'?)`));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn component.error(node, compiler_errors.invalid_binding_on(node.name, '<svelte:window>', ` — valid bindings are ${list(valid_bindings)}`));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.bindings.push(new Binding(component, this, scope, node));\r\n\t\t\t} else if (node.type === 'Action') {\r\n\t\t\t\tthis.actions.push(new Action(component, this, scope, node));\r\n\t\t\t} else {\r\n\t\t\t\t// TODO there shouldn't be anything else here...\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n","/**\r\n * Pushes all `items` into `array` using `push`, therefore mutating the array.\r\n * We do this for memory and perf reasons, and because `array.push(...items)` would\r\n * run into a \"max call stack size exceeded\" error with too many items (~65k).\r\n * @param array \r\n * @param items \r\n */\r\nexport function push_array<T>(array: T[], items: T[]): void {\r\n\tfor (let i = 0; i < items.length; i++) {\r\n\t\tarray.push(items[i]);\r\n\t}\r\n}\r\n","import AwaitBlock from '../AwaitBlock';\r\nimport Body from '../Body';\r\nimport ConstTag from '../ConstTag';\r\nimport Comment from '../Comment';\r\nimport EachBlock from '../EachBlock';\r\nimport Element from '../Element';\r\nimport Head from '../Head';\r\nimport IfBlock from '../IfBlock';\r\nimport InlineComponent from '../InlineComponent';\r\nimport KeyBlock from '../KeyBlock';\r\nimport MustacheTag from '../MustacheTag';\r\nimport Options from '../Options';\r\nimport RawMustacheTag from '../RawMustacheTag';\r\nimport DebugTag from '../DebugTag';\r\nimport Slot from '../Slot';\r\nimport SlotTemplate from '../SlotTemplate';\r\nimport Text from '../Text';\r\nimport Title from '../Title';\r\nimport Window from '../Window';\r\nimport { TemplateNode } from '../../../interfaces';\r\nimport { push_array } from '../../../utils/push_array';\r\n\r\nexport type Children = ReturnType<typeof map_children>;\r\n\r\nfunction get_constructor(type) {\r\n\tswitch (type) {\r\n\t\tcase 'AwaitBlock': return AwaitBlock;\r\n\t\tcase 'Body': return Body;\r\n\t\tcase 'Comment': return Comment;\r\n\t\tcase 'ConstTag': return ConstTag;\r\n\t\tcase 'EachBlock': return EachBlock;\r\n\t\tcase 'Element': return Element;\r\n\t\tcase 'Head': return Head;\r\n\t\tcase 'IfBlock': return IfBlock;\r\n\t\tcase 'InlineComponent': return InlineComponent;\r\n\t\tcase 'KeyBlock': return KeyBlock;\r\n\t\tcase 'MustacheTag': return MustacheTag;\r\n\t\tcase 'Options': return Options;\r\n\t\tcase 'RawMustacheTag': return RawMustacheTag;\r\n\t\tcase 'DebugTag': return DebugTag;\r\n\t\tcase 'Slot': return Slot;\r\n\t\tcase 'SlotTemplate': return SlotTemplate;\r\n\t\tcase 'Text': return Text;\r\n\t\tcase 'Title': return Title;\r\n\t\tcase 'Window': return Window;\r\n\t\tdefault: throw new Error(`Not implemented: ${type}`);\r\n\t}\r\n}\r\n\r\nexport default function map_children(component, parent, scope, children: TemplateNode[]) {\r\n\tlet last = null;\r\n\tlet ignores = [];\r\n\r\n\treturn children.map(child => {\r\n\t\tconst constructor = get_constructor(child.type);\r\n\r\n\t\tconst use_ignores = child.type !== 'Text' && child.type !== 'Comment' && ignores.length;\r\n\r\n\t\tif (use_ignores) component.push_ignores(ignores);\r\n\t\tconst node = new constructor(component, parent, scope, child);\r\n\t\tif (use_ignores) component.pop_ignores(), ignores = [];\r\n\r\n\t\tif (node.type === 'Comment' && node.ignores.length) {\r\n\t\t\tpush_array(ignores, node.ignores);\r\n\t\t}\r\n\r\n\t\tif (last) last.next = node;\r\n\t\tnode.prev = last;\r\n\t\tlast = node;\r\n\r\n\t\treturn node;\r\n\t});\r\n}\r\n","import { TemplateNode, ConstTag as ConstTagType } from '../../../interfaces';\r\nimport Component from '../../Component';\r\nimport ConstTag from '../ConstTag';\r\nimport map_children from './map_children';\r\nimport { INodeAllowConstTag, INode } from '../interfaces';\r\nimport check_graph_for_cycles from '../../utils/check_graph_for_cycles';\r\nimport compiler_errors from '../../compiler_errors';\r\n\r\nexport default function get_const_tags(children: TemplateNode[], component: Component, node: INodeAllowConstTag, parent: INode): [ConstTag[], Array<Exclude<INode, ConstTag>>] {\r\n  const const_tags: ConstTagType[] = [];\r\n  const others: Array<Exclude<TemplateNode, ConstTagType>> = [];\r\n\r\n  for (const child of children) {\r\n    if (child.type === 'ConstTag') {\r\n      const_tags.push(child as ConstTagType);\r\n    } else {\r\n      others.push(child);\r\n    }\r\n  }\r\n\r\n  const consts_nodes = const_tags.map(tag => new ConstTag(component, node, node.scope, tag));\r\n  const sorted_consts_nodes = sort_consts_nodes(consts_nodes, component);\r\n  sorted_consts_nodes.forEach(node => node.parse_expression());\r\n\r\n  const children_nodes = map_children(component, parent, node.scope, others);\r\n\r\n  return [sorted_consts_nodes, children_nodes as Array<Exclude<INode, ConstTag>>];\r\n}\r\n\r\nfunction sort_consts_nodes(consts_nodes: ConstTag[], component: Component) {\r\n  type ConstNode = {\r\n    assignees: Set<string>;\r\n    dependencies: Set<string>;\r\n    node: ConstTag;\r\n  };\r\n  const sorted_consts_nodes: ConstNode[] = [];\r\n\r\n  const unsorted_consts_nodes: ConstNode[] = consts_nodes.map(node => {\r\n    return {\r\n      assignees: node.assignees,\r\n      dependencies: node.dependencies,\r\n      node\r\n    };\r\n  });\r\n\r\n  const lookup = new Map();\r\n\r\n  unsorted_consts_nodes.forEach(node => {\r\n    node.assignees.forEach(name => {\r\n      if (!lookup.has(name)) {\r\n        lookup.set(name, []);\r\n      }\r\n      lookup.get(name).push(node);\r\n    });\r\n  });\r\n\r\n  const cycle = check_graph_for_cycles(unsorted_consts_nodes.reduce((acc, node) => {\r\n    node.assignees.forEach(v => {\r\n      node.dependencies.forEach(w => {\r\n        if (!node.assignees.has(w)) {\r\n          acc.push([v, w]);\r\n        }\r\n      });\r\n    });\r\n    return acc;\r\n  }, []));\r\n\r\n  if (cycle && cycle.length) {\r\n    const nodeList = lookup.get(cycle[0]);\r\n    const node = nodeList[0];\r\n    component.error(node.node, compiler_errors.cyclical_const_tags(cycle));\r\n  }\r\n\r\n  const add_node = (node: ConstNode) => {\r\n    if (sorted_consts_nodes.includes(node)) return;\r\n\r\n    node.dependencies.forEach(name => {\r\n      if (node.assignees.has(name)) return;\r\n      const earlier_nodes = lookup.get(name);\r\n      if (earlier_nodes) {\r\n        earlier_nodes.forEach(add_node);\r\n      }\r\n    });\r\n\r\n    sorted_consts_nodes.push(node);\r\n  };\r\n\r\n  unsorted_consts_nodes.forEach(add_node);\r\n\r\n  return sorted_consts_nodes.map(node => node.node);\r\n}\r\n","import ConstTag from '../../../nodes/ConstTag';\r\nimport Block from '../../Block';\r\nimport { b, x } from 'code-red';\r\nimport Renderer from '../../Renderer';\r\n\r\nexport function add_const_tags(block: Block, const_tags: ConstTag[], ctx: string) {\r\n  const const_tags_props = [];\r\n  const_tags.forEach((const_tag, i) => {\r\n    const name = `#constants_${i}`;\r\n    const_tags_props.push(b`const ${name} = ${const_tag.expression.manipulate(block, ctx)}`);\r\n    const_tag.contexts.forEach(context => {\r\n      const_tags_props.push(b`${ctx}[${block.renderer.context_lookup.get(context.key.name).index}] = ${context.default_modifier(context.modifier({ type: 'Identifier', name }), name => block.renderer.context_lookup.has(name) ? x`${ctx}[${block.renderer.context_lookup.get(name).index}]` : { type: 'Identifier', name })};`);\r\n    });\r\n  });\r\n  return const_tags_props;\r\n}\r\n\r\nexport function add_const_tags_context(renderer: Renderer, const_tags: ConstTag[]) {\r\n  const_tags.forEach(const_tag => {\r\n    const_tag.contexts.forEach(context => {\r\n      renderer.add_to_context(context.key.name, true);\r\n    });\r\n  });\r\n}\r\n","import Wrapper from './shared/Wrapper';\r\nimport Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport AwaitBlock from '../../nodes/AwaitBlock';\r\nimport create_debugging_comment from './shared/create_debugging_comment';\r\nimport { b, x } from 'code-red';\r\nimport FragmentWrapper from './Fragment';\r\nimport PendingBlock from '../../nodes/PendingBlock';\r\nimport ThenBlock from '../../nodes/ThenBlock';\r\nimport CatchBlock from '../../nodes/CatchBlock';\r\nimport { Context } from '../../nodes/shared/Context';\r\nimport { Identifier, Literal, Node } from 'estree';\r\nimport { add_const_tags, add_const_tags_context } from './shared/add_const_tags';\r\n\r\ntype Status = 'pending' | 'then' | 'catch';\r\n\r\nclass AwaitBlockBranch extends Wrapper {\r\n\tparent: AwaitBlockWrapper;\r\n\tnode: PendingBlock | ThenBlock | CatchBlock;\r\n\tblock: Block;\r\n\tfragment: FragmentWrapper;\r\n\tis_dynamic: boolean;\r\n\r\n\tvar = null;\r\n\tstatus: Status;\r\n\r\n\tvalue: string;\r\n\tvalue_index: Literal;\r\n\tvalue_contexts: Context[];\r\n\tis_destructured: boolean;\r\n\r\n\tconstructor(\r\n\t\tstatus: Status,\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: AwaitBlockWrapper,\r\n\t\tnode: PendingBlock | ThenBlock | CatchBlock,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\t\tthis.status = status;\r\n\r\n\t\tthis.block = block.child({\r\n\t\t\tcomment: create_debugging_comment(node, this.renderer.component),\r\n\t\t\tname: this.renderer.component.get_unique_name(`create_${status}_block`),\r\n\t\t\ttype: status\r\n\t\t});\r\n\r\n\t\tthis.add_context(parent.node[status + '_node'], parent.node[status + '_contexts']);\r\n\r\n\t\tthis.fragment = new FragmentWrapper(\r\n\t\t\trenderer,\r\n\t\t\tthis.block,\r\n\t\t\tthis.node.children,\r\n\t\t\tparent,\r\n\t\t\tstrip_whitespace,\r\n\t\t\tnext_sibling\r\n\t\t);\r\n\r\n\t\tthis.is_dynamic = this.block.dependencies.size > 0;\r\n\t}\r\n\r\n\tadd_context(node: Node | null, contexts: Context[]) {\r\n\t\tif (!node) return;\r\n\r\n\t\tif (node.type === 'Identifier') {\r\n\t\t\tthis.value = node.name;\r\n\t\t\tthis.renderer.add_to_context(this.value, true);\r\n\t\t} else {\r\n\t\t\tcontexts.forEach(context => {\r\n\t\t\t\tthis.renderer.add_to_context(context.key.name, true);\r\n\t\t\t});\r\n\t\t\tthis.value = this.block.parent.get_unique_name('value').name;\r\n\t\t\tthis.value_contexts = contexts;\r\n\t\t\tthis.renderer.add_to_context(this.value, true);\r\n\t\t\tthis.is_destructured = true;\r\n\t\t}\r\n\t\tthis.value_index = this.renderer.context_lookup.get(this.value).index;\r\n\r\n\t\tif (this.has_consts(this.node)) {\r\n\t\t\tadd_const_tags_context(this.renderer, this.node.const_tags);\r\n\t\t}\r\n\t}\r\n\r\n\thas_consts(node: PendingBlock | ThenBlock | CatchBlock): node is ThenBlock | CatchBlock {\r\n\t\treturn node instanceof ThenBlock || node instanceof CatchBlock;\r\n\t}\r\n\r\n\trender(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tthis.fragment.render(block, parent_node, parent_nodes);\r\n\r\n\t\tif (this.is_destructured || (this.has_consts(this.node) && this.node.const_tags.length > 0)) {\r\n\t\t\tthis.render_get_context();\r\n\t\t}\r\n\t}\r\n\r\n\trender_get_context() {\r\n\t\tconst props = this.is_destructured ? this.value_contexts.map(prop => b`#ctx[${this.block.renderer.context_lookup.get(prop.key.name).index}] = ${prop.default_modifier(prop.modifier(x`#ctx[${this.value_index}]`), name => this.renderer.reference(name))};`) : null;\r\n\r\n\t\tconst const_tags_props = this.has_consts(this.node) ? add_const_tags(this.block, this.node.const_tags, '#ctx') : null;\r\n\r\n\t\tconst get_context = this.block.renderer.component.get_unique_name(`get_${this.status}_context`);\r\n\t\tthis.block.renderer.blocks.push(b`\r\n\t\t\tfunction ${get_context}(#ctx) {\r\n\t\t\t\t${props}\r\n\t\t\t\t${const_tags_props}\r\n\t\t\t}\r\n\t\t`);\r\n\t\tthis.block.chunks.declarations.push(b`${get_context}(#ctx)`);\r\n\t\tif (this.block.has_update_method) {\r\n\t\t\tthis.block.chunks.update.unshift(b`${get_context}(#ctx)`);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default class AwaitBlockWrapper extends Wrapper {\r\n\tnode: AwaitBlock;\r\n\r\n\tpending: AwaitBlockBranch;\r\n\tthen: AwaitBlockBranch;\r\n\tcatch: AwaitBlockBranch;\r\n\r\n\tvar: Identifier = { type: 'Identifier', name: 'await_block' };\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: AwaitBlock,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\r\n\t\tthis.cannot_use_innerhtml();\r\n\t\tthis.not_static_content();\r\n\r\n\t\tblock.add_dependencies(this.node.expression.dependencies);\r\n\r\n\t\tlet is_dynamic = false;\r\n\t\tlet has_intros = false;\r\n\t\tlet has_outros = false;\r\n\r\n\t\t['pending', 'then', 'catch'].forEach((status: Status) => {\r\n\t\t\tconst child = this.node[status];\r\n\r\n\t\t\tconst branch = new AwaitBlockBranch(\r\n\t\t\t\tstatus,\r\n\t\t\t\trenderer,\r\n\t\t\t\tblock,\r\n\t\t\t\tthis,\r\n\t\t\t\tchild,\r\n\t\t\t\tstrip_whitespace,\r\n\t\t\t\tnext_sibling\r\n\t\t\t);\r\n\r\n\t\t\trenderer.blocks.push(branch.block);\r\n\r\n\t\t\tif (branch.is_dynamic) {\r\n\t\t\t\tis_dynamic = true;\r\n\t\t\t\t// TODO should blocks update their own parents?\r\n\t\t\t\tblock.add_dependencies(branch.block.dependencies);\r\n\t\t\t}\r\n\r\n\t\t\tif (branch.block.has_intros) has_intros = true;\r\n\t\t\tif (branch.block.has_outros) has_outros = true;\r\n\r\n\t\t\tthis[status] = branch;\r\n\t\t});\r\n\r\n\t\t['pending', 'then', 'catch'].forEach(status => {\r\n\t\t\tthis[status].block.has_update_method = is_dynamic;\r\n\t\t\tthis[status].block.has_intro_method = has_intros;\r\n\t\t\tthis[status].block.has_outro_method = has_outros;\r\n\t\t});\r\n\r\n\t\tif (has_outros) {\r\n\t\t\tblock.add_outro();\r\n\t\t}\r\n\t}\r\n\r\n\trender(\r\n\t\tblock: Block,\r\n\t\tparent_node: Identifier,\r\n\t\tparent_nodes: Identifier\r\n\t) {\r\n\t\tconst anchor = this.get_or_create_anchor(block, parent_node, parent_nodes);\r\n\t\tconst update_mount_node = this.get_update_mount_node(anchor);\r\n\r\n\t\tconst snippet = this.node.expression.manipulate(block);\r\n\r\n\t\tconst info = block.get_unique_name('info');\r\n\t\tconst promise = block.get_unique_name('promise');\r\n\r\n\t\tblock.add_variable(promise);\r\n\r\n\t\tblock.maintain_context = true;\r\n\r\n\t\tconst info_props: any = x`{\r\n\t\t\tctx: #ctx,\r\n\t\t\tcurrent: null,\r\n\t\t\ttoken: null,\r\n\t\t\thasCatch: ${this.catch.node.start !== null ? 'true' : 'false'},\r\n\t\t\tpending: ${this.pending.block.name},\r\n\t\t\tthen: ${this.then.block.name},\r\n\t\t\tcatch: ${this.catch.block.name},\r\n\t\t\tvalue: ${this.then.value_index},\r\n\t\t\terror: ${this.catch.value_index},\r\n\t\t\tblocks: ${this.pending.block.has_outro_method && x`[,,,]`}\r\n\t\t}`;\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\tlet ${info} = ${info_props};\r\n\t\t`);\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\t@handle_promise(${promise} = ${snippet}, ${info});\r\n\t\t`);\r\n\r\n\t\tblock.chunks.create.push(b`\r\n\t\t\t${info}.block.c();\r\n\t\t`);\r\n\r\n\t\tif (parent_nodes && this.renderer.options.hydratable) {\r\n\t\t\tblock.chunks.claim.push(b`\r\n\t\t\t\t${info}.block.l(${parent_nodes});\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tconst initial_mount_node = parent_node || '#target';\r\n\t\tconst anchor_node = parent_node ? 'null' : '#anchor';\r\n\r\n\t\tconst has_transitions = this.pending.block.has_intro_method || this.pending.block.has_outro_method;\r\n\r\n\t\tblock.chunks.mount.push(b`\r\n\t\t\t${info}.block.m(${initial_mount_node}, ${info}.anchor = ${anchor_node});\r\n\t\t\t${info}.mount = () => ${update_mount_node};\r\n\t\t\t${info}.anchor = ${anchor};\r\n\t\t`);\r\n\r\n\t\tif (has_transitions) {\r\n\t\t\tblock.chunks.intro.push(b`@transition_in(${info}.block);`);\r\n\t\t}\r\n\r\n\t\tconst dependencies = this.node.expression.dynamic_dependencies();\r\n\r\n\t\tconst update_await_block_branch = b`@update_await_block_branch(${info}, #ctx, #dirty)`;\r\n\r\n\t\tif (dependencies.length > 0) {\r\n\t\t\tconst condition = x`\r\n\t\t\t\t${block.renderer.dirty(dependencies)} &&\r\n\t\t\t\t${promise} !== (${promise} = ${snippet}) &&\r\n\t\t\t\t@handle_promise(${promise}, ${info})`;\r\n\r\n\t\t\tblock.chunks.update.push(\r\n\t\t\t\tb`${info}.ctx = #ctx;`\r\n\t\t\t);\r\n\r\n\t\t\tif (this.pending.block.has_update_method) {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif (${condition}) {\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t${update_await_block_branch}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\t${condition}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this.pending.block.has_update_method) {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\t${update_await_block_branch}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.pending.block.has_outro_method) {\r\n\t\t\tblock.chunks.outro.push(b`\r\n\t\t\t\tfor (let #i = 0; #i < 3; #i += 1) {\r\n\t\t\t\t\tconst block = ${info}.blocks[#i];\r\n\t\t\t\t\t@transition_out(block);\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.destroy.push(b`\r\n\t\t\t${info}.block.d(${parent_node ? null : 'detaching'});\r\n\t\t\t${info}.token = null;\r\n\t\t\t${info} = null;\r\n\t\t`);\r\n\r\n\t\t[this.pending, this.then, this.catch].forEach(branch => {\r\n\t\t\tbranch.render(branch.block, null, x`#nodes` as Identifier);\r\n\t\t});\r\n\t}\r\n}\r\n","import EventHandler from '../../../nodes/EventHandler';\r\nimport Wrapper from '../shared/Wrapper';\r\nimport Block from '../../Block';\r\nimport { b, x, p } from 'code-red';\r\nimport { Expression } from 'estree';\r\n\r\nconst TRUE = x`true`;\r\nconst FALSE = x`false`;\r\n\r\nexport default class EventHandlerWrapper {\r\n\tnode: EventHandler;\r\n\tparent: Wrapper;\r\n\r\n\tconstructor(node: EventHandler, parent: Wrapper) {\r\n\t\tthis.node = node;\r\n\t\tthis.parent = parent;\r\n\r\n\t\tif (!node.expression) {\r\n\t\t\tthis.parent.renderer.add_to_context(node.handler_name.name);\r\n\r\n\t\t\tthis.parent.renderer.component.partly_hoisted.push(b`\r\n\t\t\t\tfunction ${node.handler_name.name}(event) {\r\n\t\t\t\t\t@bubble.call(this, $$self, event);\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\t}\r\n\r\n\tget_snippet(block: Block) {\r\n\t\tconst snippet = this.node.expression ? this.node.expression.manipulate(block) : block.renderer.reference(this.node.handler_name);\r\n\r\n\t\tif (this.node.reassigned) {\r\n\t\t\tblock.maintain_context = true;\r\n\t\t\treturn x`function () { if (@is_function(${snippet})) ${snippet}.apply(this, arguments); }`;\r\n\t\t}\r\n\t\treturn snippet;\r\n\t}\r\n\r\n\trender(block: Block, target: string | Expression) {\r\n\t\tlet snippet = this.get_snippet(block);\r\n\r\n\t\tif (this.node.modifiers.has('preventDefault')) snippet = x`@prevent_default(${snippet})`;\r\n\t\tif (this.node.modifiers.has('stopPropagation')) snippet = x`@stop_propagation(${snippet})`;\r\n\t\tif (this.node.modifiers.has('self')) snippet = x`@self(${snippet})`;\r\n\t\tif (this.node.modifiers.has('trusted')) snippet = x`@trusted(${snippet})`;\r\n\r\n\t\tconst args = [];\r\n\r\n\t\tconst opts = ['nonpassive', 'passive', 'once', 'capture'].filter(mod => this.node.modifiers.has(mod));\r\n\t\tif (opts.length) {\r\n\t\t\tif (opts.length === 1 && opts[0] === 'capture') {\r\n\t\t\t\targs.push(TRUE);\r\n\t\t\t} else {\r\n\t\t\t\targs.push(x`{ ${ opts.map(opt =>\r\n\t\t\t\t\topt === 'nonpassive'\r\n\t\t\t\t\t\t? p`passive: false`\r\n\t\t\t\t\t\t: p`${opt}: true`\r\n\t\t\t\t) } }`);\r\n\t\t\t}\r\n\t\t} else if (block.renderer.options.dev) {\r\n\t\t\targs.push(FALSE);\r\n\t\t}\r\n\r\n\t\tif (block.renderer.options.dev) {\r\n\t\t\targs.push(this.node.modifiers.has('preventDefault') ? TRUE : FALSE);\r\n\t\t\targs.push(this.node.modifiers.has('stopPropagation') ? TRUE : FALSE);\r\n\t\t}\r\n\r\n\t\tblock.event_listeners.push(\r\n\t\t\tx`@listen(${target}, \"${this.node.name}\", ${snippet}, ${args})`\r\n\t\t);\r\n\t}\r\n}\r\n","import Block from '../../Block';\r\nimport EventHandler from '../Element/EventHandler';\r\nimport { Expression } from 'estree';\r\n\r\nexport default function add_event_handlers(\r\n\tblock: Block,\r\n\ttarget: string | Expression,\r\n\thandlers: EventHandler[]\r\n) {\r\n\thandlers.forEach(handler => add_event_handler(block, target, handler));\r\n}\r\n\r\nexport function add_event_handler(\r\n\tblock: Block,\r\n\ttarget: string | Expression,\r\n\thandler: EventHandler\r\n) {\r\n\thandler.render(block, target);\r\n}\r\n","import { b, x } from 'code-red';\r\nimport Block from '../../Block';\r\nimport Action from '../../../nodes/Action';\r\nimport { Expression, Node } from 'estree';\r\nimport is_contextual from '../../../nodes/shared/is_contextual';\r\n\r\nexport default function add_actions(\r\n\tblock: Block,\r\n\ttarget: string | Expression,\r\n\tactions: Action[]\r\n) {\r\n\tactions.forEach(action => add_action(block, target, action));\r\n}\r\n\r\nconst regex_invalid_variable_identifier_characters = /[^a-zA-Z0-9_$]/g;\r\n\r\nexport function add_action(block: Block, target: string | Expression, action: Action) {\r\n\tconst { expression, template_scope } = action;\r\n\tlet snippet: Node | undefined;\r\n\tlet dependencies: string[] | undefined;\r\n\r\n\tif (expression) {\r\n\t\tsnippet = expression.manipulate(block);\r\n\t\tdependencies = expression.dynamic_dependencies();\r\n\t}\r\n\r\n\tconst id = block.get_unique_name(\r\n\t\t`${action.name.replace(regex_invalid_variable_identifier_characters, '_')}_action`\r\n\t);\r\n\r\n\tblock.add_variable(id);\r\n\r\n\tconst [obj, ...properties] = action.name.split('.');\r\n\r\n\tconst fn = is_contextual(action.component, template_scope, obj)\r\n\t\t? block.renderer.reference(obj)\r\n\t\t: obj;\r\n\r\n\tif (properties.length) {\r\n\t\tconst member_expression = properties.reduce((lhs, rhs) => x`${lhs}.${rhs}`, fn);\r\n\t\tblock.event_listeners.push(\r\n\t\t\tx`@action_destroyer(${id} = ${member_expression}(${target}, ${snippet}))`\r\n\t\t);\r\n\t} else {\r\n\t\tblock.event_listeners.push(\r\n\t\t\tx`@action_destroyer(${id} = ${fn}.call(null, ${target}, ${snippet}))`\r\n\t\t);\r\n\t}\r\n\r\n\tif (dependencies && dependencies.length > 0) {\r\n\t\tlet condition = x`${id} && @is_function(${id}.update)`;\r\n\r\n\t\tif (dependencies.length > 0) {\r\n\t\t\tcondition = x`${condition} && ${block.renderer.dirty(dependencies)}`;\r\n\t\t}\r\n\r\n\t\tblock.chunks.update.push(\r\n\t\t\tb`if (${condition}) ${id}.update.call(null, ${snippet});`\r\n\t\t);\r\n\t}\r\n}\r\n","import Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport Wrapper from './shared/Wrapper';\r\nimport create_debugging_comment from './shared/create_debugging_comment';\r\nimport EachBlock from '../../nodes/EachBlock';\r\nimport FragmentWrapper from './Fragment';\r\nimport { b, x } from 'code-red';\r\nimport ElseBlock from '../../nodes/ElseBlock';\r\nimport { Identifier, Node } from 'estree';\r\nimport get_object from '../../utils/get_object';\r\nimport { add_const_tags, add_const_tags_context } from './shared/add_const_tags';\r\n\r\nexport class ElseBlockWrapper extends Wrapper {\r\n\tnode: ElseBlock;\r\n\tblock: Block;\r\n\tfragment: FragmentWrapper;\r\n\tis_dynamic: boolean;\r\n\r\n\tvar = null;\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: ElseBlock,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\t\tadd_const_tags_context(renderer, this.node.const_tags);\r\n\r\n\t\tthis.block = block.child({\r\n\t\t\tcomment: create_debugging_comment(node, this.renderer.component),\r\n\t\t\tname: this.renderer.component.get_unique_name('create_else_block'),\r\n\t\t\ttype: 'else'\r\n\t\t});\r\n\r\n\t\tthis.fragment = new FragmentWrapper(\r\n\t\t\trenderer,\r\n\t\t\tthis.block,\r\n\t\t\tthis.node.children,\r\n\t\t\tparent,\r\n\t\t\tstrip_whitespace,\r\n\t\t\tnext_sibling\r\n\t\t);\r\n\r\n\t\tthis.is_dynamic = this.block.dependencies.size > 0;\r\n\t}\r\n}\r\n\r\nexport default class EachBlockWrapper extends Wrapper {\r\n\tblock: Block;\r\n\tnode: EachBlock;\r\n\tfragment: FragmentWrapper;\r\n\telse?: ElseBlockWrapper;\r\n\tvars: {\r\n\t\tcreate_each_block: Identifier;\r\n\t\teach_block_value: Identifier;\r\n\t\tget_each_context: Identifier;\r\n\t\titerations: Identifier;\r\n\t\tfixed_length: number;\r\n\t\tdata_length: Node | number;\r\n\t\tview_length: Node | number;\r\n\t};\r\n\r\n\tcontext_props: Array<Node | Node[]>;\r\n\tindex_name: Identifier;\r\n\tupdates: Array<Node | Node[]> = [];\r\n\tdependencies: Set<string>;\r\n\r\n\tvar: Identifier = { type: 'Identifier', name: 'each' };\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: EachBlock,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\t\tthis.cannot_use_innerhtml();\r\n\t\tthis.not_static_content();\r\n\r\n\t\tconst { dependencies } = node.expression;\r\n\t\tblock.add_dependencies(dependencies);\r\n\r\n\t\tthis.node.contexts.forEach(context => {\r\n\t\t\trenderer.add_to_context(context.key.name, true);\r\n\t\t});\r\n\t\tadd_const_tags_context(renderer, this.node.const_tags);\r\n\r\n\t\tthis.block = block.child({\r\n\t\t\tcomment: create_debugging_comment(this.node, this.renderer.component),\r\n\t\t\tname: renderer.component.get_unique_name('create_each_block'),\r\n\t\t\ttype: 'each',\r\n\t\t\t// @ts-ignore todo: probably error\r\n\t\t\tkey: node.key as string,\r\n\r\n\t\t\tbindings: new Map(block.bindings)\r\n\t\t});\r\n\r\n\t\t// TODO this seems messy\r\n\t\tthis.block.has_animation = this.node.has_animation;\r\n\r\n\t\tthis.index_name = this.node.index\r\n\t\t\t? { type: 'Identifier', name: this.node.index }\r\n\t\t\t: renderer.component.get_unique_name(`${this.node.context}_index`);\r\n\r\n\t\tconst fixed_length =\r\n\t\t\tnode.expression.node.type === 'ArrayExpression' &&\r\n\t\t\tnode.expression.node.elements.every(element => element.type !== 'SpreadElement')\r\n\t\t\t\t? node.expression.node.elements.length\r\n\t\t\t\t: null;\r\n\r\n\t\t// hack the sourcemap, so that if data is missing the bug\r\n\t\t// is easy to find\r\n\t\tlet c = this.node.start + 2;\r\n\t\twhile (renderer.component.source[c] !== 'e') c += 1;\r\n\t\tconst start = renderer.component.locate(c);\r\n\t\tconst end = { line: start.line, column: start.column + 4 };\r\n\t\tconst length = {\r\n\t\t\ttype: 'Identifier',\r\n\t\t\tname: 'length',\r\n\t\t\tloc: { start, end }\r\n\t\t};\r\n\r\n\t\tconst each_block_value = renderer.component.get_unique_name(`${this.var.name}_value`);\r\n\t\tconst iterations = block.get_unique_name(`${this.var.name}_blocks`);\r\n\r\n\t\trenderer.add_to_context(each_block_value.name, true);\r\n\t\trenderer.add_to_context(this.index_name.name, true);\r\n\r\n\t\tthis.vars = {\r\n\t\t\tcreate_each_block: this.block.name,\r\n\t\t\teach_block_value,\r\n\t\t\tget_each_context: renderer.component.get_unique_name(`get_${this.var.name}_context`),\r\n\t\t\titerations,\r\n\r\n\t\t\t// optimisation for array literal\r\n\t\t\tfixed_length,\r\n\t\t\tdata_length: fixed_length === null ? x`${each_block_value}.${length}` : fixed_length,\r\n\t\t\tview_length: fixed_length === null ? x`${iterations}.length` : fixed_length\r\n\t\t};\r\n\r\n\t\tconst object = get_object(node.expression.node);\r\n\t\tconst store = object.type === 'Identifier' && object.name[0] === '$' ? object.name.slice(1) : null;\r\n\r\n\t\tnode.contexts.forEach(prop => {\r\n\t\t\tthis.block.bindings.set(prop.key.name, {\r\n\t\t\t\tobject: this.vars.each_block_value,\r\n\t\t\t\tproperty: this.index_name,\r\n\t\t\t\tmodifier: prop.modifier,\r\n\t\t\t\tsnippet: prop.modifier(x`${this.vars.each_block_value}[${this.index_name}]` as Node),\r\n\t\t\t\tstore\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tif (this.node.index) {\r\n\t\t\tthis.block.get_unique_name(this.node.index); // this prevents name collisions (#1254)\r\n\t\t}\r\n\r\n\t\trenderer.blocks.push(this.block);\r\n\r\n\t\tthis.fragment = new FragmentWrapper(renderer, this.block, node.children, this, strip_whitespace, next_sibling);\r\n\r\n\t\tif (this.node.else) {\r\n\t\t\tthis.else = new ElseBlockWrapper(\r\n\t\t\t\trenderer,\r\n\t\t\t\tblock,\r\n\t\t\t\tthis,\r\n\t\t\t\tthis.node.else,\r\n\t\t\t\tstrip_whitespace,\r\n\t\t\t\tnext_sibling\r\n\t\t\t);\r\n\r\n\t\t\trenderer.blocks.push(this.else.block);\r\n\r\n\t\t\tif (this.else.is_dynamic) {\r\n\t\t\t\tthis.block.add_dependencies(this.else.block.dependencies);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tblock.add_dependencies(this.block.dependencies);\r\n\r\n\t\tif (this.block.has_outros || (this.else && this.else.block.has_outros)) {\r\n\t\t\tblock.add_outro();\r\n\t\t}\r\n\t}\r\n\r\n\trender(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tif (this.fragment.nodes.length === 0) return;\r\n\r\n\t\tconst { renderer } = this;\r\n\t\tconst { component } = renderer;\r\n\r\n\t\tconst needs_anchor = this.next\r\n\t\t\t? !this.next.is_dom_node() :\r\n\t\t\t!parent_node || !this.parent.is_dom_node();\r\n\r\n\t\tconst snippet = this.node.expression.manipulate(block);\r\n\r\n\t\tblock.chunks.init.push(b`let ${this.vars.each_block_value} = ${snippet};`);\r\n\t\tif (this.renderer.options.dev) {\r\n\t\t\tblock.chunks.init.push(b`@validate_each_argument(${this.vars.each_block_value});`);\r\n\t\t}\r\n\r\n\t\tconst initial_anchor_node: Identifier = { type: 'Identifier', name: parent_node ? 'null' : '#anchor' };\r\n\t\tconst initial_mount_node: Identifier = parent_node || { type: 'Identifier', name: '#target' };\r\n\t\tconst update_anchor_node = needs_anchor\r\n\t\t\t? block.get_unique_name(`${this.var.name}_anchor`)\r\n\t\t\t: (this.next && this.next.var) || { type: 'Identifier', name: 'null' };\r\n\t\tconst update_mount_node: Identifier = this.get_update_mount_node((update_anchor_node as Identifier));\r\n\r\n\t\tconst args = {\r\n\t\t\tblock,\r\n\t\t\tparent_node,\r\n\t\t\tparent_nodes,\r\n\t\t\tsnippet,\r\n\t\t\tinitial_anchor_node,\r\n\t\t\tinitial_mount_node,\r\n\t\t\tupdate_anchor_node,\r\n\t\t\tupdate_mount_node\r\n\t\t};\r\n\r\n\t\tconst all_dependencies = new Set(this.block.dependencies); // TODO should be dynamic deps only\r\n\t\tthis.node.expression.dynamic_dependencies().forEach((dependency: string) => {\r\n\t\t\tall_dependencies.add(dependency);\r\n\t\t});\r\n\t\tif (this.node.key) {\r\n\t\t\tthis.node.key.dynamic_dependencies().forEach((dependency: string) => {\r\n\t\t\t\tall_dependencies.add(dependency);\r\n\t\t\t});\r\n\t\t}\r\n\t\tthis.dependencies = all_dependencies;\r\n\r\n\t\tif (this.node.key) {\r\n\t\t\tthis.render_keyed(args);\r\n\t\t} else {\r\n\t\t\tthis.render_unkeyed(args);\r\n\t\t}\r\n\r\n\t\tif (this.block.has_intro_method || this.block.has_outro_method) {\r\n\t\t\tblock.chunks.intro.push(b`\r\n\t\t\t\tfor (let #i = 0; #i < ${this.vars.data_length}; #i += 1) {\r\n\t\t\t\t\t@transition_in(${this.vars.iterations}[#i]);\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tif (needs_anchor) {\r\n\t\t\tblock.add_element(\r\n\t\t\t\tupdate_anchor_node as Identifier,\r\n\t\t\t\tx`@empty()`,\r\n\t\t\t\tparent_nodes && x`@empty()`,\r\n\t\t\t\tparent_node\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (this.else) {\r\n\t\t\tlet else_ctx = x`#ctx`;\r\n\t\t\tif (this.else.node.const_tags.length > 0) {\r\n\t\t\t\tconst get_ctx_name = this.renderer.component.get_unique_name('get_else_ctx');\r\n\t\t\t\tthis.renderer.blocks.push(b`\r\n\t\t\t\t\tfunction ${get_ctx_name}(#ctx) {\r\n\t\t\t\t\t\tconst child_ctx = #ctx.slice();\r\n\t\t\t\t\t\t${add_const_tags(block, this.else.node.const_tags, 'child_ctx')}\r\n\t\t\t\t\t\treturn child_ctx;\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t\telse_ctx = x`${get_ctx_name}(#ctx)`;\r\n\t\t\t}\r\n\t\t\tconst each_block_else = component.get_unique_name(`${this.var.name}_else`);\r\n\r\n\t\t\tblock.chunks.init.push(b`let ${each_block_else} = null;`);\r\n\r\n\t\t\t// TODO neaten this up... will end up with an empty line in the block\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\tif (!${this.vars.data_length}) {\r\n\t\t\t\t\t${each_block_else} = ${this.else.block.name}(${else_ctx});\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\r\n\t\t\tblock.chunks.create.push(b`\r\n\t\t\t\tif (${each_block_else}) {\r\n\t\t\t\t\t${each_block_else}.c();\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\r\n\t\t\tif (this.renderer.options.hydratable) {\r\n\t\t\t\tblock.chunks.claim.push(b`\r\n\t\t\t\t\tif (${each_block_else}) {\r\n\t\t\t\t\t\t${each_block_else}.l(${parent_nodes});\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.mount.push(b`\r\n\t\t\t\tif (${each_block_else}) {\r\n\t\t\t\t\t${each_block_else}.m(${initial_mount_node}, ${initial_anchor_node});\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\r\n\t\t\tconst has_transitions = !!(this.else.block.has_intro_method || this.else.block.has_outro_method);\r\n\r\n\t\t\tconst destroy_block_else = this.else.block.has_outro_method\r\n\t\t\t\t? b`\r\n\t\t\t\t\t@group_outros();\r\n\t\t\t\t\t@transition_out(${each_block_else}, 1, 1, () => {\r\n\t\t\t\t\t\t${each_block_else} = null;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t@check_outros();`\r\n\t\t\t\t: b`\r\n\t\t\t\t\t${each_block_else}.d(1);\r\n\t\t\t\t\t${each_block_else} = null;`;\r\n\r\n\t\t\tif (this.else.block.has_update_method) {\r\n\t\t\t\tthis.updates.push(b`\r\n\t\t\t\t\tif (!${this.vars.data_length} && ${each_block_else}) {\r\n\t\t\t\t\t\t${each_block_else}.p(${else_ctx}, #dirty);\r\n\t\t\t\t\t} else if (!${this.vars.data_length}) {\r\n\t\t\t\t\t\t${each_block_else} = ${this.else.block.name}(${else_ctx});\r\n\t\t\t\t\t\t${each_block_else}.c();\r\n\t\t\t\t\t\t${has_transitions && b`@transition_in(${each_block_else}, 1);`}\r\n\t\t\t\t\t\t${each_block_else}.m(${update_mount_node}, ${update_anchor_node});\r\n\t\t\t\t\t} else if (${each_block_else}) {\r\n\t\t\t\t\t\t${destroy_block_else};\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tthis.updates.push(b`\r\n\t\t\t\t\tif (${this.vars.data_length}) {\r\n\t\t\t\t\t\tif (${each_block_else}) {\r\n\t\t\t\t\t\t\t${destroy_block_else};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (!${each_block_else}) {\r\n\t\t\t\t\t\t${each_block_else} = ${this.else.block.name}(${else_ctx});\r\n\t\t\t\t\t\t${each_block_else}.c();\r\n\t\t\t\t\t\t${has_transitions && b`@transition_in(${each_block_else}, 1);`}\r\n\t\t\t\t\t\t${each_block_else}.m(${update_mount_node}, ${update_anchor_node});\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.destroy.push(b`\r\n\t\t\t\tif (${each_block_else}) ${each_block_else}.d(${parent_node ? '' : 'detaching'});\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tif (this.updates.length) {\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${block.renderer.dirty(Array.from(all_dependencies))}) {\r\n\t\t\t\t\t${this.updates}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tthis.fragment.render(this.block, null, x`#nodes` as Identifier);\r\n\r\n\t\tif (this.else) {\r\n\t\t\tthis.else.fragment.render(this.else.block, null, x`#nodes` as Identifier);\r\n\t\t}\r\n\r\n\t\tthis.context_props = this.node.contexts.map(prop => b`child_ctx[${renderer.context_lookup.get(prop.key.name).index}] = ${prop.default_modifier(prop.modifier(x`list[i]`), name => renderer.context_lookup.has(name) ? x`child_ctx[${renderer.context_lookup.get(name).index}]` : { type: 'Identifier', name })};`);\r\n\r\n\t\tif (this.node.has_binding) this.context_props.push(b`child_ctx[${renderer.context_lookup.get(this.vars.each_block_value.name).index}] = list;`);\r\n\t\tif (this.node.has_binding || this.node.has_index_binding || this.node.index) this.context_props.push(b`child_ctx[${renderer.context_lookup.get(this.index_name.name).index}] = i;`);\r\n\r\n\t\t// TODO which is better — Object.create(array) or array.slice()?\r\n\t\trenderer.blocks.push(b`\r\n\t\t\tfunction ${this.vars.get_each_context}(#ctx, list, i) {\r\n\t\t\t\tconst child_ctx = #ctx.slice();\r\n\t\t\t\t${this.context_props}\r\n\t\t\t\t${add_const_tags(this.block, this.node.const_tags, 'child_ctx')}\r\n\t\t\t\treturn child_ctx;\r\n\t\t\t}\r\n\t\t`);\r\n\t}\r\n\r\n\trender_keyed({\r\n\t\tblock,\r\n\t\tparent_node,\r\n\t\tparent_nodes,\r\n\t\tsnippet,\r\n\t\tinitial_anchor_node,\r\n\t\tinitial_mount_node,\r\n\t\tupdate_anchor_node,\r\n\t\tupdate_mount_node\r\n\t}: {\r\n\t\tblock: Block;\r\n\t\tparent_node: Identifier;\r\n\t\tparent_nodes: Identifier;\r\n\t\tsnippet: Node;\r\n\t\tinitial_anchor_node: Identifier;\r\n\t\tinitial_mount_node: Identifier;\r\n\t\tupdate_anchor_node: Identifier;\r\n\t\tupdate_mount_node: Identifier;\r\n\t}) {\r\n\t\tconst {\r\n\t\t\tcreate_each_block,\r\n\t\t\titerations,\r\n\t\t\tdata_length,\r\n\t\t\tview_length\r\n\t\t} = this.vars;\r\n\r\n\t\tconst get_key = block.get_unique_name('get_key');\r\n\t\tconst lookup = block.get_unique_name(`${this.var.name}_lookup`);\r\n\r\n\t\tblock.add_variable(iterations, x`[]`);\r\n\t\tblock.add_variable(lookup, x`new @_Map()`);\r\n\r\n\t\tif (this.fragment.nodes[0].is_dom_node()) {\r\n\t\t\tthis.block.first = this.fragment.nodes[0].var;\r\n\t\t} else {\r\n\t\t\tthis.block.first = this.block.get_unique_name('first');\r\n\t\t\tthis.block.add_element(\r\n\t\t\t\tthis.block.first,\r\n\t\t\t\tx`@empty()`,\r\n\t\t\t\tparent_nodes && x`@empty()`,\r\n\t\t\t\tnull\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\tconst ${get_key} = #ctx => ${this.node.key.manipulate(block)};\r\n\r\n\t\t\t${this.renderer.options.dev && b`@validate_each_keys(#ctx, ${this.vars.each_block_value}, ${this.vars.get_each_context}, ${get_key});`}\r\n\t\t\tfor (let #i = 0; #i < ${data_length}; #i += 1) {\r\n\t\t\t\tlet child_ctx = ${this.vars.get_each_context}(#ctx, ${this.vars.each_block_value}, #i);\r\n\t\t\t\tlet key = ${get_key}(child_ctx);\r\n\t\t\t\t${lookup}.set(key, ${iterations}[#i] = ${create_each_block}(key, child_ctx));\r\n\t\t\t}\r\n\t\t`);\r\n\r\n\t\tblock.chunks.create.push(b`\r\n\t\t\tfor (let #i = 0; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t${iterations}[#i].c();\r\n\t\t\t}\r\n\t\t`);\r\n\r\n\t\tif (parent_nodes && this.renderer.options.hydratable) {\r\n\t\t\tblock.chunks.claim.push(b`\r\n\t\t\t\tfor (let #i = 0; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t\t${iterations}[#i].l(${parent_nodes});\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.mount.push(b`\r\n\t\t\tfor (let #i = 0; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t${iterations}[#i].m(${initial_mount_node}, ${initial_anchor_node});\r\n\t\t\t}\r\n\t\t`);\r\n\r\n\t\tconst dynamic = this.block.has_update_method;\r\n\r\n\t\tconst destroy = this.node.has_animation\r\n\t\t\t? (this.block.has_outros\r\n\t\t\t\t? '@fix_and_outro_and_destroy_block'\r\n\t\t\t\t: '@fix_and_destroy_block')\r\n\t\t\t: this.block.has_outros\r\n\t\t\t\t? '@outro_and_destroy_block'\r\n\t\t\t\t: '@destroy_block';\r\n\r\n\t\tif (this.dependencies.size) {\r\n\t\t\tthis.block.maintain_context = true;\r\n\r\n\t\t\tthis.updates.push(b`\r\n\t\t\t\t${this.vars.each_block_value} = ${snippet};\r\n\t\t\t\t${this.renderer.options.dev && b`@validate_each_argument(${this.vars.each_block_value});`}\r\n\r\n\t\t\t\t${this.block.has_outros && b`@group_outros();`}\r\n\t\t\t\t${this.node.has_animation && b`for (let #i = 0; #i < ${view_length}; #i += 1) ${iterations}[#i].r();`}\r\n\t\t\t\t${this.renderer.options.dev && b`@validate_each_keys(#ctx, ${this.vars.each_block_value}, ${this.vars.get_each_context}, ${get_key});`}\r\n\t\t\t\t${iterations} = @update_keyed_each(${iterations}, #dirty, ${get_key}, ${dynamic ? 1 : 0}, #ctx, ${this.vars.each_block_value}, ${lookup}, ${update_mount_node}, ${destroy}, ${create_each_block}, ${update_anchor_node}, ${this.vars.get_each_context});\r\n\t\t\t\t${this.node.has_animation && b`for (let #i = 0; #i < ${view_length}; #i += 1) ${iterations}[#i].a();`}\r\n\t\t\t\t${this.block.has_outros && b`@check_outros();`}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tif (this.block.has_outros) {\r\n\t\t\tblock.chunks.outro.push(b`\r\n\t\t\t\tfor (let #i = 0; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t\t@transition_out(${iterations}[#i]);\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.destroy.push(b`\r\n\t\t\tfor (let #i = 0; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t${iterations}[#i].d(${parent_node ? null : 'detaching'});\r\n\t\t\t}\r\n\t\t`);\r\n\t}\r\n\r\n\trender_unkeyed({\r\n\t\tblock,\r\n\t\tparent_nodes,\r\n\t\tsnippet,\r\n\t\tinitial_anchor_node,\r\n\t\tinitial_mount_node,\r\n\t\tupdate_anchor_node,\r\n\t\tupdate_mount_node\r\n\t}: {\r\n\t\tblock: Block;\r\n\t\tparent_nodes: Identifier;\r\n\t\tsnippet: Node;\r\n\t\tinitial_anchor_node: Identifier;\r\n\t\tinitial_mount_node: Identifier;\r\n\t\tupdate_anchor_node: Identifier;\r\n\t\tupdate_mount_node: Identifier;\r\n\t}) {\r\n\t\tconst {\r\n\t\t\tcreate_each_block,\r\n\t\t\titerations,\r\n\t\t\tfixed_length,\r\n\t\t\tdata_length,\r\n\t\t\tview_length\r\n\t\t} = this.vars;\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\tlet ${iterations} = [];\r\n\r\n\t\t\tfor (let #i = 0; #i < ${data_length}; #i += 1) {\r\n\t\t\t\t${iterations}[#i] = ${create_each_block}(${this.vars.get_each_context}(#ctx, ${this.vars.each_block_value}, #i));\r\n\t\t\t}\r\n\t\t`);\r\n\r\n\t\tblock.chunks.create.push(b`\r\n\t\t\tfor (let #i = 0; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t${iterations}[#i].c();\r\n\t\t\t}\r\n\t\t`);\r\n\r\n\t\tif (parent_nodes && this.renderer.options.hydratable) {\r\n\t\t\tblock.chunks.claim.push(b`\r\n\t\t\t\tfor (let #i = 0; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t\t${iterations}[#i].l(${parent_nodes});\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.mount.push(b`\r\n\t\t\tfor (let #i = 0; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t${iterations}[#i].m(${initial_mount_node}, ${initial_anchor_node});\r\n\t\t\t}\r\n\t\t`);\r\n\r\n\t\tif (this.dependencies.size) {\r\n\t\t\tconst has_transitions = !!(this.block.has_intro_method || this.block.has_outro_method);\r\n\r\n\t\t\tconst for_loop_body = this.block.has_update_method\r\n\t\t\t\t? b`\r\n\t\t\t\t\tif (${iterations}[#i]) {\r\n\t\t\t\t\t\t${iterations}[#i].p(child_ctx, #dirty);\r\n\t\t\t\t\t\t${has_transitions && b`@transition_in(${this.vars.iterations}[#i], 1);`}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t${iterations}[#i] = ${create_each_block}(child_ctx);\r\n\t\t\t\t\t\t${iterations}[#i].c();\r\n\t\t\t\t\t\t${has_transitions && b`@transition_in(${this.vars.iterations}[#i], 1);`}\r\n\t\t\t\t\t\t${iterations}[#i].m(${update_mount_node}, ${update_anchor_node});\r\n\t\t\t\t\t}\r\n\t\t\t\t`\r\n\t\t\t\t: has_transitions\r\n\t\t\t\t\t? b`\r\n\t\t\t\t\t\tif (${iterations}[#i]) {\r\n\t\t\t\t\t\t\t@transition_in(${this.vars.iterations}[#i], 1);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t${iterations}[#i] = ${create_each_block}(child_ctx);\r\n\t\t\t\t\t\t\t${iterations}[#i].c();\r\n\t\t\t\t\t\t\t@transition_in(${this.vars.iterations}[#i], 1);\r\n\t\t\t\t\t\t\t${iterations}[#i].m(${update_mount_node}, ${update_anchor_node});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t`\r\n\t\t\t\t\t: b`\r\n\t\t\t\t\t\tif (!${iterations}[#i]) {\r\n\t\t\t\t\t\t\t${iterations}[#i] = ${create_each_block}(child_ctx);\r\n\t\t\t\t\t\t\t${iterations}[#i].c();\r\n\t\t\t\t\t\t\t${iterations}[#i].m(${update_mount_node}, ${update_anchor_node});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t`;\r\n\r\n\t\t\tconst start = this.block.has_update_method ? 0 : '#old_length';\r\n\r\n\t\t\tlet remove_old_blocks: Node[];\r\n\r\n\t\t\tif (this.block.has_outros) {\r\n\t\t\t\tconst out = block.get_unique_name('out');\r\n\r\n\t\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t\tconst ${out} = i => @transition_out(${iterations}[i], 1, 1, () => {\r\n\t\t\t\t\t\t${iterations}[i] = null;\r\n\t\t\t\t\t});\r\n\t\t\t\t`);\r\n\t\t\t\tremove_old_blocks = b`\r\n\t\t\t\t\t@group_outros();\r\n\t\t\t\t\tfor (#i = ${data_length}; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t\t\t${out}(#i);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t@check_outros();\r\n\t\t\t\t`;\r\n\t\t\t} else {\r\n\t\t\t\tremove_old_blocks = b`\r\n\t\t\t\t\tfor (${this.block.has_update_method ? null : x`#i = ${data_length}`}; #i < ${this.block.has_update_method ? view_length : '#old_length'}; #i += 1) {\r\n\t\t\t\t\t\t${iterations}[#i].d(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t${!fixed_length && b`${view_length} = ${data_length};`}\r\n\t\t\t\t`;\r\n\t\t\t}\r\n\r\n\t\t\t// We declare `i` as block scoped here, as the `remove_old_blocks` code\r\n\t\t\t// may rely on continuing where this iteration stopped.\r\n\t\t\tconst update = b`\r\n\t\t\t\t${!this.block.has_update_method && b`const #old_length = ${this.vars.each_block_value}.length;`}\r\n\t\t\t\t${this.vars.each_block_value} = ${snippet};\r\n\t\t\t\t${this.renderer.options.dev && b`@validate_each_argument(${this.vars.each_block_value});`}\r\n\r\n\t\t\t\tlet #i;\r\n\t\t\t\tfor (#i = ${start}; #i < ${data_length}; #i += 1) {\r\n\t\t\t\t\tconst child_ctx = ${this.vars.get_each_context}(#ctx, ${this.vars.each_block_value}, #i);\r\n\r\n\t\t\t\t\t${for_loop_body}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t${remove_old_blocks}\r\n\t\t\t`;\r\n\r\n\t\t\tthis.updates.push(update);\r\n\t\t}\r\n\r\n\t\tif (this.block.has_outros) {\r\n\t\t\tblock.chunks.outro.push(b`\r\n\t\t\t\t${iterations} = ${iterations}.filter(@_Boolean);\r\n\t\t\t\tfor (let #i = 0; #i < ${view_length}; #i += 1) {\r\n\t\t\t\t\t@transition_out(${iterations}[#i]);\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.destroy.push(b`@destroy_each(${iterations}, detaching);`);\r\n\t}\r\n}\r\n","import Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport Text from '../../nodes/Text';\r\nimport Wrapper from './shared/Wrapper';\r\nimport { x } from 'code-red';\r\nimport { Identifier } from 'estree';\r\n\r\nconst regex_non_whitespace_characters = /[\\S\\u00A0]/;\r\n\r\nexport default class TextWrapper extends Wrapper {\r\n\tnode: Text;\r\n\tdata: string;\r\n\tskip: boolean;\r\n\tvar: Identifier;\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: Text,\r\n\t\tdata: string\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\r\n\t\tthis.skip = this.node.should_skip();\r\n\t\tthis.data = data;\r\n\t\tthis.var = (this.skip ? null : x`t`) as unknown as Identifier;\r\n\t}\r\n\r\n\tuse_space() {\r\n\t\tif (this.renderer.component.component_options.preserveWhitespace) return false;\r\n\t\tif (regex_non_whitespace_characters.test(this.data)) return false;\r\n\r\n\t\treturn !this.node.within_pre();\r\n\t}\r\n\r\n\trender(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tif (this.skip) return;\r\n\t\tconst use_space = this.use_space();\r\n\r\n\t\tconst string_literal = {\r\n\t\t\ttype: 'Literal',\r\n\t\t\tvalue: this.data,\r\n\t\t\tloc: {\r\n\t\t\t\tstart: this.renderer.locate(this.node.start),\r\n\t\t\t\tend: this.renderer.locate(this.node.end)\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tblock.add_element(\r\n\t\t\tthis.var,\r\n\t\t\tuse_space ? x`@space()` : x`@text(${string_literal})`,\r\n\t\t\tparent_nodes && (use_space ? x`@claim_space(${parent_nodes})` : x`@claim_text(${parent_nodes}, ${string_literal})`),\r\n\t\t\tparent_node as Identifier\r\n\t\t);\r\n\t}\r\n}\r\n","const svg_attributes = 'accent-height accumulate additive alignment-baseline allowReorder alphabetic amplitude arabic-form ascent attributeName attributeType autoReverse azimuth baseFrequency baseline-shift baseProfile bbox begin bias by calcMode cap-height class clip clipPathUnits clip-path clip-rule color color-interpolation color-interpolation-filters color-profile color-rendering contentScriptType contentStyleType cursor cx cy d decelerate descent diffuseConstant direction display divisor dominant-baseline dur dx dy edgeMode elevation enable-background end exponent externalResourcesRequired fill fill-opacity fill-rule filter filterRes filterUnits flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight format from fr fx fy g1 g2 glyph-name glyph-orientation-horizontal glyph-orientation-vertical glyphRef gradientTransform gradientUnits hanging height href horiz-adv-x horiz-origin-x id ideographic image-rendering in in2 intercept k k1 k2 k3 k4 kernelMatrix kernelUnitLength kerning keyPoints keySplines keyTimes lang lengthAdjust letter-spacing lighting-color limitingConeAngle local marker-end marker-mid marker-start markerHeight markerUnits markerWidth mask maskContentUnits maskUnits mathematical max media method min mode name numOctaves offset onabort onactivate onbegin onclick onend onerror onfocusin onfocusout onload onmousedown onmousemove onmouseout onmouseover onmouseup onrepeat onresize onscroll onunload opacity operator order orient orientation origin overflow overline-position overline-thickness panose-1 paint-order pathLength patternContentUnits patternTransform patternUnits pointer-events points pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits r radius refX refY rendering-intent repeatCount repeatDur requiredExtensions requiredFeatures restart result rotate rx ry scale seed shape-rendering slope spacing specularConstant specularExponent speed spreadMethod startOffset stdDeviation stemh stemv stitchTiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfaceScale systemLanguage tabindex tableValues target targetX targetY text-anchor text-decoration text-rendering textLength to transform type u1 u2 underline-position underline-thickness unicode unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical values version vert-adv-y vert-origin-x vert-origin-y viewBox viewTarget visibility width widths word-spacing writing-mode x x-height x1 x2 xChannelSelector xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type xml:base xml:lang xml:space y y1 y2 yChannelSelector z zoomAndPan'.split(' ');\r\n\r\nconst svg_attribute_lookup = new Map();\r\n\r\nsvg_attributes.forEach(name => {\r\n\tsvg_attribute_lookup.set(name.toLowerCase(), name);\r\n});\r\n\r\nexport default function fix_attribute_casing(name: string) {\r\n\tname = name.toLowerCase();\r\n\treturn svg_attribute_lookup.get(name) || name;\r\n}\r\n","// source: https://html.spec.whatwg.org/multipage/indices.html\r\nexport const boolean_attributes = new Set([\r\n\t'allowfullscreen',\r\n\t'allowpaymentrequest',\r\n\t'async',\r\n\t'autofocus',\r\n\t'autoplay',\r\n\t'checked',\r\n\t'controls',\r\n\t'default',\r\n\t'defer',\r\n\t'disabled',\r\n\t'formnovalidate',\r\n\t'hidden',\r\n\t'inert',\r\n\t'ismap',\r\n\t'itemscope',\r\n\t'loop',\r\n\t'multiple',\r\n\t'muted',\r\n\t'nomodule',\r\n\t'novalidate',\r\n\t'open',\r\n\t'playsinline',\r\n\t'readonly',\r\n\t'required',\r\n\t'reversed',\r\n\t'selected'\r\n]);\r\n","import Attribute from '../../../nodes/Attribute';\r\nimport Block from '../../Block';\r\nimport fix_attribute_casing from './fix_attribute_casing';\r\nimport ElementWrapper from './index';\r\nimport { string_literal } from '../../../utils/stringify';\r\nimport { b, x } from 'code-red';\r\nimport Expression from '../../../nodes/shared/Expression';\r\nimport Text from '../../../nodes/Text';\r\nimport handle_select_value_binding from './handle_select_value_binding';\r\nimport { Identifier, Node } from 'estree';\r\nimport { namespaces } from '../../../../utils/namespaces';\r\nimport { boolean_attributes } from '../../../../../shared/boolean_attributes';\r\nimport { regex_double_quotes } from '../../../../utils/patterns';\r\n\r\nconst non_textlike_input_types = new Set([\r\n\t'button',\r\n\t'checkbox',\r\n\t'color',\r\n\t'date',\r\n\t'datetime-local',\r\n\t'file',\r\n\t'hidden',\r\n\t'image',\r\n\t'radio',\r\n\t'range',\r\n\t'reset',\r\n\t'submit'\r\n]);\r\n\r\nexport class BaseAttributeWrapper {\r\n\tnode: Attribute;\r\n\tparent: ElementWrapper;\r\n\r\n\tconstructor(parent: ElementWrapper, block: Block, node: Attribute) {\r\n\t\tthis.node = node;\r\n\t\tthis.parent = parent;\r\n\r\n\t\tif (node.dependencies.size > 0) {\r\n\t\t\tparent.cannot_use_innerhtml();\r\n\t\t\tparent.not_static_content();\r\n\r\n\t\t\tblock.add_dependencies(node.dependencies);\r\n\t\t}\r\n\t}\r\n\r\n\trender(_block: Block) { }\r\n}\r\n\r\nconst regex_minus_sign = /-/;\r\nconst regex_invalid_variable_identifier_characters = /[^a-zA-Z_$]/g;\r\n\r\nexport default class AttributeWrapper extends BaseAttributeWrapper {\r\n\tnode: Attribute;\r\n\tparent: ElementWrapper;\r\n\tmetadata: any;\r\n\tname: string;\r\n\tproperty_name: string;\r\n\tis_indirectly_bound_value: boolean;\r\n\tis_src: boolean;\r\n\tis_select_value_attribute: boolean;\r\n\tis_input_value: boolean;\r\n\tshould_cache: boolean;\r\n\tlast: Identifier;\r\n\r\n\tconstructor(parent: ElementWrapper, block: Block, node: Attribute) {\r\n\t\tsuper(parent, block, node);\r\n\r\n\t\tif (node.dependencies.size > 0) {\r\n\t\t\t// special case — <option value={foo}> — see below\r\n\t\t\tif (this.parent.node.name === 'option' && node.name === 'value') {\r\n\t\t\t\tlet select: ElementWrapper = this.parent;\r\n\t\t\t\twhile (select && (select.node.type !== 'Element' || select.node.name !== 'select')) {\r\n\t\t\t\t\t// @ts-ignore todo: doublecheck this, but looks to be correct\r\n\t\t\t\t\tselect = select.parent;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (select && select.select_binding_dependencies) {\r\n\t\t\t\t\tselect.select_binding_dependencies.forEach(prop => {\r\n\t\t\t\t\t\tthis.node.dependencies.forEach((dependency: string) => {\r\n\t\t\t\t\t\t\tthis.parent.renderer.component.indirect_dependencies.get(prop).add(dependency);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (node.name === 'value') {\r\n\t\t\t\thandle_select_value_binding(this, node.dependencies);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.parent.node.namespace == namespaces.foreign) {\r\n\t\t\t// leave attribute case alone for elements in the \"foreign\" namespace\r\n\t\t\tthis.name = this.node.name;\r\n\t\t\tthis.metadata = this.get_metadata();\r\n\t\t\tthis.is_indirectly_bound_value = false;\r\n\t\t\tthis.property_name = null;\r\n\t\t\tthis.is_select_value_attribute = false;\r\n\t\t\tthis.is_input_value = false;\r\n\t\t} else {\r\n\t\t\tthis.name = fix_attribute_casing(this.node.name);\r\n\t\t\tthis.metadata = this.get_metadata();\r\n\t\t\tthis.is_indirectly_bound_value = is_indirectly_bound_value(this);\r\n\t\t\tthis.property_name = this.is_indirectly_bound_value\r\n\t\t\t\t? '__value'\r\n\t\t\t\t: this.metadata && this.metadata.property_name;\r\n\t\t\tthis.is_select_value_attribute = this.name === 'value' && this.parent.node.name === 'select';\r\n\t\t\tthis.is_input_value = this.name === 'value' && this.parent.node.name === 'input';\r\n\t\t}\r\n\r\n\t\t// TODO retire this exception in favour of https://github.com/sveltejs/svelte/issues/3750\r\n\t\tthis.is_src = this.name === 'src' && (!this.parent.node.namespace || this.parent.node.namespace === namespaces.html);\r\n\t\tthis.should_cache = should_cache(this);\r\n\t}\r\n\r\n\trender(block: Block) {\r\n\t\tconst element = this.parent;\r\n\t\tconst { name, property_name, should_cache, is_indirectly_bound_value } = this;\r\n\r\n\t\t// xlink is a special case... we could maybe extend this to generic\r\n\t\t// namespaced attributes but I'm not sure that's applicable in\r\n\t\t// HTML5?\r\n\t\tconst method = regex_minus_sign.test(element.node.name)\r\n\t\t\t? '@set_custom_element_data'\r\n\t\t\t: name.slice(0, 6) === 'xlink:'\r\n\t\t\t\t? '@xlink_attr'\r\n\t\t\t\t: '@attr';\r\n\r\n\t\tconst is_legacy_input_type = element.renderer.component.compile_options.legacy && name === 'type' && this.parent.node.name === 'input';\r\n\r\n\t\tconst dependencies = this.get_dependencies();\r\n\t\tconst value = this.get_value(block);\r\n\r\n\t\tlet updater: Node[];\r\n\t\tconst init = this.get_init(block, value);\r\n\r\n\t\tif (is_legacy_input_type) {\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`@set_input_type(${element.var}, ${init});`\r\n\t\t\t);\r\n\t\t\tupdater = b`@set_input_type(${element.var}, ${should_cache ? this.last : value});`;\r\n\t\t} else if (this.is_select_value_attribute) {\r\n\t\t\t// annoying special case\r\n\t\t\tconst is_multiple_select = element.node.get_static_attribute_value('multiple');\r\n\r\n\t\t\tif (is_multiple_select) {\r\n\t\t\t\tupdater = b`@select_options(${element.var}, ${value});`;\r\n\t\t\t} else {\r\n\t\t\t\tupdater = b`@select_option(${element.var}, ${value});`;\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.mount.push(b`\r\n\t\t\t\t${updater}\r\n\t\t\t`);\r\n\t\t} else if (this.is_src) {\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`if (!@src_url_equal(${element.var}.src, ${init})) ${method}(${element.var}, \"${name}\", ${this.last});`\r\n\t\t\t);\r\n\t\t\tupdater = b`${method}(${element.var}, \"${name}\", ${should_cache ? this.last : value});`;\r\n\t\t} else if (property_name) {\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`${element.var}.${property_name} = ${init};`\r\n\t\t\t);\r\n\t\t\tupdater = block.renderer.options.dev\r\n\t\t\t\t? b`@prop_dev(${element.var}, \"${property_name}\", ${should_cache ? this.last : value});`\r\n\t\t\t\t: b`${element.var}.${property_name} = ${should_cache ? this.last : value};`;\r\n\t\t} else {\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`${method}(${element.var}, \"${name}\", ${init});`\r\n\t\t\t);\r\n\t\t\tupdater = b`${method}(${element.var}, \"${name}\", ${should_cache ? this.last : value});`;\r\n\t\t}\r\n\r\n\t\tif (is_indirectly_bound_value) {\r\n\t\t\tconst update_value = b`${element.var}.value = ${element.var}.__value;`;\r\n\t\t\tblock.chunks.hydrate.push(update_value);\r\n\r\n\t\t\tupdater = b`\r\n\t\t\t\t${updater}\r\n\t\t\t\t${update_value};\r\n\t\t\t`;\r\n\t\t}\r\n\r\n\t\tif (dependencies.length > 0) {\r\n\t\t\tconst condition = this.get_dom_update_conditions(block, block.renderer.dirty(dependencies));\r\n\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${condition}) {\r\n\t\t\t\t\t${updater}\r\n\t\t\t\t}`);\r\n\t\t}\r\n\r\n\t\t// special case – autofocus. has to be handled in a bit of a weird way\r\n\t\tif (name === 'autofocus') {\r\n\t\t\tblock.autofocus = {\r\n\t\t\t\telement_var: element.var,\r\n\t\t\t\tcondition_expression: this.node.is_true ? undefined : value\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\tget_init(block: Block, value) {\r\n\t\tthis.last = this.should_cache && block.get_unique_name(\r\n\t\t\t`${this.parent.var.name}_${this.name.replace(regex_invalid_variable_identifier_characters, '_')}_value`\r\n\t\t);\r\n\r\n\t\tif (this.should_cache) block.add_variable(this.last);\r\n\r\n\t\treturn this.should_cache ? x`${this.last} = ${value}` : value;\r\n\t}\r\n\r\n\tget_dom_update_conditions(block: Block, dependency_condition: Node) {\r\n\t\tconst { property_name, should_cache, last } = this;\r\n\t\tconst element = this.parent;\r\n\t\tconst value = this.get_value(block);\r\n\r\n\t\tlet condition = dependency_condition;\r\n\r\n\t\tif (should_cache) {\r\n\t\t\tcondition = this.is_src\r\n\t\t\t\t? x`${condition} && (!@src_url_equal(${element.var}.src, (${last} = ${value})))`\r\n\t\t\t\t: x`${condition} && (${last} !== (${last} = ${value}))`;\r\n\t\t}\r\n\r\n\t\tif (this.is_input_value) {\r\n\t\t\tconst type = element.node.get_static_attribute_value('type');\r\n\t\t\tif (type !== true && !non_textlike_input_types.has(type)) {\r\n\t\t\t\tcondition = x`${condition} && ${element.var}.${property_name} !== ${should_cache ? last : value}`;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (block.has_outros) {\r\n\t\t\tcondition = x`!#current || ${condition}`;\r\n\t\t}\r\n\r\n\t\treturn condition;\r\n\t}\r\n\r\n\tget_dependencies() {\r\n\t\tconst node_dependencies = this.node.get_dependencies();\r\n\t\tconst dependencies = new Set(node_dependencies);\r\n\r\n\t\tnode_dependencies.forEach((prop: string) => {\r\n\t\t\tconst indirect_dependencies = this.parent.renderer.component.indirect_dependencies.get(prop);\r\n\t\t\tif (indirect_dependencies) {\r\n\t\t\t\tindirect_dependencies.forEach(indirect_dependency => {\r\n\t\t\t\t\tdependencies.add(indirect_dependency);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn Array.from(dependencies);\r\n\t}\r\n\r\n\tget_metadata() {\r\n\t\tif (this.parent.node.namespace) return null;\r\n\t\tconst metadata = attribute_lookup[this.name];\r\n\t\tif (metadata && metadata.applies_to && !metadata.applies_to.includes(this.parent.node.name)) return null;\r\n\t\treturn metadata;\r\n\t}\r\n\r\n\tget_value(block: Block) {\r\n\t\tif (this.node.is_true) {\r\n\t\t\tif (this.metadata && boolean_attributes.has(this.metadata.property_name.toLowerCase())) {\r\n\t\t\t\treturn x`true`;\r\n\t\t\t}\r\n\t\t\treturn x`\"\"`;\r\n\t\t}\r\n\t\tif (this.node.chunks.length === 0) return x`\"\"`;\r\n\r\n\t\t// TODO some of this code is repeated in Tag.ts — would be good to\r\n\t\t// DRY it out if that's possible without introducing crazy indirection\r\n\t\tif (this.node.chunks.length === 1) {\r\n\t\t\treturn this.node.chunks[0].type === 'Text'\r\n\t\t\t\t? string_literal((this.node.chunks[0] as Text).data)\r\n\t\t\t\t: (this.node.chunks[0] as Expression).manipulate(block);\r\n\t\t}\r\n\r\n\t\tlet value = this.node.name === 'class'\r\n\t\t\t? this.get_class_name_text(block)\r\n\t\t\t: this.render_chunks(block).reduce((lhs, rhs) => x`${lhs} + ${rhs}`);\r\n\r\n\t\t// '{foo} {bar}' — treat as string concatenation\r\n\t\tif (this.node.chunks[0].type !== 'Text') {\r\n\t\t\tvalue = x`\"\" + ${value}`;\r\n\t\t}\r\n\r\n\t\treturn value;\r\n\t}\r\n\r\n\tget_class_name_text(block: Block) {\r\n\t\tconst scoped_css = this.node.chunks.some((chunk: Text) => chunk.synthetic);\r\n\t\tconst rendered = this.render_chunks(block);\r\n\r\n\t\tif (scoped_css && rendered.length === 2) {\r\n\t\t\t// we have a situation like class={possiblyUndefined}\r\n\t\t\trendered[0] = x`@null_to_empty(${rendered[0]})`;\r\n\t\t}\r\n\r\n\t\treturn rendered.reduce((lhs, rhs) => x`${lhs} + ${rhs}`);\r\n\t}\r\n\r\n\trender_chunks(block: Block) {\r\n\t\treturn this.node.chunks.map((chunk) => {\r\n\t\t\tif (chunk.type === 'Text') {\r\n\t\t\t\treturn string_literal(chunk.data);\r\n\t\t\t}\r\n\r\n\t\t\treturn chunk.manipulate(block);\r\n\t\t});\r\n\t}\r\n\r\n\tstringify() {\r\n\t\tif (this.node.is_true) return '';\r\n\r\n\t\tconst value = this.node.chunks;\r\n\t\tif (value.length === 0) return '=\"\"';\r\n\r\n\t\treturn `=\"${value.map(chunk => {\r\n\t\t\treturn chunk.type === 'Text'\r\n\t\t\t\t? chunk.data.replace(regex_double_quotes, '\\\\\"')\r\n\t\t\t\t: `\\${${chunk.manipulate()}}`;\r\n\t\t}).join('')}\"`;\r\n\t}\r\n}\r\n\r\n// source: https://html.spec.whatwg.org/multipage/indices.html\r\nconst attribute_lookup = {\r\n\tallowfullscreen: { property_name: 'allowFullscreen', applies_to: ['iframe'] },\r\n\tallowpaymentrequest: { property_name: 'allowPaymentRequest', applies_to: ['iframe'] },\r\n\tasync: { applies_to: ['script'] },\r\n\tautofocus: { applies_to: ['button', 'input', 'keygen', 'select', 'textarea'] },\r\n\tautoplay: { applies_to: ['audio', 'video'] },\r\n\tchecked: { applies_to: ['input'] },\r\n\tcontrols: { applies_to: ['audio', 'video'] },\r\n\tdefault: { applies_to: ['track'] },\r\n\tdefer: { applies_to: ['script'] },\r\n\tdisabled: {\r\n\t\tapplies_to: [\r\n\t\t\t'button',\r\n\t\t\t'fieldset',\r\n\t\t\t'input',\r\n\t\t\t'keygen',\r\n\t\t\t'optgroup',\r\n\t\t\t'option',\r\n\t\t\t'select',\r\n\t\t\t'textarea'\r\n\t\t]\r\n\t},\r\n\tformnovalidate: { property_name: 'formNoValidate', applies_to: ['button', 'input'] },\r\n\thidden: {},\r\n\tindeterminate: { applies_to: ['input'] },\r\n\tismap: { property_name: 'isMap', applies_to: ['img'] },\r\n\tloop: { applies_to: ['audio', 'bgsound', 'video'] },\r\n\tmultiple: { applies_to: ['input', 'select'] },\r\n\tmuted: { applies_to: ['audio', 'video'] },\r\n\tnomodule: { property_name: 'noModule', applies_to: ['script'] },\r\n\tnovalidate: { property_name: 'noValidate', applies_to: ['form'] },\r\n\topen: { applies_to: ['details', 'dialog'] },\r\n\tplaysinline: { property_name: 'playsInline', applies_to: ['video'] },\r\n\treadonly: { property_name: 'readOnly', applies_to: ['input', 'textarea'] },\r\n\trequired: { applies_to: ['input', 'select', 'textarea'] },\r\n\treversed: { applies_to: ['ol'] },\r\n\tselected: { applies_to: ['option'] },\r\n\tvalue: {\r\n\t\tapplies_to: [\r\n\t\t\t'button',\r\n\t\t\t'option',\r\n\t\t\t'input',\r\n\t\t\t'li',\r\n\t\t\t'meter',\r\n\t\t\t'progress',\r\n\t\t\t'param',\r\n\t\t\t'select',\r\n\t\t\t'textarea'\r\n\t\t]\r\n\t}\r\n};\r\n\r\nObject.keys(attribute_lookup).forEach(name => {\r\n\tconst metadata = attribute_lookup[name];\r\n\tif (!metadata.property_name) metadata.property_name = name;\r\n});\r\n\r\nfunction should_cache(attribute: AttributeWrapper) {\r\n\treturn attribute.is_src || attribute.node.should_cache();\r\n}\r\n\r\nconst regex_contains_checked_or_group = /checked|group/;\r\n\r\nfunction is_indirectly_bound_value(attribute: AttributeWrapper) {\r\n\tconst element = attribute.parent;\r\n\treturn attribute.name === 'value' &&\r\n\t\t(element.node.name === 'option' || // TODO check it's actually bound\r\n\t\t\t(element.node.name === 'input' &&\r\n\t\t\t\telement.node.bindings.some(\r\n\t\t\t\t\t(binding) => regex_contains_checked_or_group.test(binding.name)\r\n\t\t\t\t)));\r\n}\r\n","import { b, x } from 'code-red';\r\nimport Attribute from '../../../nodes/Attribute';\r\nimport Block from '../../Block';\r\nimport AttributeWrapper from './Attribute';\r\nimport ElementWrapper from '../Element';\r\nimport { string_literal } from '../../../utils/stringify';\r\nimport add_to_set from '../../../utils/add_to_set';\r\nimport Expression from '../../../nodes/shared/Expression';\r\nimport Text from '../../../nodes/Text';\r\n\r\nexport interface StyleProp {\r\n\tkey: string;\r\n\tvalue: Array<Text | Expression>;\r\n\timportant: boolean;\r\n}\r\n\r\nexport default class StyleAttributeWrapper extends AttributeWrapper {\r\n\tnode: Attribute;\r\n\tparent: ElementWrapper;\r\n\r\n\trender(block: Block) {\r\n\t\tconst style_props = optimize_style(this.node.chunks);\r\n\t\tif (!style_props) return super.render(block);\r\n\r\n\t\tstyle_props.forEach((prop: StyleProp) => {\r\n\t\t\tlet value;\r\n\r\n\t\t\tif (is_dynamic(prop.value)) {\r\n\t\t\t\tconst prop_dependencies: Set<string> = new Set();\r\n\r\n\t\t\t\tvalue = prop.value\r\n\t\t\t\t\t.map(chunk => {\r\n\t\t\t\t\t\tif (chunk.type === 'Text') {\r\n\t\t\t\t\t\t\treturn string_literal(chunk.data);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tadd_to_set(prop_dependencies, chunk.dynamic_dependencies());\r\n\t\t\t\t\t\t\treturn chunk.manipulate(block);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.reduce((lhs, rhs) => x`${lhs} + ${rhs}`);\r\n\r\n\t\t\t\t// TODO is this necessary? style.setProperty always treats value as string, no?\r\n\t\t\t\t// if (prop.value.length === 1 || prop.value[0].type !== 'Text') {\r\n\t\t\t\t// \tvalue = x`\"\" + ${value}`;\r\n\t\t\t\t// }\r\n\r\n\t\t\t\tif (prop_dependencies.size) {\r\n\t\t\t\t\tlet condition = block.renderer.dirty(Array.from(prop_dependencies));\r\n\r\n\t\t\t\t\tif (block.has_outros) {\r\n\t\t\t\t\t\tcondition = x`!#current || ${condition}`;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst update = b`\r\n\t\t\t\t\t\tif (${condition}) {\r\n\t\t\t\t\t\t\t@set_style(${this.parent.var}, \"${prop.key}\", ${value}, ${prop.important ? 1 : null});\r\n\t\t\t\t\t\t}`;\r\n\r\n\t\t\t\t\tblock.chunks.update.push(update);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tvalue = string_literal((prop.value[0] as Text).data);\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`@set_style(${this.parent.var}, \"${prop.key}\", ${value}, ${prop.important ? 1 : null});`\r\n\t\t\t);\r\n\t\t});\r\n\t}\r\n}\r\n\r\nconst regex_style_prop_key = /^\\s*([\\w-]+):\\s*/;\r\n\r\nfunction optimize_style(value: Array<Text | Expression>) {\r\n\tconst props: StyleProp[] = [];\r\n\tlet chunks = value.slice();\r\n\r\n\twhile (chunks.length) {\r\n\t\tconst chunk = chunks[0];\r\n\r\n\t\tif (chunk.type !== 'Text') return null;\r\n\r\n\t\tconst key_match = regex_style_prop_key.exec(chunk.data);\r\n\t\tif (!key_match) return null;\r\n\r\n\t\tconst key = key_match[1];\r\n\r\n\t\tconst offset = key_match.index + key_match[0].length;\r\n\t\tconst remaining_data = chunk.data.slice(offset);\r\n\r\n\t\tif (remaining_data) {\r\n\t\t\tchunks[0] = {\r\n\t\t\t\tstart: chunk.start + offset,\r\n\t\t\t\tend: chunk.end,\r\n\t\t\t\ttype: 'Text',\r\n\t\t\t\tdata: remaining_data\r\n\t\t\t} as Text;\r\n\t\t} else {\r\n\t\t\tchunks.shift();\r\n\t\t}\r\n\r\n\t\tconst result = get_style_value(chunks);\r\n\r\n\t\tprops.push({ key, value: result.value, important: result.important });\r\n\t\tchunks = result.chunks;\r\n\t}\r\n\r\n\treturn props;\r\n}\r\n\r\nconst regex_important_flag = /\\s*!important\\s*$/;\r\nconst regex_semicolon_or_whitespace = /[;\\s]/;\r\n\r\nfunction get_style_value(chunks: Array<Text | Expression>) {\r\n\tconst value: Array<Text | Expression> = [];\r\n\r\n\tlet in_url = false;\r\n\tlet quote_mark = null;\r\n\tlet escaped = false;\r\n\tlet closed = false;\r\n\r\n\twhile (chunks.length && !closed) {\r\n\t\tconst chunk = chunks.shift();\r\n\r\n\t\tif (chunk.type === 'Text') {\r\n\t\t\tlet c = 0;\r\n\t\t\twhile (c < chunk.data.length) {\r\n\t\t\t\tconst char = chunk.data[c];\r\n\r\n\t\t\t\tif (escaped) {\r\n\t\t\t\t\tescaped = false;\r\n\t\t\t\t} else if (char === '\\\\') {\r\n\t\t\t\t\tescaped = true;\r\n\t\t\t\t} else if (char === quote_mark) {\r\n\t\t\t\t\tquote_mark = null;\r\n\t\t\t\t} else if (char === '\"' || char === \"'\") {\r\n\t\t\t\t\tquote_mark = char;\r\n\t\t\t\t} else if (char === ')' && in_url) {\r\n\t\t\t\t\tin_url = false;\r\n\t\t\t\t} else if (char === 'u' && chunk.data.slice(c, c + 4) === 'url(') {\r\n\t\t\t\t\tin_url = true;\r\n\t\t\t\t} else if (char === ';' && !in_url && !quote_mark) {\r\n\t\t\t\t\tclosed = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tc += 1;\r\n\t\t\t}\r\n\r\n\t\t\tif (c > 0) {\r\n\t\t\t\tvalue.push({\r\n\t\t\t\t\ttype: 'Text',\r\n\t\t\t\t\tstart: chunk.start,\r\n\t\t\t\t\tend: chunk.start + c,\r\n\t\t\t\t\tdata: chunk.data.slice(0, c)\r\n\t\t\t\t} as Text);\r\n\t\t\t}\r\n\r\n\t\t\twhile (regex_semicolon_or_whitespace.test(chunk.data[c])) c += 1;\r\n\t\t\tconst remaining_data = chunk.data.slice(c);\r\n\r\n\t\t\tif (remaining_data) {\r\n\t\t\t\tchunks.unshift({\r\n\t\t\t\t\tstart: chunk.start + c,\r\n\t\t\t\t\tend: chunk.end,\r\n\t\t\t\t\ttype: 'Text',\r\n\t\t\t\t\tdata: remaining_data\r\n\t\t\t\t} as Text);\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvalue.push(chunk);\r\n\t\t}\r\n\t}\r\n\r\n\tlet important = false;\r\n\r\n\tconst last_chunk = value[value.length - 1];\r\n\tif (last_chunk && last_chunk.type === 'Text' && regex_important_flag.test(last_chunk.data)) {\r\n\t\timportant = true;\r\n\t\tlast_chunk.data = last_chunk.data.replace(regex_important_flag, '');\r\n\t\tif (!last_chunk.data) value.pop();\r\n\t}\r\n\r\n\treturn {\r\n\t\tchunks,\r\n\t\tvalue,\r\n\t\timportant\r\n\t};\r\n}\r\n\r\nfunction is_dynamic(value: Array<Text | Expression>) {\r\n\treturn value.length > 1 || value[0].type !== 'Text';\r\n}\r\n","import { b, x } from 'code-red';\r\nimport Binding from '../../../nodes/Binding';\r\nimport ElementWrapper from '../Element';\r\nimport InlineComponentWrapper from '../InlineComponent';\r\nimport get_object from '../../../utils/get_object';\r\nimport replace_object from '../../../utils/replace_object';\r\nimport Block from '../../Block';\r\nimport Renderer from '../../Renderer';\r\nimport flatten_reference from '../../../utils/flatten_reference';\r\nimport { Node, Identifier } from 'estree';\r\nimport add_to_set from '../../../utils/add_to_set';\r\nimport mark_each_block_bindings from '../shared/mark_each_block_bindings';\r\nimport handle_select_value_binding from './handle_select_value_binding';\r\n\r\nexport default class BindingWrapper {\r\n\tnode: Binding;\r\n\tparent: ElementWrapper | InlineComponentWrapper;\r\n\r\n\tobject: string;\r\n\thandler: {\r\n\t\tuses_context: boolean;\r\n\t\tmutation: (Node | Node[]);\r\n\t\tcontextual_dependencies: Set<string>;\r\n\t\tlhs?: Node;\r\n\t};\r\n\tsnippet: Node;\r\n\tis_readonly: boolean;\r\n\tneeds_lock: boolean;\r\n\r\n\tconstructor(block: Block, node: Binding, parent: ElementWrapper | InlineComponentWrapper) {\r\n\t\tthis.node = node;\r\n\t\tthis.parent = parent;\r\n\r\n\t\tconst { dependencies } = this.node.expression;\r\n\r\n\t\tblock.add_dependencies(dependencies);\r\n\r\n\t\t// TODO does this also apply to e.g. `<input type='checkbox' bind:group='foo'>`?\r\n\r\n\t\thandle_select_value_binding(this, dependencies);\r\n\r\n\t\tif (node.is_contextual) {\r\n\t\t\tmark_each_block_bindings(this.parent, this.node);\r\n\t\t}\r\n\r\n\t\tthis.object = get_object(this.node.expression.node).name;\r\n\r\n\t\t// view to model\r\n\t\tthis.handler = get_event_handler(this, parent.renderer, block, this.object, this.node.raw_expression);\r\n\r\n\t\tthis.snippet = this.node.expression.manipulate(block);\r\n\r\n\t\tthis.is_readonly = this.node.is_readonly;\r\n\r\n\t\tthis.needs_lock = this.node.name === 'currentTime';  // TODO others?\r\n\t}\r\n\r\n\tget_dependencies() {\r\n\t\tconst dependencies = new Set(this.node.expression.dependencies);\r\n\r\n\t\tthis.node.expression.dependencies.forEach((prop: string) => {\r\n\t\t\tconst indirect_dependencies = this.parent.renderer.component.indirect_dependencies.get(prop);\r\n\t\t\tif (indirect_dependencies) {\r\n\t\t\t\tindirect_dependencies.forEach(indirect_dependency => {\r\n\t\t\t\t\tdependencies.add(indirect_dependency);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn dependencies;\r\n\t}\r\n\r\n\tget_update_dependencies() {\r\n\t\tconst object = this.object;\r\n\t\tconst dependencies = new Set<string>();\r\n\t\tif (this.node.expression.template_scope.names.has(object)) {\r\n\t\t\tthis.node.expression.template_scope.dependencies_for_name\r\n\t\t\t\t.get(object)\r\n\t\t\t\t.forEach((name) => dependencies.add(name));\r\n\t\t} else {\r\n\t\t\tdependencies.add(object);\r\n\t\t}\r\n\r\n\t\tconst result = new Set(dependencies);\r\n\t\tdependencies.forEach((dependency) => {\r\n\t\t\tconst indirect_dependencies = this.parent.renderer.component.indirect_dependencies.get(dependency);\r\n\t\t\tif (indirect_dependencies) {\r\n\t\t\t\tindirect_dependencies.forEach(indirect_dependency => {\r\n\t\t\t\t\tresult.add(indirect_dependency);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\tis_readonly_media_attribute() {\r\n\t\treturn this.node.is_readonly_media_attribute();\r\n\t}\r\n\r\n\trender(block: Block, lock: Identifier) {\r\n\t\tif (this.is_readonly) return;\r\n\r\n\t\tconst { parent } = this;\r\n\r\n\t\tconst update_conditions: any[] = this.needs_lock ? [x`!${lock}`] : [];\r\n\t\tconst mount_conditions: any[] = [];\r\n\r\n\t\tconst dependency_array = Array.from(this.get_dependencies());\r\n\r\n\t\tif (dependency_array.length > 0) {\r\n\t\t\tupdate_conditions.push(block.renderer.dirty(dependency_array));\r\n\t\t}\r\n\r\n\t\tif (parent.node.name === 'input') {\r\n\t\t\tconst type = parent.node.get_static_attribute_value('type');\r\n\r\n\t\t\tif (\r\n\t\t\t\ttype === null ||\r\n\t\t\t\ttype === '' ||\r\n\t\t\t\ttype === 'text' ||\r\n\t\t\t\ttype === 'email' ||\r\n\t\t\t\ttype === 'password'\r\n\t\t\t) {\r\n\t\t\t\tupdate_conditions.push(\r\n\t\t\t\t\tx`${parent.var}.${this.node.name} !== ${this.snippet}`\r\n\t\t\t\t);\r\n\t\t\t} else if (type === 'number') {\r\n\t\t\t\tupdate_conditions.push(\r\n\t\t\t\t\tx`@to_number(${parent.var}.${this.node.name}) !== ${this.snippet}`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// model to view\r\n\t\tlet update_dom = get_dom_updater(parent, this);\r\n\t\tlet mount_dom = update_dom;\r\n\r\n\t\t// special cases\r\n\t\tswitch (this.node.name) {\r\n\t\t\tcase 'group':\r\n\t\t\t{\r\n\t\t\t\tconst { binding_group, is_context, contexts, index, keypath } = get_binding_group(parent.renderer, this.node, block);\r\n\r\n\t\t\t\tblock.renderer.add_to_context('$$binding_groups');\r\n\r\n\t\t\t\tif (is_context && !block.binding_group_initialised.has(keypath)) {\r\n\t\t\t\t\tif (contexts.length > 1) {\r\n\t\t\t\t\t\tlet binding_group = x`${block.renderer.reference('$$binding_groups')}[${index}]`;\r\n\t\t\t\t\t\tfor (const name of contexts.slice(0, -1)) {\r\n\t\t\t\t\t\t\tbinding_group = x`${binding_group}[${block.renderer.reference(name)}]`;\r\n\t\t\t\t\t\t\tblock.chunks.init.push(\r\n\t\t\t\t\t\t\t\tb`${binding_group} = ${binding_group} || [];`\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tblock.chunks.init.push(\r\n\t\t\t\t\t\tb`${binding_group(true)} = [];`\r\n\t\t\t\t\t);\r\n\t\t\t\t\tblock.binding_group_initialised.add(keypath);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\t\tb`${binding_group(true)}.push(${parent.var});`\r\n\t\t\t\t);\r\n\r\n\t\t\t\tblock.chunks.destroy.push(\r\n\t\t\t\t\tb`${binding_group(true)}.splice(${binding_group(true)}.indexOf(${parent.var}), 1);`\r\n\t\t\t\t);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase 'textContent':\r\n\t\t\t\tupdate_conditions.push(x`${this.snippet} !== ${parent.var}.textContent`);\r\n\t\t\t\tmount_conditions.push(x`${this.snippet} !== void 0`);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'innerHTML':\r\n\t\t\t\tupdate_conditions.push(x`${this.snippet} !== ${parent.var}.innerHTML`);\r\n\t\t\t\tmount_conditions.push(x`${this.snippet} !== void 0`);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'currentTime':\r\n\t\t\t\tupdate_conditions.push(x`!@_isNaN(${this.snippet})`);\r\n\t\t\t\tmount_dom = null;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'playbackRate':\r\n\t\t\tcase 'volume':\r\n\t\t\t\tupdate_conditions.push(x`!@_isNaN(${this.snippet})`);\r\n\t\t\t\tmount_conditions.push(x`!@_isNaN(${this.snippet})`);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'paused':\r\n\t\t\t{\r\n\t\t\t\t// this is necessary to prevent audio restarting by itself\r\n\t\t\t\tconst last = block.get_unique_name(`${parent.var.name}_is_paused`);\r\n\t\t\t\tblock.add_variable(last, x`true`);\r\n\r\n\t\t\t\tupdate_conditions.push(x`${last} !== (${last} = ${this.snippet})`);\r\n\t\t\t\tupdate_dom = b`${parent.var}[${last} ? \"pause\" : \"play\"]();`;\r\n\t\t\t\tmount_dom = null;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcase 'value':\r\n\t\t\t\tif (parent.node.get_static_attribute_value('type') === 'file') {\r\n\t\t\t\t\tupdate_dom = null;\r\n\t\t\t\t\tmount_dom = null;\r\n\t\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (update_dom) {\r\n\t\t\tif (update_conditions.length > 0) {\r\n\t\t\t\tconst condition = update_conditions.reduce((lhs, rhs) => x`${lhs} && ${rhs}`);\r\n\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif (${condition}) {\r\n\t\t\t\t\t\t${update_dom}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.update.push(update_dom);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (mount_dom) {\r\n\t\t\tif (mount_conditions.length > 0) {\r\n\t\t\t\tconst condition = mount_conditions.reduce((lhs, rhs) => x`${lhs} && ${rhs}`);\r\n\r\n\t\t\t\tblock.chunks.mount.push(b`\r\n\t\t\t\t\tif (${condition}) {\r\n\t\t\t\t\t\t${mount_dom}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.mount.push(mount_dom);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction get_dom_updater(\r\n\telement: ElementWrapper | InlineComponentWrapper,\r\n\tbinding: BindingWrapper\r\n) {\r\n\tconst { node } = element;\r\n\r\n\tif (binding.is_readonly_media_attribute()) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (binding.node.name === 'this') {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif (node.name === 'select') {\r\n\t\treturn node.get_static_attribute_value('multiple') === true ?\r\n\t\t\tb`@select_options(${element.var}, ${binding.snippet})` :\r\n\t\t\tb`@select_option(${element.var}, ${binding.snippet})`;\r\n\t}\r\n\r\n\tif (binding.node.name === 'group') {\r\n\t\tconst type = node.get_static_attribute_value('type');\r\n\r\n\t\tconst condition = type === 'checkbox'\r\n\t\t\t? x`~${binding.snippet}.indexOf(${element.var}.__value)`\r\n\t\t\t: x`${element.var}.__value === ${binding.snippet}`;\r\n\r\n\t\treturn b`${element.var}.checked = ${condition};`;\r\n\t}\r\n\r\n\tif (binding.node.name === 'value') {\r\n\t\treturn b`@set_input_value(${element.var}, ${binding.snippet});`;\r\n\t}\r\n\r\n\treturn b`${element.var}.${binding.node.name} = ${binding.snippet};`;\r\n}\r\n\r\nfunction get_binding_group(renderer: Renderer, value: Binding, block: Block) {\r\n\tconst { parts } = flatten_reference(value.raw_expression);\r\n\tlet keypath = parts.join('.');\r\n\r\n\tconst contexts = [];\r\n\tconst contextual_dependencies = new Set<string>();\r\n\tconst { template_scope } = value.expression;\r\n\tconst add_contextual_dependency = (dep: string) => {\r\n\t\tcontextual_dependencies.add(dep);\r\n\t\tconst owner = template_scope.get_owner(dep);\r\n\t\tif (owner.type === 'EachBlock') {\r\n\t\t\tfor (const dep of owner.expression.contextual_dependencies) {\r\n\t\t\t\tadd_contextual_dependency(dep);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tfor (const dep of value.expression.contextual_dependencies) {\r\n\t\tadd_contextual_dependency(dep);\r\n\t}\r\n\r\n\tfor (const dep of contextual_dependencies) {\r\n\t\tconst context = block.bindings.get(dep);\r\n\t\tlet key: string;\r\n\t\tlet name: string;\r\n\t\tif (context) {\r\n\t\t\tkey = context.object.name;\r\n\t\t\tname = context.property.name;\r\n\t\t} else {\r\n\t\t\tkey = dep;\r\n\t\t\tname = dep;\r\n\t\t}\r\n\t\tkeypath = `${key}@${keypath}`;\r\n\t\tcontexts.push(name);\r\n\t}\r\n\r\n\tif (!renderer.binding_groups.has(keypath)) {\r\n\t\tconst index = renderer.binding_groups.size;\r\n\r\n\t\tcontexts.forEach(context => {\r\n\t\t\trenderer.add_to_context(context, true);\r\n\t\t});\r\n\r\n\t\trenderer.binding_groups.set(keypath, {\r\n\t\t\tbinding_group: (to_reference: boolean = false) => {\r\n\t\t\t\tlet binding_group = '$$binding_groups';\r\n\t\t\t\tlet _secondary_indexes = contexts;\r\n\r\n\t\t\t\tif (to_reference) {\r\n\t\t\t\t\tbinding_group = block.renderer.reference(binding_group);\r\n\t\t\t\t\t_secondary_indexes = _secondary_indexes.map(name => block.renderer.reference(name));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (_secondary_indexes.length > 0) {\r\n\t\t\t\t\tlet obj = x`${binding_group}[${index}]`;\r\n\t\t\t\t\t_secondary_indexes.forEach(secondary_index => {\r\n\t\t\t\t\t\tobj = x`${obj}[${secondary_index}]`;\r\n\t\t\t\t\t});\r\n\t\t\t\t\treturn obj;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn x`${binding_group}[${index}]`;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tis_context: contexts.length > 0,\r\n\t\t\tcontexts,\r\n\t\t\tindex,\r\n\t\t\tkeypath\r\n\t\t});\r\n\t}\r\n\r\n\treturn renderer.binding_groups.get(keypath);\r\n}\r\n\r\nfunction get_event_handler(\r\n\tbinding: BindingWrapper,\r\n\trenderer: Renderer,\r\n\tblock: Block,\r\n\tname: string,\r\n\tlhs: Node\r\n): {\r\n\tuses_context: boolean;\r\n\tmutation: (Node | Node[]);\r\n\tcontextual_dependencies: Set<string>;\r\n\tlhs?: Node;\r\n} {\r\n\tconst contextual_dependencies = new Set<string>(binding.node.expression.contextual_dependencies);\r\n\r\n\tconst context = block.bindings.get(name);\r\n\tlet set_store: Node[] | undefined;\r\n\r\n\tif (context) {\r\n\t\tconst { object, property, store, snippet } = context;\r\n\t\tlhs = replace_object(lhs, snippet);\r\n\t\tcontextual_dependencies.add(object.name);\r\n\t\tcontextual_dependencies.add(property.name);\r\n\t\tcontextual_dependencies.delete(name);\r\n\r\n\t\tif (store) {\r\n\t\t\tset_store = b`${store}.set(${`$${store}`});`;\r\n\t\t}\r\n\t} else {\r\n\t\tconst object = get_object(lhs);\r\n\t\tif (object.name[0] === '$') {\r\n\t\t\tconst store = object.name.slice(1);\r\n\t\t\tset_store = b`${store}.set(${object.name});`;\r\n\t\t}\r\n\t}\r\n\r\n\tconst value = get_value_from_dom(renderer, binding.parent, binding, block, contextual_dependencies);\r\n\r\n\tconst mutation = b`\r\n\t\t${lhs} = ${value};\r\n\t\t${set_store}\r\n\t`;\r\n\r\n\treturn {\r\n\t\tuses_context: binding.node.is_contextual || binding.node.expression.uses_context, // TODO this is messy\r\n\t\tmutation,\r\n\t\tcontextual_dependencies,\r\n\t\tlhs\r\n\t};\r\n}\r\n\r\nfunction get_value_from_dom(\r\n\trenderer: Renderer,\r\n\telement: ElementWrapper | InlineComponentWrapper,\r\n\tbinding: BindingWrapper,\r\n\tblock: Block,\r\n\tcontextual_dependencies: Set<string>\r\n) {\r\n\tconst { node } = element;\r\n\tconst { name } = binding.node;\r\n\r\n\tif (name === 'this') {\r\n\t\treturn x`$$value`;\r\n\t}\r\n\r\n\t// <select bind:value='selected>\r\n\tif (node.name === 'select') {\r\n\t\treturn node.get_static_attribute_value('multiple') === true ?\r\n\t\t\tx`@select_multiple_value(this)` :\r\n\t\t\tx`@select_value(this)`;\r\n\t}\r\n\r\n\tconst type = node.get_static_attribute_value('type');\r\n\r\n\t// <input type='checkbox' bind:group='foo'>\r\n\tif (name === 'group') {\r\n\t\tif (type === 'checkbox') {\r\n\t\t\tconst { binding_group, contexts } = get_binding_group(renderer, binding.node, block);\r\n\t\t\tadd_to_set(contextual_dependencies, contexts);\r\n\t\t\treturn x`@get_binding_group_value(${binding_group()}, this.__value, this.checked)`;\r\n\t\t}\r\n\r\n\t\treturn x`this.__value`;\r\n\t}\r\n\r\n\t// <input type='range|number' bind:value>\r\n\tif (type === 'range' || type === 'number') {\r\n\t\treturn x`@to_number(this.${name})`;\r\n\t}\r\n\r\n\tif ((name === 'buffered' || name === 'seekable' || name === 'played')) {\r\n\t\treturn x`@time_ranges_to_array(this.${name})`;\r\n\t}\r\n\r\n\t// everything else\r\n\treturn x`this.${name}`;\r\n}\r\n","import Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport Tag from './shared/Tag';\r\nimport Wrapper from './shared/Wrapper';\r\nimport MustacheTag from '../../nodes/MustacheTag';\r\nimport RawMustacheTag from '../../nodes/RawMustacheTag';\r\nimport { x } from 'code-red';\r\nimport { Identifier } from 'estree';\r\n\r\nexport default class MustacheTagWrapper extends Tag {\r\n\tvar: Identifier = { type: 'Identifier', name: 't' };\r\n\r\n\tconstructor(renderer: Renderer, block: Block, parent: Wrapper, node: MustacheTag | RawMustacheTag) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\t}\r\n\r\n\trender(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tconst { init } = this.rename_this_method(\r\n\t\t\tblock,\r\n\t\t\tvalue => x`@set_data(${this.var}, ${value})`\r\n\t\t);\r\n\r\n\t\tblock.add_element(\r\n\t\t\tthis.var,\r\n\t\t\tx`@text(${init})`,\r\n\t\t\tparent_nodes && x`@claim_text(${parent_nodes}, ${init})`,\r\n\t\t\tparent_node\r\n\t\t);\r\n\t}\r\n}\r\n","import { namespaces } from './../../../utils/namespaces';\r\nimport { b, x } from 'code-red';\r\nimport Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport Tag from './shared/Tag';\r\nimport Wrapper from './shared/Wrapper';\r\nimport Element from '../../nodes/Element';\r\nimport MustacheTag from '../../nodes/MustacheTag';\r\nimport RawMustacheTag from '../../nodes/RawMustacheTag';\r\nimport { is_head } from './shared/is_head';\r\nimport { Identifier, Node } from 'estree';\r\n\r\nexport default class RawMustacheTagWrapper extends Tag {\r\n\tvar: Identifier = { type: 'Identifier', name: 'raw' };\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: MustacheTag | RawMustacheTag\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\t\tthis.cannot_use_innerhtml();\r\n\t\tthis.not_static_content();\r\n\t}\r\n\r\n\trender(block: Block, parent_node: Identifier, _parent_nodes: Identifier) {\r\n\t\tconst in_head = is_head(parent_node);\r\n\r\n\t\tconst can_use_innerhtml = !in_head && parent_node && !this.prev && !this.next;\r\n\r\n\t\tif (can_use_innerhtml) {\r\n\t\t\tconst insert = (content: Node) => b`${parent_node}.innerHTML = ${content};`[0];\r\n\r\n\t\t\tconst { init } = this.rename_this_method(\r\n\t\t\t\tblock,\r\n\t\t\t\tcontent => insert(content)\r\n\t\t\t);\r\n\r\n\t\t\tblock.chunks.mount.push(insert(init));\r\n\t\t} else {\r\n\t\t\tconst needs_anchor = in_head || (this.next ? !this.next.is_dom_node() : (!this.parent || !this.parent.is_dom_node()));\r\n\r\n\t\t\tconst html_tag = block.get_unique_name('html_tag');\r\n\t\t\tconst html_anchor = needs_anchor && block.get_unique_name('html_anchor');\r\n\r\n\t\t\tblock.add_variable(html_tag);\r\n\r\n\t\t\tconst { init } = this.rename_this_method(\r\n\t\t\t\tblock,\r\n\t\t\t\tcontent => x`${html_tag}.p(${content})`\r\n\t\t\t);\r\n\r\n\t\t\tconst update_anchor = needs_anchor ? html_anchor : this.next ? this.next.var : 'null';\r\n\r\n\t\t\tconst parent_element = this.node.find_nearest(/^Element/) as Element;\r\n\t\t\tconst is_svg = parent_element && parent_element.namespace === namespaces.svg;\r\n\t\t\tblock.chunks.create.push(b`${html_tag} = new @HtmlTag(${is_svg ? 'true' : 'false'});`);\r\n\r\n\t\t\tif (this.renderer.options.hydratable) {\r\n\t\t\t\tblock.chunks.claim.push(b`${html_tag} = @claim_html_tag(${_parent_nodes}, ${is_svg ? 'true' : 'false'});`);\r\n\t\t\t}\r\n\t\t\tblock.chunks.hydrate.push(b`${html_tag}.a = ${update_anchor};`);\r\n\t\t\tblock.chunks.mount.push(b`${html_tag}.m(${init}, ${parent_node || '#target'}, ${parent_node ? null : '#anchor'});`);\r\n\r\n\t\t\tif (needs_anchor) {\r\n\t\t\t\tblock.add_element(html_anchor, x`@empty()`, x`@empty()`, parent_node);\r\n\t\t\t}\r\n\r\n\t\t\tif (!parent_node || in_head) {\r\n\t\t\t\tblock.chunks.destroy.push(b`if (detaching) ${html_tag}.d();`);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","import Renderer from '../../Renderer';\r\nimport Element from '../../../nodes/Element';\r\nimport Wrapper from '../shared/Wrapper';\r\nimport Block from '../../Block';\r\nimport { is_void } from '../../../../../shared/utils/names';\r\nimport FragmentWrapper from '../Fragment';\r\nimport { escape_html, string_literal } from '../../../utils/stringify';\r\nimport TextWrapper from '../Text';\r\nimport fix_attribute_casing from './fix_attribute_casing';\r\nimport { b, x, p } from 'code-red';\r\nimport { namespaces } from '../../../../utils/namespaces';\r\nimport AttributeWrapper from './Attribute';\r\nimport StyleAttributeWrapper from './StyleAttribute';\r\nimport SpreadAttributeWrapper from './SpreadAttribute';\r\nimport { regex_dimensions, regex_starts_with_newline, regex_backslashes } from '../../../../utils/patterns';\r\nimport Binding from './Binding';\r\nimport add_to_set from '../../../utils/add_to_set';\r\nimport { add_event_handler } from '../shared/add_event_handlers';\r\nimport { add_action } from '../shared/add_actions';\r\nimport bind_this from '../shared/bind_this';\r\nimport { is_head } from '../shared/is_head';\r\nimport { Identifier, ExpressionStatement, CallExpression, Node } from 'estree';\r\nimport EventHandler from './EventHandler';\r\nimport { extract_names } from 'periscopic';\r\nimport Action from '../../../nodes/Action';\r\nimport MustacheTagWrapper from '../MustacheTag';\r\nimport RawMustacheTagWrapper from '../RawMustacheTag';\r\nimport is_dynamic from '../shared/is_dynamic';\r\nimport create_debugging_comment from '../shared/create_debugging_comment';\r\nimport { push_array } from '../../../../utils/push_array';\r\n\r\ninterface BindingGroup {\r\n\tevents: string[];\r\n\tbindings: Binding[];\r\n}\r\n\r\nconst regex_contains_radio_or_checkbox_or_file = /radio|checkbox|file/;\r\nconst regex_contains_radio_or_checkbox_or_range_or_file = /radio|checkbox|range|file/;\r\n\r\nconst events = [\r\n\t{\r\n\t\tevent_names: ['input'],\r\n\t\tfilter: (node: Element, _name: string) =>\r\n\t\t\tnode.name === 'textarea' ||\r\n\t\t\tnode.name === 'input' &&\r\n\t\t\t!regex_contains_radio_or_checkbox_or_range_or_file.test(node.get_static_attribute_value('type') as string)\r\n\t},\r\n\t{\r\n\t\tevent_names: ['input'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\t(name === 'textContent' || name === 'innerHTML') &&\r\n\t\t\tnode.attributes.some(attribute => attribute.name === 'contenteditable')\r\n\t},\r\n\t{\r\n\t\tevent_names: ['change'],\r\n\t\tfilter: (node: Element, _name: string) =>\r\n\t\t\tnode.name === 'select' ||\r\n\t\t\tnode.name === 'input' &&\r\n\t\t\tregex_contains_radio_or_checkbox_or_file.test(node.get_static_attribute_value('type') as string)\r\n\t},\r\n\t{\r\n\t\tevent_names: ['change', 'input'],\r\n\t\tfilter: (node: Element, _name: string) =>\r\n\t\t\tnode.name === 'input' && node.get_static_attribute_value('type') === 'range'\r\n\t},\r\n\r\n\t{\r\n\t\tevent_names: ['elementresize'],\r\n\t\tfilter: (_node: Element, name: string) =>\r\n\t\t\tregex_dimensions.test(name)\r\n\t},\r\n\r\n\t// media events\r\n\t{\r\n\t\tevent_names: ['timeupdate'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\t(name === 'currentTime' || name === 'played' || name === 'ended')\r\n\t},\r\n\t{\r\n\t\tevent_names: ['durationchange'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\tname === 'duration'\r\n\t},\r\n\t{\r\n\t\tevent_names: ['play', 'pause'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\tname === 'paused'\r\n\t},\r\n\t{\r\n\t\tevent_names: ['progress'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\tname === 'buffered'\r\n\t},\r\n\t{\r\n\t\tevent_names: ['loadedmetadata'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\t(name === 'buffered' || name === 'seekable')\r\n\t},\r\n\t{\r\n\t\tevent_names: ['volumechange'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\t(name === 'volume' || name === 'muted')\r\n\t},\r\n\t{\r\n\t\tevent_names: ['ratechange'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\tname === 'playbackRate'\r\n\t},\r\n\t{\r\n\t\tevent_names: ['seeking', 'seeked'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\t(name === 'seeking')\r\n\t},\r\n\t{\r\n\t\tevent_names: ['ended'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\tname === 'ended'\r\n\t},\r\n\t{\r\n\t\tevent_names: ['resize'],\r\n\t\tfilter: (node: Element, name: string) =>\r\n\t\t\tnode.is_media_node() &&\r\n\t\t\t(name === 'videoHeight' || name === 'videoWidth')\r\n\t},\r\n\r\n\t// details event\r\n\t{\r\n\t\tevent_names: ['toggle'],\r\n\t\tfilter: (node: Element, _name: string) =>\r\n\t\t\tnode.name === 'details'\r\n\t}\r\n];\r\n\r\nconst CHILD_DYNAMIC_ELEMENT_BLOCK = 'child_dynamic_element';\r\nconst regex_invalid_variable_identifier_characters = /[^a-zA-Z0-9_$]/g;\r\nconst regex_minus_signs = /-/g;\r\n\r\nexport default class ElementWrapper extends Wrapper {\r\n\tnode: Element;\r\n\tfragment: FragmentWrapper;\r\n\tattributes: Array<AttributeWrapper | StyleAttributeWrapper | SpreadAttributeWrapper>;\r\n\tbindings: Binding[];\r\n\tevent_handlers: EventHandler[];\r\n\tclass_dependencies: string[];\r\n\r\n\tselect_binding_dependencies?: Set<string>;\r\n\r\n\tvar: any;\r\n\tvoid: boolean;\r\n\r\n\tchild_dynamic_element_block?: Block = null;\r\n\tchild_dynamic_element?: ElementWrapper = null;\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: Element,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\r\n\t\tif (node.is_dynamic_element && block.type !== CHILD_DYNAMIC_ELEMENT_BLOCK) {\r\n\t\t\tthis.child_dynamic_element_block = block.child({\r\n\t\t\t\tcomment: create_debugging_comment(node, renderer.component),\r\n\t\t\t\tname: renderer.component.get_unique_name('create_dynamic_element'),\r\n\t\t\t\ttype: CHILD_DYNAMIC_ELEMENT_BLOCK\r\n\t\t\t});\r\n\t\t\trenderer.blocks.push(this.child_dynamic_element_block);\r\n\t\t\tthis.child_dynamic_element = new ElementWrapper(\r\n\t\t\t\trenderer,\r\n\t\t\t\tthis.child_dynamic_element_block,\r\n\t\t\t\tparent,\r\n\t\t\t\tnode,\r\n\t\t\t\tstrip_whitespace,\r\n\t\t\t\tnext_sibling\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tthis.var = {\r\n\t\t\ttype: 'Identifier',\r\n\t\t\tname: node.name.replace(regex_invalid_variable_identifier_characters, '_')\r\n\t\t};\r\n\r\n\t\tthis.void = is_void(node.name);\r\n\r\n\t\tthis.class_dependencies = [];\r\n\r\n\t\tif (this.node.children.length) {\r\n\t\t\tthis.node.lets.forEach(l => {\r\n\t\t\t\textract_names(l.value || l.name).forEach(name => {\r\n\t\t\t\t\trenderer.add_to_context(name, true);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.attributes = this.node.attributes.map(attribute => {\r\n\t\t\tif (attribute.name === 'style') {\r\n\t\t\t\treturn new StyleAttributeWrapper(this, block, attribute);\r\n\t\t\t}\r\n\t\t\tif (attribute.type === 'Spread') {\r\n\t\t\t\treturn new SpreadAttributeWrapper(this, block, attribute);\r\n\t\t\t}\r\n\t\t\treturn new AttributeWrapper(this, block, attribute);\r\n\t\t});\r\n\r\n\t\t// ordinarily, there'll only be one... but we need to handle\r\n\t\t// the rare case where an element can have multiple bindings,\r\n\t\t// e.g. <audio bind:paused bind:currentTime>\r\n\t\tthis.bindings = this.node.bindings.map(binding => new Binding(block, binding, this));\r\n\r\n\t\tthis.event_handlers = this.node.handlers.map(event_handler => new EventHandler(event_handler, this));\r\n\r\n\t\tif (node.intro || node.outro) {\r\n\t\t\tif (node.intro) block.add_intro(node.intro.is_local);\r\n\t\t\tif (node.outro) block.add_outro(node.outro.is_local);\r\n\t\t}\r\n\r\n\t\tif (node.animation) {\r\n\t\t\tblock.add_animation();\r\n\t\t}\r\n\r\n\t\tblock.add_dependencies(node.tag_expr.dependencies);\r\n\r\n\t\t// add directive and handler dependencies\r\n\t\t[node.animation, node.outro, ...node.actions, ...node.classes, ...node.styles].forEach(directive => {\r\n\t\t\tif (directive && directive.expression) {\r\n\t\t\t\tblock.add_dependencies(directive.expression.dependencies);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tnode.handlers.forEach(handler => {\r\n\t\t\tif (handler.expression) {\r\n\t\t\t\tblock.add_dependencies(handler.expression.dependencies);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (this.parent) {\r\n\t\t\tif (node.actions.length > 0 ||\r\n\t\t\t\tnode.animation ||\r\n\t\t\t\tnode.bindings.length > 0 ||\r\n\t\t\t\tnode.classes.length > 0 ||\r\n\t\t\t\tnode.intro || node.outro ||\r\n\t\t\t\tnode.handlers.length > 0 ||\r\n\t\t\t\tnode.styles.length > 0 ||\r\n\t\t\t\tthis.node.name === 'option' ||\r\n\t\t\t\tnode.tag_expr.dynamic_dependencies().length ||\r\n\t\t\t\trenderer.options.dev\r\n\t\t\t) {\r\n\t\t\t\tthis.parent.cannot_use_innerhtml(); // need to use add_location\r\n\t\t\t\tthis.parent.not_static_content();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.fragment = new FragmentWrapper(renderer, block, node.children, this, strip_whitespace, next_sibling);\r\n\t}\r\n\r\n\trender(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tif (this.child_dynamic_element) {\r\n\t\t\tthis.render_dynamic_element(block, parent_node, parent_nodes);\r\n\t\t} else {\r\n\t\t\tthis.render_element(block, parent_node, parent_nodes);\r\n\t\t}\r\n\t}\r\n\r\n\trender_dynamic_element(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tthis.child_dynamic_element.render(\r\n\t\t\tthis.child_dynamic_element_block,\r\n\t\t\tnull,\r\n\t\t\t(x`#nodes` as unknown) as Identifier\r\n\t\t);\r\n\r\n\t\tconst previous_tag = block.get_unique_name('previous_tag');\r\n\t\tconst tag = this.node.tag_expr.manipulate(block);\r\n\t\tblock.add_variable(previous_tag, tag);\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\t${this.renderer.options.dev && b`@validate_dynamic_element(${tag});`}\r\n\t\t\t${this.renderer.options.dev && this.node.children.length > 0 && b`@validate_void_dynamic_element(${tag});`}\r\n\t\t\tlet ${this.var} = ${tag} && ${this.child_dynamic_element_block.name}(#ctx);\r\n\t\t`);\r\n\r\n\t\tblock.chunks.create.push(b`\r\n\t\t\tif (${this.var}) ${this.var}.c();\r\n\t\t`);\r\n\r\n\t\tif (this.renderer.options.hydratable) {\r\n\t\t\tblock.chunks.claim.push(b`\r\n\t\t\t\tif (${this.var}) ${this.var}.l(${parent_nodes});\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.mount.push(b`\r\n\t\t\tif (${this.var}) ${this.var}.m(${parent_node || '#target'}, ${parent_node ? 'null' : '#anchor'});\r\n\t\t`);\r\n\r\n\t\tconst anchor = this.get_or_create_anchor(block, parent_node, parent_nodes);\r\n\t\tconst has_transitions = !!(this.node.intro || this.node.outro);\r\n\t\tconst not_equal = this.renderer.component.component_options.immutable ? x`@not_equal` : x`@safe_not_equal`;\r\n\r\n\t\tblock.chunks.update.push(b`\r\n\t\t\tif (${tag}) {\r\n\t\t\t\tif (!${previous_tag}) {\r\n\t\t\t\t\t${this.var} = ${this.child_dynamic_element_block.name}(#ctx);\r\n\t\t\t\t\t${this.var}.c();\r\n\t\t\t\t\t${has_transitions && b`@transition_in(${this.var})`}\r\n\t\t\t\t\t${this.var}.m(${this.get_update_mount_node(anchor)}, ${anchor});\r\n\t\t\t\t} else if (${not_equal}(${previous_tag}, ${tag})) {\r\n\t\t\t\t\t${this.var}.d(1);\r\n\t\t\t\t\t${this.renderer.options.dev && b`@validate_dynamic_element(${tag});`}\r\n\t\t\t\t\t${this.renderer.options.dev && this.node.children.length > 0 && b`@validate_void_dynamic_element(${tag});`}\r\n\t\t\t\t\t${this.var} = ${this.child_dynamic_element_block.name}(#ctx);\r\n\t\t\t\t\t${this.var}.c();\r\n\t\t\t\t\t${this.var}.m(${this.get_update_mount_node(anchor)}, ${anchor});\r\n\t\t\t\t} else {\r\n\t\t\t\t\t${this.var}.p(#ctx, #dirty);\r\n\t\t\t\t}\r\n\t\t\t} else if (${previous_tag}) {\r\n\t\t\t\t${\r\n\t\t\t\t\thas_transitions\r\n\t\t\t\t\t\t? b`\r\n\t\t\t\t\t\t\t@group_outros();\r\n\t\t\t\t\t\t\t@transition_out(${this.var}, 1, 1, () => {\r\n\t\t\t\t\t\t\t\t${this.var} = null;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t@check_outros();\r\n\t\t\t\t\t\t`\r\n\t\t\t\t\t\t: b`\r\n\t\t\t\t\t\t\t${this.var}.d(1);\r\n\t\t\t\t\t\t\t${this.var} = null;\r\n\t\t\t\t\t\t`\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t${previous_tag} = ${tag};\r\n\t\t`);\r\n\r\n\t\tif (this.child_dynamic_element_block.has_intros) {\r\n\t\t\tblock.chunks.intro.push(b`@transition_in(${this.var});`);\r\n\t\t}\r\n\r\n\t\tif (this.child_dynamic_element_block.has_outros) {\r\n\t\t\tblock.chunks.outro.push(b`@transition_out(${this.var});`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.destroy.push(b`if (${this.var}) ${this.var}.d(detaching)`);\r\n\r\n\t\tif (this.node.animation) {\r\n\t\t\tconst measurements = block.get_unique_name('measurements');\r\n\t\t\tblock.add_variable(measurements);\r\n\t\t\tblock.chunks.measure.push(b`${measurements} = ${this.var}.r()`);\r\n\t\t\tblock.chunks.fix.push(b`${this.var}.f();`);\r\n\t\t\tblock.chunks.animate.push(b`\r\n\t\t\t\t${this.var}.s(${measurements});\r\n\t\t\t\t${this.var}.a()\r\n\t\t\t`);\r\n\t\t}\r\n\t}\r\n\r\n\tis_dom_node() {\r\n\t\treturn super.is_dom_node() && !this.child_dynamic_element;\r\n\t}\r\n\r\n\trender_element(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\r\n\t\tconst { renderer } = this;\r\n\r\n\t\tif (this.node.name === 'noscript') return;\r\n\r\n\t\tconst node = this.var;\r\n\t\tconst nodes = parent_nodes && block.get_unique_name(`${this.var.name}_nodes`); // if we're in unclaimable territory, i.e. <head>, parent_nodes is null\r\n\t\tconst children = x`@children(${this.node.name === 'template' ? x`${node}.content` : node})`;\r\n\r\n\t\tblock.add_variable(node);\r\n\t\tconst render_statement = this.get_render_statement(block);\r\n\t\tblock.chunks.create.push(\r\n\t\t\tb`${node} = ${render_statement};`\r\n\t\t);\r\n\r\n\t\tif (renderer.options.hydratable) {\r\n\t\t\tif (parent_nodes) {\r\n\t\t\t\tblock.chunks.claim.push(b`\r\n\t\t\t\t\t${node} = ${this.get_claim_statement(block, parent_nodes)};\r\n\t\t\t\t`);\r\n\r\n\t\t\t\tif (!this.void && this.node.children.length > 0) {\r\n\t\t\t\t\tblock.chunks.claim.push(b`\r\n\t\t\t\t\t\tvar ${nodes} = ${children};\r\n\t\t\t\t\t`);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.claim.push(\r\n\t\t\t\t\tb`${node} = ${render_statement};`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (parent_node) {\r\n\t\t\tconst append = b`@append(${parent_node}, ${node});`;\r\n\t\t\t((append[0] as ExpressionStatement).expression as CallExpression).callee.loc = {\r\n\t\t\t\tstart: this.renderer.locate(this.node.start),\r\n\t\t\t\tend: this.renderer.locate(this.node.end)\r\n\t\t\t};\r\n\t\t\tblock.chunks.mount.push(append);\r\n\r\n\t\t\tif (is_head(parent_node)) {\r\n\t\t\t\tblock.chunks.destroy.push(b`@detach(${node});`);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst insert = b`@insert(#target, ${node}, #anchor);`;\r\n\t\t\t((insert[0] as ExpressionStatement).expression as CallExpression).callee.loc = {\r\n\t\t\t\tstart: this.renderer.locate(this.node.start),\r\n\t\t\t\tend: this.renderer.locate(this.node.end)\r\n\t\t\t};\r\n\t\t\tblock.chunks.mount.push(insert);\r\n\r\n\t\t\t// TODO we eventually need to consider what happens to elements\r\n\t\t\t// that belong to the same outgroup as an outroing element...\r\n\t\t\tblock.chunks.destroy.push(b`if (detaching) @detach(${node});`);\r\n\t\t}\r\n\r\n\t\t// insert static children with textContent or innerHTML\r\n\t\t// skip textcontent for <template>.  append nodes to TemplateElement.content instead\r\n\t\tconst can_use_textcontent = this.can_use_textcontent();\r\n\t\tconst is_template = this.node.name === 'template';\r\n\t\tconst is_template_with_text_content = is_template && can_use_textcontent;\r\n\r\n\t\tif (!is_template_with_text_content && !this.node.namespace && (this.can_use_innerhtml || can_use_textcontent) && this.fragment.nodes.length > 0) {\r\n\t\t\tif (this.fragment.nodes.length === 1 && this.fragment.nodes[0].node.type === 'Text') {\r\n\t\t\t\tblock.chunks.create.push(\r\n\t\t\t\t\tb`${node}.textContent = ${string_literal((this.fragment.nodes[0] as TextWrapper).data)};`\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\tconst state = {\r\n\t\t\t\t\tquasi: {\r\n\t\t\t\t\t\ttype: 'TemplateElement',\r\n\t\t\t\t\t\tvalue: { raw: '' }\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\r\n\t\t\t\tconst literal = {\r\n\t\t\t\t\ttype: 'TemplateLiteral',\r\n\t\t\t\t\texpressions: [],\r\n\t\t\t\t\tquasis: []\r\n\t\t\t\t};\r\n\r\n\t\t\t\tconst can_use_raw_text = !this.can_use_innerhtml && can_use_textcontent;\r\n\t\t\t\tto_html((this.fragment.nodes as unknown as Array<ElementWrapper | TextWrapper>), block, literal, state, can_use_raw_text);\r\n\t\t\t\tliteral.quasis.push(state.quasi);\r\n\r\n\t\t\t\tblock.chunks.create.push(\r\n\t\t\t\t\tb`${node}.${this.can_use_innerhtml ? 'innerHTML' : 'textContent'} = ${literal};`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.fragment.nodes.forEach((child: Wrapper) => {\r\n\t\t\t\tchild.render(\r\n\t\t\t\t\tblock,\r\n\t\t\t\t\tis_template ? x`${node}.content` : node,\r\n\t\t\t\t\tnodes\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst event_handler_or_binding_uses_context = (\r\n\t\t\tthis.bindings.some(binding => binding.handler.uses_context) ||\r\n\t\t\tthis.node.handlers.some(handler => handler.uses_context) ||\r\n\t\t\tthis.node.actions.some(action => action.uses_context)\r\n\t\t);\r\n\r\n\t\tif (event_handler_or_binding_uses_context) {\r\n\t\t\tblock.maintain_context = true;\r\n\t\t}\r\n\r\n\t\tthis.add_attributes(block);\r\n\t\tthis.add_directives_in_order(block);\r\n\t\tthis.add_transitions(block);\r\n\t\tthis.add_animation(block);\r\n\t\tthis.add_classes(block);\r\n\t\tthis.add_styles(block);\r\n\t\tthis.add_manual_style_scoping(block);\r\n\r\n\t\tif (nodes && this.renderer.options.hydratable && !this.void) {\r\n\t\t\tblock.chunks.claim.push(\r\n\t\t\t\tb`${this.node.children.length > 0 ? nodes : children}.forEach(@detach);`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (renderer.options.dev) {\r\n\t\t\tconst loc = renderer.locate(this.node.start);\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`@add_location(${this.var}, ${renderer.file_var}, ${loc.line - 1}, ${loc.column}, ${this.node.start});`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tblock.renderer.dirty(this.node.tag_expr.dynamic_dependencies());\r\n\t}\r\n\r\n\tcan_use_textcontent() {\r\n\t\treturn this.is_static_content && this.fragment.nodes.every(node => node.node.type === 'Text' || node.node.type === 'MustacheTag');\r\n\t}\r\n\r\n\tget_render_statement(block: Block) {\r\n\t\tconst { name, namespace, tag_expr } = this.node;\r\n\t\tconst reference = tag_expr.manipulate(block);\r\n\r\n\t\tif (namespace === namespaces.svg) {\r\n\t\t\treturn x`@svg_element(${reference})`;\r\n\t\t}\r\n\r\n\t\tif (namespace) {\r\n\t\t\treturn x`@_document.createElementNS(\"${namespace}\", \"${name}\")`;\r\n\t\t}\r\n\r\n\t\tconst is: AttributeWrapper = this.attributes.find(attr => attr.node.name === 'is') as any;\r\n\t\tif (is) {\r\n\t\t\treturn x`@element_is(\"${name}\", ${is.render_chunks(block).reduce((lhs, rhs) => x`${lhs} + ${rhs}`)})`;\r\n\t\t}\r\n\r\n\t\treturn x`@element(${reference})`;\r\n\t}\r\n\r\n\tget_claim_statement(block: Block, nodes: Identifier) {\r\n\t\tconst attributes = this.attributes\r\n\t\t\t.filter((attr) => !(attr instanceof SpreadAttributeWrapper) && !attr.property_name)\r\n\t\t\t.map((attr) => p`${(attr as StyleAttributeWrapper | AttributeWrapper).name}: true`);\r\n\r\n\t\tlet reference: string | ReturnType<typeof x>;\r\n\t\tif (this.node.tag_expr.node.type === 'Literal') {\r\n\t\t\tif (this.node.namespace) {\r\n\t\t\t\treference = `\"${this.node.tag_expr.node.value}\"`;\r\n\t\t\t} else {\r\n\t\t\t\treference = `\"${(this.node.tag_expr.node.value as String || '').toUpperCase()}\"`;\r\n\t\t\t}\r\n\t\t} else if (this.node.namespace) {\r\n\t\t\treference = x`${this.node.tag_expr.manipulate(block)}`;\r\n\t\t} else {\r\n\t\t\treference = x`(${this.node.tag_expr.manipulate(block)} || 'null').toUpperCase()`;\r\n\t\t}\r\n\r\n\t\tif (this.node.namespace === namespaces.svg) {\r\n\t\t\treturn x`@claim_svg_element(${nodes}, ${reference}, { ${attributes} })`;\r\n\t\t} else {\r\n\t\t\treturn x`@claim_element(${nodes}, ${reference}, { ${attributes} })`;\r\n\t\t}\r\n\t}\r\n\r\n\tadd_directives_in_order(block: Block) {\r\n\t\ttype OrderedAttribute = EventHandler | BindingGroup | Binding | Action;\r\n\r\n\t\tconst binding_groups = events\r\n\t\t\t.map(event => ({\r\n\t\t\t\tevents: event.event_names,\r\n\t\t\t\tbindings: this.bindings\r\n\t\t\t\t\t.filter(binding => binding.node.name !== 'this')\r\n\t\t\t\t\t.filter(binding => event.filter(this.node, binding.node.name))\r\n\t\t\t}))\r\n\t\t\t.filter(group => group.bindings.length);\r\n\r\n\t\tconst this_binding = this.bindings.find(b => b.node.name === 'this');\r\n\r\n\t\tfunction getOrder(item: OrderedAttribute) {\r\n\t\t\tif (item instanceof EventHandler) {\r\n\t\t\t\treturn item.node.start;\r\n\t\t\t} else if (item instanceof Binding) {\r\n\t\t\t\treturn item.node.start;\r\n\t\t\t} else if (item instanceof Action) {\r\n\t\t\t\treturn item.start;\r\n\t\t\t} else {\r\n\t\t\t\treturn item.bindings[0].node.start;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t([\r\n\t\t\t...binding_groups,\r\n\t\t\t...this.event_handlers,\r\n\t\t\tthis_binding,\r\n\t\t\t...this.node.actions\r\n\t\t] as OrderedAttribute[])\r\n\t\t\t.filter(Boolean)\r\n\t\t\t.sort((a, b) => getOrder(a) - getOrder(b))\r\n\t\t\t.forEach(item => {\r\n\t\t\t\tif (item instanceof EventHandler) {\r\n\t\t\t\t\tadd_event_handler(block, this.var, item);\r\n\t\t\t\t} else if (item instanceof Binding) {\r\n\t\t\t\t\tthis.add_this_binding(block, item);\r\n\t\t\t\t} else if (item instanceof Action) {\r\n\t\t\t\t\tadd_action(block, this.var, item);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.add_bindings(block, item);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t}\r\n\r\n\tadd_bindings(block: Block, binding_group: BindingGroup) {\r\n\t\tconst { renderer } = this;\r\n\r\n\t\tif (binding_group.bindings.length === 0) return;\r\n\r\n\t\trenderer.component.has_reactive_assignments = true;\r\n\r\n\t\tconst lock = binding_group.bindings.some(binding => binding.needs_lock) ?\r\n\t\t\tblock.get_unique_name(`${this.var.name}_updating`) :\r\n\t\t\tnull;\r\n\r\n\t\tif (lock) block.add_variable(lock, x`false`);\r\n\r\n\t\tconst handler = renderer.component.get_unique_name(`${this.var.name}_${binding_group.events.join('_')}_handler`);\r\n\t\trenderer.add_to_context(handler.name);\r\n\r\n\t\t// TODO figure out how to handle locks\r\n\t\tconst needs_lock = binding_group.bindings.some(binding => binding.needs_lock);\r\n\r\n\t\tconst dependencies: Set<string> = new Set();\r\n\t\tconst contextual_dependencies: Set<string> = new Set();\r\n\r\n\t\tbinding_group.bindings.forEach(binding => {\r\n\t\t\t// TODO this is a mess\r\n\t\t\tadd_to_set(dependencies, binding.get_update_dependencies());\r\n\t\t\tadd_to_set(contextual_dependencies, binding.handler.contextual_dependencies);\r\n\r\n\t\t\tbinding.render(block, lock);\r\n\t\t});\r\n\r\n\t\t// media bindings — awkward special case. The native timeupdate events\r\n\t\t// fire too infrequently, so we need to take matters into our\r\n\t\t// own hands\r\n\t\tlet animation_frame: Identifier | undefined;\r\n\t\tif (binding_group.events[0] === 'timeupdate') {\r\n\t\t\tanimation_frame = block.get_unique_name(`${this.var.name}_animationframe`);\r\n\t\t\tblock.add_variable(animation_frame);\r\n\t\t}\r\n\r\n\t\tconst has_local_function = contextual_dependencies.size > 0 || needs_lock || animation_frame;\r\n\r\n\t\tlet callee = renderer.reference(handler);\r\n\r\n\t\t// TODO dry this out — similar code for event handlers and component bindings\r\n\t\tif (has_local_function) {\r\n\t\t\tconst args = Array.from(contextual_dependencies).map(name => renderer.reference(name));\r\n\r\n\t\t\t// need to create a block-local function that calls an instance-level function\r\n\t\t\tif (animation_frame) {\r\n\t\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t\tfunction ${handler}() {\r\n\t\t\t\t\t\t@_cancelAnimationFrame(${animation_frame});\r\n\t\t\t\t\t\tif (!${this.var}.paused) {\r\n\t\t\t\t\t\t\t${animation_frame} = @raf(${handler});\r\n\t\t\t\t\t\t\t${needs_lock && b`${lock} = true;`}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t${callee}.call(${this.var}, ${args});\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t\tfunction ${handler}() {\r\n\t\t\t\t\t\t${needs_lock && b`${lock} = true;`}\r\n\t\t\t\t\t\t${callee}.call(${this.var}, ${args});\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\r\n\t\t\tcallee = handler;\r\n\t\t}\r\n\r\n\t\tconst params = Array.from(contextual_dependencies).map(name => ({\r\n\t\t\ttype: 'Identifier',\r\n\t\t\tname\r\n\t\t}));\r\n\r\n\t\tthis.renderer.component.partly_hoisted.push(b`\r\n\t\t\tfunction ${handler}(${params}) {\r\n\t\t\t\t${binding_group.bindings.map(b => b.handler.mutation)}\r\n\t\t\t\t${Array.from(dependencies)\r\n\t\t\t\t\t.filter(dep => dep[0] !== '$')\r\n\t\t\t\t\t.filter(dep => !contextual_dependencies.has(dep))\r\n\t\t\t\t\t.map(dep => b`${this.renderer.invalidate(dep)};`)}\r\n\t\t\t}\r\n\t\t`);\r\n\r\n\t\tbinding_group.events.forEach(name => {\r\n\t\t\tif (name === 'elementresize') {\r\n\t\t\t\t// special case\r\n\t\t\t\tconst resize_listener = block.get_unique_name(`${this.var.name}_resize_listener`);\r\n\t\t\t\tblock.add_variable(resize_listener);\r\n\r\n\t\t\t\tblock.chunks.mount.push(\r\n\t\t\t\t\tb`${resize_listener} = @add_resize_listener(${this.var}, ${callee}.bind(${this.var}));`\r\n\t\t\t\t);\r\n\r\n\t\t\t\tblock.chunks.destroy.push(\r\n\t\t\t\t\tb`${resize_listener}();`\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\tblock.event_listeners.push(\r\n\t\t\t\t\tx`@listen(${this.var}, \"${name}\", ${callee})`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst some_initial_state_is_undefined = binding_group.bindings\r\n\t\t\t.map(binding => x`${binding.snippet} === void 0`)\r\n\t\t\t.reduce((lhs, rhs) => x`${lhs} || ${rhs}`);\r\n\r\n\t\tconst should_initialise = (\r\n\t\t\tthis.node.name === 'select' ||\r\n\t\t\tbinding_group.bindings.find(binding => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\tbinding.node.name === 'indeterminate' ||\r\n\t\t\t\t\tbinding.node.name === 'textContent' ||\r\n\t\t\t\t\tbinding.node.name === 'innerHTML' ||\r\n\t\t\t\t\tbinding.is_readonly_media_attribute()\r\n\t\t\t\t);\r\n\t\t\t})\r\n\t\t);\r\n\r\n\t\tif (should_initialise) {\r\n\t\t\tconst callback = has_local_function ? handler : x`() => ${callee}.call(${this.var})`;\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`if (${some_initial_state_is_undefined}) @add_render_callback(${callback});`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (binding_group.events[0] === 'elementresize') {\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`@add_render_callback(() => ${callee}.call(${this.var}));`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (lock) {\r\n\t\t\tblock.chunks.update.push(b`${lock} = false;`);\r\n\t\t}\r\n\t}\r\n\r\n\tadd_this_binding(block: Block, this_binding: Binding) {\r\n\t\tconst { renderer } = this;\r\n\r\n\t\trenderer.component.has_reactive_assignments = true;\r\n\r\n\t\tconst binding_callback = bind_this(renderer.component, block, this_binding, this.var);\r\n\t\tblock.chunks.mount.push(binding_callback);\r\n\t}\r\n\r\n\tadd_attributes(block: Block) {\r\n\t\t// Get all the class dependencies first\r\n\t\tthis.attributes.forEach((attribute) => {\r\n\t\t\tif (attribute.node.name === 'class') {\r\n\t\t\t\tconst dependencies = attribute.node.get_dependencies();\r\n\t\t\t\tpush_array(this.class_dependencies, dependencies);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (this.node.attributes.some(attr => attr.is_spread) || this.node.is_dynamic_element) {\r\n\t\t\tthis.add_spread_attributes(block);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.attributes.forEach((attribute) => {\r\n\t\t\tattribute.render(block);\r\n\t\t});\r\n\t}\r\n\r\n\tadd_spread_attributes(block: Block) {\r\n\t\tconst levels = block.get_unique_name(`${this.var.name}_levels`);\r\n\t\tconst data = block.get_unique_name(`${this.var.name}_data`);\r\n\r\n\t\tconst initial_props = [];\r\n\t\tconst updates = [];\r\n\r\n\t\tthis.attributes\r\n\t\t\t.forEach(attr => {\r\n\t\t\t\tconst dependencies = attr.node.get_dependencies();\r\n\r\n\t\t\t\tconst condition = dependencies.length > 0\r\n\t\t\t\t\t? block.renderer.dirty(dependencies)\r\n\t\t\t\t\t: null;\r\n\r\n\t\t\t\tif (attr instanceof SpreadAttributeWrapper) {\r\n\t\t\t\t\tconst snippet = attr.node.expression.manipulate(block);\r\n\r\n\t\t\t\t\tinitial_props.push(snippet);\r\n\r\n\t\t\t\t\tupdates.push(condition ? x`${condition} && ${snippet}` : snippet);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst name = attr.property_name || attr.name;\r\n\t\t\t\t\tinitial_props.push(x`{ ${name}: ${attr.get_init(block, attr.get_value(block))} }`);\r\n\t\t\t\t\tconst snippet = x`{ ${name}: ${attr.should_cache ? attr.last : attr.get_value(block)} }`;\r\n\r\n\t\t\t\t\tupdates.push(condition ? x`${attr.get_dom_update_conditions(block, condition)} && ${snippet}` : snippet);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\tlet ${levels} = [${initial_props}];\r\n\r\n\t\t\tlet ${data} = {};\r\n\t\t\tfor (let #i = 0; #i < ${levels}.length; #i += 1) {\r\n\t\t\t\t${data} = @assign(${data}, ${levels}[#i]);\r\n\t\t\t}\r\n\t\t`);\r\n\r\n\t\tconst fn = this.node.namespace === namespaces.svg ? x`@set_svg_attributes` : x`@set_attributes`;\r\n\r\n\t\tif (this.node.is_dynamic_element) {\r\n\t\t\t// call attribute bindings for custom element if tag is custom element\r\n\t\t\tconst tag = this.node.tag_expr.manipulate(block);\r\n\t\t\tconst attr_update = this.node.namespace === namespaces.svg\r\n\t\t\t\t? b`${fn}(${this.var}, ${data});`\r\n\t\t\t\t: b`\r\n\t\t\t\t\tif (/-/.test(${tag})) {\r\n\t\t\t\t\t\t@set_custom_element_data_map(${this.var}, ${data});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t${fn}(${this.var}, ${data});\r\n\t\t\t\t\t}`;\r\n\t\t\tblock.chunks.hydrate.push(attr_update);\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t${data} = @get_spread_update(${levels}, [${updates}]);\r\n\t\t\t\t${attr_update}`\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`${fn}(${this.var}, ${data});`\r\n\t\t\t);\r\n\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t${fn}(${this.var}, ${data} = @get_spread_update(${levels}, [\r\n\t\t\t\t\t${updates}\r\n\t\t\t\t]));\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\t// handle edge cases for elements\r\n\t\tif (this.node.name === 'select') {\r\n\t\t\tconst dependencies = new Set<string>();\r\n\t\t\tfor (const attr of this.attributes) {\r\n\t\t\t\tfor (const dep of attr.node.dependencies) {\r\n\t\t\t\t\tdependencies.add(dep);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.mount.push(b`\r\n\t\t\t\t(${data}.multiple ? @select_options : @select_option)(${this.var}, ${data}.value);\r\n\t\t\t`);\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${block.renderer.dirty(Array.from(dependencies))} && 'value' in ${data}) (${data}.multiple ? @select_options : @select_option)(${this.var}, ${data}.value);\r\n\t\t\t`);\r\n\t\t} else if (this.node.name === 'input' && this.attributes.find(attr => attr.node.name === 'value')) {\r\n\t\t\tconst type = this.node.get_static_attribute_value('type');\r\n\t\t\tif (type === null || type === '' || type === 'text' || type === 'email' || type === 'password') {\r\n\t\t\t\tblock.chunks.mount.push(b`\r\n\t\t\t\t\t${this.var}.value = ${data}.value;\r\n\t\t\t\t`);\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif ('value' in ${data}) {\r\n\t\t\t\t\t\t${this.var}.value = ${data}.value;\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (['button', 'input', 'keygen', 'select', 'textarea'].includes(this.node.name)) {\r\n\t\t\tblock.chunks.mount.push(b`\r\n\t\t\t\tif (${this.var}.autofocus) ${this.var}.focus();\r\n\t\t\t`);\r\n\t\t}\r\n\t}\r\n\r\n\tadd_transitions(block: Block) {\r\n\t\tconst { intro, outro } = this.node;\r\n\t\tif (!intro && !outro) return;\r\n\r\n\t\tif (intro === outro) {\r\n\t\t\t// bidirectional transition\r\n\t\t\tconst name = block.get_unique_name(`${this.var.name}_transition`);\r\n\t\t\tconst snippet = intro.expression\r\n\t\t\t\t? intro.expression.manipulate(block)\r\n\t\t\t\t: x`{}`;\r\n\r\n\t\t\tblock.add_variable(name);\r\n\r\n\t\t\tconst fn = this.renderer.reference(intro.name);\r\n\r\n\t\t\tconst intro_block = b`\r\n\t\t\t\t@add_render_callback(() => {\r\n\t\t\t\t\tif (!${name}) ${name} = @create_bidirectional_transition(${this.var}, ${fn}, ${snippet}, true);\r\n\t\t\t\t\t${name}.run(1);\r\n\t\t\t\t});\r\n\t\t\t`;\r\n\r\n\t\t\tconst outro_block = b`\r\n\t\t\t\tif (!${name}) ${name} = @create_bidirectional_transition(${this.var}, ${fn}, ${snippet}, false);\r\n\t\t\t\t${name}.run(0);\r\n\t\t\t`;\r\n\r\n\t\t\tif (intro.is_local) {\r\n\t\t\t\tblock.chunks.intro.push(b`\r\n\t\t\t\t\tif (#local) {\r\n\t\t\t\t\t\t${intro_block}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\r\n\t\t\t\tblock.chunks.outro.push(b`\r\n\t\t\t\t\tif (#local) {\r\n\t\t\t\t\t\t${outro_block}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.intro.push(intro_block);\r\n\t\t\t\tblock.chunks.outro.push(outro_block);\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.destroy.push(b`if (detaching && ${name}) ${name}.end();`);\r\n\t\t} else {\r\n\t\t\tconst intro_name = intro && block.get_unique_name(`${this.var.name}_intro`);\r\n\t\t\tconst outro_name = outro && block.get_unique_name(`${this.var.name}_outro`);\r\n\r\n\t\t\tif (intro) {\r\n\t\t\t\tblock.add_variable(intro_name);\r\n\t\t\t\tconst snippet = intro.expression\r\n\t\t\t\t\t? intro.expression.manipulate(block)\r\n\t\t\t\t\t: x`{}`;\r\n\r\n\t\t\t\tconst fn = this.renderer.reference(intro.name);\r\n\r\n\t\t\t\tlet intro_block: Node[];\r\n\r\n\t\t\t\tif (outro) {\r\n\t\t\t\t\tintro_block = b`\r\n\t\t\t\t\t\t@add_render_callback(() => {\r\n\t\t\t\t\t\t\tif (${outro_name}) ${outro_name}.end(1);\r\n\t\t\t\t\t\t\t${intro_name} = @create_in_transition(${this.var}, ${fn}, ${snippet});\r\n\t\t\t\t\t\t\t${intro_name}.start();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t`;\r\n\r\n\t\t\t\t\tblock.chunks.outro.push(b`if (${intro_name}) ${intro_name}.invalidate();`);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tintro_block = b`\r\n\t\t\t\t\t\tif (!${intro_name}) {\r\n\t\t\t\t\t\t\t@add_render_callback(() => {\r\n\t\t\t\t\t\t\t\t${intro_name} = @create_in_transition(${this.var}, ${fn}, ${snippet});\r\n\t\t\t\t\t\t\t\t${intro_name}.start();\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t`;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (intro.is_local) {\r\n\t\t\t\t\tintro_block = b`\r\n\t\t\t\t\t\tif (#local) {\r\n\t\t\t\t\t\t\t${intro_block}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t`;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tblock.chunks.intro.push(intro_block);\r\n\t\t\t}\r\n\r\n\t\t\tif (outro) {\r\n\t\t\t\tblock.add_variable(outro_name);\r\n\t\t\t\tconst snippet = outro.expression\r\n\t\t\t\t\t? outro.expression.manipulate(block)\r\n\t\t\t\t\t: x`{}`;\r\n\r\n\t\t\t\tconst fn = this.renderer.reference(outro.name);\r\n\r\n\t\t\t\tif (!intro) {\r\n\t\t\t\t\tblock.chunks.intro.push(b`\r\n\t\t\t\t\t\tif (${outro_name}) ${outro_name}.end(1);\r\n\t\t\t\t\t`);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// TODO hide elements that have outro'd (unless they belong to a still-outroing\r\n\t\t\t\t// group) prior to their removal from the DOM\r\n\t\t\t\tlet outro_block = b`\r\n\t\t\t\t\t${outro_name} = @create_out_transition(${this.var}, ${fn}, ${snippet});\r\n\t\t\t\t`;\r\n\r\n\t\t\t\tif (outro.is_local) {\r\n\t\t\t\t\toutro_block = b`\r\n\t\t\t\t\t\tif (#local) {\r\n\t\t\t\t\t\t\t${outro_block}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t`;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tblock.chunks.outro.push(outro_block);\r\n\r\n\t\t\t\tblock.chunks.destroy.push(b`if (detaching && ${outro_name}) ${outro_name}.end();`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((intro && intro.expression && intro.expression.dependencies.size) || (outro && outro.expression && outro.expression.dependencies.size)) {\r\n\t\t\tblock.maintain_context = true;\r\n\t\t}\r\n\t}\r\n\r\n\tadd_animation(block: Block) {\r\n\t\tif (!this.node.animation) return;\r\n\r\n\t\tconst { outro } = this.node;\r\n\r\n\t\tconst rect = block.get_unique_name('rect');\r\n\t\tconst stop_animation = block.get_unique_name('stop_animation');\r\n\r\n\t\tblock.add_variable(rect);\r\n\t\tblock.add_variable(stop_animation, x`@noop`);\r\n\r\n\t\tblock.chunks.measure.push(b`\r\n\t\t\t${rect} = ${this.var}.getBoundingClientRect();\r\n\t\t`);\r\n\r\n\t\tif (block.type === CHILD_DYNAMIC_ELEMENT_BLOCK) {\r\n\t\t\tblock.chunks.measure.push(b`return ${rect}`);\r\n\t\t\tblock.chunks.restore_measurements.push(b`${rect} = #measurement;`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.fix.push(b`\r\n\t\t\t@fix_position(${this.var});\r\n\t\t\t${stop_animation}();\r\n\t\t\t${outro && b`@add_transform(${this.var}, ${rect});`}\r\n\t\t`);\r\n\r\n\t\tlet params: Node | ReturnType<typeof x>;\r\n\t\tif (this.node.animation.expression) {\r\n\t\t\tparams = this.node.animation.expression.manipulate(block);\r\n\r\n\t\t\tif (this.node.animation.expression.dynamic_dependencies().length) {\r\n\t\t\t\t// if `params` is dynamic, calculate params ahead of time in the `.r()` method\r\n\t\t\t\tconst params_var = block.get_unique_name('params');\r\n\t\t\t\tblock.add_variable(params_var);\r\n\r\n\t\t\t\tblock.chunks.measure.push(b`${params_var} = ${params};`);\r\n\t\t\t\tparams = params_var;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tparams = x`{}`;\r\n\t\t}\r\n\r\n\t\tconst name = this.renderer.reference(this.node.animation.name);\r\n\r\n\t\tblock.chunks.animate.push(b`\r\n\t\t\t${stop_animation}();\r\n\t\t\t${stop_animation} = @create_animation(${this.var}, ${rect}, ${name}, ${params});\r\n\t\t`);\r\n\t}\r\n\r\n\tadd_classes(block: Block) {\r\n\t\tconst has_spread = this.node.attributes.some(attr => attr.is_spread);\r\n\t\tthis.node.classes.forEach(class_directive => {\r\n\t\t\tconst { expression, name } = class_directive;\r\n\t\t\tlet snippet: Node | string;\r\n\t\t\tlet dependencies: Set<string>;\r\n\t\t\tif (expression) {\r\n\t\t\t\tsnippet = expression.manipulate(block);\r\n\t\t\t\tdependencies = expression.dependencies;\r\n\t\t\t} else {\r\n\t\t\t\tsnippet = name;\r\n\t\t\t\tdependencies = new Set([name]);\r\n\t\t\t}\r\n\t\t\tconst updater = b`@toggle_class(${this.var}, \"${name}\", ${snippet});`;\r\n\r\n\t\t\tblock.chunks.hydrate.push(updater);\r\n\r\n\t\t\tif (has_spread || this.node.is_dynamic_element) {\r\n\t\t\t\tblock.chunks.update.push(updater);\r\n\t\t\t} else if ((dependencies && dependencies.size > 0) || this.class_dependencies.length) {\r\n\t\t\t\tconst all_dependencies = this.class_dependencies.concat(...dependencies);\r\n\t\t\t\tlet condition = block.renderer.dirty(all_dependencies);\r\n\t\t\t\tif (block.has_outros) {\r\n\t\t\t\t\tcondition = x`!#current || ${condition}`;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If all of the dependencies are non-dynamic (don't get updated) then there is no reason\r\n\t\t\t\t// to add an updater for this.\r\n\t\t\t\tconst any_dynamic_dependencies = all_dependencies.some((dep) => {\r\n\t\t\t\t\tconst variable = this.renderer.component.var_lookup.get(dep);\r\n\t\t\t\t\treturn !variable || is_dynamic(variable);\r\n\t\t\t\t});\r\n\t\t\t\tif (any_dynamic_dependencies) {\r\n\t\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\t\tif (${condition}) {\r\n\t\t\t\t\t\t\t${updater}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t`);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tadd_styles(block: Block) {\r\n\t\tconst has_spread = this.node.attributes.some(attr => attr.is_spread);\r\n\t\tthis.node.styles.forEach((style_directive) => {\r\n\t\t\tconst { name, expression, should_cache, important } = style_directive;\r\n\r\n\t\t\tconst snippet = expression.manipulate(block);\r\n\t\t\tlet cached_snippet: Identifier | undefined;\r\n\t\t\tif (should_cache) {\r\n\t\t\t\tcached_snippet = block.get_unique_name(`style_${name.replace(regex_minus_signs, '_')}`);\r\n\t\t\t\tblock.add_variable(cached_snippet, snippet);\r\n\t\t\t}\r\n\r\n\t\t\tconst updater = b`@set_style(${this.var}, \"${name}\", ${should_cache ? cached_snippet : snippet}, ${important ? 1 : null})`;\r\n\r\n\t\t\tblock.chunks.hydrate.push(updater);\r\n\r\n\t\t\tconst dependencies = expression.dynamic_dependencies();\r\n\t\t\tif (has_spread) {\r\n\t\t\t\tblock.chunks.update.push(updater);\r\n\t\t\t} else if (dependencies.length > 0) {\r\n\t\t\t\tif (should_cache) {\r\n\t\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\t\t\tif (${block.renderer.dirty(dependencies)} && (${cached_snippet} !== (${cached_snippet} = ${snippet}))) {\r\n\t\t\t\t\t\t\t\t${updater}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t`);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\t\tif (${block.renderer.dirty(dependencies)}) {\r\n\t\t\t\t\t\t\t${updater}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t`);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tadd_manual_style_scoping(block: Block) {\r\n\t\tif (this.node.needs_manual_style_scoping) {\r\n\t\t\tconst updater = b`@toggle_class(${this.var}, \"${this.node.component.stylesheet.id}\", true);`;\r\n\t\t\tblock.chunks.hydrate.push(updater);\r\n\t\t\tblock.chunks.update.push(updater);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nconst regex_backticks = /`/g;\r\nconst regex_dollar_signs = /\\$/g;\r\n\r\nfunction to_html(wrappers: Array<ElementWrapper | TextWrapper | MustacheTagWrapper | RawMustacheTagWrapper>, block: Block, literal: any, state: any, can_use_raw_text?: boolean) {\r\n\twrappers.forEach(wrapper => {\r\n\t\tif (wrapper instanceof TextWrapper) {\r\n\t\t\t// Don't add the <pre>/<textarea> newline logic here because pre/textarea.innerHTML\r\n\t\t\t// would keep the leading newline, too, only someParent.innerHTML = '..<pre/textarea>..' won't\r\n\r\n\t\t\tif ((wrapper as TextWrapper).use_space()) state.quasi.value.raw += ' ';\r\n\r\n\t\t\tconst parent = wrapper.node.parent as Element;\r\n\r\n\t\t\tconst raw = parent && (\r\n\t\t\t\tparent.name === 'script' ||\r\n\t\t\t\tparent.name === 'style' ||\r\n\t\t\t\tcan_use_raw_text\r\n\t\t\t);\r\n\r\n\t\t\tstate.quasi.value.raw += (raw ? wrapper.data : escape_html(wrapper.data))\r\n\t\t\t\t.replace(regex_backslashes, '\\\\\\\\')\r\n\t\t\t\t.replace(regex_backticks, '\\\\`')\r\n\t\t\t\t.replace(regex_dollar_signs, '\\\\$');\r\n\t\t} else if (wrapper instanceof MustacheTagWrapper || wrapper instanceof RawMustacheTagWrapper) {\r\n\t\t\tliteral.quasis.push(state.quasi);\r\n\t\t\tliteral.expressions.push(wrapper.node.expression.manipulate(block));\r\n\t\t\tstate.quasi = {\r\n\t\t\t\ttype: 'TemplateElement',\r\n\t\t\t\tvalue: { raw: '' }\r\n\t\t\t};\r\n\t\t} else if (wrapper.node.name === 'noscript') {\r\n\t\t\t// do nothing\r\n\t\t} else {\r\n\t\t\t// element\r\n\t\t\tstate.quasi.value.raw += `<${wrapper.node.name}`;\r\n\r\n\t\t\tconst is_empty_textarea = wrapper.node.name === 'textarea' && wrapper.fragment.nodes.length === 0;\r\n\r\n\t\t\t(wrapper as ElementWrapper).attributes.forEach((attr: AttributeWrapper) => {\r\n\t\t\t\tif (is_empty_textarea && attr.node.name === 'value') {\r\n\t\t\t\t\t// The value attribute of <textarea> renders as content.\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstate.quasi.value.raw += ` ${fix_attribute_casing(attr.node.name)}=\"`;\r\n\r\n\t\t\t\tto_html_for_attr_value(attr, block, literal, state);\r\n\r\n\t\t\t\tstate.quasi.value.raw += '\"';\r\n\t\t\t});\r\n\r\n\t\t\tif (!wrapper.void) {\r\n\t\t\t\tstate.quasi.value.raw += '>';\r\n\r\n\t\t\t\tif (wrapper.node.name === 'pre') {\r\n\t\t\t\t\t// Two or more leading newlines are required to restore the leading newline immediately after `<pre>`.\r\n\t\t\t\t\t// see https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element\r\n\t\t\t\t\tconst first = wrapper.fragment.nodes[0];\r\n\t\t\t\t\tif (first && first.node.type === 'Text' && regex_starts_with_newline.test(first.node.data)) {\r\n\t\t\t\t\t\tstate.quasi.value.raw += '\\n';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (is_empty_textarea) {\r\n\t\t\t\t\t// The <textarea> renders the value attribute as content because the content is stored in the value attribute.\r\n\t\t\t\t\tconst value_attribute = wrapper.attributes.find(attr => attr.node.name === 'value');\r\n\t\t\t\t\tif (value_attribute) {\r\n\t\t\t\t\t\t// Two or more leading newlines are required to restore the leading newline immediately after `<textarea>`.\r\n\t\t\t\t\t\t// see https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions\r\n\t\t\t\t\t\tconst first = value_attribute.node.chunks[0];\r\n\t\t\t\t\t\tif (first && first.type === 'Text' && regex_starts_with_newline.test(first.data)) {\r\n\t\t\t\t\t\t\tstate.quasi.value.raw += '\\n';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tto_html_for_attr_value(value_attribute, block, literal, state);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tto_html(wrapper.fragment.nodes as Array<ElementWrapper | TextWrapper>, block, literal, state);\r\n\r\n\t\t\t\tstate.quasi.value.raw += `</${wrapper.node.name}>`;\r\n\t\t\t} else {\r\n\t\t\t\tstate.quasi.value.raw += '/>';\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}\r\n\r\nfunction to_html_for_attr_value(attr: AttributeWrapper | StyleAttributeWrapper | SpreadAttributeWrapper, block: Block, literal: any, state: any) {\r\n\tattr.node.chunks.forEach(chunk => {\r\n\t\tif (chunk.type === 'Text') {\r\n\t\t\tstate.quasi.value.raw += escape_html(chunk.data);\r\n\t\t} else {\r\n\t\t\tliteral.quasis.push(state.quasi);\r\n\t\t\tliteral.expressions.push(chunk.manipulate(block));\r\n\r\n\t\t\tstate.quasi = {\r\n\t\t\t\ttype: 'TemplateElement',\r\n\t\t\t\tvalue: { raw: '' }\r\n\t\t\t};\r\n\t\t}\r\n\t});\r\n}\r\n","import Wrapper from './shared/Wrapper';\r\nimport Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport EachBlock from '../../nodes/EachBlock';\r\nimport IfBlock from '../../nodes/IfBlock';\r\nimport create_debugging_comment from './shared/create_debugging_comment';\r\nimport ElseBlock from '../../nodes/ElseBlock';\r\nimport FragmentWrapper from './Fragment';\r\nimport { b, x } from 'code-red';\r\nimport { walk } from 'estree-walker';\r\nimport { is_head } from './shared/is_head';\r\nimport { Identifier, Node } from 'estree';\r\nimport { push_array } from '../../../utils/push_array';\r\nimport { add_const_tags, add_const_tags_context } from './shared/add_const_tags';\r\n\r\ntype DetachingOrNull = 'detaching' | null;\r\n\r\nfunction is_else_if(node: ElseBlock) {\r\n\treturn (\r\n\t\tnode && node.children.length === 1 && node.children[0].type === 'IfBlock'\r\n\t);\r\n}\r\n\r\nclass IfBlockBranch extends Wrapper {\r\n\tblock: Block;\r\n\tfragment: FragmentWrapper;\r\n\tdependencies?: string[];\r\n\tcondition?: any;\r\n\tsnippet?: Node;\r\n\tis_dynamic: boolean;\r\n\tnode: IfBlock | ElseBlock;\r\n\r\n\tvar = null;\r\n\tget_ctx_name: Node | undefined;\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: IfBlockWrapper,\r\n\t\tnode: IfBlock | ElseBlock,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\r\n\t\tconst { expression } = (node as IfBlock);\r\n\t\tconst is_else = !expression;\r\n\r\n\t\tif (expression) {\r\n\t\t\tthis.dependencies = expression.dynamic_dependencies();\r\n\r\n\t\t\t// TODO is this the right rule? or should any non-reference count?\r\n\t\t\t// const should_cache = !is_reference(expression.node, null) && dependencies.length > 0;\r\n\t\t\tlet should_cache = false;\r\n\t\t\twalk(expression.node, {\r\n\t\t\t\tenter(node) {\r\n\t\t\t\t\tif (node.type === 'CallExpression' || node.type === 'NewExpression') {\r\n\t\t\t\t\t\tshould_cache = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (should_cache) {\r\n\t\t\t\tthis.condition = block.get_unique_name('show_if');\r\n\t\t\t\tthis.snippet = (expression.manipulate(block) as Node);\r\n\t\t\t} else {\r\n\t\t\t\tthis.condition = expression.manipulate(block);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tadd_const_tags_context(renderer, this.node.const_tags);\r\n\r\n\t\tthis.block = block.child({\r\n\t\t\tcomment: create_debugging_comment(node, parent.renderer.component),\r\n\t\t\tname: parent.renderer.component.get_unique_name(\r\n\t\t\t\tis_else ? 'create_else_block' : 'create_if_block'\r\n\t\t\t),\r\n\t\t\ttype: (node as IfBlock).expression ? 'if' : 'else'\r\n\t\t});\r\n\r\n\t\tthis.fragment = new FragmentWrapper(renderer, this.block, node.children, parent, strip_whitespace, next_sibling);\r\n\r\n\t\tthis.is_dynamic = this.block.dependencies.size > 0;\r\n\r\n\t\tif (node.const_tags.length > 0) {\r\n\t\t\tthis.get_ctx_name = parent.renderer.component.get_unique_name(is_else ? 'get_else_ctx' : 'get_if_ctx');\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default class IfBlockWrapper extends Wrapper {\r\n\tnode: IfBlock;\r\n\tbranches: IfBlockBranch[];\r\n\tneeds_update = false;\r\n\r\n\tvar: Identifier = { type: 'Identifier', name: 'if_block' };\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: EachBlock,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\r\n\t\tthis.cannot_use_innerhtml();\r\n\t\tthis.not_static_content();\r\n\r\n\t\tthis.branches = [];\r\n\r\n\t\tconst blocks: Block[] = [];\r\n\t\tlet is_dynamic = false;\r\n\t\tlet has_intros = false;\r\n\t\tlet has_outros = false;\r\n\r\n\t\tconst create_branches = (node: IfBlock) => {\r\n\t\t\tconst branch = new IfBlockBranch(\r\n\t\t\t\trenderer,\r\n\t\t\t\tblock,\r\n\t\t\t\tthis,\r\n\t\t\t\tnode,\r\n\t\t\t\tstrip_whitespace,\r\n\t\t\t\tnext_sibling\r\n\t\t\t);\r\n\r\n\t\t\tthis.branches.push(branch);\r\n\r\n\t\t\tblocks.push(branch.block);\r\n\t\t\tblock.add_dependencies(node.expression.dependencies);\r\n\r\n\t\t\tif (branch.block.dependencies.size > 0) {\r\n\t\t\t\t// the condition, or its contents, is dynamic\r\n\t\t\t\tis_dynamic = true;\r\n\t\t\t\tblock.add_dependencies(branch.block.dependencies);\r\n\t\t\t}\r\n\r\n\t\t\tif (branch.dependencies && branch.dependencies.length > 0) {\r\n\t\t\t\t// the condition itself is dynamic\r\n\t\t\t\tthis.needs_update = true;\r\n\t\t\t}\r\n\r\n\t\t\tif (branch.block.has_intros) has_intros = true;\r\n\t\t\tif (branch.block.has_outros) has_outros = true;\r\n\r\n\t\t\tif (is_else_if(node.else)) {\r\n\t\t\t\tcreate_branches(node.else.children[0] as IfBlock);\r\n\t\t\t} else if (node.else) {\r\n\t\t\t\tconst branch = new IfBlockBranch(\r\n\t\t\t\t\trenderer,\r\n\t\t\t\t\tblock,\r\n\t\t\t\t\tthis,\r\n\t\t\t\t\tnode.else,\r\n\t\t\t\t\tstrip_whitespace,\r\n\t\t\t\t\tnext_sibling\r\n\t\t\t\t);\r\n\r\n\t\t\t\tthis.branches.push(branch);\r\n\r\n\t\t\t\tblocks.push(branch.block);\r\n\r\n\t\t\t\tif (branch.block.dependencies.size > 0) {\r\n\t\t\t\t\tis_dynamic = true;\r\n\t\t\t\t\tblock.add_dependencies(branch.block.dependencies);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (branch.block.has_intros) has_intros = true;\r\n\t\t\t\tif (branch.block.has_outros) has_outros = true;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tcreate_branches(this.node);\r\n\r\n\t\tblocks.forEach(block => {\r\n\t\t\tblock.has_update_method = is_dynamic;\r\n\t\t\tblock.has_intro_method = has_intros;\r\n\t\t\tblock.has_outro_method = has_outros;\r\n\t\t});\r\n\r\n\t\tpush_array(renderer.blocks, blocks);\r\n\t}\r\n\r\n\trender(\r\n\t\tblock: Block,\r\n\t\tparent_node: Identifier,\r\n\t\tparent_nodes: Identifier\r\n\t) {\r\n\t\tconst name = this.var;\r\n\r\n\t\tconst needs_anchor = this.next ? !this.next.is_dom_node() : !parent_node || !this.parent.is_dom_node();\r\n\t\tconst anchor = needs_anchor\r\n\t\t\t? block.get_unique_name(`${this.var.name}_anchor`)\r\n\t\t\t: (this.next && this.next.var) || 'null';\r\n\r\n\t\tconst has_else = !(this.branches[this.branches.length - 1].condition);\r\n\t\tconst if_exists_condition = has_else ? null : name;\r\n\r\n\t\tconst dynamic = this.branches[0].block.has_update_method; // can use [0] as proxy for all, since they necessarily have the same value\r\n\t\tconst has_intros = this.branches[0].block.has_intro_method;\r\n\t\tconst has_outros = this.branches[0].block.has_outro_method;\r\n\t\tconst has_transitions = has_intros || has_outros;\r\n\r\n\t\tthis.branches.forEach(branch => {\r\n\t\t\tif (branch.get_ctx_name) {\r\n\t\t\t\tthis.renderer.blocks.push(b`\r\n\t\t\t\tfunction ${branch.get_ctx_name}(#ctx) {\r\n\t\t\t\t\tconst child_ctx = #ctx.slice();\r\n\t\t\t\t\t${add_const_tags(block, branch.node.const_tags, 'child_ctx')}\r\n\t\t\t\t\treturn child_ctx;\r\n\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst vars = { name, anchor, if_exists_condition, has_else, has_transitions };\r\n\r\n\t\tconst detaching: DetachingOrNull = parent_node && !is_head(parent_node) ? null : 'detaching';\r\n\r\n\t\tif (this.node.else) {\r\n\t\t\tthis.branches.forEach(branch => {\r\n\t\t\t\tif (branch.snippet) block.add_variable(branch.condition);\r\n\t\t\t});\r\n\r\n\t\t\tif (has_outros) {\r\n\t\t\t\tthis.render_compound_with_outros(block, parent_node, parent_nodes, dynamic, vars, detaching);\r\n\r\n\t\t\t\tblock.chunks.outro.push(b`@transition_out(${name});`);\r\n\t\t\t} else {\r\n\t\t\t\tthis.render_compound(block, parent_node, parent_nodes, dynamic, vars, detaching);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.render_simple(block, parent_node, parent_nodes, dynamic, vars, detaching);\r\n\r\n\t\t\tif (has_outros) {\r\n\t\t\t\tblock.chunks.outro.push(b`@transition_out(${name});`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (if_exists_condition) {\r\n\t\t\tblock.chunks.create.push(b`if (${if_exists_condition}) ${name}.c();`);\r\n\t\t} else {\r\n\t\t\tblock.chunks.create.push(b`${name}.c();`);\r\n\t\t}\r\n\r\n\t\tif (parent_nodes && this.renderer.options.hydratable) {\r\n\t\t\tif (if_exists_condition) {\r\n\t\t\t\tblock.chunks.claim.push(\r\n\t\t\t\t\tb`if (${if_exists_condition}) ${name}.l(${parent_nodes});`\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.claim.push(\r\n\t\t\t\t\tb`${name}.l(${parent_nodes});`\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (has_intros || has_outros) {\r\n\t\t\tblock.chunks.intro.push(b`@transition_in(${name});`);\r\n\t\t}\r\n\r\n\t\tif (needs_anchor) {\r\n\t\t\tblock.add_element(\r\n\t\t\t\tanchor as Identifier,\r\n\t\t\t\tx`@empty()`,\r\n\t\t\t\tparent_nodes && x`@empty()`,\r\n\t\t\t\tparent_node\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tthis.branches.forEach(branch => {\r\n\t\t\tbranch.fragment.render(branch.block, null, x`#nodes` as unknown as Identifier);\r\n\t\t});\r\n\t}\r\n\r\n\trender_compound(\r\n\t\tblock: Block,\r\n\t\tparent_node: Identifier,\r\n\t\t_parent_nodes: Identifier,\r\n\t\tdynamic: boolean,\r\n\t\t{ name, anchor, has_else, if_exists_condition, has_transitions },\r\n\t\tdetaching: DetachingOrNull\r\n\t) {\r\n\t\tconst select_block_type = this.renderer.component.get_unique_name('select_block_type');\r\n\t\tconst current_block_type = block.get_unique_name('current_block_type');\r\n\t\tconst need_select_block_ctx = this.branches.some(branch => branch.get_ctx_name);\r\n\t\tconst select_block_ctx = need_select_block_ctx ? block.get_unique_name('select_block_ctx') : null;\r\n\t\tconst if_ctx = select_block_ctx ? x`${select_block_ctx}(#ctx, ${current_block_type})` : x`#ctx`;\r\n\r\n\t\tconst get_block = has_else\r\n\t\t\t? x`${current_block_type}(${if_ctx})`\r\n\t\t\t: x`${current_block_type} && ${current_block_type}(${if_ctx})`;\r\n\r\n\t\tif (this.needs_update) {\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\tfunction ${select_block_type}(#ctx, #dirty) {\r\n\t\t\t\t\t${this.branches.map(({ dependencies, condition, snippet }) => {\r\n\t\t\t\t\t\treturn b`${snippet && dependencies.length > 0 ? b`if (${block.renderer.dirty(dependencies)}) ${condition} = null;` : null}`;\r\n\t\t\t\t\t})}\r\n\t\t\t\t\t${this.branches.map(({ condition, snippet, block }) => condition\r\n\t\t\t\t\t\t? b`\r\n\t\t\t\t\t\t\t\t${snippet && b`if (${condition} == null) ${condition} = !!${snippet}`}\r\n\t\t\t\t\t\t\t\tif (${condition}) return ${block.name};`\r\n\t\t\t\t\t\t: b`return ${block.name};`\r\n\t\t\t\t\t)}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t} else {\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\tfunction ${select_block_type}(#ctx, #dirty) {\r\n\t\t\t\t\t${this.branches.map(({ condition, snippet, block }) => condition\r\n\t\t\t\t? b`if (${snippet || condition}) return ${block.name};`\r\n\t\t\t\t: b`return ${block.name};`)}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tif (need_select_block_ctx) {\r\n\t\t\t// if all branches needs create a context\r\n\t\t\tif (this.branches.every(branch => branch.get_ctx_name)) {\r\n\t\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t\tfunction ${select_block_ctx}(#ctx, #type) {\r\n\t\t\t\t\t\t${this.branches.map(({ condition, get_ctx_name, block }) => {\r\n\t\t\t\t\t\t\treturn condition\r\n\t\t\t\t\t\t\t\t? b`if (#type === ${block.name}) return ${get_ctx_name}(#ctx);`\r\n\t\t\t\t\t\t\t\t: b`return ${get_ctx_name}(#ctx);`;\r\n\t\t\t\t\t\t}).filter(Boolean)}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\t// when not all branches need to create a new context,\r\n\t\t\t\t// this code is simpler\r\n\t\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t\tfunction ${select_block_ctx}(#ctx, #type) {\r\n\t\t\t\t\t\t${this.branches.map(({ get_ctx_name, block }) => {\r\n\t\t\t\t\t\t\treturn get_ctx_name\r\n\t\t\t\t\t\t\t\t? b`if (#type === ${block.name}) return ${get_ctx_name}(#ctx);`\r\n\t\t\t\t\t\t\t\t: null;\r\n\t\t\t\t\t\t}).filter(Boolean)}\r\n\t\t\t\t\t\treturn #ctx;\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\tlet ${current_block_type} = ${select_block_type}(#ctx, ${this.renderer.get_initial_dirty()});\r\n\t\t\tlet ${name} = ${get_block};\r\n\t\t`);\r\n\r\n\t\tconst initial_mount_node = parent_node || '#target';\r\n\t\tconst anchor_node = parent_node ? 'null' : '#anchor';\r\n\r\n\t\tif (if_exists_condition) {\r\n\t\t\tblock.chunks.mount.push(\r\n\t\t\t\tb`if (${if_exists_condition}) ${name}.m(${initial_mount_node}, ${anchor_node});`\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\tblock.chunks.mount.push(\r\n\t\t\t\tb`${name}.m(${initial_mount_node}, ${anchor_node});`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (this.needs_update) {\r\n\t\t\tconst update_mount_node = this.get_update_mount_node(anchor);\r\n\r\n\t\t\tconst change_block = b`\r\n\t\t\t\t${if_exists_condition ? b`if (${if_exists_condition}) ${name}.d(1)` : b`${name}.d(1)`};\r\n\t\t\t\t${name} = ${get_block};\r\n\t\t\t\tif (${name}) {\r\n\t\t\t\t\t${name}.c();\r\n\t\t\t\t\t${has_transitions && b`@transition_in(${name}, 1);`}\r\n\t\t\t\t\t${name}.m(${update_mount_node}, ${anchor});\r\n\t\t\t\t}\r\n\t\t\t`;\r\n\r\n\t\t\tif (dynamic) {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif (${current_block_type} === (${current_block_type} = ${select_block_type}(#ctx, #dirty)) && ${name}) {\r\n\t\t\t\t\t\t${name}.p(${if_ctx}, #dirty);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t${change_block}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif (${current_block_type} !== (${current_block_type} = ${select_block_type}(#ctx, #dirty))) {\r\n\t\t\t\t\t\t${change_block}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t} else if (dynamic) {\r\n\t\t\tif (if_exists_condition) {\r\n\t\t\t\tblock.chunks.update.push(b`if (${if_exists_condition}) ${name}.p(${if_ctx}, #dirty);`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.update.push(b`${name}.p(${if_ctx}, #dirty);`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (if_exists_condition) {\r\n\t\t\tblock.chunks.destroy.push(b`\r\n\t\t\t\tif (${if_exists_condition}) {\r\n\t\t\t\t\t${name}.d(${detaching});\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t} else {\r\n\t\t\tblock.chunks.destroy.push(b`\r\n\t\t\t\t${name}.d(${detaching});\r\n\t\t\t`);\r\n\t\t}\r\n\t}\r\n\r\n\t// if any of the siblings have outros, we need to keep references to the blocks\r\n\t// (TODO does this only apply to bidi transitions?)\r\n\trender_compound_with_outros(\r\n\t\tblock: Block,\r\n\t\tparent_node: Identifier,\r\n\t\t_parent_nodes: Identifier,\r\n\t\tdynamic: boolean,\r\n\t\t{ name, anchor, has_else, has_transitions, if_exists_condition },\r\n\t\tdetaching: DetachingOrNull\r\n\t) {\r\n\t\tconst select_block_type = this.renderer.component.get_unique_name('select_block_type');\r\n\t\tconst current_block_type_index = block.get_unique_name('current_block_type_index');\r\n\t\tconst previous_block_index = block.get_unique_name('previous_block_index');\r\n\t\tconst if_block_creators = block.get_unique_name('if_block_creators');\r\n\t\tconst if_blocks = block.get_unique_name('if_blocks');\r\n\t\tconst need_select_block_ctx = this.branches.some(branch => branch.get_ctx_name);\r\n\t\tconst select_block_ctx = need_select_block_ctx ? block.get_unique_name('select_block_ctx') : null;\r\n\t\tconst if_ctx = select_block_ctx ? x`${select_block_ctx}(#ctx, ${current_block_type_index})` : x`#ctx`;\r\n\r\n\t\tconst if_current_block_type_index = has_else\r\n\t\t\t? (nodes: Node[]) => nodes\r\n\t\t\t: (nodes: Node[]) => b`if (~${current_block_type_index}) { ${nodes} }`;\r\n\r\n\t\tblock.add_variable(current_block_type_index);\r\n\t\tblock.add_variable(name);\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\tconst ${if_block_creators} = [\r\n\t\t\t\t${this.branches.map(branch => branch.block.name)}\r\n\t\t\t];\r\n\r\n\t\t\tconst ${if_blocks} = [];\r\n\r\n\t\t\t${this.needs_update\r\n\t\t\t\t? b`\r\n\t\t\t\t\tfunction ${select_block_type}(#ctx, #dirty) {\r\n\t\t\t\t\t\t${this.branches.map(({ dependencies, condition, snippet }) => {\r\n\t\t\t\t\t\t\treturn b`${snippet && dependencies.length > 0 ? b`if (${block.renderer.dirty(dependencies)}) ${condition} = null;` : null}`;\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t${this.branches.map(({ condition, snippet }, i) => condition\r\n\t\t\t\t\t\t\t? b`\r\n\t\t\t\t\t\t\t\t${snippet && b`if (${condition} == null) ${condition} = !!${snippet}`}\r\n\t\t\t\t\t\t\t\tif (${condition}) return ${i};`\r\n\t\t\t\t\t\t\t: b`return ${i};`)}\r\n\t\t\t\t\t\t\t\t${!has_else && b`return -1;`}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t`\r\n\t\t\t\t: b`\r\n\t\t\t\t\tfunction ${select_block_type}(#ctx, #dirty) {\r\n\t\t\t\t\t\t${this.branches.map(({ condition, snippet }, i) => condition\r\n\t\t\t\t\t\t\t? b`if (${snippet || condition}) return ${i};`\r\n\t\t\t\t\t\t\t: b`return ${i};`)}\r\n\t\t\t\t\t\t${!has_else && b`return -1;`}\r\n\t\t\t\t\t}\r\n\t\t\t\t`}\r\n\t\t`);\r\n\r\n\t\tif (need_select_block_ctx) {\r\n\t\t\t// if all branches needs create a context\r\n\t\t\tif (this.branches.every(branch => branch.get_ctx_name)) {\r\n\t\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t\tfunction ${select_block_ctx}(#ctx, #index) {\r\n\t\t\t\t\t\t${this.branches.map(({ condition, get_ctx_name }, i) => {\r\n\t\t\t\t\t\t\treturn condition\r\n\t\t\t\t\t\t\t\t? b`if (#index === ${i}) return ${get_ctx_name}(#ctx);`\r\n\t\t\t\t\t\t\t\t: b`return ${get_ctx_name}(#ctx);`;\r\n\t\t\t\t\t\t}).filter(Boolean)}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\t// when not all branches need to create a new context,\r\n\t\t\t\t// this code is simpler\r\n\t\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t\tfunction ${select_block_ctx}(#ctx, #index) {\r\n\t\t\t\t\t\t${this.branches.map(({ get_ctx_name }, i) => {\r\n\t\t\t\t\t\t\treturn get_ctx_name\r\n\t\t\t\t\t\t\t\t? b`if (#index === ${i}) return ${get_ctx_name}(#ctx);`\r\n\t\t\t\t\t\t\t\t: null;\r\n\t\t\t\t\t\t}).filter(Boolean)}\r\n\t\t\t\t\t\treturn #ctx;\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (has_else) {\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t${current_block_type_index} = ${select_block_type}(#ctx, ${this.renderer.get_initial_dirty()});\r\n\t\t\t\t${name} = ${if_blocks}[${current_block_type_index}] = ${if_block_creators}[${current_block_type_index}](${if_ctx});\r\n\t\t\t`);\r\n\t\t} else {\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\tif (~(${current_block_type_index} = ${select_block_type}(#ctx, ${this.renderer.get_initial_dirty()}))) {\r\n\t\t\t\t\t${name} = ${if_blocks}[${current_block_type_index}] = ${if_block_creators}[${current_block_type_index}](${if_ctx});\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tconst initial_mount_node = parent_node || '#target';\r\n\t\tconst anchor_node = parent_node ? 'null' : '#anchor';\r\n\r\n\t\tblock.chunks.mount.push(\r\n\t\t\tif_current_block_type_index(\r\n\t\t\t\tb`${if_blocks}[${current_block_type_index}].m(${initial_mount_node}, ${anchor_node});`\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tif (this.needs_update) {\r\n\t\t\tconst update_mount_node = this.get_update_mount_node(anchor);\r\n\r\n\t\t\tconst destroy_old_block = b`\r\n\t\t\t\t@group_outros();\r\n\t\t\t\t@transition_out(${if_blocks}[${previous_block_index}], 1, 1, () => {\r\n\t\t\t\t\t${if_blocks}[${previous_block_index}] = null;\r\n\t\t\t\t});\r\n\t\t\t\t@check_outros();\r\n\t\t\t`;\r\n\r\n\t\t\tconst create_new_block = b`\r\n\t\t\t\t${name} = ${if_blocks}[${current_block_type_index}];\r\n\t\t\t\tif (!${name}) {\r\n\t\t\t\t\t${name} = ${if_blocks}[${current_block_type_index}] = ${if_block_creators}[${current_block_type_index}](${if_ctx});\r\n\t\t\t\t\t${name}.c();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t${dynamic && b`${name}.p(${if_ctx}, #dirty);`}\r\n\t\t\t\t}\r\n\t\t\t\t${has_transitions && b`@transition_in(${name}, 1);`}\r\n\t\t\t\t${name}.m(${update_mount_node}, ${anchor});\r\n\t\t\t`;\r\n\r\n\t\t\tconst change_block = has_else\r\n\t\t\t\t? b`\r\n\t\t\t\t\t${destroy_old_block}\r\n\r\n\t\t\t\t\t${create_new_block}\r\n\t\t\t\t`\r\n\t\t\t\t: b`\r\n\t\t\t\t\tif (${name}) {\r\n\t\t\t\t\t\t${destroy_old_block}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (~${current_block_type_index}) {\r\n\t\t\t\t\t\t${create_new_block}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t${name} = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t`;\r\n\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tlet ${previous_block_index} = ${current_block_type_index};\r\n\t\t\t\t${current_block_type_index} = ${select_block_type}(#ctx, #dirty);\r\n\t\t\t`);\r\n\r\n\t\t\tif (dynamic) {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif (${current_block_type_index} === ${previous_block_index}) {\r\n\t\t\t\t\t\t${if_current_block_type_index(b`${if_blocks}[${current_block_type_index}].p(${if_ctx}, #dirty);`)}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t${change_block}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif (${current_block_type_index} !== ${previous_block_index}) {\r\n\t\t\t\t\t\t${change_block}\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t} else if (dynamic) {\r\n\t\t\tif (if_exists_condition) {\r\n\t\t\t\tblock.chunks.update.push(b`if (${if_exists_condition}) ${name}.p(${if_ctx}, #dirty);`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.update.push(b`${name}.p(${if_ctx}, #dirty);`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tblock.chunks.destroy.push(\r\n\t\t\tif_current_block_type_index(b`${if_blocks}[${current_block_type_index}].d(${detaching});`)\r\n\t\t);\r\n\t}\r\n\r\n\trender_simple(\r\n\t\tblock: Block,\r\n\t\tparent_node: Identifier,\r\n\t\t_parent_nodes: Identifier,\r\n\t\tdynamic: boolean,\r\n\t\t{ name, anchor, if_exists_condition, has_transitions },\r\n\t\tdetaching: DetachingOrNull\r\n\t) {\r\n\t\tconst branch = this.branches[0];\r\n\t\tconst if_ctx = branch.get_ctx_name ? x`${branch.get_ctx_name}(#ctx)` : x`#ctx`;\r\n\r\n\t\tif (branch.snippet) block.add_variable(branch.condition, branch.snippet);\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\tlet ${name} = ${branch.condition} && ${branch.block.name}(${if_ctx});\r\n\t\t`);\r\n\r\n\t\tconst initial_mount_node = parent_node || '#target';\r\n\t\tconst anchor_node = parent_node ? 'null' : '#anchor';\r\n\r\n\t\tblock.chunks.mount.push(\r\n\t\t\tb`if (${name}) ${name}.m(${initial_mount_node}, ${anchor_node});`\r\n\t\t);\r\n\r\n\t\tif (branch.dependencies.length > 0) {\r\n\t\t\tconst update_mount_node = this.get_update_mount_node(anchor);\r\n\r\n\t\t\tconst enter = b`\r\n\t\t\t\tif (${name}) {\r\n\t\t\t\t\t${dynamic && b`${name}.p(${if_ctx}, #dirty);`}\r\n\t\t\t\t\t${has_transitions &&\r\n\t\t\t\t\t\tb`if (${block.renderer.dirty(branch.dependencies)}) {\r\n\t\t\t\t\t\t\t\t\t@transition_in(${name}, 1);\r\n\t\t\t\t\t\t\t\t}`\r\n\t\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t${name} = ${branch.block.name}(${if_ctx});\r\n\t\t\t\t\t${name}.c();\r\n\t\t\t\t\t${has_transitions && b`@transition_in(${name}, 1);`}\r\n\t\t\t\t\t${name}.m(${update_mount_node}, ${anchor});\r\n\t\t\t\t}\r\n\t\t\t`;\r\n\r\n\t\t\tif (branch.snippet) {\r\n\t\t\t\tblock.chunks.update.push(b`if (${block.renderer.dirty(branch.dependencies)}) ${branch.condition} = ${branch.snippet}`);\r\n\t\t\t}\r\n\r\n\t\t\t// no `p()` here — we don't want to update outroing nodes,\r\n\t\t\t// as that will typically result in glitching\r\n\t\t\tif (branch.block.has_outro_method) {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif (${branch.condition}) {\r\n\t\t\t\t\t\t${enter}\r\n\t\t\t\t\t} else if (${name}) {\r\n\t\t\t\t\t\t@group_outros();\r\n\t\t\t\t\t\t@transition_out(${name}, 1, 1, () => {\r\n\t\t\t\t\t\t\t${name} = null;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t@check_outros();\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif (${branch.condition}) {\r\n\t\t\t\t\t\t${enter}\r\n\t\t\t\t\t} else if (${name}) {\r\n\t\t\t\t\t\t${name}.d(1);\r\n\t\t\t\t\t\t${name} = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t} else if (dynamic) {\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${branch.condition}) ${name}.p(${if_ctx}, #dirty);\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tif (if_exists_condition) {\r\n\t\t\tblock.chunks.destroy.push(b`\r\n\t\t\t\tif (${if_exists_condition}) ${name}.d(${detaching});\r\n\t\t\t`);\r\n\t\t} else {\r\n\t\t\tblock.chunks.destroy.push(b`\r\n\t\t\t\t${name}.d(${detaching});\r\n\t\t\t`);\r\n\t\t}\r\n\t}\r\n}\r\n","import Wrapper from './shared/Wrapper';\r\nimport Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport KeyBlock from '../../nodes/KeyBlock';\r\nimport create_debugging_comment from './shared/create_debugging_comment';\r\nimport FragmentWrapper from './Fragment';\r\nimport { b, x } from 'code-red';\r\nimport { Identifier } from 'estree';\r\n\r\nexport default class KeyBlockWrapper extends Wrapper {\r\n\tnode: KeyBlock;\r\n\tfragment: FragmentWrapper;\r\n\tblock: Block;\r\n\tdependencies: string[];\r\n\tvar: Identifier = { type: 'Identifier', name: 'key_block' };\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: KeyBlock,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\r\n\t\tthis.cannot_use_innerhtml();\r\n\t\tthis.not_static_content();\r\n\r\n\t\tthis.dependencies = node.expression.dynamic_dependencies();\r\n\r\n\t\tif (this.dependencies.length) {\r\n\t\t\tblock = block.child({\r\n\t\t\t\tcomment: create_debugging_comment(node, renderer.component),\r\n\t\t\t\tname: renderer.component.get_unique_name('create_key_block'),\r\n\t\t\t\ttype: 'key'\r\n\t\t\t});\r\n\t\t\tblock.add_dependencies(node.expression.dependencies);\r\n\t\t\trenderer.blocks.push(block);\r\n\t\t}\r\n\r\n\t\tthis.block = block;\r\n\t\tthis.fragment = new FragmentWrapper(\r\n\t\t\trenderer,\r\n\t\t\tthis.block,\r\n\t\t\tnode.children,\r\n\t\t\tthis,\r\n\t\t\tstrip_whitespace,\r\n\t\t\tnext_sibling\r\n\t\t);\r\n\t}\r\n\r\n\trender(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tif (this.dependencies.length === 0) {\r\n\t\t\tthis.render_static_key(block, parent_node, parent_nodes);\r\n\t\t} else {\r\n\t\t\tthis.render_dynamic_key(block, parent_node, parent_nodes);\r\n\t\t}\r\n\t}\r\n\r\n\trender_static_key(_block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tthis.fragment.render(this.block, parent_node, parent_nodes);\r\n\t}\r\n\r\n\trender_dynamic_key(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tthis.fragment.render(\r\n\t\t\tthis.block,\r\n\t\t\tnull,\r\n\t\t\t(x`#nodes` as unknown) as Identifier\r\n\t\t);\r\n\r\n\t\tconst has_transitions = !!(\r\n\t\t\tthis.block.has_intro_method || this.block.has_outro_method\r\n\t\t);\r\n\t\tconst dynamic = this.block.has_update_method;\r\n\r\n\t\tconst previous_key = block.get_unique_name('previous_key');\r\n\t\tconst snippet = this.node.expression.manipulate(block);\r\n\t\tblock.add_variable(previous_key, snippet);\r\n\r\n\t\tconst not_equal = this.renderer.component.component_options.immutable ? x`@not_equal` : x`@safe_not_equal`;\r\n\t\tconst condition = x`${this.renderer.dirty(this.dependencies)} && ${not_equal}(${previous_key}, ${previous_key} = ${snippet})`;\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\tlet ${this.var} = ${this.block.name}(#ctx);\r\n\t\t`);\r\n\t\tblock.chunks.create.push(b`${this.var}.c();`);\r\n\t\tif (this.renderer.options.hydratable) {\r\n\t\t\tblock.chunks.claim.push(b`${this.var}.l(${parent_nodes});`);\r\n\t\t}\r\n\t\tblock.chunks.mount.push(\r\n\t\t\tb`${this.var}.m(${parent_node || '#target'}, ${\r\n\t\t\t\tparent_node ? 'null' : '#anchor'\r\n\t\t\t});`\r\n\t\t);\r\n\t\tconst anchor = this.get_or_create_anchor(block, parent_node, parent_nodes);\r\n\t\tconst body = b`\r\n\t\t\t${\r\n\t\t\t\thas_transitions\r\n\t\t\t\t\t? b`\r\n\t\t\t\t\t\t@group_outros();\r\n\t\t\t\t\t\t@transition_out(${this.var}, 1, 1, @noop);\r\n\t\t\t\t\t\t@check_outros();\r\n\t\t\t\t\t`\r\n\t\t\t\t\t: b`${this.var}.d(1);`\r\n\t\t\t}\r\n\t\t\t${this.var} = ${this.block.name}(#ctx);\r\n\t\t\t${this.var}.c();\r\n\t\t\t${has_transitions && b`@transition_in(${this.var}, 1)`}\r\n\t\t\t${this.var}.m(${this.get_update_mount_node(anchor)}, ${anchor});\r\n\t\t`;\r\n\r\n\t\tif (dynamic) {\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${condition}) {\r\n\t\t\t\t\t${body}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t${this.var}.p(#ctx, #dirty);\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t} else {\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${condition}) {\r\n\t\t\t\t\t${body}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tif (has_transitions) {\r\n\t\t\tblock.chunks.intro.push(b`@transition_in(${this.var})`);\r\n\t\t\tblock.chunks.outro.push(b`@transition_out(${this.var})`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.destroy.push(b`${this.var}.d(detaching)`);\r\n\t}\r\n}\r\n","import Wrapper from '../shared/Wrapper';\r\nimport BindingWrapper from '../Element/Binding';\r\nimport Renderer from '../../Renderer';\r\nimport Block from '../../Block';\r\nimport InlineComponent from '../../../nodes/InlineComponent';\r\nimport FragmentWrapper from '../Fragment';\r\nimport SlotTemplateWrapper from '../SlotTemplate';\r\nimport { sanitize } from '../../../../utils/names';\r\nimport add_to_set from '../../../utils/add_to_set';\r\nimport { b, x, p } from 'code-red';\r\nimport Attribute from '../../../nodes/Attribute';\r\nimport TemplateScope from '../../../nodes/shared/TemplateScope';\r\nimport is_dynamic from '../shared/is_dynamic';\r\nimport bind_this from '../shared/bind_this';\r\nimport { Node, Identifier, ObjectExpression } from 'estree';\r\nimport EventHandler from '../Element/EventHandler';\r\nimport { extract_names } from 'periscopic';\r\nimport mark_each_block_bindings from '../shared/mark_each_block_bindings';\r\nimport { string_to_member_expression } from '../../../utils/string_to_member_expression';\r\nimport SlotTemplate from '../../../nodes/SlotTemplate';\r\nimport { is_head } from '../shared/is_head';\r\nimport compiler_warnings from '../../../compiler_warnings';\r\nimport { namespaces } from '../../../../utils/namespaces';\r\n\r\ntype SlotDefinition = { block: Block; scope: TemplateScope; get_context?: Node; get_changes?: Node };\r\n\r\nconst regex_invalid_variable_identifier_characters = /[^a-zA-Z_$]/g;\r\n\r\nexport default class InlineComponentWrapper extends Wrapper {\r\n\tvar: Identifier;\r\n\tslots: Map<string, SlotDefinition> = new Map();\r\n\tnode: InlineComponent;\r\n\tfragment: FragmentWrapper;\r\n\tchildren: Array<Wrapper | FragmentWrapper> = [];\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: InlineComponent,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\r\n\t\tthis.cannot_use_innerhtml();\r\n\t\tthis.not_static_content();\r\n\r\n\t\tif (this.node.expression) {\r\n\t\t\tblock.add_dependencies(this.node.expression.dependencies);\r\n\t\t}\r\n\r\n\t\tthis.node.attributes.forEach(attr => {\r\n\t\t\tblock.add_dependencies(attr.dependencies);\r\n\t\t});\r\n\r\n\t\tthis.node.bindings.forEach(binding => {\r\n\t\t\tif (binding.is_contextual) {\r\n\t\t\t\tmark_each_block_bindings(this, binding);\r\n\t\t\t}\r\n\r\n\t\t\tblock.add_dependencies(binding.expression.dependencies);\r\n\t\t});\r\n\r\n\t\tthis.node.handlers.forEach(handler => {\r\n\t\t\tif (handler.expression) {\r\n\t\t\t\tblock.add_dependencies(handler.expression.dependencies);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.node.css_custom_properties.forEach(attr => {\r\n\t\t\tblock.add_dependencies(attr.dependencies);\r\n\t\t});\r\n\r\n\t\tthis.var = {\r\n\t\t\ttype: 'Identifier',\r\n\t\t\tname: (\r\n\t\t\t\tthis.node.name === 'svelte:self' ? renderer.component.name.name :\r\n\t\t\t\t\tthis.node.name === 'svelte:component' ? 'switch_instance' :\r\n\t\t\t\t\t\tsanitize(this.node.name)\r\n\t\t\t).toLowerCase()\r\n\t\t};\r\n\r\n\t\tif (this.node.children.length) {\r\n\t\t\tthis.node.lets.forEach(l => {\r\n\t\t\t\textract_names(l.value || l.name).forEach(name => {\r\n\t\t\t\t\trenderer.add_to_context(name, true);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\tthis.children = this.node.children.map(child => new SlotTemplateWrapper(renderer, block, this, child as SlotTemplate, strip_whitespace, next_sibling));\r\n\t\t}\r\n\r\n\t\tblock.add_outro();\r\n\t}\r\n\r\n\tset_slot(name: string, slot_definition: SlotDefinition) {\r\n\t\tif (this.slots.has(name)) {\r\n\t\t\tif (name === 'default') {\r\n\t\t\t\tthrow new Error('Found elements without slot attribute when using slot=\"default\"');\r\n\t\t\t}\r\n\t\t\tthrow new Error(`Duplicate slot name \"${name}\" in <${this.node.name}>`);\r\n\t\t}\r\n\t\tthis.slots.set(name, slot_definition);\r\n\t}\r\n\r\n\twarn_if_reactive() {\r\n\t\tconst { name } = this.node;\r\n\t\tconst variable = this.renderer.component.var_lookup.get(name);\r\n\t\tif (!variable) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (variable.reassigned || variable.export_name || variable.is_reactive_dependency) {\r\n\t\t\tthis.renderer.component.warn(this.node, compiler_warnings.reactive_component(name));\r\n\t\t}\r\n\t}\r\n\r\n\trender(\r\n\t\tblock: Block,\r\n\t\tparent_node: Identifier,\r\n\t\tparent_nodes: Identifier\r\n\t) {\r\n\t\tthis.warn_if_reactive();\r\n\r\n\t\tconst { renderer } = this;\r\n\t\tconst { component } = renderer;\r\n\r\n\t\tconst name = this.var;\r\n\t\tblock.add_variable(name);\r\n\r\n\t\tconst component_opts = x`{}` as ObjectExpression;\r\n\r\n\t\tconst statements: Array<Node | Node[]> = [];\r\n\t\tconst updates: Array<Node | Node[]> = [];\r\n\r\n\t\tthis.children.forEach((child) => {\r\n\t\t\tthis.renderer.add_to_context('$$scope', true);\r\n\t\t\tchild.render(block, null, x`#nodes` as Identifier);\r\n\t\t});\r\n\r\n\t\tlet props: Identifier | undefined;\r\n\t\tconst name_changes = block.get_unique_name(`${name.name}_changes`);\r\n\r\n\t\tconst uses_spread = !!this.node.attributes.find(a => a.is_spread);\r\n\r\n\t\t// removing empty slot\r\n\t\tfor (const slot of this.slots.keys()) {\r\n\t\t\tif (!this.slots.get(slot).block.has_content()) {\r\n\t\t\t\tthis.renderer.remove_block(this.slots.get(slot).block);\r\n\t\t\t\tthis.slots.delete(slot);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst has_css_custom_properties = this.node.css_custom_properties.length > 0;\r\n\t\tconst is_svg_namespace = this.node.namespace === namespaces.svg;\r\n\t\tconst css_custom_properties_wrapper_element = is_svg_namespace ? 'g' : 'div';\r\n\t\tconst css_custom_properties_wrapper = has_css_custom_properties ? block.get_unique_name(css_custom_properties_wrapper_element) : null;\r\n\t\tif (has_css_custom_properties) {\r\n\t\t\tblock.add_variable(css_custom_properties_wrapper);\r\n\t\t}\r\n\r\n\t\tconst initial_props = this.slots.size > 0\r\n\t\t\t? [\r\n\t\t\t\tp`$$slots: {\r\n\t\t\t\t\t${Array.from(this.slots).map(([name, slot]) => {\r\n\t\t\t\t\t\treturn p`${name}: [${slot.block.name}, ${slot.get_context || null}, ${slot.get_changes || null}]`;\r\n\t\t\t\t\t})}\r\n\t\t\t\t}`,\r\n\t\t\t\tp`$$scope: {\r\n\t\t\t\t\tctx: #ctx\r\n\t\t\t\t}`\r\n\t\t\t]\r\n\t\t\t: [];\r\n\r\n\t\tconst attribute_object = uses_spread\r\n\t\t\t? x`{ ${initial_props} }`\r\n\t\t\t: x`{\r\n\t\t\t\t${this.node.attributes.map(attr => p`${attr.name}: ${attr.get_value(block)}`)},\r\n\t\t\t\t${initial_props}\r\n\t\t\t}`;\r\n\r\n\t\tif (this.node.attributes.length || this.node.bindings.length || initial_props.length) {\r\n\t\t\tif (!uses_spread && this.node.bindings.length === 0) {\r\n\t\t\t\tcomponent_opts.properties.push(p`props: ${attribute_object}`);\r\n\t\t\t} else {\r\n\t\t\t\tprops = block.get_unique_name(`${name.name}_props`);\r\n\t\t\t\tcomponent_opts.properties.push(p`props: ${props}`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (component.compile_options.dev) {\r\n\t\t\t// TODO this is a terrible hack, but without it the component\r\n\t\t\t// will complain that options.target is missing. This would\r\n\t\t\t// work better if components had separate public and private\r\n\t\t\t// APIs\r\n\t\t\tcomponent_opts.properties.push(p`$$inline: true`);\r\n\t\t}\r\n\r\n\t\tconst fragment_dependencies = new Set(this.slots.size ? ['$$scope'] : []);\r\n\t\tthis.slots.forEach(slot => {\r\n\t\t\tslot.block.dependencies.forEach(name => {\r\n\t\t\t\tconst is_let = slot.scope.is_let(name);\r\n\t\t\t\tconst variable = renderer.component.var_lookup.get(name);\r\n\r\n\t\t\t\tif (is_let || is_dynamic(variable)) fragment_dependencies.add(name);\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tconst dynamic_attributes = this.node.attributes.filter(a => a.get_dependencies().length > 0);\r\n\r\n\t\tif (!uses_spread && (dynamic_attributes.length > 0 || this.node.bindings.length > 0 || fragment_dependencies.size > 0)) {\r\n\t\t\tupdates.push(b`const ${name_changes} = {};`);\r\n\t\t}\r\n\r\n\t\tif (this.node.attributes.length) {\r\n\t\t\tif (uses_spread) {\r\n\t\t\t\tconst levels = block.get_unique_name(`${this.var.name}_spread_levels`);\r\n\r\n\t\t\t\tconst initial_props = [];\r\n\t\t\t\tconst changes = [];\r\n\r\n\t\t\t\tconst all_dependencies: Set<string> = new Set();\r\n\r\n\t\t\t\tthis.node.attributes.forEach(attr => {\r\n\t\t\t\t\tadd_to_set(all_dependencies, attr.dependencies);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.node.attributes.forEach((attr, i) => {\r\n\t\t\t\t\tconst { name, dependencies } = attr;\r\n\r\n\t\t\t\t\tconst condition = dependencies.size > 0 && (dependencies.size !== all_dependencies.size)\r\n\t\t\t\t\t\t? renderer.dirty(Array.from(dependencies))\r\n\t\t\t\t\t\t: null;\r\n\t\t\t\t\tconst unchanged = dependencies.size === 0;\r\n\r\n\t\t\t\t\tlet change_object: Node | ReturnType<typeof x>;\r\n\t\t\t\t\tif (attr.is_spread) {\r\n\t\t\t\t\t\tconst value = attr.expression.manipulate(block);\r\n\t\t\t\t\t\tinitial_props.push(value);\r\n\r\n\t\t\t\t\t\tlet value_object = value;\r\n\t\t\t\t\t\tif (attr.expression.node.type !== 'ObjectExpression') {\r\n\t\t\t\t\t\t\tvalue_object = x`@get_spread_object(${value})`;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tchange_object = value_object;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconst obj = x`{ ${name}: ${attr.get_value(block)} }`;\r\n\t\t\t\t\t\tinitial_props.push(obj);\r\n\t\t\t\t\t\tchange_object = obj;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tchanges.push(\r\n\t\t\t\t\t\tunchanged\r\n\t\t\t\t\t\t\t? x`${levels}[${i}]`\r\n\t\t\t\t\t\t\t: condition\r\n\t\t\t\t\t\t\t? x`${condition} && ${change_object}`\r\n\t\t\t\t\t\t\t: change_object\r\n\t\t\t\t\t);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t\tconst ${levels} = [\r\n\t\t\t\t\t\t${initial_props}\r\n\t\t\t\t\t];\r\n\t\t\t\t`);\r\n\r\n\t\t\t\tstatements.push(b`\r\n\t\t\t\t\tfor (let #i = 0; #i < ${levels}.length; #i += 1) {\r\n\t\t\t\t\t\t${props} = @assign(${props}, ${levels}[#i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\r\n\t\t\t\tif (all_dependencies.size) {\r\n\t\t\t\t\tconst condition = renderer.dirty(Array.from(all_dependencies));\r\n\r\n\t\t\t\t\tupdates.push(b`\r\n\t\t\t\t\t\tconst ${name_changes} = ${condition} ? @get_spread_update(${levels}, [\r\n\t\t\t\t\t\t\t${changes}\r\n\t\t\t\t\t\t]) : {}\r\n\t\t\t\t\t`);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tupdates.push(b`\r\n\t\t\t\t\t\tconst ${name_changes} = {};\r\n\t\t\t\t\t`);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tdynamic_attributes.forEach((attribute: Attribute) => {\r\n\t\t\t\t\tconst dependencies = attribute.get_dependencies();\r\n\t\t\t\t\tif (dependencies.length > 0) {\r\n\t\t\t\t\t\tconst condition = renderer.dirty(dependencies);\r\n\r\n\t\t\t\t\t\tupdates.push(b`\r\n\t\t\t\t\t\t\tif (${condition}) ${name_changes}.${attribute.name} = ${attribute.get_value(block)};\r\n\t\t\t\t\t\t`);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (fragment_dependencies.size > 0) {\r\n\t\t\tupdates.push(b`\r\n\t\t\t\tif (${renderer.dirty(Array.from(fragment_dependencies))}) {\r\n\t\t\t\t\t${name_changes}.$$scope = { dirty: #dirty, ctx: #ctx };\r\n\t\t\t\t}`);\r\n\t\t}\r\n\r\n\t\tconst munged_bindings = this.node.bindings.map(binding => {\r\n\t\t\tcomponent.has_reactive_assignments = true;\r\n\r\n\t\t\tif (binding.name === 'this') {\r\n\t\t\t\treturn bind_this(component, block, new BindingWrapper(block, binding, this), this.var);\r\n\t\t\t}\r\n\r\n\t\t\tconst id = component.get_unique_name(`${this.var.name}_${binding.name}_binding`);\r\n\t\t\trenderer.add_to_context(id.name);\r\n\t\t\tconst callee = renderer.reference(id);\r\n\r\n\t\t\tconst updating = block.get_unique_name(`updating_${binding.name}`);\r\n\t\t\tblock.add_variable(updating);\r\n\r\n\t\t\tconst snippet = binding.expression.manipulate(block);\r\n\r\n\t\t\tstatements.push(b`\r\n\t\t\t\tif (${snippet} !== void 0) {\r\n\t\t\t\t\t${props}.${binding.name} = ${snippet};\r\n\t\t\t\t}`\r\n\t\t\t);\r\n\r\n\t\t\tupdates.push(b`\r\n\t\t\t\tif (!${updating} && ${renderer.dirty(Array.from(binding.expression.dependencies))}) {\r\n\t\t\t\t\t${updating} = true;\r\n\t\t\t\t\t${name_changes}.${binding.name} = ${snippet};\r\n\t\t\t\t\t@add_flush_callback(() => ${updating} = false);\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\r\n\t\t\tconst contextual_dependencies = Array.from(binding.expression.contextual_dependencies);\r\n\t\t\tconst dependencies = Array.from(binding.expression.dependencies);\r\n\r\n\t\t\tlet lhs = binding.raw_expression;\r\n\r\n\t\t\tif (binding.is_contextual && binding.expression.node.type === 'Identifier') {\r\n\t\t\t\t// bind:x={y} — we can't just do `y = x`, we need to\r\n\t\t\t\t// to `array[index] = x;\r\n\t\t\t\tconst { name } = binding.expression.node;\r\n\t\t\t\tconst { object, property, snippet } = block.bindings.get(name);\r\n\t\t\t\tlhs = snippet;\r\n\t\t\t\tcontextual_dependencies.push(object.name, property.name);\r\n\t\t\t}\r\n\r\n\t\t\tconst params: Identifier[] = [x`#value` as Identifier];\r\n\t\t\tconst args = [x`#value`];\r\n\t\t\tif (contextual_dependencies.length > 0) {\r\n\r\n\t\t\t\tcontextual_dependencies.forEach(name => {\r\n\t\t\t\t\tparams.push({\r\n\t\t\t\t\t\ttype: 'Identifier',\r\n\t\t\t\t\t\tname\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\trenderer.add_to_context(name, true);\r\n\t\t\t\t\targs.push(renderer.reference(name));\r\n\t\t\t\t});\r\n\r\n\r\n\t\t\t\tblock.maintain_context = true; // TODO put this somewhere more logical\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\tfunction ${id}(#value) {\r\n\t\t\t\t\t${callee}(${args});\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\r\n\t\t\tlet invalidate_binding = b`\r\n\t\t\t\t${lhs} = #value;\r\n\t\t\t\t${renderer.invalidate(dependencies[0])};\r\n\t\t\t`;\r\n\t\t\tif (binding.expression.node.type === 'MemberExpression') {\r\n\t\t\t\tinvalidate_binding = b`\r\n\t\t\t\t\tif ($$self.$$.not_equal(${lhs}, #value)) {\r\n\t\t\t\t\t\t${invalidate_binding}\r\n\t\t\t\t\t}\r\n\t\t\t\t`;\r\n\t\t\t}\r\n\r\n\t\t\tconst body = b`\r\n\t\t\t\tfunction ${id}(${params}) {\r\n\t\t\t\t\t${invalidate_binding}\r\n\t\t\t\t}\r\n\t\t\t`;\r\n\r\n\t\t\tcomponent.partly_hoisted.push(body);\r\n\r\n\t\t\treturn b`@binding_callbacks.push(() => @bind(${this.var}, '${binding.name}', ${id}));`;\r\n\t\t});\r\n\r\n\t\tconst munged_handlers = this.node.handlers.map(handler => {\r\n\t\t\tconst event_handler = new EventHandler(handler, this);\r\n\t\t\tlet snippet = event_handler.get_snippet(block);\r\n\t\t\tif (handler.modifiers.has('once')) snippet = x`@once(${snippet})`;\r\n\r\n\t\t\treturn b`${name}.$on(\"${handler.name}\", ${snippet});`;\r\n\t\t});\r\n\r\n\t\tconst mount_target = has_css_custom_properties ? css_custom_properties_wrapper : (parent_node || '#target');\r\n\t\tconst mount_anchor = has_css_custom_properties ? 'null' : (parent_node ? 'null' : '#anchor');\r\n\t\tconst to_claim = parent_nodes && this.renderer.options.hydratable;\r\n\t\tlet claim_nodes = parent_nodes;\r\n\r\n\t\tif (this.node.name === 'svelte:component') {\r\n\t\t\tconst switch_value = block.get_unique_name('switch_value');\r\n\t\t\tconst switch_props = block.get_unique_name('switch_props');\r\n\r\n\t\t\tconst snippet = this.node.expression.manipulate(block);\r\n\r\n\t\t\tif (has_css_custom_properties) {\r\n\t\t\t\tthis.set_css_custom_properties(block, css_custom_properties_wrapper, css_custom_properties_wrapper_element, is_svg_namespace);\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\tvar ${switch_value} = ${snippet};\r\n\r\n\t\t\t\tfunction ${switch_props}(#ctx) {\r\n\t\t\t\t\t${(this.node.attributes.length > 0 || this.node.bindings.length > 0) && b`\r\n\t\t\t\t\t${props && b`let ${props} = ${attribute_object};`}`}\r\n\t\t\t\t\t${statements}\r\n\t\t\t\t\treturn ${component_opts};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (${switch_value}) {\r\n\t\t\t\t\t${name} = @construct_svelte_component(${switch_value}, ${switch_props}(#ctx));\r\n\r\n\t\t\t\t\t${munged_bindings}\r\n\t\t\t\t\t${munged_handlers}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\r\n\t\t\tblock.chunks.create.push(\r\n\t\t\t\tb`if (${name}) @create_component(${name}.$$.fragment);`\r\n\t\t\t);\r\n\r\n\t\t\tif (css_custom_properties_wrapper) this.create_css_custom_properties_wrapper_mount_chunk(block, parent_node, css_custom_properties_wrapper);\r\n\t\t\tblock.chunks.mount.push(b`if (${name}) @mount_component(${name}, ${mount_target}, ${mount_anchor});`);\r\n\r\n\t\t\tif (to_claim) {\r\n\t\t\t\tif (css_custom_properties_wrapper) claim_nodes = this.create_css_custom_properties_wrapper_claim_chunk(block, claim_nodes, css_custom_properties_wrapper, css_custom_properties_wrapper_element, is_svg_namespace);\r\n\t\t\t\tblock.chunks.claim.push(b`if (${name}) @claim_component(${name}.$$.fragment, ${claim_nodes});`);\r\n\t\t\t}\r\n\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\t${updates}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\r\n\t\t\tconst tmp_anchor = this.get_or_create_anchor(block, parent_node, parent_nodes);\r\n\t\t\tconst anchor = has_css_custom_properties ? 'null' : tmp_anchor;\r\n\t\t\tconst update_mount_node = has_css_custom_properties ? css_custom_properties_wrapper : this.get_update_mount_node(tmp_anchor);\r\n\t\t\tconst update_insert =\r\n\t\t\t\tcss_custom_properties_wrapper &&\r\n\t\t\t\t(tmp_anchor.name !== 'null'\r\n\t\t\t\t\t? b`@insert(${tmp_anchor}.parentNode, ${css_custom_properties_wrapper}, ${tmp_anchor});`\r\n\t\t\t\t\t: b`@insert(${parent_node}, ${css_custom_properties_wrapper}, ${tmp_anchor});`);\r\n\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${switch_value} !== (${switch_value} = ${snippet})) {\r\n\t\t\t\t\tif (${name}) {\r\n\t\t\t\t\t\t@group_outros();\r\n\t\t\t\t\t\tconst old_component = ${name};\r\n\t\t\t\t\t\t@transition_out(old_component.$$.fragment, 1, 0, () => {\r\n\t\t\t\t\t\t\t@destroy_component(old_component, 1);\r\n\t\t\t\t\t\t\t${has_css_custom_properties ? b`@detach(${update_mount_node})` : null}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t@check_outros();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (${switch_value}) {\r\n\t\t\t\t\t\t${update_insert}\r\n\t\t\t\t\t\t${name} = @construct_svelte_component(${switch_value}, ${switch_props}(#ctx));\r\n\r\n\t\t\t\t\t\t${munged_bindings}\r\n\t\t\t\t\t\t${munged_handlers}\r\n\r\n\t\t\t\t\t\t@create_component(${name}.$$.fragment);\r\n\t\t\t\t\t\t@transition_in(${name}.$$.fragment, 1);\r\n\t\t\t\t\t\t@mount_component(${name}, ${update_mount_node}, ${anchor});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t${name} = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (${switch_value}) {\r\n\t\t\t\t\t${updates.length > 0 && b`${name}.$set(${name_changes});`}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\r\n\t\t\tblock.chunks.intro.push(b`\r\n\t\t\t\tif (${name}) @transition_in(${name}.$$.fragment, #local);\r\n\t\t\t`);\r\n\r\n\t\t\tblock.chunks.outro.push(\r\n\t\t\t\tb`if (${name}) @transition_out(${name}.$$.fragment, #local);`\r\n\t\t\t);\r\n\r\n\t\t\tblock.chunks.destroy.push(b`if (${name}) @destroy_component(${name}, ${parent_node ? null : 'detaching'});`);\r\n\t\t} else {\r\n\t\t\tconst expression = this.node.name === 'svelte:self'\r\n\t\t\t\t? component.name\r\n\t\t\t\t: this.renderer.reference(string_to_member_expression(this.node.name));\r\n\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t${(this.node.attributes.length > 0 || this.node.bindings.length > 0) && b`\r\n\t\t\t\t${props && b`let ${props} = ${attribute_object};`}`}\r\n\t\t\t\t${statements}\r\n\t\t\t\t${name} = new ${expression}(${component_opts});\r\n\r\n\t\t\t\t${munged_bindings}\r\n\t\t\t\t${munged_handlers}\r\n\t\t\t`);\r\n\r\n\t\t\tif (has_css_custom_properties) {\r\n\t\t\t\tthis.set_css_custom_properties(block, css_custom_properties_wrapper, css_custom_properties_wrapper_element, is_svg_namespace);\r\n\t\t\t}\r\n\t\t\tblock.chunks.create.push(b`@create_component(${name}.$$.fragment);`);\r\n\r\n\t\t\tif (css_custom_properties_wrapper) this.create_css_custom_properties_wrapper_mount_chunk(block, parent_node, css_custom_properties_wrapper);\r\n\t\t\tblock.chunks.mount.push(b`@mount_component(${name}, ${mount_target}, ${mount_anchor});`);\r\n\r\n\t\t\tif (to_claim) {\r\n\t\t\t\tif (css_custom_properties_wrapper) claim_nodes = this.create_css_custom_properties_wrapper_claim_chunk(block, claim_nodes, css_custom_properties_wrapper, css_custom_properties_wrapper_element, is_svg_namespace);\r\n\t\t\t\tblock.chunks.claim.push(b`@claim_component(${name}.$$.fragment, ${claim_nodes});`);\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.intro.push(b`\r\n\t\t\t\t@transition_in(${name}.$$.fragment, #local);\r\n\t\t\t`);\r\n\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\t${updates}\r\n\t\t\t\t\t${name}.$set(${name_changes});\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\r\n\t\t\tblock.chunks.destroy.push(b`\r\n\t\t\t\t@destroy_component(${name}, ${parent_node ? null : 'detaching'});\r\n\t\t\t`);\r\n\r\n\t\t\tblock.chunks.outro.push(\r\n\t\t\t\tb`@transition_out(${name}.$$.fragment, #local);`\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate create_css_custom_properties_wrapper_mount_chunk(\r\n\t\tblock: Block,\r\n\t\tparent_node: Identifier,\r\n\t\tcss_custom_properties_wrapper: Identifier | null\r\n\t) {\r\n\t\t\tif (parent_node) {\r\n\t\t\t\tblock.chunks.mount.push(b`@append(${parent_node}, ${css_custom_properties_wrapper})`);\r\n\t\t\t\tif (is_head(parent_node)) {\r\n\t\t\t\t\tblock.chunks.destroy.push(b`@detach(${css_custom_properties_wrapper});`);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tblock.chunks.mount.push(b`@insert(#target, ${css_custom_properties_wrapper}, #anchor);`);\r\n\t\t\t\t// TODO we eventually need to consider what happens to elements\r\n\t\t\t\t// that belong to the same outgroup as an outroing element...\r\n\t\t\t\tblock.chunks.destroy.push(b`if (detaching && ${this.var}) @detach(${css_custom_properties_wrapper});`);\r\n\t\t\t}\r\n\t}\r\n\r\n\tprivate create_css_custom_properties_wrapper_claim_chunk(\r\n\t\tblock: Block,\r\n\t\tparent_nodes: Identifier,\r\n\t\tcss_custom_properties_wrapper: Identifier | null,\r\n\t\tcss_custom_properties_wrapper_element: string,\r\n\t\tis_svg_namespace: boolean\r\n\t) {\r\n\t\tconst nodes = block.get_unique_name(`${css_custom_properties_wrapper.name}_nodes`);\r\n\t\tconst claim_element = is_svg_namespace ? x`@claim_svg_element` : x`@claim_element`;\r\n\t\tblock.chunks.claim.push(b`\r\n\t\t\t${css_custom_properties_wrapper} = ${claim_element}(${parent_nodes}, \"${css_custom_properties_wrapper_element.toUpperCase()}\", { style: true })\r\n\t\t\tvar ${nodes} = @children(${css_custom_properties_wrapper});\r\n\t\t`);\r\n\t\treturn nodes;\r\n\t}\r\n\r\n\tprivate set_css_custom_properties(\r\n\t\tblock: Block,\r\n\t\tcss_custom_properties_wrapper: Identifier,\r\n\t\tcss_custom_properties_wrapper_element: string,\r\n\t\tis_svg_namespace: boolean\r\n\t) {\r\n\t\tconst element = is_svg_namespace ? x`@svg_element` : x`@element`;\r\n\t\tblock.chunks.create.push(b`${css_custom_properties_wrapper} = ${element}(\"${css_custom_properties_wrapper_element}\");`);\r\n\t\tif (!is_svg_namespace) block.chunks.hydrate.push(b`@set_style(${css_custom_properties_wrapper}, \"display\", \"contents\");`);\r\n\t\tthis.node.css_custom_properties.forEach((attr) => {\r\n\t\t\tconst dependencies = attr.get_dependencies();\r\n\t\t\tconst should_cache = attr.should_cache();\r\n\t\t\tconst last = should_cache &&\tblock.get_unique_name(`${attr.name.replace(regex_invalid_variable_identifier_characters, '_')}_last`);\r\n\t\t\tif (should_cache) block.add_variable(last);\r\n\t\t\tconst value = attr.get_value(block);\r\n\t\t\tconst init = should_cache ? x`${last} = ${value}` : value;\r\n\r\n\t\t\tblock.chunks.hydrate.push(\r\n\t\t\t\tb`@set_style(${css_custom_properties_wrapper}, \"${attr.name}\", ${init});`\r\n\t\t\t);\r\n\t\t\tif (dependencies.length > 0) {\r\n\t\t\t\tlet condition = block.renderer.dirty(dependencies);\r\n\t\t\t\tif (should_cache) condition = x`${condition} && (${last} !== (${last} = ${value}))`;\r\n\t\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\t\tif (${condition}) {\r\n\t\t\t\t\t\t@set_style(${css_custom_properties_wrapper}, \"${attr.name}\", ${should_cache ? last : value});\r\n\t\t\t\t\t}\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}\r\n","import Attribute from '../nodes/Attribute';\r\nimport { p, x } from 'code-red';\r\nimport { string_literal } from './stringify';\r\nimport Block from '../render_dom/Block';\r\n\r\nexport default function get_slot_data(values: Map<string, Attribute>, block: Block = null) {\r\n\treturn {\r\n\t\ttype: 'ObjectExpression',\r\n\t\tproperties: Array.from(values.values())\r\n\t\t\t.filter(attribute => attribute.name !== 'name')\r\n\t\t\t.map(attribute => {\r\n\t\t\t\tif (attribute.is_spread) {\r\n\t\t\t\t\tconst argument = get_spread_value(block, attribute);\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttype: 'SpreadElement',\r\n\t\t\t\t\t\targument\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst value = get_value(block, attribute);\r\n\t\t\t\treturn p`${attribute.name}: ${value}`;\r\n\t\t\t})\r\n\t};\r\n}\r\n\r\nfunction get_value(block: Block, attribute: Attribute) {\r\n\tif (attribute.is_true) return x`true`;\r\n\tif (attribute.chunks.length === 0) return x`\"\"`;\r\n\r\n\tlet value = attribute.chunks\r\n\t\t.map(chunk => chunk.type === 'Text' ? string_literal(chunk.data) : (block ? chunk.manipulate(block) : chunk.node))\r\n\t\t.reduce((lhs, rhs) => x`${lhs} + ${rhs}`);\r\n\r\n\tif (attribute.chunks.length > 1 && attribute.chunks[0].type !== 'Text') {\r\n\t\tvalue = x`\"\" + ${value}`;\r\n\t}\r\n\r\n\treturn value;\r\n}\r\n\r\nfunction get_spread_value(block: Block, attribute: Attribute) {\r\n\treturn block ? attribute.expression.manipulate(block) : attribute.expression.node;\r\n}\r\n","import Wrapper from './shared/Wrapper';\r\nimport Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport Slot from '../../nodes/Slot';\r\nimport FragmentWrapper from './Fragment';\r\nimport { b, p, x } from 'code-red';\r\nimport { sanitize } from '../../../utils/names';\r\nimport add_to_set from '../../utils/add_to_set';\r\nimport get_slot_data from '../../utils/get_slot_data';\r\nimport { is_reserved_keyword } from '../../utils/reserved_keywords';\r\nimport is_dynamic from './shared/is_dynamic';\r\nimport { Identifier, ObjectExpression, Node } from 'estree';\r\nimport create_debugging_comment from './shared/create_debugging_comment';\r\n\r\nexport default class SlotWrapper extends Wrapper {\r\n\tnode: Slot;\r\n\tfragment: FragmentWrapper;\r\n\tfallback: Block | null = null;\r\n\tslot_block: Block;\r\n\r\n\tvar: Identifier = { type: 'Identifier', name: 'slot' };\r\n\tdependencies: Set<string> = new Set(['$$scope']);\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tparent: Wrapper,\r\n\t\tnode: Slot,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\t\tthis.cannot_use_innerhtml();\r\n\t\tthis.not_static_content();\r\n\r\n\t\tif (this.node.children.length) {\r\n\t\t\tthis.fallback = block.child({\r\n\t\t\t\tcomment: create_debugging_comment(this.node.children[0], this.renderer.component),\r\n\t\t\t\tname: this.renderer.component.get_unique_name('fallback_block'),\r\n\t\t\t\ttype: 'fallback'\r\n\t\t\t});\r\n\t\t\trenderer.blocks.push(this.fallback);\r\n\t\t}\r\n\r\n\t\tthis.fragment = new FragmentWrapper(\r\n\t\t\trenderer,\r\n\t\t\tthis.fallback,\r\n\t\t\tnode.children,\r\n\t\t\tthis,\r\n\t\t\tstrip_whitespace,\r\n\t\t\tnext_sibling\r\n\t\t);\r\n\r\n\t\tthis.node.values.forEach(attribute => {\r\n\t\t\tadd_to_set(this.dependencies, attribute.dependencies);\r\n\t\t});\r\n\r\n\t\tblock.add_dependencies(this.dependencies);\r\n\r\n\t\t// we have to do this, just in case\r\n\t\tblock.add_intro();\r\n\t\tblock.add_outro();\r\n\t}\r\n\r\n\trender(\r\n\t\tblock: Block,\r\n\t\tparent_node: Identifier,\r\n\t\tparent_nodes: Identifier\r\n\t) {\r\n\t\tconst { renderer } = this;\r\n\r\n\t\tconst { slot_name } = this.node;\r\n\r\n\t\tif (this.slot_block) {\r\n\t\t\tblock = this.slot_block;\r\n\t\t}\r\n\r\n\t\tlet get_slot_changes_fn: Identifier | 'null';\r\n\t\tlet get_slot_spread_changes_fn: Identifier | undefined;\r\n\t\tlet get_slot_context_fn: Identifier | 'null';\r\n\r\n\t\tif (this.node.values.size > 0) {\r\n\t\t\tget_slot_changes_fn = renderer.component.get_unique_name(`get_${sanitize(slot_name)}_slot_changes`);\r\n\t\t\tget_slot_context_fn = renderer.component.get_unique_name(`get_${sanitize(slot_name)}_slot_context`);\r\n\r\n\t\t\tconst changes = x`{}` as ObjectExpression;\r\n\r\n\t\t\tconst spread_dynamic_dependencies = new Set<string>();\r\n\r\n\t\t\tthis.node.values.forEach(attribute => {\r\n\t\t\t\tif (attribute.type === 'Spread') {\r\n\t\t\t\t\tadd_to_set(spread_dynamic_dependencies, Array.from(attribute.dependencies).filter((name) => this.is_dependency_dynamic(name)));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst dynamic_dependencies = Array.from(attribute.dependencies).filter((name) => this.is_dependency_dynamic(name));\r\n\r\n\t\t\t\t\tif (dynamic_dependencies.length > 0) {\r\n\t\t\t\t\t\tchanges.properties.push(p`${attribute.name}: ${renderer.dirty(dynamic_dependencies)}`);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\trenderer.blocks.push(b`\r\n\t\t\t\tconst ${get_slot_changes_fn} = #dirty => ${changes};\r\n\t\t\t\tconst ${get_slot_context_fn} = #ctx => ${get_slot_data(this.node.values, block)};\r\n\t\t\t`);\r\n\r\n\t\t\tif (spread_dynamic_dependencies.size) {\r\n\t\t\t\tget_slot_spread_changes_fn = renderer.component.get_unique_name(`get_${sanitize(slot_name)}_slot_spread_changes`);\r\n\t\t\t\trenderer.blocks.push(b`\r\n\t\t\t\t\tconst ${get_slot_spread_changes_fn} = #dirty => ${renderer.dirty(Array.from(spread_dynamic_dependencies))};\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tget_slot_changes_fn = 'null';\r\n\t\t\tget_slot_context_fn = 'null';\r\n\t\t}\r\n\r\n\t\tlet has_fallback = !!this.fallback;\r\n\t\tif (this.fallback) {\r\n\t\t\tthis.fragment.render(this.fallback, null, x`#nodes` as Identifier);\r\n\t\t\thas_fallback = this.fallback.has_content();\r\n\t\t\tif (!has_fallback) {\r\n\t\t\t\trenderer.remove_block(this.fallback);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst slot = block.get_unique_name(`${sanitize(slot_name)}_slot`);\r\n\t\tconst slot_definition = block.get_unique_name(`${sanitize(slot_name)}_slot_template`);\r\n\t\tconst slot_or_fallback = has_fallback ? block.get_unique_name(`${sanitize(slot_name)}_slot_or_fallback`) : slot;\r\n\r\n\t\tblock.chunks.init.push(b`\r\n\t\t\tconst ${slot_definition} = ${renderer.reference('#slots')}.${slot_name};\r\n\t\t\tconst ${slot} = @create_slot(${slot_definition}, #ctx, ${renderer.reference('$$scope')}, ${get_slot_context_fn});\r\n\t\t\t${has_fallback ? b`const ${slot_or_fallback} = ${slot} || ${this.fallback.name}(#ctx);` : null}\r\n\t\t`);\r\n\r\n\t\tblock.chunks.create.push(\r\n\t\t\tb`if (${slot_or_fallback}) ${slot_or_fallback}.c();`\r\n\t\t);\r\n\r\n\t\tif (renderer.options.hydratable) {\r\n\t\t\tblock.chunks.claim.push(\r\n\t\t\t\tb`if (${slot_or_fallback}) ${slot_or_fallback}.l(${parent_nodes});`\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tblock.chunks.mount.push(b`\r\n\t\t\tif (${slot_or_fallback}) {\r\n\t\t\t\t${slot_or_fallback}.m(${parent_node || '#target'}, ${parent_node ? 'null' : '#anchor'});\r\n\t\t\t}\r\n\t\t`);\r\n\r\n\t\tblock.chunks.intro.push(\r\n\t\t\tb`@transition_in(${slot_or_fallback}, #local);`\r\n\t\t);\r\n\r\n\t\tblock.chunks.outro.push(\r\n\t\t\tb`@transition_out(${slot_or_fallback}, #local);`\r\n\t\t);\r\n\r\n\t\tconst dynamic_dependencies = Array.from(this.dependencies).filter((name) => this.is_dependency_dynamic(name));\r\n\r\n\t\tconst fallback_dynamic_dependencies = has_fallback\r\n\t\t\t? Array.from(this.fallback.dependencies).filter((name) => this.is_dependency_dynamic(name))\r\n\t\t\t: [];\r\n\r\n\t\tlet condition = renderer.dirty(dynamic_dependencies);\r\n\t\tif (block.has_outros) {\r\n\t\t\tcondition = x`!#current || ${condition}`;\r\n\t\t}\r\n\r\n\t\t// conditions to treat everything as dirty\r\n\t\tconst all_dirty_conditions = [\r\n\t\t\tget_slot_spread_changes_fn ? x`${get_slot_spread_changes_fn}(#dirty)` : null,\r\n\t\t\tblock.has_outros ? x`!#current` : null\r\n\t\t].filter(Boolean);\r\n\t\tconst all_dirty_condition = all_dirty_conditions.length ? all_dirty_conditions.reduce((condition1, condition2) => x`${condition1} || ${condition2}`) : null;\r\n\r\n\t\tlet slot_update: Node[];\r\n\t\tif (all_dirty_condition) {\r\n\t\t\tconst dirty = x`${all_dirty_condition} ? @get_all_dirty_from_scope(${renderer.reference('$$scope')}) : @get_slot_changes(${slot_definition}, ${renderer.reference('$$scope')}, #dirty, ${get_slot_changes_fn})`;\r\n\r\n\t\t\tslot_update = b`\r\n\t\t\t\tif (${slot}.p && ${condition}) {\r\n\t\t\t\t\t@update_slot_base(${slot}, ${slot_definition}, #ctx, ${renderer.reference('$$scope')}, ${dirty}, ${get_slot_context_fn});\r\n\t\t\t\t}\r\n\t\t\t`;\r\n\t\t} else {\r\n\t\t\tslot_update = b`\r\n\t\t\t\tif (${slot}.p && ${condition}) {\r\n\t\t\t\t\t@update_slot(${slot}, ${slot_definition}, #ctx, ${renderer.reference('$$scope')}, #dirty, ${get_slot_changes_fn}, ${get_slot_context_fn});\r\n\t\t\t\t}\r\n\t\t\t`;\r\n\t\t}\r\n\r\n\t\tlet fallback_condition = renderer.dirty(fallback_dynamic_dependencies);\r\n\t\tlet fallback_dirty = x`#dirty`;\r\n\t\tif (block.has_outros) {\r\n\t\t\tfallback_condition = x`!#current || ${fallback_condition}`;\r\n\t\t\tfallback_dirty = x`!#current ? ${renderer.get_initial_dirty()} : ${fallback_dirty}`;\r\n\t\t}\r\n\r\n\t\tconst fallback_update = has_fallback && fallback_dynamic_dependencies.length > 0 && b`\r\n\t\t\tif (${slot_or_fallback} && ${slot_or_fallback}.p && ${fallback_condition}) {\r\n\t\t\t\t${slot_or_fallback}.p(#ctx, ${fallback_dirty});\r\n\t\t\t}\r\n\t\t`;\r\n\r\n\t\tif (fallback_update) {\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${slot}) {\r\n\t\t\t\t\t${slot_update}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t${fallback_update}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t} else {\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${slot}) {\r\n\t\t\t\t\t${slot_update}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\tblock.chunks.destroy.push(\r\n\t\t\tb`if (${slot_or_fallback}) ${slot_or_fallback}.d(detaching);`\r\n\t\t);\r\n\t}\r\n\r\n\tis_dependency_dynamic(name: string) {\r\n\t\tif (name === '$$scope') return true;\r\n\t\tif (this.node.scope.is_let(name)) return true;\r\n\t\tif (is_reserved_keyword(name)) return true;\r\n\t\tconst variable = this.renderer.component.var_lookup.get(name);\r\n\t\treturn is_dynamic(variable);\r\n\t}\r\n}\r\n","import Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport Wrapper from './shared/Wrapper';\r\nimport { b, x } from 'code-red';\r\nimport add_event_handlers from './shared/add_event_handlers';\r\nimport Window from '../../nodes/Window';\r\nimport add_actions from './shared/add_actions';\r\nimport { Identifier } from 'estree';\r\nimport { TemplateNode } from '../../../interfaces';\r\nimport EventHandler from './Element/EventHandler';\r\n\r\nconst associated_events = {\r\n\tinnerWidth: 'resize',\r\n\tinnerHeight: 'resize',\r\n\touterWidth: 'resize',\r\n\touterHeight: 'resize',\r\n\r\n\tscrollX: 'scroll',\r\n\tscrollY: 'scroll'\r\n};\r\n\r\nconst properties = {\r\n\tscrollX: 'pageXOffset',\r\n\tscrollY: 'pageYOffset'\r\n};\r\n\r\nconst readonly = new Set([\r\n\t'innerWidth',\r\n\t'innerHeight',\r\n\t'outerWidth',\r\n\t'outerHeight',\r\n\t'online'\r\n]);\r\n\r\nexport default class WindowWrapper extends Wrapper {\r\n\tnode: Window;\r\n\thandlers: EventHandler[];\r\n\r\n\tconstructor(renderer: Renderer, block: Block, parent: Wrapper, node: TemplateNode) {\r\n\t\tsuper(renderer, block, parent, node);\r\n\t\tthis.handlers = this.node.handlers.map(handler => new EventHandler(handler, this));\r\n\t}\r\n\r\n\trender(block: Block, _parent_node: Identifier, _parent_nodes: Identifier) {\r\n\t\tconst { renderer } = this;\r\n\t\tconst { component } = renderer;\r\n\r\n\t\tconst events: Record<string, Array<{ name: string; value: string }>> = {};\r\n\t\tconst bindings: Record<string, string> = {};\r\n\r\n\t\tadd_actions(block, '@_window', this.node.actions);\r\n\t\tadd_event_handlers(block, '@_window', this.handlers);\r\n\r\n\t\tthis.node.bindings.forEach(binding => {\r\n\t\t\t// TODO: what if it's a MemberExpression?\r\n\t\t\tconst binding_name = (binding.expression.node as Identifier).name;\r\n\r\n\t\t\t// in dev mode, throw if read-only values are written to\r\n\t\t\tif (readonly.has(binding.name)) {\r\n\t\t\t\trenderer.readonly.add(binding_name);\r\n\t\t\t}\r\n\r\n\t\t\tbindings[binding.name] = binding_name;\r\n\r\n\t\t\t// bind:online is a special case, we need to listen for two separate events\r\n\t\t\tif (binding.name === 'online') return;\r\n\r\n\t\t\tconst associated_event = associated_events[binding.name];\r\n\t\t\tconst property = properties[binding.name] || binding.name;\r\n\r\n\t\t\tif (!events[associated_event]) events[associated_event] = [];\r\n\t\t\tevents[associated_event].push({\r\n\t\t\t\tname: binding_name,\r\n\t\t\t\tvalue: property\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tconst scrolling = block.get_unique_name('scrolling');\r\n\t\tconst clear_scrolling = block.get_unique_name('clear_scrolling');\r\n\t\tconst scrolling_timeout = block.get_unique_name('scrolling_timeout');\r\n\r\n\t\tObject.keys(events).forEach(event => {\r\n\t\t\tconst id = block.get_unique_name(`onwindow${event}`);\r\n\t\t\tconst props = events[event];\r\n\r\n\t\t\trenderer.add_to_context(id.name);\r\n\t\t\tconst fn = renderer.reference(id.name);\r\n\r\n\t\t\tif (event === 'scroll') {\r\n\t\t\t\t// TODO other bidirectional bindings...\r\n\t\t\t\tblock.add_variable(scrolling, x`false`);\r\n\t\t\t\tblock.add_variable(clear_scrolling, x`() => { ${scrolling} = false }`);\r\n\t\t\t\tblock.add_variable(scrolling_timeout);\r\n\r\n\t\t\t\tconst condition = bindings.scrollX && bindings.scrollY\r\n\t\t\t\t\t? x`\"${bindings.scrollX}\" in this._state || \"${bindings.scrollY}\" in this._state`\r\n\t\t\t\t\t: x`\"${bindings.scrollX || bindings.scrollY}\" in this._state`;\r\n\r\n\t\t\t\tconst scrollX = bindings.scrollX && x`this._state.${bindings.scrollX}`;\r\n\t\t\t\tconst scrollY = bindings.scrollY && x`this._state.${bindings.scrollY}`;\r\n\r\n\t\t\t\trenderer.meta_bindings.push(b`\r\n\t\t\t\t\tif (${condition}) {\r\n\t\t\t\t\t\t@_scrollTo(${scrollX || '@_window.pageXOffset'}, ${scrollY || '@_window.pageYOffset'});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t${scrollX && `${scrollX} = @_window.pageXOffset;`}\r\n\t\t\t\t\t${scrollY && `${scrollY} = @_window.pageYOffset;`}\r\n\t\t\t\t`);\r\n\r\n\t\t\t\tblock.event_listeners.push(x`\r\n\t\t\t\t\t@listen(@_window, \"${event}\", () => {\r\n\t\t\t\t\t\t${scrolling} = true;\r\n\t\t\t\t\t\t@_clearTimeout(${scrolling_timeout});\r\n\t\t\t\t\t\t${scrolling_timeout} = @_setTimeout(${clear_scrolling}, 100);\r\n\t\t\t\t\t\t${fn}();\r\n\t\t\t\t\t})\r\n\t\t\t\t`);\r\n\t\t\t} else {\r\n\t\t\t\tprops.forEach(prop => {\r\n\t\t\t\t\trenderer.meta_bindings.push(\r\n\t\t\t\t\t\tb`this._state.${prop.name} = @_window.${prop.value};`\r\n\t\t\t\t\t);\r\n\t\t\t\t});\r\n\r\n\t\t\t\tblock.event_listeners.push(x`\r\n\t\t\t\t\t@listen(@_window, \"${event}\", ${fn})\r\n\t\t\t\t`);\r\n\t\t\t}\r\n\r\n\t\t\tcomponent.partly_hoisted.push(b`\r\n\t\t\t\tfunction ${id}() {\r\n\t\t\t\t\t${props.map(prop => renderer.invalidate(prop.name, x`${prop.name} = @_window.${prop.value}`))}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t@add_render_callback(${fn});\r\n\t\t\t`);\r\n\r\n\t\t\tcomponent.has_reactive_assignments = true;\r\n\t\t});\r\n\r\n\t\t// special case... might need to abstract this out if we add more special cases\r\n\t\tif (bindings.scrollX || bindings.scrollY) {\r\n\t\t\tconst condition = renderer.dirty([bindings.scrollX, bindings.scrollY].filter(Boolean));\r\n\r\n\t\t\tconst scrollX = bindings.scrollX ? renderer.reference(bindings.scrollX) : x`@_window.pageXOffset`;\r\n\t\t\tconst scrollY = bindings.scrollY ? renderer.reference(bindings.scrollY) : x`@_window.pageYOffset`;\r\n\r\n\t\t\tblock.chunks.update.push(b`\r\n\t\t\t\tif (${condition} && !${scrolling}) {\r\n\t\t\t\t\t${scrolling} = true;\r\n\t\t\t\t\t@_clearTimeout(${scrolling_timeout});\r\n\t\t\t\t\t@_scrollTo(${scrollX}, ${scrollY});\r\n\t\t\t\t\t${scrolling_timeout} = @_setTimeout(${clear_scrolling}, 100);\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\t\t}\r\n\r\n\t\t// another special case. (I'm starting to think these are all special cases.)\r\n\t\tif (bindings.online) {\r\n\t\t\tconst id = block.get_unique_name('onlinestatuschanged');\r\n\t\t\tconst name = bindings.online;\r\n\r\n\t\t\trenderer.add_to_context(id.name);\r\n\t\t\tconst reference = renderer.reference(id.name);\r\n\r\n\t\t\tcomponent.partly_hoisted.push(b`\r\n\t\t\t\tfunction ${id}() {\r\n\t\t\t\t\t${renderer.invalidate(name, x`${name} = @_navigator.onLine`)}\r\n\t\t\t\t}\r\n\t\t\t`);\r\n\r\n\t\t\tblock.chunks.init.push(b`\r\n\t\t\t\t@add_render_callback(${reference});\r\n\t\t\t`);\r\n\r\n\t\t\tblock.event_listeners.push(\r\n\t\t\t\tx`@listen(@_window, \"online\", ${reference})`,\r\n\t\t\t\tx`@listen(@_window, \"offline\", ${reference})`\r\n\t\t\t);\r\n\r\n\t\t\tcomponent.has_reactive_assignments = true;\r\n\t\t}\r\n\t}\r\n}\r\n","import Wrapper from './shared/Wrapper';\r\nimport AwaitBlock from './AwaitBlock';\r\nimport Body from './Body';\r\nimport DebugTag from './DebugTag';\r\nimport EachBlock from './EachBlock';\r\nimport Element from './Element/index';\r\nimport Head from './Head';\r\nimport IfBlock from './IfBlock';\r\nimport KeyBlock from './KeyBlock';\r\nimport InlineComponent from './InlineComponent/index';\r\nimport MustacheTag from './MustacheTag';\r\nimport RawMustacheTag from './RawMustacheTag';\r\nimport Slot from './Slot';\r\nimport SlotTemplate from './SlotTemplate';\r\nimport Text from './Text';\r\nimport Title from './Title';\r\nimport Window from './Window';\r\nimport { INode } from '../../nodes/interfaces';\r\nimport Renderer from '../Renderer';\r\nimport Block from '../Block';\r\nimport { trim_start, trim_end } from '../../../utils/trim';\r\nimport { link } from '../../../utils/link';\r\nimport { Identifier } from 'estree';\r\nimport { regex_starts_with_whitespace } from '../../../utils/patterns';\r\n\r\nconst wrappers = {\r\n\tAwaitBlock,\r\n\tBody,\r\n\tComment: null,\r\n\tDebugTag,\r\n\tEachBlock,\r\n\tElement,\r\n\tHead,\r\n\tIfBlock,\r\n\tInlineComponent,\r\n\tKeyBlock,\r\n\tMustacheTag,\r\n\tOptions: null,\r\n\tRawMustacheTag,\r\n\tSlot,\r\n\tSlotTemplate,\r\n\tText,\r\n\tTitle,\r\n\tWindow\r\n};\r\n\r\nfunction trimmable_at(child: INode, next_sibling: Wrapper): boolean {\r\n\t// Whitespace is trimmable if one of the following is true:\r\n\t// The child and its sibling share a common nearest each block (not at an each block boundary)\r\n\t// The next sibling's previous node is an each block\r\n\treturn (next_sibling.node.find_nearest(/EachBlock/) === child.find_nearest(/EachBlock/)) || next_sibling.node.prev.type === 'EachBlock';\r\n}\r\n\r\nexport default class FragmentWrapper {\r\n\tnodes: Wrapper[];\r\n\r\n\tconstructor(\r\n\t\trenderer: Renderer,\r\n\t\tblock: Block,\r\n\t\tnodes: INode[],\r\n\t\tparent: Wrapper,\r\n\t\tstrip_whitespace: boolean,\r\n\t\tnext_sibling: Wrapper\r\n\t) {\r\n\t\tthis.nodes = [];\r\n\r\n\t\tlet last_child: Wrapper;\r\n\t\tlet window_wrapper: Window | undefined;\r\n\r\n\t\tlet i = nodes.length;\r\n\t\twhile (i--) {\r\n\t\t\tconst child = nodes[i];\r\n\r\n\t\t\tif (!child.type) {\r\n\t\t\t\tthrow new Error('missing type');\r\n\t\t\t}\r\n\r\n\t\t\tif (!(child.type in wrappers)) {\r\n\t\t\t\tthrow new Error(`TODO implement ${child.type}`);\r\n\t\t\t}\r\n\r\n\t\t\t// special case — this is an easy way to remove whitespace surrounding\r\n\t\t\t// <svelte:window/>. lil hacky but it works\r\n\t\t\tif (child.type === 'Window') {\r\n\t\t\t\twindow_wrapper = new Window(renderer, block, parent, child);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (child.type === 'Text') {\r\n\t\t\t\tlet { data } = child;\r\n\r\n\t\t\t\t// We want to remove trailing whitespace inside an element/component/block,\r\n\t\t\t\t// *unless* there is no whitespace between this node and its next sibling\r\n\t\t\t\tif (this.nodes.length === 0) {\r\n\t\t\t\t\tconst should_trim = (\r\n\t\t\t\t\t\tnext_sibling ? (next_sibling.node.type === 'Text' && regex_starts_with_whitespace.test(next_sibling.node.data) && trimmable_at(child, next_sibling)) : !child.has_ancestor('EachBlock')\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tif (should_trim && !child.keep_space()) {\r\n\t\t\t\t\t\tdata = trim_end(data);\r\n\t\t\t\t\t\tif (!data) continue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// glue text nodes (which could e.g. be separated by comments) together\r\n\t\t\t\tif (last_child && last_child.node.type === 'Text') {\r\n\t\t\t\t\t(last_child as Text).data = data + (last_child as Text).data;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst wrapper = new Text(renderer, block, parent, child, data);\r\n\t\t\t\tif (wrapper.skip) continue;\r\n\r\n\t\t\t\tthis.nodes.unshift(wrapper);\r\n\r\n\t\t\t\tlink(last_child, last_child = wrapper);\r\n\t\t\t} else {\r\n\t\t\t\tconst Wrapper = wrappers[child.type];\r\n\t\t\t\tif (!Wrapper) continue;\r\n\r\n\t\t\t\tconst wrapper = new Wrapper(renderer, block, parent, child, strip_whitespace, last_child || next_sibling);\r\n\t\t\t\tthis.nodes.unshift(wrapper);\r\n\r\n\t\t\t\tlink(last_child, last_child = wrapper);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (strip_whitespace) {\r\n\t\t\tconst first = this.nodes[0] as Text;\r\n\r\n\t\t\tif (first && first.node.type === 'Text' && !first.node.keep_space()) {\r\n\t\t\t\tfirst.data = trim_start(first.data);\r\n\t\t\t\tif (!first.data) {\r\n\t\t\t\t\tfirst.var = null;\r\n\t\t\t\t\tthis.nodes.shift();\r\n\r\n\t\t\t\t\tif (this.nodes[0]) {\r\n\t\t\t\t\t\tthis.nodes[0].prev = null;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (window_wrapper) {\r\n\t\t\tthis.nodes.unshift(window_wrapper);\r\n\t\t\tlink(last_child, window_wrapper);\r\n\t\t}\r\n\t}\r\n\r\n\trender(block: Block, parent_node: Identifier, parent_nodes: Identifier) {\r\n\t\tfor (let i = 0; i < this.nodes.length; i += 1) {\r\n\t\t\tthis.nodes[i].render(block, parent_node, parent_nodes);\r\n\t\t}\r\n\t}\r\n}\r\n","var charToInteger = {};\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nfor (var i = 0; i < chars.length; i++) {\n    charToInteger[chars.charCodeAt(i)] = i;\n}\nfunction decode(mappings) {\n    var decoded = [];\n    var line = [];\n    var segment = [\n        0,\n        0,\n        0,\n        0,\n        0,\n    ];\n    var j = 0;\n    for (var i = 0, shift = 0, value = 0; i < mappings.length; i++) {\n        var c = mappings.charCodeAt(i);\n        if (c === 44) { // \",\"\n            segmentify(line, segment, j);\n            j = 0;\n        }\n        else if (c === 59) { // \";\"\n            segmentify(line, segment, j);\n            j = 0;\n            decoded.push(line);\n            line = [];\n            segment[0] = 0;\n        }\n        else {\n            var integer = charToInteger[c];\n            if (integer === undefined) {\n                throw new Error('Invalid character (' + String.fromCharCode(c) + ')');\n            }\n            var hasContinuationBit = integer & 32;\n            integer &= 31;\n            value += integer << shift;\n            if (hasContinuationBit) {\n                shift += 5;\n            }\n            else {\n                var shouldNegate = value & 1;\n                value >>>= 1;\n                if (shouldNegate) {\n                    value = value === 0 ? -0x80000000 : -value;\n                }\n                segment[j] += value;\n                j++;\n                value = shift = 0; // reset\n            }\n        }\n    }\n    segmentify(line, segment, j);\n    decoded.push(line);\n    return decoded;\n}\nfunction segmentify(line, segment, j) {\n    // This looks ugly, but we're creating specialized arrays with a specific\n    // length. This is much faster than creating a new array (which v8 expands to\n    // a capacity of 17 after pushing the first item), or slicing out a subarray\n    // (which is slow). Length 4 is assumed to be the most frequent, followed by\n    // length 5 (since not everything will have an associated name), followed by\n    // length 1 (it's probably rare for a source substring to not have an\n    // associated segment data).\n    if (j === 4)\n        line.push([segment[0], segment[1], segment[2], segment[3]]);\n    else if (j === 5)\n        line.push([segment[0], segment[1], segment[2], segment[3], segment[4]]);\n    else if (j === 1)\n        line.push([segment[0]]);\n}\nfunction encode(decoded) {\n    var sourceFileIndex = 0; // second field\n    var sourceCodeLine = 0; // third field\n    var sourceCodeColumn = 0; // fourth field\n    var nameIndex = 0; // fifth field\n    var mappings = '';\n    for (var i = 0; i < decoded.length; i++) {\n        var line = decoded[i];\n        if (i > 0)\n            mappings += ';';\n        if (line.length === 0)\n            continue;\n        var generatedCodeColumn = 0; // first field\n        var lineMappings = [];\n        for (var _i = 0, line_1 = line; _i < line_1.length; _i++) {\n            var segment = line_1[_i];\n            var segmentMappings = encodeInteger(segment[0] - generatedCodeColumn);\n            generatedCodeColumn = segment[0];\n            if (segment.length > 1) {\n                segmentMappings +=\n                    encodeInteger(segment[1] - sourceFileIndex) +\n                        encodeInteger(segment[2] - sourceCodeLine) +\n                        encodeInteger(segment[3] - sourceCodeColumn);\n                sourceFileIndex = segment[1];\n                sourceCodeLine = segment[2];\n                sourceCodeColumn = segment[3];\n            }\n            if (segment.length === 5) {\n                segmentMappings += encodeInteger(segment[4] - nameIndex);\n                nameIndex = segment[4];\n            }\n            lineMappings.push(segmentMappings);\n        }\n        mappings += lineMappings.join(',');\n    }\n    return mappings;\n}\nfunction encodeInteger(num) {\n    var result = '';\n    num = num < 0 ? (-num << 1) | 1 : num << 1;\n    do {\n        var clamped = num & 31;\n        num >>>= 5;\n        if (num > 0) {\n            clamped |= 32;\n        }\n        result += chars[clamped];\n    } while (num > 0);\n    return result;\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Creates a brand new (prototype-less) object with the enumerable-own\n * properties of `target`. Any enumerable-own properties from `source` which\n * are not present on `target` will be copied as well.\n */\nfunction defaults(target, source) {\n    return Object.assign(Object.create(null), source, target);\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Decodes an input sourcemap into a `DecodedSourceMap` sourcemap object.\n *\n * Valid input maps include a `DecodedSourceMap`, a `RawSourceMap`, or JSON\n * representations of either type.\n */\nfunction decodeSourceMap(map) {\n    if (typeof map === 'string') {\n        map = JSON.parse(map);\n    }\n    let { mappings } = map;\n    if (typeof mappings === 'string') {\n        mappings = decode(mappings);\n    }\n    else {\n        // Clone the Line so that we can sort it. We don't want to mutate an array\n        // that we don't own directly.\n        mappings = mappings.map(cloneSegmentLine);\n    }\n    // Sort each Line's segments. There's no guarantee that segments are sorted for us,\n    // and even Chrome's implementation sorts:\n    // https://cs.chromium.org/chromium/src/third_party/devtools-frontend/src/front_end/sdk/SourceMap.js?l=507-508&rcl=109232bcf479c8f4ef8ead3cf56c49eb25f8c2f0\n    mappings.forEach(sortSegments);\n    return defaults({ mappings }, map);\n}\nfunction cloneSegmentLine(segments) {\n    return segments.slice();\n}\nfunction sortSegments(segments) {\n    segments.sort(segmentComparator);\n}\nfunction segmentComparator(a, b) {\n    return a[0] - b[0];\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A \"leaf\" node in the sourcemap tree, representing an original, unmodified\n * source file. Recursive segment tracing ends at the `OriginalSource`.\n */\nclass OriginalSource {\n    constructor(filename, content) {\n        this.filename = filename;\n        this.content = content;\n    }\n    /**\n     * Tracing a `SourceMapSegment` ends when we get to an `OriginalSource`,\n     * meaning this line/column location originated from this source file.\n     */\n    traceSegment(line, column, name) {\n        return { column, line, name, source: this };\n    }\n}\n\n/* istanbul ignore next */\nconst Url = (typeof URL !== 'undefined' ? URL : require('url').URL);\n// Matches \"..\", which must be preceeded by \"/\" or the start of the string, and\n// must be followed by a \"/\". We do not eat the following \"/\", so that the next\n// iteration can match on it.\nconst parentRegex = /(^|\\/)\\.\\.(?=\\/|$)/g;\nfunction isAbsoluteUrl(url) {\n    try {\n        return !!new Url(url);\n    }\n    catch (e) {\n        return false;\n    }\n}\n/**\n * Creates a directory name that is guaranteed to not be in `str`.\n */\nfunction uniqInStr(str) {\n    let uniq = String(Math.random()).slice(2);\n    while (str.indexOf(uniq) > -1) {\n        /* istanbul ignore next */\n        uniq += uniq;\n    }\n    return uniq;\n}\n/**\n * Removes the filename from the path (everything trailing the last \"/\"). This\n * is only safe to call on a path, never call with an absolute or protocol\n * relative URL.\n */\nfunction stripPathFilename(path) {\n    path = normalizePath(path);\n    const index = path.lastIndexOf('/');\n    return path.slice(0, index + 1);\n}\n/**\n * Normalizes a protocol-relative URL, but keeps it protocol relative by\n * stripping out the protocl before returning it.\n */\nfunction normalizeProtocolRelative(input, absoluteBase) {\n    const { href, protocol } = new Url(input, absoluteBase);\n    return href.slice(protocol.length);\n}\n/**\n * Normalizes a simple path (one that has no \"..\"s, or is absolute so \"..\"s can\n * be normalized absolutely).\n */\nfunction normalizeSimplePath(input) {\n    const { href } = new Url(input, 'https://foo.com/');\n    return href.slice('https://foo.com/'.length);\n}\n/**\n * Normalizes a path, ensuring that excess \"..\"s are preserved for relative\n * paths in the output.\n *\n * If the input is absolute, this will return an absolutey normalized path, but\n * it will not have a leading \"/\".\n *\n * If the input has a leading \"..\", the output will have a leading \"..\".\n *\n * If the input has a leading \".\", the output will not have a leading \".\"\n * unless there are too many \"..\"s, in which case there will be a leading \"..\".\n */\nfunction normalizePath(input) {\n    // If there are no \"..\"s, we can treat this as if it were an absolute path.\n    // The return won't be an absolute path, so it's easy.\n    if (!parentRegex.test(input))\n        return normalizeSimplePath(input);\n    // We already found one \"..\". Let's see how many there are.\n    let total = 1;\n    while (parentRegex.test(input))\n        total++;\n    // If there are \"..\"s, we need to prefix the the path with the same number of\n    // unique directories. This is to ensure that we \"remember\" how many parent\n    // directories we are accessing. Eg, \"../../..\" must keep 3, and \"foo/../..\"\n    // must keep 1.\n    const uniqDirectory = `z${uniqInStr(input)}/`;\n    // uniqDirectory is just a \"z\", followed by numbers, followed by a \"/\". So\n    // generating a runtime regex from it is safe. We'll use this search regex to\n    // strip out our uniq directory names and insert any needed \"..\"s.\n    const search = new RegExp(`^(?:${uniqDirectory})*`);\n    // Now we can resolve the total path. If there are excess \"..\"s, they will\n    // eliminate one or more of the unique directories we prefix with.\n    const relative = normalizeSimplePath(uniqDirectory.repeat(total) + input);\n    // We can now count the number of unique directories that were eliminated. If\n    // there were 3, and 1 was eliminated, we know we only need to add 1 \"..\". If\n    // 2 were eliminated, we need to insert 2 \"..\"s. If all 3 were eliminated,\n    // then we need 3, etc. This replace is guranteed to match (it may match 0 or\n    // more times), and we can count the total match to see how many were eliminated.\n    return relative.replace(search, (all) => {\n        const leftover = all.length / uniqDirectory.length;\n        return '../'.repeat(total - leftover);\n    });\n}\n/**\n * Attempts to resolve `input` URL relative to `base`.\n */\nfunction resolve(input, base) {\n    if (!base)\n        base = '';\n    // Absolute URLs are very easy to resolve right.\n    if (isAbsoluteUrl(input))\n        return new Url(input).href;\n    if (base) {\n        // Absolute URLs are easy...\n        if (isAbsoluteUrl(base))\n            return new Url(input, base).href;\n        // If base is protocol relative, we'll resolve with it but keep the result\n        // protocol relative.\n        if (base.startsWith('//'))\n            return normalizeProtocolRelative(input, `https:${base}`);\n    }\n    // Normalize input, but keep it protocol relative. We know base doesn't supply\n    // a protocol, because that would have been handled above.\n    if (input.startsWith('//'))\n        return normalizeProtocolRelative(input, 'https://foo.com/');\n    // We now know that base (if there is one) and input are paths. We've handled\n    // both absolute and protocol-relative variations above.\n    // Absolute paths don't need any special handling, because they cannot have\n    // extra \".\" or \"..\"s. That'll all be stripped away. Input takes priority here,\n    // because if input is an absolute path, base path won't affect it in any way.\n    if (input.startsWith('/'))\n        return '/' + normalizeSimplePath(input);\n    // Since input and base are paths, we need to join them to do any further\n    // processing. Paths are joined at the directory level, so we need to remove\n    // the base's filename before joining. We also know that input does not have a\n    // leading slash, and that the stripped base will have a trailing slash if\n    // there are any directories (or it'll be empty).\n    const joined = stripPathFilename(base) + input;\n    // If base is an absolute path, then input will be relative to it.\n    if (base.startsWith('/'))\n        return '/' + normalizeSimplePath(joined);\n    // We now know both base (if there is one) and input are relative paths.\n    const relative = normalizePath(joined);\n    // If base started with a leading \".\", or there is no base and input started\n    // with a \".\", then we need to ensure that the relative path starts with a\n    // \".\". We don't know if relative starts with a \"..\", though, so check before\n    // prepending.\n    if ((base || input).startsWith('.') && !relative.startsWith('.')) {\n        return './' + relative;\n    }\n    return relative;\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction resolve$1(input, base) {\n    // The base is always treated as a directory, if it's not empty.\n    // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n    // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n    if (base && !base.endsWith('/'))\n        base += '/';\n    return resolve(input, base);\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A binary search implementation that returns the index if a match is found,\n * or the negated index of where the `needle` should be inserted.\n *\n * The `comparator` callback receives both the `item` under comparison and the\n * needle we are searching for. It must return `0` if the `item` is a match,\n * any negative number if `item` is too small (and we must search after it), or\n * any positive number if the `item` is too large (and we must search before\n * it).\n *\n * If no match is found, a negated index of where to insert the `needle` is\n * returned. This negated index is guaranteed to be less than 0. To insert an\n * item, negate it (again) and splice:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, -2);\n * assert.equal(~index, 1);\n * array.splice(~index, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nfunction binarySearch(haystack, needle, comparator) {\n    let low = 0;\n    let high = haystack.length - 1;\n    while (low <= high) {\n        const mid = low + ((high - low) >> 1);\n        const cmp = comparator(haystack[mid], needle);\n        if (cmp === 0) {\n            return mid;\n        }\n        if (cmp < 0) {\n            low = mid + 1;\n        }\n        else {\n            high = mid - 1;\n        }\n    }\n    return ~low;\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * FastStringArray acts like a `Set` (allowing only one occurrence of a string\n * `key`), but provides the index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of\n * the backing array, like how `sourcesContent[i]` is the source content\n * associated with `source[i]`, and there are never duplicates.\n */\nclass FastStringArray {\n    constructor() {\n        this.indexes = Object.create(null);\n        this.array = [];\n    }\n    /**\n     * Puts `key` into the backing array, if it is not already present. Returns\n     * the index of the `key` in the backing array.\n     */\n    put(key) {\n        const { array, indexes } = this;\n        // The key may or may not be present. If it is present, it's a number.\n        let index = indexes[key];\n        // If it's not yet present, we need to insert it and track the index in the\n        // indexes.\n        if (index === undefined) {\n            index = indexes[key] = array.length;\n            array.push(key);\n        }\n        return index;\n    }\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * SourceMapTree represents a single sourcemap, with the ability to trace\n * mappings into its child nodes (which may themselves be SourceMapTrees).\n */\nclass SourceMapTree {\n    constructor(map, sources) {\n        this.map = map;\n        this.sources = sources;\n    }\n    /**\n     * traceMappings is only called on the root level SourceMapTree, and begins\n     * the process of resolving each mapping in terms of the original source\n     * files.\n     */\n    traceMappings() {\n        const mappings = [];\n        const names = new FastStringArray();\n        const sources = new FastStringArray();\n        const sourcesContent = [];\n        const { mappings: rootMappings, names: rootNames } = this.map;\n        for (let i = 0; i < rootMappings.length; i++) {\n            const segments = rootMappings[i];\n            const tracedSegments = [];\n            for (let j = 0; j < segments.length; j++) {\n                const segment = segments[j];\n                // 1-length segments only move the current generated column, there's no\n                // source information to gather from it.\n                if (segment.length === 1)\n                    continue;\n                const source = this.sources[segment[1]];\n                const traced = source.traceSegment(segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : '');\n                if (!traced)\n                    continue;\n                // So we traced a segment down into its original source file. Now push a\n                // new segment pointing to this location.\n                const { column, line, name } = traced;\n                const { content, filename } = traced.source;\n                // Store the source location, and ensure we keep sourcesContent up to\n                // date with the sources array.\n                const sourceIndex = sources.put(filename);\n                sourcesContent[sourceIndex] = content;\n                // This looks like unnecessary duplication, but it noticeably increases\n                // performance. If we were to push the nameIndex onto length-4 array, v8\n                // would internally allocate 22 slots! That's 68 wasted bytes! Array\n                // literals have the same capacity as their length, saving memory.\n                if (name) {\n                    tracedSegments.push([segment[0], sourceIndex, line, column, names.put(name)]);\n                }\n                else {\n                    tracedSegments.push([segment[0], sourceIndex, line, column]);\n                }\n            }\n            mappings.push(tracedSegments);\n        }\n        // TODO: Make all sources relative to the sourceRoot.\n        return defaults({\n            mappings,\n            names: names.array,\n            sources: sources.array,\n            sourcesContent,\n        }, this.map);\n    }\n    /**\n     * traceSegment is only called on children SourceMapTrees. It recurses down\n     * into its own child SourceMapTrees, until we find the original source map.\n     */\n    traceSegment(line, column, name) {\n        const { mappings, names } = this.map;\n        // It's common for parent sourcemaps to have pointers to lines that have no\n        // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n        if (line >= mappings.length)\n            return null;\n        const segments = mappings[line];\n        if (segments.length === 0)\n            return null;\n        let index = binarySearch(segments, column, segmentComparator$1);\n        if (index === -1)\n            return null; // we come before any mapped segment\n        // If we can't find a segment that lines up to this column, we use the\n        // segment before.\n        if (index < 0) {\n            index = ~index - 1;\n        }\n        const segment = segments[index];\n        // 1-length segments only move the current generated column, there's no\n        // source information to gather from it.\n        if (segment.length === 1)\n            return null;\n        const source = this.sources[segment[1]];\n        // So now we can recurse down, until we hit the original source file.\n        return source.traceSegment(segment[2], segment[3], \n        // A child map's recorded name for this segment takes precedence over the\n        // parent's mapped name. Imagine a mangler changing the name over, etc.\n        segment.length === 5 ? names[segment[4]] : name);\n    }\n}\nfunction segmentComparator$1(segment, column) {\n    return segment[0] - column;\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Removes the filename from a path.\n */\nfunction stripFilename(path) {\n    if (!path)\n        return '';\n    const index = path.lastIndexOf('/');\n    return path.slice(0, index + 1);\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction asArray(value) {\n    if (Array.isArray(value))\n        return value;\n    return [value];\n}\n/**\n * Recursively builds a tree structure out of sourcemap files, with each node\n * being either an `OriginalSource` \"leaf\" or a `SourceMapTree` composed of\n * `OriginalSource`s and `SourceMapTree`s.\n *\n * Every sourcemap is composed of a collection of source files and mappings\n * into locations of those source files. When we generate a `SourceMapTree` for\n * the sourcemap, we attempt to load each source file's own sourcemap. If it\n * does not have an associated sourcemap, it is considered an original,\n * unmodified source file.\n */\nfunction buildSourceMapTree(input, loader, relativeRoot) {\n    const maps = asArray(input).map(decodeSourceMap);\n    const map = maps.pop();\n    for (let i = 0; i < maps.length; i++) {\n        if (maps[i].sources.length !== 1) {\n            throw new Error(`Transformation map ${i} must have exactly one source file.\\n` +\n                'Did you specify these with the most recent transformation maps first?');\n        }\n    }\n    const { sourceRoot, sources, sourcesContent } = map;\n    const children = sources.map((sourceFile, i) => {\n        // Each source file is loaded relative to the sourcemap's own sourceRoot,\n        // which is itself relative to the sourcemap's parent.\n        const uri = resolve$1(sourceFile || '', resolve$1(sourceRoot || '', stripFilename(relativeRoot)));\n        // Use the provided loader callback to retrieve the file's sourcemap.\n        // TODO: We should eventually support async loading of sourcemap files.\n        const sourceMap = loader(uri);\n        // If there is no sourcemap, then it is an unmodified source file.\n        if (!sourceMap) {\n            // The source file's actual contents must be included in the sourcemap\n            // (done when generating the sourcemap) for it to be included as a\n            // sourceContent in the output sourcemap.\n            const sourceContent = sourcesContent ? sourcesContent[i] : null;\n            return new OriginalSource(uri, sourceContent);\n        }\n        // Else, it's a real sourcemap, and we need to recurse into it to load its\n        // source files.\n        return buildSourceMapTree(decodeSourceMap(sourceMap), loader, uri);\n    });\n    let tree = new SourceMapTree(map, children);\n    for (let i = maps.length - 1; i >= 0; i--) {\n        tree = new SourceMapTree(maps[i], [tree]);\n    }\n    return tree;\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A SourceMap v3 compatible sourcemap, which only includes fields that were\n * provided to it.\n */\nclass SourceMap {\n    constructor(map, excludeContent) {\n        this.version = 3; // SourceMap spec says this should be first.\n        if ('file' in map)\n            this.file = map.file;\n        this.mappings = encode(map.mappings);\n        this.names = map.names;\n        // TODO: We first need to make all source URIs relative to the sourceRoot\n        // before we can support a sourceRoot.\n        // if ('sourceRoot' in map) this.sourceRoot = map.sourceRoot;\n        this.sources = map.sources;\n        if (!excludeContent && 'sourcesContent' in map)\n            this.sourcesContent = map.sourcesContent;\n    }\n    toString() {\n        return JSON.stringify(this);\n    }\n}\n\n/**\n * Copyright 2019 The AMP HTML Authors. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Traces through all the mappings in the root sourcemap, through the sources\n * (and their sourcemaps), all the way back to the original source location.\n *\n * `loader` will be called every time we encounter a source file. If it returns\n * a sourcemap, we will recurse into that sourcemap to continue the trace. If\n * it returns a falsey value, that source file is treated as an original,\n * unmodified source file.\n *\n * Pass `excludeContent` content to exclude any self-containing source file\n * content from the output sourcemap.\n */\nfunction remapping(input, loader, excludeContent) {\n    const graph = buildSourceMapTree(input, loader);\n    return new SourceMap(graph.traceMappings(), !!excludeContent);\n}\n\nexport default remapping;\n//# sourceMappingURL=remapping.mjs.map\n","import { DecodedSourceMap, RawSourceMap, SourceMapLoader } from '@ampproject/remapping/dist/types/types';\r\nimport remapping from '@ampproject/remapping';\r\nimport { SourceMap } from 'magic-string';\r\nimport { Source, Processed } from '../preprocess/types';\r\nimport { push_array } from './push_array';\r\n\r\nexport type SourceLocation = {\r\n\tline: number;\r\n\tcolumn: number;\r\n};\r\n\r\nfunction last_line_length(s: string) {\r\n\treturn s.length - s.lastIndexOf('\\n') - 1;\r\n}\r\n\r\n// mutate map in-place\r\nexport function sourcemap_add_offset(\r\n\tmap: DecodedSourceMap, offset: SourceLocation, source_index: number\r\n) {\r\n\tif (map.mappings.length == 0) return;\r\n\tfor (let line = 0; line < map.mappings.length; line++) {\r\n\t\tconst segment_list = map.mappings[line];\r\n\t\tfor (let segment = 0; segment < segment_list.length; segment++) {\r\n\t\t\tconst seg = segment_list[segment];\r\n\t\t\t// shift only segments that belong to component source file\r\n\t\t\tif (seg[1] === source_index) { // also ensures that seg.length >= 4\r\n\t\t\t\t// shift column if it points at the first line\r\n\t\t\t\tif (seg[2] === 0) {\r\n\t\t\t\t\tseg[3] += offset.column;\r\n\t\t\t\t}\r\n\t\t\t\t// shift line\r\n\t\t\t\tseg[2] += offset.line;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction merge_tables<T>(this_table: T[], other_table: T[]): [T[], number[], boolean, boolean] {\r\n\tconst new_table = this_table.slice();\r\n\tconst idx_map = [];\r\n\tother_table = other_table || [];\r\n\tlet val_changed = false;\r\n\tfor (const [other_idx, other_val] of other_table.entries()) {\r\n\t\tconst this_idx = this_table.indexOf(other_val);\r\n\t\tif (this_idx >= 0) {\r\n\t\t\tidx_map[other_idx] = this_idx;\r\n\t\t} else {\r\n\t\t\tconst new_idx = new_table.length;\r\n\t\t\tnew_table[new_idx] = other_val;\r\n\t\t\tidx_map[other_idx] = new_idx;\r\n\t\t\tval_changed = true;\r\n\t\t}\r\n\t}\r\n\tlet idx_changed = val_changed;\r\n\tif (val_changed) {\r\n\t\tif (idx_map.find((val, idx) => val != idx) === undefined) {\r\n\t\t\t// idx_map is identity map [0, 1, 2, 3, 4, ....]\r\n\t\t\tidx_changed = false;\r\n\t\t}\r\n\t}\r\n\treturn [new_table, idx_map, val_changed, idx_changed];\r\n}\r\n\r\nconst regex_line_token = /([^\\d\\w\\s]|\\s+)/g;\r\n\r\nexport class MappedCode {\r\n\tstring: string;\r\n\tmap: DecodedSourceMap;\r\n\r\n\tconstructor(string = '', map: DecodedSourceMap = null) {\r\n\t\tthis.string = string;\r\n\t\tif (map) {\r\n\t\t\tthis.map = map as DecodedSourceMap;\r\n\t\t} else {\r\n\t\t\tthis.map = {\r\n\t\t\t\tversion: 3,\r\n\t\t\t\tmappings: [],\r\n\t\t\t\tsources: [],\r\n\t\t\t\tnames: []\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * concat in-place (mutable), return this (chainable)\r\n\t * will also mutate the `other` object\r\n\t */\r\n\tconcat(other: MappedCode): MappedCode {\r\n\t\t// noop: if one is empty, return the other\r\n\t\tif (other.string == '') return this;\r\n\t\tif (this.string == '') {\r\n\t\t\tthis.string = other.string;\r\n\t\t\tthis.map = other.map;\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\t// compute last line length before mutating\r\n\t\tconst column_offset = last_line_length(this.string);\r\n\r\n\t\tthis.string += other.string;\r\n\r\n\t\tconst m1 = this.map;\r\n\t\tconst m2 = other.map;\r\n\r\n\t\tif (m2.mappings.length == 0) return this;\r\n\r\n\t\t// combine sources and names\r\n\t\tconst [sources, new_source_idx, sources_changed, sources_idx_changed] = merge_tables(m1.sources, m2.sources);\r\n\t\tconst [names, new_name_idx, names_changed, names_idx_changed] = merge_tables(m1.names, m2.names);\r\n\r\n\t\tif (sources_changed) m1.sources = sources;\r\n\t\tif (names_changed) m1.names = names;\r\n\r\n\t\t// unswitched loops are faster\r\n\t\tif (sources_idx_changed && names_idx_changed) {\r\n\t\t\tfor (let line = 0; line < m2.mappings.length; line++) {\r\n\t\t\t\tconst segment_list = m2.mappings[line];\r\n\t\t\t\tfor (let segment = 0; segment < segment_list.length; segment++) {\r\n\t\t\t\t\tconst seg = segment_list[segment];\r\n\t\t\t\t\tif (seg[1] >= 0) seg[1] = new_source_idx[seg[1]];\r\n\t\t\t\t\tif (seg[4] >= 0) seg[4] = new_name_idx[seg[4]];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (sources_idx_changed) {\r\n\t\t\tfor (let line = 0; line < m2.mappings.length; line++) {\r\n\t\t\t\tconst segment_list = m2.mappings[line];\r\n\t\t\t\tfor (let segment = 0; segment < segment_list.length; segment++) {\r\n\t\t\t\t\tconst seg = segment_list[segment];\r\n\t\t\t\t\tif (seg[1] >= 0) seg[1] = new_source_idx[seg[1]];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (names_idx_changed) {\r\n\t\t\tfor (let line = 0; line < m2.mappings.length; line++) {\r\n\t\t\t\tconst segment_list = m2.mappings[line];\r\n\t\t\t\tfor (let segment = 0; segment < segment_list.length; segment++) {\r\n\t\t\t\t\tconst seg = segment_list[segment];\r\n\t\t\t\t\tif (seg[4] >= 0) seg[4] = new_name_idx[seg[4]];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// combine the mappings\r\n\r\n\t\t// combine\r\n\t\t// 1. last line of first map\r\n\t\t// 2. first line of second map\r\n\t\t// columns of 2 must be shifted\r\n\r\n\t\tif (m2.mappings.length > 0 && column_offset > 0) {\r\n\t\t\tconst first_line = m2.mappings[0];\r\n\t\t\tfor (let i = 0; i < first_line.length; i++) {\r\n\t\t\t\tfirst_line[i][0] += column_offset;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// combine last line + first line\r\n\t\tpush_array(m1.mappings[m1.mappings.length - 1], m2.mappings.shift());\r\n\r\n\t\t// append other lines\r\n\t\tpush_array(m1.mappings, m2.mappings);\r\n\r\n\t\treturn this;\r\n\t}\r\n\r\n\tstatic from_processed(string: string, map?: DecodedSourceMap): MappedCode {\r\n\t\tconst line_count = string.split('\\n').length;\r\n\r\n\t\tif (map) {\r\n\t\t\t// ensure that count of source map mappings lines\r\n\t\t\t// is equal to count of generated code lines\r\n\t\t\t// (some tools may produce less)\r\n\t\t\tconst missing_lines = line_count - map.mappings.length;\r\n\t\t\tfor (let i = 0; i < missing_lines; i++) {\r\n\t\t\t\tmap.mappings.push([]);\r\n\t\t\t}\r\n\t\t\treturn new MappedCode(string, map);\r\n\t\t}\r\n\r\n\t\tif (string == '') return new MappedCode();\r\n\t\tmap = { version: 3, names: [], sources: [], mappings: [] };\r\n\r\n\t\t// add empty SourceMapSegment[] for every line\r\n\t\tfor (let i = 0; i < line_count; i++) map.mappings.push([]);\r\n\t\treturn new MappedCode(string, map);\r\n\t}\r\n\r\n\tstatic from_source({ source, file_basename, get_location }: Source): MappedCode {\r\n\t\tlet offset: SourceLocation = get_location(0);\r\n\r\n\t\tif (!offset) offset = { line: 0, column: 0 };\r\n\t\tconst map: DecodedSourceMap = { version: 3, names: [], sources: [file_basename], mappings: [] };\r\n\t\tif (source == '') return new MappedCode(source, map);\r\n\r\n\t\t// we create a high resolution identity map here,\r\n\t\t// we know that it will eventually be merged with svelte's map,\r\n\t\t// at which stage the resolution will decrease.\r\n\t\tconst line_list = source.split('\\n');\r\n\t\tfor (let line = 0; line < line_list.length; line++) {\r\n\t\t\tmap.mappings.push([]);\r\n\t\t\tconst token_list = line_list[line].split(regex_line_token);\r\n\t\t\tfor (let token = 0, column = 0; token < token_list.length; token++) {\r\n\t\t\t\tif (token_list[token] == '') continue;\r\n\t\t\t\tmap.mappings[line].push([column, 0, offset.line + line, column]);\r\n\t\t\t\tcolumn += token_list[token].length;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// shift columns in first line\r\n\t\tconst segment_list = map.mappings[0];\r\n\t\tfor (let segment = 0; segment < segment_list.length; segment++) {\r\n\t\t\tsegment_list[segment][3] += offset.column;\r\n\t\t}\r\n\t\treturn new MappedCode(source, map);\r\n\t}\r\n}\r\n\r\nexport function combine_sourcemaps(\r\n\tfilename: string,\r\n\tsourcemap_list: Array<DecodedSourceMap | RawSourceMap>\r\n): RawSourceMap {\r\n\tif (sourcemap_list.length == 0) return null;\r\n\r\n\tlet map_idx = 1;\r\n\tconst map: RawSourceMap =\r\n\t\tsourcemap_list.slice(0, -1)\r\n\t\t\t.find(m => m.sources.length !== 1) === undefined\r\n\r\n\t\t\t? remapping( // use array interface\r\n\t\t\t\t// only the oldest sourcemap can have multiple sources\r\n\t\t\t\tsourcemap_list,\r\n\t\t\t\t() => null,\r\n\t\t\t\ttrue // skip optional field `sourcesContent`\r\n\t\t\t)\r\n\r\n\t\t\t: remapping( // use loader interface\r\n\t\t\t\tsourcemap_list[0], // last map\r\n\t\t\t\tfunction loader(sourcefile) {\r\n\t\t\t\t\tif (sourcefile === filename && sourcemap_list[map_idx]) {\r\n\t\t\t\t\t\treturn sourcemap_list[map_idx++]; // idx 1, 2, ...\r\n\t\t\t\t\t\t// bundle file = branch node\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn null; // source file = leaf node\r\n\t\t\t\t\t}\r\n\t\t\t\t} as SourceMapLoader,\r\n\t\t\t\ttrue\r\n\t\t\t);\r\n\r\n\tif (!map.file) delete map.file; // skip optional field `file`\r\n\r\n\t// When source maps are combined and the leading map is empty, sources is not set.\r\n\t// Add the filename to the empty array in this case.\r\n\t// Further improvements to remapping may help address this as well https://github.com/ampproject/remapping/issues/116\r\n\tif (!map.sources.length) map.sources = [filename];\r\n\r\n\treturn map;\r\n}\r\n\r\n// browser vs node.js\r\nconst b64enc = typeof btoa == 'function' ? btoa : b => Buffer.from(b).toString('base64');\r\nconst b64dec = typeof atob == 'function' ? atob : a => Buffer.from(a, 'base64').toString();\r\n\r\nexport function apply_preprocessor_sourcemap(filename: string, svelte_map: SourceMap, preprocessor_map_input: string | DecodedSourceMap | RawSourceMap): SourceMap {\r\n\tif (!svelte_map || !preprocessor_map_input) return svelte_map;\r\n\r\n\tconst preprocessor_map = typeof preprocessor_map_input === 'string' ? JSON.parse(preprocessor_map_input) : preprocessor_map_input;\r\n\r\n\tconst result_map = combine_sourcemaps(\r\n\t\tfilename,\r\n\t\t[\r\n\t\t\tsvelte_map as RawSourceMap,\r\n\t\t\tpreprocessor_map\r\n\t\t]\r\n\t) as RawSourceMap;\r\n\r\n\t// Svelte expects a SourceMap which includes toUrl and toString. Instead of wrapping our output in a class,\r\n\t// we just tack on the extra properties.\r\n\tObject.defineProperties(result_map, {\r\n\t\ttoString: {\r\n\t\t\tenumerable: false,\r\n\t\t\tvalue: function toString() {\r\n\t\t\t\treturn JSON.stringify(this);\r\n\t\t\t}\r\n\t\t},\r\n\t\ttoUrl: {\r\n\t\t\tenumerable: false,\r\n\t\t\tvalue: function toUrl() {\r\n\t\t\t\treturn 'data:application/json;charset=utf-8;base64,' + b64enc(this.toString());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\treturn result_map as SourceMap;\r\n}\r\n\r\nconst regex_data_uri = /data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,(\\S*)/;\r\n\r\n// parse attached sourcemap in processed.code\r\nexport function parse_attached_sourcemap(processed: Processed, tag_name: 'script' | 'style'): void {\r\n\tconst r_in = '[#@]\\\\s*sourceMappingURL\\\\s*=\\\\s*(\\\\S*)';\r\n\tconst regex = (tag_name == 'script')\r\n\t\t? new RegExp('(?://' + r_in + ')|(?:/\\\\*' + r_in + '\\\\s*\\\\*/)$')\r\n\t\t: new RegExp('/\\\\*' + r_in + '\\\\s*\\\\*/$');\r\n\tfunction log_warning(message) {\r\n\t\t// code_start: help to find preprocessor\r\n\t\tconst code_start = processed.code.length < 100 ? processed.code : (processed.code.slice(0, 100) + ' [...]');\r\n\t\tconsole.warn(`warning: ${message}. processed.code = ${JSON.stringify(code_start)}`);\r\n\t}\r\n\tprocessed.code = processed.code.replace(regex, (_, match1, match2) => {\r\n\t\tconst map_url = (tag_name == 'script') ? (match1 || match2) : match1;\r\n\t\tconst map_data = (map_url.match(regex_data_uri) || [])[1];\r\n\t\tif (map_data) {\r\n\t\t\t// sourceMappingURL is data URL\r\n\t\t\tif (processed.map) {\r\n\t\t\t\tlog_warning('Not implemented. ' +\r\n\t\t\t\t\t'Found sourcemap in both processed.code and processed.map. ' +\r\n\t\t\t\t\t'Please update your preprocessor to return only one sourcemap.');\r\n\t\t\t\t// ignore attached sourcemap\r\n\t\t\t\treturn '';\r\n\t\t\t}\r\n\t\t\tprocessed.map = b64dec(map_data); // use attached sourcemap\r\n\t\t\treturn ''; // remove from processed.code\r\n\t\t}\r\n\t\t// sourceMappingURL is path or URL\r\n\t\tif (!processed.map) {\r\n\t\t\tlog_warning(`Found sourcemap path ${JSON.stringify(map_url)} in processed.code, but no sourcemap data. ` +\r\n\t\t\t\t'Please update your preprocessor to return sourcemap data directly.');\r\n\t\t}\r\n\t\t// ignore sourcemap path\r\n\t\treturn ''; // remove from processed.code\r\n\t});\r\n}\r\n","import Attribute from '../../../nodes/Attribute';\r\nimport { string_literal } from '../../../utils/stringify';\r\nimport Text from '../../../nodes/Text';\r\nimport { x } from 'code-red';\r\nimport Expression from '../../../nodes/shared/Expression';\r\nimport { Expression as ESTreeExpression } from 'estree';\r\nimport { regex_double_quotes } from '../../../../utils/patterns';\r\n\r\nexport function get_class_attribute_value(attribute: Attribute): ESTreeExpression {\r\n\t// handle special case — `class={possiblyUndefined}` with scoped CSS\r\n\tif (attribute.chunks.length === 2 && (attribute.chunks[1] as Text).synthetic) {\r\n\t\tconst value = (attribute.chunks[0] as Expression).node;\r\n\t\treturn x`@escape(@null_to_empty(${value}), true) + \"${(attribute.chunks[1] as Text).data}\"`;\r\n\t}\r\n\r\n\treturn get_attribute_value(attribute);\r\n}\r\n\r\nexport function get_attribute_value(attribute: Attribute): ESTreeExpression {\r\n\tif (attribute.chunks.length === 0) return x`\"\"`;\r\n\r\n\treturn attribute.chunks\r\n\t\t.map((chunk) => {\r\n\t\t\treturn chunk.type === 'Text'\r\n\t\t\t\t? string_literal(chunk.data.replace(regex_double_quotes, '&quot;')) as ESTreeExpression\r\n\t\t\t\t: x`@escape(${chunk.node}, true)`;\r\n\t\t})\r\n\t\t.reduce((lhs, rhs) => x`${lhs} + ${rhs}`);\r\n}\r\n\r\nexport function get_attribute_expression(attribute: Attribute): ESTreeExpression {\r\n\tif (attribute.chunks.length === 1 && attribute.chunks[0].type === 'Expression') {\r\n\t\treturn (attribute.chunks[0] as Expression).node as ESTreeExpression;\r\n\t}\r\n\treturn get_attribute_value(attribute);\r\n}\r\n","import { INode } from '../../../nodes/interfaces';\r\nimport { trim_end, trim_start } from '../../../../utils/trim';\r\nimport { link } from '../../../../utils/link';\r\nimport { regex_starts_with_whitespace } from '../../../../utils/patterns';\r\n\r\n// similar logic from `compile/render_dom/wrappers/Fragment`\r\n// We want to remove trailing whitespace inside an element/component/block,\r\n// *unless* there is no whitespace between this node and its next sibling\r\nexport default function remove_whitespace_children(children: INode[], next?: INode): INode[] {\r\n\tconst nodes: INode[] = [];\r\n\tlet last_child: INode;\r\n\tlet i = children.length;\r\n\twhile (i--) {\r\n\t\tconst child = children[i];\r\n\r\n\t\tif (child.type === 'Text') {\r\n\t\t\tif (child.should_skip()) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet { data } = child;\r\n\r\n\t\t\tif (nodes.length === 0) {\r\n\t\t\t\tconst should_trim = next\r\n\t\t\t\t\t? next.type === 'Text' &&\r\n\t\t\t\t\tregex_starts_with_whitespace.test(next.data) &&\r\n\t\t\t\t\t  trimmable_at(child, next)\r\n\t\t\t\t\t: !child.has_ancestor('EachBlock');\r\n\r\n\t\t\t\tif (should_trim && !child.keep_space()) {\r\n\t\t\t\t\tdata = trim_end(data);\r\n\t\t\t\t\tif (!data) continue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// glue text nodes (which could e.g. be separated by comments) together\r\n\t\t\tif (last_child && last_child.type === 'Text') {\r\n\t\t\t\tlast_child.data = data + last_child.data;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tnodes.unshift(child);\r\n\t\t\tlink(last_child, last_child = child);\r\n\t\t} else {\r\n\t\t\tnodes.unshift(child);\r\n\t\t\tlink(last_child, last_child = child);\r\n\t\t}\r\n\t}\r\n\r\n\tconst first = nodes[0];\r\n\tif (first && first.type === 'Text' && !first.keep_space()) {\r\n\t\tfirst.data = trim_start(first.data);\r\n\t\tif (!first.data) {\r\n\t\t\tfirst.var = null;\r\n\t\t\tnodes.shift();\r\n\r\n\t\t\tif (nodes[0]) {\r\n\t\t\t\tnodes[0].prev = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn nodes;\r\n}\r\n\r\nfunction trimmable_at(child: INode, next_sibling: INode): boolean {\r\n\t// Whitespace is trimmable if one of the following is true:\r\n\t// The child and its sibling share a common nearest each block (not at an each block boundary)\r\n\t// The next sibling's previous node is an each block\r\n\treturn (\r\n\t\tnext_sibling.find_nearest(/EachBlock/) ===\r\n\t\t\tchild.find_nearest(/EachBlock/) || next_sibling.prev.type === 'EachBlock'\r\n\t);\r\n}\r\n","import { string_literal } from '../../utils/stringify';\r\nimport { get_attribute_value } from './shared/get_attribute_value';\r\nimport Renderer, { RenderOptions } from '../Renderer';\r\nimport InlineComponent from '../../nodes/InlineComponent';\r\nimport { p, x } from 'code-red';\r\nimport { namespaces } from '../../../utils/namespaces';\r\n\r\nfunction get_prop_value(attribute) {\r\n\tif (attribute.is_true) return x`true`;\r\n\tif (attribute.chunks.length === 0) return x`''`;\r\n\r\n\treturn attribute.chunks\r\n\t\t.map(chunk => {\r\n\t\t\tif (chunk.type === 'Text') return string_literal(chunk.data);\r\n\t\t\treturn chunk.node;\r\n\t\t})\r\n\t\t.reduce((lhs, rhs) => x`${lhs} + ${rhs}`);\r\n}\r\n\r\nexport default function(node: InlineComponent, renderer: Renderer, options: RenderOptions) {\r\n\tconst binding_props = [];\r\n\tconst binding_fns = [];\r\n\r\n\tnode.bindings.forEach(binding => {\r\n\t\trenderer.has_bindings = true;\r\n\r\n\t\t// TODO this probably won't work for contextual bindings\r\n\t\tconst snippet = binding.expression.node;\r\n\r\n\t\tbinding_props.push(p`${binding.name}: ${snippet}`);\r\n\t\tbinding_fns.push(p`${binding.name}: $$value => { ${snippet} = $$value; $$settled = false }`);\r\n\t});\r\n\r\n\tconst uses_spread = node.attributes.find(attr => attr.is_spread);\r\n\r\n\tlet props;\r\n\r\n\tif (uses_spread) {\r\n\t\tprops = x`@_Object.assign(${\r\n\t\t\tnode.attributes\r\n\t\t\t\t.map(attribute => {\r\n\t\t\t\t\tif (attribute.is_spread) {\r\n\t\t\t\t\t\treturn attribute.expression.node;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn x`{ ${attribute.name}: ${get_prop_value(attribute)} }`;\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.concat(binding_props.map(p => x`{ ${p} }`))\r\n\t\t})`;\r\n\t} else {\r\n\t\tprops = x`{\r\n\t\t\t${node.attributes.map(attribute => p`${attribute.name}: ${get_prop_value(attribute)}`)},\r\n\t\t\t${binding_props}\r\n\t\t}`;\r\n\t}\r\n\r\n\tconst bindings = x`{\r\n\t\t${binding_fns}\r\n\t}`;\r\n\r\n\tconst expression = (\r\n\t\tnode.name === 'svelte:self'\r\n\t\t\t? renderer.name\r\n\t\t\t: node.name === 'svelte:component'\r\n\t\t\t\t? x`(${node.expression.node}) || @missing_component`\r\n\t\t\t\t: node.name.split('.').reduce(((lhs, rhs) => x`${lhs}.${rhs}`) as any)\r\n\t);\r\n\r\n\tconst slot_fns = [];\r\n\r\n\tconst children = node.children;\r\n\r\n\tif (children.length) {\r\n\t\tconst slot_scopes = new Map();\r\n\r\n\t\trenderer.render(children, Object.assign({}, options, {\r\n\t\t\tslot_scopes\r\n\t\t}));\r\n\r\n\t\tslot_scopes.forEach(({ input, output, statements }, name) => {\r\n\t\t\tslot_fns.push(\r\n\t\t\t\tp`${name}: (${input}) => { ${statements}; return ${output}; }`\r\n\t\t\t);\r\n\t\t});\r\n\t}\r\n\r\n\tconst slots = x`{\r\n\t\t${slot_fns}\r\n\t}`;\r\n\r\n\tif (node.css_custom_properties.length > 0) {\r\n\t\tif (node.namespace === namespaces.svg) {\r\n\t\t\trenderer.add_string('<g style=\"');\r\n\t\t} else {\r\n\t\t\trenderer.add_string('<div style=\"display: contents; ');\r\n\t\t}\r\n\t\tnode.css_custom_properties.forEach((attr, index) => {\r\n\t\t\trenderer.add_string(`${attr.name}:`);\r\n\t\t\trenderer.add_expression(get_attribute_value(attr));\r\n\t\t\trenderer.add_string(';');\r\n\t\t\tif (index < node.css_custom_properties.length - 1) renderer.add_string(' ');\r\n\t\t});\r\n\t\trenderer.add_string('\">');\r\n\t}\r\n\r\n\trenderer.add_expression(x`@validate_component(${expression}, \"${node.name}\").$$render($$result, ${props}, ${bindings}, ${slots})`);\r\n\r\n\tif (node.css_custom_properties.length > 0) {\r\n\t\tif (node.namespace === namespaces.svg) {\r\n\t\t\trenderer.add_string('</g>');\r\n\t\t} else {\r\n\t\t\trenderer.add_string('</div>');\r\n\t\t}\r\n\t}\r\n}\r\n","import Renderer, { RenderOptions } from '../Renderer';\r\nimport SlotTemplate from '../../nodes/SlotTemplate';\r\nimport remove_whitespace_children from './utils/remove_whitespace_children';\r\nimport { get_slot_scope } from './shared/get_slot_scope';\r\nimport InlineComponent from '../../nodes/InlineComponent';\r\nimport { get_const_tags } from './shared/get_const_tags';\r\n\r\nexport default function(node: SlotTemplate, renderer: Renderer, options: RenderOptions & {\r\n\tslot_scopes: Map<any, any>;\r\n}) {\r\n\tconst parent_inline_component = node.parent as InlineComponent;\r\n\tconst children = remove_whitespace_children(node instanceof SlotTemplate ? node.children : [node], node.next);\r\n\r\n\trenderer.push();\r\n\trenderer.render(children, options);\r\n\r\n\tconst lets = node.lets;\r\n\tconst seen = new Set(lets.map(l => l.name.name));\r\n\tparent_inline_component.lets.forEach(l => {\r\n\t\tif (!seen.has(l.name.name)) lets.push(l);\r\n\t});\r\n\r\n\tconst slot_fragment_content = renderer.pop();\r\n\tif (!is_empty_template_literal(slot_fragment_content)) {\r\n\t\tif (options.slot_scopes.has(node.slot_template_name)) {\r\n\t\t\tif (node.slot_template_name === 'default') {\r\n\t\t\t\tthrow new Error('Found elements without slot attribute when using slot=\"default\"');\r\n\t\t\t}\r\n\t\t\tthrow new Error(`Duplicate slot name \"${node.slot_template_name}\" in <${parent_inline_component.name}>`);\r\n\t\t}\r\n\r\n\t\toptions.slot_scopes.set(node.slot_template_name, {\r\n\t\t\tinput: get_slot_scope(node.lets),\r\n\t\t\toutput: slot_fragment_content,\r\n\t\t\tstatements: get_const_tags(node.const_tags)\r\n\t\t});\r\n\t}\r\n}\r\n\r\nfunction is_empty_template_literal(template_literal) {\r\n\treturn (\r\n\t\ttemplate_literal.expressions.length === 0 &&\r\n\t\ttemplate_literal.quasis.length === 1 &&\r\n\t\ttemplate_literal.quasis[0].value.raw === ''\r\n\t);\r\n}\r\n","import AwaitBlock from './handlers/AwaitBlock';\r\nimport Comment from './handlers/Comment';\r\nimport DebugTag from './handlers/DebugTag';\r\nimport EachBlock from './handlers/EachBlock';\r\nimport Element from './handlers/Element';\r\nimport Head from './handlers/Head';\r\nimport HtmlTag from './handlers/HtmlTag';\r\nimport IfBlock from './handlers/IfBlock';\r\nimport InlineComponent from './handlers/InlineComponent';\r\nimport KeyBlock from './handlers/KeyBlock';\r\nimport Slot from './handlers/Slot';\r\nimport SlotTemplate from './handlers/SlotTemplate';\r\nimport Tag from './handlers/Tag';\r\nimport Text from './handlers/Text';\r\nimport Title from './handlers/Title';\r\nimport { AppendTarget, CompileOptions } from '../../interfaces';\r\nimport { INode } from '../nodes/interfaces';\r\nimport { Expression, TemplateLiteral, Identifier } from 'estree';\r\nimport { escape_template } from '../utils/stringify';\r\n\r\ntype Handler = (node: any, renderer: Renderer, options: CompileOptions) => void;\r\n\r\nfunction noop() {}\r\n\r\nconst handlers: Record<string, Handler> = {\r\n\tAwaitBlock,\r\n\tBody: noop,\r\n\tComment,\r\n\tDebugTag,\r\n\tEachBlock,\r\n\tElement,\r\n\tHead,\r\n\tIfBlock,\r\n\tInlineComponent,\r\n\tKeyBlock,\r\n\tMustacheTag: Tag, // TODO MustacheTag is an anachronism\r\n\tOptions: noop,\r\n\tRawMustacheTag: HtmlTag,\r\n\tSlot,\r\n\tSlotTemplate,\r\n\tText,\r\n\tTitle,\r\n\tWindow: noop\r\n};\r\n\r\nexport interface RenderOptions extends CompileOptions{\r\n\tlocate: (c: number) => { line: number; column: number };\r\n\thead_id?: string;\r\n}\r\n\r\nexport default class Renderer {\r\n\thas_bindings = false;\r\n\r\n\tname: Identifier;\r\n\r\n\tstack: Array<{ current: { value: string }; literal: TemplateLiteral }> = [];\r\n\tcurrent: { value: string }; // TODO can it just be `current: string`?\r\n\tliteral: TemplateLiteral;\r\n\r\n\ttargets: AppendTarget[] = [];\r\n\r\n\tconstructor({ name }) {\r\n\t\tthis.name = name;\r\n\t\tthis.push();\r\n\t}\r\n\r\n\tadd_string(str: string) {\r\n\t\tthis.current.value += escape_template(str);\r\n\t}\r\n\r\n\tadd_expression(node: Expression) {\r\n\t\tthis.literal.quasis.push({\r\n\t\t\ttype: 'TemplateElement',\r\n\t\t\tvalue: { raw: this.current.value, cooked: null },\r\n\t\t\ttail: false\r\n\t\t});\r\n\r\n\t\tthis.literal.expressions.push(node);\r\n\t\tthis.current.value = '';\r\n\t}\r\n\r\n\tpush() {\r\n\t\tconst current = this.current = { value: '' };\r\n\r\n\t\tconst literal = this.literal = {\r\n\t\t\ttype: 'TemplateLiteral',\r\n\t\t\texpressions: [],\r\n\t\t\tquasis: []\r\n\t\t};\r\n\r\n\t\tthis.stack.push({ current, literal });\r\n\t}\r\n\r\n\tpop() {\r\n\t\tthis.literal.quasis.push({\r\n\t\t\ttype: 'TemplateElement',\r\n\t\t\tvalue: { raw: this.current.value, cooked: null },\r\n\t\t\ttail: true\r\n\t\t});\r\n\r\n\t\tconst popped = this.stack.pop();\r\n\t\tconst last = this.stack[this.stack.length - 1];\r\n\r\n\t\tif (last) {\r\n\t\t\tthis.literal = last.literal;\r\n\t\t\tthis.current = last.current;\r\n\t\t}\r\n\r\n\t\treturn popped.literal;\r\n\t}\r\n\r\n\trender(nodes: INode[], options: RenderOptions) {\r\n\t\tnodes.forEach(node => {\r\n\t\t\tconst handler = handlers[node.type];\r\n\r\n\t\t\tif (!handler) {\r\n\t\t\t\tthrow new Error(`No handler for '${node.type}' nodes`);\r\n\t\t\t}\r\n\r\n\t\t\thandler(node, this, options);\r\n\t\t});\r\n\t}\r\n}\r\n","import { b } from 'code-red';\r\nimport Component from '../Component';\r\nimport { CompileOptions, CssResult } from '../../interfaces';\r\nimport { string_literal } from '../utils/stringify';\r\nimport Renderer from './Renderer';\r\nimport { INode as TemplateNode } from '../nodes/interfaces'; // TODO\r\nimport Text from '../nodes/Text';\r\nimport { LabeledStatement, Statement, Node } from 'estree';\r\nimport { extract_names } from 'periscopic';\r\nimport { walk } from 'estree-walker';\r\n\r\nimport { invalidate } from '../render_dom/invalidate';\r\nimport check_enable_sourcemap from '../utils/check_enable_sourcemap';\r\n\r\nexport default function ssr(\r\n\tcomponent: Component,\r\n\toptions: CompileOptions\r\n): {js: Node[]; css: CssResult} {\r\n\tconst renderer = new Renderer({\r\n\t\tname: component.name\r\n\t});\r\n\r\n\tconst { name } = component;\r\n\r\n\t// create $$render function\r\n\trenderer.render(trim(component.fragment.children), Object.assign({\r\n\t\tlocate: component.locate\r\n\t}, options));\r\n\r\n\t// TODO put this inside the Renderer class\r\n\tconst literal = renderer.pop();\r\n\r\n\t// TODO concatenate CSS maps\r\n\tconst css = options.customElement ?\r\n\t\t{ code: null, map: null } :\r\n\t\tcomponent.stylesheet.render(options.filename, true);\r\n\r\n\tconst uses_rest = component.var_lookup.has('$$restProps');\r\n\tconst props = component.vars.filter(variable => !variable.module && variable.export_name);\r\n\tconst rest = uses_rest ? b`let $$restProps = @compute_rest_props($$props, [${props.map(prop => `\"${prop.export_name}\"`).join(',')}]);` : null;\r\n\r\n\tconst uses_slots = component.var_lookup.has('$$slots');\r\n\tconst slots = uses_slots ? b`let $$slots = @compute_slots(#slots);` : null;\r\n\r\n\tconst reactive_stores = component.vars.filter(variable => variable.name[0] === '$' && variable.name[1] !== '$');\r\n\tconst reactive_store_subscriptions = reactive_stores\r\n\t\t.filter(store => {\r\n\t\t\tconst variable = component.var_lookup.get(store.name.slice(1));\r\n\t\t\treturn !variable || variable.hoistable;\r\n\t\t})\r\n\t\t.map(({ name }) => {\r\n\t\t\tconst store_name = name.slice(1);\r\n\t\t\treturn b`\r\n\t\t\t\t${component.compile_options.dev && b`@validate_store(${store_name}, '${store_name}');`}\r\n\t\t\t\t${`$$unsubscribe_${store_name}`} = @subscribe(${store_name}, #value => ${name} = #value)\r\n\t\t\t`;\r\n\t\t});\r\n\tconst reactive_store_unsubscriptions = reactive_stores.map(\r\n\t\t({ name }) => b`${`$$unsubscribe_${name.slice(1)}`}()`\r\n\t);\r\n\r\n\tconst reactive_store_declarations = reactive_stores\r\n\t\t.map(({ name }) => {\r\n\t\t\tconst store_name = name.slice(1);\r\n\t\t\tconst store = component.var_lookup.get(store_name);\r\n\r\n\t\t\tif (store && store.reassigned) {\r\n\t\t\t\tconst unsubscribe = `$$unsubscribe_${store_name}`;\r\n\t\t\t\tconst subscribe = `$$subscribe_${store_name}`;\r\n\r\n\t\t\t\treturn b`let ${name}, ${unsubscribe} = @noop, ${subscribe} = () => (${unsubscribe}(), ${unsubscribe} = @subscribe(${store_name}, $$value => ${name} = $$value), ${store_name})`;\r\n\t\t\t}\r\n\t\t\treturn b`let ${name}, ${`$$unsubscribe_${store_name}`};`;\r\n\t\t});\r\n\r\n\t// instrument get/set store value\r\n\tif (component.ast.instance) {\r\n\t\tlet scope = component.instance_scope;\r\n\t\tconst map = component.instance_scope_map;\r\n\r\n\t\twalk(component.ast.instance.content, {\r\n\t\t\tenter(node: Node) {\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = map.get(node);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tleave(node: Node) {\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = scope.parent;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (node.type === 'AssignmentExpression' || node.type === 'UpdateExpression') {\r\n\t\t\t\t\tconst assignee = node.type === 'AssignmentExpression' ? node.left : node.argument;\r\n\t\t\t\t\tconst names = new Set(extract_names(assignee as Node));\r\n\t\t\t\t\tconst to_invalidate = new Set<string>();\r\n\r\n\t\t\t\t\tfor (const name of names) {\r\n\t\t\t\t\t\tconst variable = component.var_lookup.get(name);\r\n\t\t\t\t\t\tif (variable &&\r\n\t\t\t\t\t\t\t!variable.hoistable &&\r\n\t\t\t\t\t\t\t!variable.global &&\r\n\t\t\t\t\t\t\t!variable.module &&\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\tvariable.subscribable || variable.name[0] === '$'\r\n\t\t\t\t\t\t\t)) {\r\n\t\t\t\t\t\t\t\tto_invalidate.add(variable.name);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (to_invalidate.size) {\r\n\t\t\t\t\t\tthis.replace(\r\n\t\t\t\t\t\t\tinvalidate(\r\n\t\t\t\t\t\t\t\t{ component } as any,\r\n\t\t\t\t\t\t\t\tscope,\r\n\t\t\t\t\t\t\t\tnode,\r\n\t\t\t\t\t\t\t\tto_invalidate,\r\n\t\t\t\t\t\t\t\ttrue\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tcomponent.rewrite_props(({ name, reassigned }) => {\r\n\t\tconst value = `$${name}`;\r\n\r\n\t\tlet insert = reassigned\r\n\t\t\t? b`${`$$subscribe_${name}`}()`\r\n\t\t\t: b`${`$$unsubscribe_${name}`} = @subscribe(${name}, #value => $${value} = #value)`;\r\n\r\n\t\tif (component.compile_options.dev) {\r\n\t\t\tinsert = b`@validate_store(${name}, '${name}'); ${insert}`;\r\n\t\t}\r\n\r\n\t\treturn insert;\r\n\t});\r\n\r\n\tconst instance_javascript = component.extract_javascript(component.ast.instance);\r\n\r\n\t// TODO only do this for props with a default value\r\n\tconst parent_bindings = instance_javascript\r\n\t\t? component.vars\r\n\t\t\t.filter(variable => !variable.module && variable.export_name)\r\n\t\t\t.map(prop => {\r\n\t\t\t\treturn b`if ($$props.${prop.export_name} === void 0 && $$bindings.${prop.export_name} && ${prop.name} !== void 0) $$bindings.${prop.export_name}(${prop.name});`;\r\n\t\t\t})\r\n\t\t: [];\r\n\r\n\tconst injected = Array.from(component.injected_reactive_declaration_vars).filter(name => {\r\n\t\tconst variable = component.var_lookup.get(name);\r\n\t\treturn variable.injected;\r\n\t});\r\n\r\n\tconst reactive_declarations = component.reactive_declarations.map(d => {\r\n\t\tconst body: Statement = (d.node as LabeledStatement).body;\r\n\r\n\t\tlet statement = b`${body}`;\r\n\r\n\t\tif (!d.declaration) { // TODO do not add label if it's not referenced\r\n\t\t\tstatement = b`$: { ${statement} }`;\r\n\t\t}\r\n\r\n\t\treturn statement;\r\n\t});\r\n\r\n\tconst main = renderer.has_bindings\r\n\t\t? b`\r\n\t\t\tlet $$settled;\r\n\t\t\tlet $$rendered;\r\n\r\n\t\t\tdo {\r\n\t\t\t\t$$settled = true;\r\n\r\n\t\t\t\t${reactive_declarations}\r\n\r\n\t\t\t\t$$rendered = ${literal};\r\n\t\t\t} while (!$$settled);\r\n\r\n\t\t\t${reactive_store_unsubscriptions}\r\n\r\n\t\t\treturn $$rendered;\r\n\t\t`\r\n\t\t: b`\r\n\t\t\t${reactive_declarations}\r\n\r\n\t\t\t${reactive_store_unsubscriptions}\r\n\r\n\t\t\treturn ${literal};`;\r\n\r\n\tconst blocks = [\r\n\t\t...injected.map(name => b`let ${name};`),\r\n\t\trest,\r\n\t\tslots,\r\n\t\t...reactive_store_declarations,\r\n\t\t...reactive_store_subscriptions,\r\n\t\tinstance_javascript,\r\n\t\t...parent_bindings,\r\n\t\tcss.code && b`$$result.css.add(#css);`,\r\n\t\tmain\r\n\t].filter(Boolean);\r\n\r\n\tconst css_sourcemap_enabled = check_enable_sourcemap(options.enableSourcemap, 'css');\r\n\r\n\tconst js = b`\r\n\t\t${css.code ? b`\r\n\t\tconst #css = {\r\n\t\t\tcode: \"${css.code}\",\r\n\t\t\tmap: ${css_sourcemap_enabled && css.map ? string_literal(css.map.toString()) : 'null'}\r\n\t\t};` : null}\r\n\r\n\t\t${component.extract_javascript(component.ast.module)}\r\n\r\n\t\t${component.fully_hoisted}\r\n\r\n\t\tconst ${name} = @create_ssr_component(($$result, $$props, $$bindings, #slots) => {\r\n\t\t\t${blocks}\r\n\t\t});\r\n\t`;\r\n\r\n\treturn {js, css};\r\n}\r\n\r\nfunction trim(nodes: TemplateNode[]) {\r\n\tlet start = 0;\r\n\tfor (; start < nodes.length; start += 1) {\r\n\t\tconst node = nodes[start] as Text;\r\n\t\tif (node.type !== 'Text') break;\r\n\r\n\t\tnode.data = node.data.replace(/^\\s+/, '');\r\n\t\tif (node.data) break;\r\n\t}\r\n\r\n\tlet end = nodes.length;\r\n\tfor (; end > start; end -= 1) {\r\n\t\tconst node = nodes[end - 1] as Text;\r\n\t\tif (node.type !== 'Text') break;\r\n\r\n\t\tnode.data = node.data.trimRight();\r\n\t\tif (node.data) break;\r\n\t}\r\n\r\n\treturn nodes.slice(start, end);\r\n}\r\n","/** ----------------------------------------------------------------------\r\nThis file is automatically generated by `scripts/globals-extractor.mjs`.\r\nGenerated At: 2022-09-03T15:22:37.415Z\r\n---------------------------------------------------------------------- */\r\n\r\nexport default new Set([\r\n\t'AbortController',\r\n\t'AbortSignal',\r\n\t'AbstractRange',\r\n\t'ActiveXObject',\r\n\t'AggregateError',\r\n\t'AnalyserNode',\r\n\t'Animation',\r\n\t'AnimationEffect',\r\n\t'AnimationEvent',\r\n\t'AnimationPlaybackEvent',\r\n\t'AnimationTimeline',\r\n\t'Array',\r\n\t'ArrayBuffer',\r\n\t'Atomics',\r\n\t'Attr',\r\n\t'Audio',\r\n\t'AudioBuffer',\r\n\t'AudioBufferSourceNode',\r\n\t'AudioContext',\r\n\t'AudioDestinationNode',\r\n\t'AudioListener',\r\n\t'AudioNode',\r\n\t'AudioParam',\r\n\t'AudioParamMap',\r\n\t'AudioProcessingEvent',\r\n\t'AudioScheduledSourceNode',\r\n\t'AudioWorklet',\r\n\t'AudioWorkletNode',\r\n\t'AuthenticatorAssertionResponse',\r\n\t'AuthenticatorAttestationResponse',\r\n\t'AuthenticatorResponse',\r\n\t'BarProp',\r\n\t'BaseAudioContext',\r\n\t'BeforeUnloadEvent',\r\n\t'BigInt',\r\n\t'BigInt64Array',\r\n\t'BigUint64Array',\r\n\t'BiquadFilterNode',\r\n\t'Blob',\r\n\t'BlobEvent',\r\n\t'Boolean',\r\n\t'BroadcastChannel',\r\n\t'ByteLengthQueuingStrategy',\r\n\t'CDATASection',\r\n\t'CSS',\r\n\t'CSSAnimation',\r\n\t'CSSConditionRule',\r\n\t'CSSCounterStyleRule',\r\n\t'CSSFontFaceRule',\r\n\t'CSSGroupingRule',\r\n\t'CSSImportRule',\r\n\t'CSSKeyframeRule',\r\n\t'CSSKeyframesRule',\r\n\t'CSSMediaRule',\r\n\t'CSSNamespaceRule',\r\n\t'CSSPageRule',\r\n\t'CSSRule',\r\n\t'CSSRuleList',\r\n\t'CSSStyleDeclaration',\r\n\t'CSSStyleRule',\r\n\t'CSSStyleSheet',\r\n\t'CSSSupportsRule',\r\n\t'CSSTransition',\r\n\t'Cache',\r\n\t'CacheStorage',\r\n\t'CanvasCaptureMediaStreamTrack',\r\n\t'CanvasGradient',\r\n\t'CanvasPattern',\r\n\t'CanvasRenderingContext2D',\r\n\t'ChannelMergerNode',\r\n\t'ChannelSplitterNode',\r\n\t'CharacterData',\r\n\t'ClientRect',\r\n\t'Clipboard',\r\n\t'ClipboardEvent',\r\n\t'ClipboardItem',\r\n\t'CloseEvent',\r\n\t'Comment',\r\n\t'CompositionEvent',\r\n\t'ConstantSourceNode',\r\n\t'ConvolverNode',\r\n\t'CountQueuingStrategy',\r\n\t'Credential',\r\n\t'CredentialsContainer',\r\n\t'Crypto',\r\n\t'CryptoKey',\r\n\t'CustomElementRegistry',\r\n\t'CustomEvent',\r\n\t'DOMException',\r\n\t'DOMImplementation',\r\n\t'DOMMatrix',\r\n\t'DOMMatrixReadOnly',\r\n\t'DOMParser',\r\n\t'DOMPoint',\r\n\t'DOMPointReadOnly',\r\n\t'DOMQuad',\r\n\t'DOMRect',\r\n\t'DOMRectList',\r\n\t'DOMRectReadOnly',\r\n\t'DOMStringList',\r\n\t'DOMStringMap',\r\n\t'DOMTokenList',\r\n\t'DataTransfer',\r\n\t'DataTransferItem',\r\n\t'DataTransferItemList',\r\n\t'DataView',\r\n\t'Date',\r\n\t'DelayNode',\r\n\t'DeviceMotionEvent',\r\n\t'DeviceOrientationEvent',\r\n\t'Document',\r\n\t'DocumentFragment',\r\n\t'DocumentTimeline',\r\n\t'DocumentType',\r\n\t'DragEvent',\r\n\t'DynamicsCompressorNode',\r\n\t'Element',\r\n\t'ElementInternals',\r\n\t'Enumerator',\r\n\t'Error',\r\n\t'ErrorEvent',\r\n\t'EvalError',\r\n\t'Event',\r\n\t'EventCounts',\r\n\t'EventSource',\r\n\t'EventTarget',\r\n\t'External',\r\n\t'File',\r\n\t'FileList',\r\n\t'FileReader',\r\n\t'FileSystem',\r\n\t'FileSystemDirectoryEntry',\r\n\t'FileSystemDirectoryHandle',\r\n\t'FileSystemDirectoryReader',\r\n\t'FileSystemEntry',\r\n\t'FileSystemFileEntry',\r\n\t'FileSystemFileHandle',\r\n\t'FileSystemHandle',\r\n\t'FinalizationRegistry',\r\n\t'Float32Array',\r\n\t'Float64Array',\r\n\t'FocusEvent',\r\n\t'FontFace',\r\n\t'FontFaceSet',\r\n\t'FontFaceSetLoadEvent',\r\n\t'FormData',\r\n\t'FormDataEvent',\r\n\t'Function',\r\n\t'GainNode',\r\n\t'Gamepad',\r\n\t'GamepadButton',\r\n\t'GamepadEvent',\r\n\t'GamepadHapticActuator',\r\n\t'Geolocation',\r\n\t'GeolocationCoordinates',\r\n\t'GeolocationPosition',\r\n\t'GeolocationPositionError',\r\n\t'HTMLAllCollection',\r\n\t'HTMLAnchorElement',\r\n\t'HTMLAreaElement',\r\n\t'HTMLAudioElement',\r\n\t'HTMLBRElement',\r\n\t'HTMLBaseElement',\r\n\t'HTMLBodyElement',\r\n\t'HTMLButtonElement',\r\n\t'HTMLCanvasElement',\r\n\t'HTMLCollection',\r\n\t'HTMLDListElement',\r\n\t'HTMLDataElement',\r\n\t'HTMLDataListElement',\r\n\t'HTMLDetailsElement',\r\n\t'HTMLDialogElement',\r\n\t'HTMLDirectoryElement',\r\n\t'HTMLDivElement',\r\n\t'HTMLDocument',\r\n\t'HTMLElement',\r\n\t'HTMLEmbedElement',\r\n\t'HTMLFieldSetElement',\r\n\t'HTMLFontElement',\r\n\t'HTMLFormControlsCollection',\r\n\t'HTMLFormElement',\r\n\t'HTMLFrameElement',\r\n\t'HTMLFrameSetElement',\r\n\t'HTMLHRElement',\r\n\t'HTMLHeadElement',\r\n\t'HTMLHeadingElement',\r\n\t'HTMLHtmlElement',\r\n\t'HTMLIFrameElement',\r\n\t'HTMLImageElement',\r\n\t'HTMLInputElement',\r\n\t'HTMLLIElement',\r\n\t'HTMLLabelElement',\r\n\t'HTMLLegendElement',\r\n\t'HTMLLinkElement',\r\n\t'HTMLMapElement',\r\n\t'HTMLMarqueeElement',\r\n\t'HTMLMediaElement',\r\n\t'HTMLMenuElement',\r\n\t'HTMLMetaElement',\r\n\t'HTMLMeterElement',\r\n\t'HTMLModElement',\r\n\t'HTMLOListElement',\r\n\t'HTMLObjectElement',\r\n\t'HTMLOptGroupElement',\r\n\t'HTMLOptionElement',\r\n\t'HTMLOptionsCollection',\r\n\t'HTMLOutputElement',\r\n\t'HTMLParagraphElement',\r\n\t'HTMLParamElement',\r\n\t'HTMLPictureElement',\r\n\t'HTMLPreElement',\r\n\t'HTMLProgressElement',\r\n\t'HTMLQuoteElement',\r\n\t'HTMLScriptElement',\r\n\t'HTMLSelectElement',\r\n\t'HTMLSlotElement',\r\n\t'HTMLSourceElement',\r\n\t'HTMLSpanElement',\r\n\t'HTMLStyleElement',\r\n\t'HTMLTableCaptionElement',\r\n\t'HTMLTableCellElement',\r\n\t'HTMLTableColElement',\r\n\t'HTMLTableElement',\r\n\t'HTMLTableRowElement',\r\n\t'HTMLTableSectionElement',\r\n\t'HTMLTemplateElement',\r\n\t'HTMLTextAreaElement',\r\n\t'HTMLTimeElement',\r\n\t'HTMLTitleElement',\r\n\t'HTMLTrackElement',\r\n\t'HTMLUListElement',\r\n\t'HTMLUnknownElement',\r\n\t'HTMLVideoElement',\r\n\t'HashChangeEvent',\r\n\t'Headers',\r\n\t'History',\r\n\t'IDBCursor',\r\n\t'IDBCursorWithValue',\r\n\t'IDBDatabase',\r\n\t'IDBFactory',\r\n\t'IDBIndex',\r\n\t'IDBKeyRange',\r\n\t'IDBObjectStore',\r\n\t'IDBOpenDBRequest',\r\n\t'IDBRequest',\r\n\t'IDBTransaction',\r\n\t'IDBVersionChangeEvent',\r\n\t'IIRFilterNode',\r\n\t'IdleDeadline',\r\n\t'Image',\r\n\t'ImageBitmap',\r\n\t'ImageBitmapRenderingContext',\r\n\t'ImageData',\r\n\t'Infinity',\r\n\t'InputDeviceInfo',\r\n\t'InputEvent',\r\n\t'Int16Array',\r\n\t'Int32Array',\r\n\t'Int8Array',\r\n\t'InternalError',\r\n\t'IntersectionObserver',\r\n\t'IntersectionObserverEntry',\r\n\t'Intl',\r\n\t'JSON',\r\n\t'KeyboardEvent',\r\n\t'KeyframeEffect',\r\n\t'Location',\r\n\t'Lock',\r\n\t'LockManager',\r\n\t'Map',\r\n\t'Math',\r\n\t'MathMLElement',\r\n\t'MediaCapabilities',\r\n\t'MediaDeviceInfo',\r\n\t'MediaDevices',\r\n\t'MediaElementAudioSourceNode',\r\n\t'MediaEncryptedEvent',\r\n\t'MediaError',\r\n\t'MediaKeyMessageEvent',\r\n\t'MediaKeySession',\r\n\t'MediaKeyStatusMap',\r\n\t'MediaKeySystemAccess',\r\n\t'MediaKeys',\r\n\t'MediaList',\r\n\t'MediaMetadata',\r\n\t'MediaQueryList',\r\n\t'MediaQueryListEvent',\r\n\t'MediaRecorder',\r\n\t'MediaRecorderErrorEvent',\r\n\t'MediaSession',\r\n\t'MediaSource',\r\n\t'MediaStream',\r\n\t'MediaStreamAudioDestinationNode',\r\n\t'MediaStreamAudioSourceNode',\r\n\t'MediaStreamTrack',\r\n\t'MediaStreamTrackEvent',\r\n\t'MessageChannel',\r\n\t'MessageEvent',\r\n\t'MessagePort',\r\n\t'MimeType',\r\n\t'MimeTypeArray',\r\n\t'MouseEvent',\r\n\t'MutationEvent',\r\n\t'MutationObserver',\r\n\t'MutationRecord',\r\n\t'NaN',\r\n\t'NamedNodeMap',\r\n\t'NavigationPreloadManager',\r\n\t'Navigator',\r\n\t'NetworkInformation',\r\n\t'Node',\r\n\t'NodeFilter',\r\n\t'NodeIterator',\r\n\t'NodeList',\r\n\t'Notification',\r\n\t'Number',\r\n\t'Object',\r\n\t'OfflineAudioCompletionEvent',\r\n\t'OfflineAudioContext',\r\n\t'Option',\r\n\t'OscillatorNode',\r\n\t'OverconstrainedError',\r\n\t'PageTransitionEvent',\r\n\t'PannerNode',\r\n\t'Path2D',\r\n\t'PaymentAddress',\r\n\t'PaymentMethodChangeEvent',\r\n\t'PaymentRequest',\r\n\t'PaymentRequestUpdateEvent',\r\n\t'PaymentResponse',\r\n\t'Performance',\r\n\t'PerformanceEntry',\r\n\t'PerformanceEventTiming',\r\n\t'PerformanceMark',\r\n\t'PerformanceMeasure',\r\n\t'PerformanceNavigation',\r\n\t'PerformanceNavigationTiming',\r\n\t'PerformanceObserver',\r\n\t'PerformanceObserverEntryList',\r\n\t'PerformancePaintTiming',\r\n\t'PerformanceResourceTiming',\r\n\t'PerformanceServerTiming',\r\n\t'PerformanceTiming',\r\n\t'PeriodicWave',\r\n\t'PermissionStatus',\r\n\t'Permissions',\r\n\t'PictureInPictureWindow',\r\n\t'Plugin',\r\n\t'PluginArray',\r\n\t'PointerEvent',\r\n\t'PopStateEvent',\r\n\t'ProcessingInstruction',\r\n\t'ProgressEvent',\r\n\t'Promise',\r\n\t'PromiseRejectionEvent',\r\n\t'Proxy',\r\n\t'PublicKeyCredential',\r\n\t'PushManager',\r\n\t'PushSubscription',\r\n\t'PushSubscriptionOptions',\r\n\t'RTCCertificate',\r\n\t'RTCDTMFSender',\r\n\t'RTCDTMFToneChangeEvent',\r\n\t'RTCDataChannel',\r\n\t'RTCDataChannelEvent',\r\n\t'RTCDtlsTransport',\r\n\t'RTCEncodedAudioFrame',\r\n\t'RTCEncodedVideoFrame',\r\n\t'RTCError',\r\n\t'RTCErrorEvent',\r\n\t'RTCIceCandidate',\r\n\t'RTCIceTransport',\r\n\t'RTCPeerConnection',\r\n\t'RTCPeerConnectionIceErrorEvent',\r\n\t'RTCPeerConnectionIceEvent',\r\n\t'RTCRtpReceiver',\r\n\t'RTCRtpSender',\r\n\t'RTCRtpTransceiver',\r\n\t'RTCSctpTransport',\r\n\t'RTCSessionDescription',\r\n\t'RTCStatsReport',\r\n\t'RTCTrackEvent',\r\n\t'RadioNodeList',\r\n\t'Range',\r\n\t'RangeError',\r\n\t'ReadableByteStreamController',\r\n\t'ReadableStream',\r\n\t'ReadableStreamBYOBReader',\r\n\t'ReadableStreamBYOBRequest',\r\n\t'ReadableStreamDefaultController',\r\n\t'ReadableStreamDefaultReader',\r\n\t'ReferenceError',\r\n\t'Reflect',\r\n\t'RegExp',\r\n\t'RemotePlayback',\r\n\t'Request',\r\n\t'ResizeObserver',\r\n\t'ResizeObserverEntry',\r\n\t'ResizeObserverSize',\r\n\t'Response',\r\n\t'SVGAElement',\r\n\t'SVGAngle',\r\n\t'SVGAnimateElement',\r\n\t'SVGAnimateMotionElement',\r\n\t'SVGAnimateTransformElement',\r\n\t'SVGAnimatedAngle',\r\n\t'SVGAnimatedBoolean',\r\n\t'SVGAnimatedEnumeration',\r\n\t'SVGAnimatedInteger',\r\n\t'SVGAnimatedLength',\r\n\t'SVGAnimatedLengthList',\r\n\t'SVGAnimatedNumber',\r\n\t'SVGAnimatedNumberList',\r\n\t'SVGAnimatedPreserveAspectRatio',\r\n\t'SVGAnimatedRect',\r\n\t'SVGAnimatedString',\r\n\t'SVGAnimatedTransformList',\r\n\t'SVGAnimationElement',\r\n\t'SVGCircleElement',\r\n\t'SVGClipPathElement',\r\n\t'SVGComponentTransferFunctionElement',\r\n\t'SVGCursorElement',\r\n\t'SVGDefsElement',\r\n\t'SVGDescElement',\r\n\t'SVGElement',\r\n\t'SVGEllipseElement',\r\n\t'SVGFEBlendElement',\r\n\t'SVGFEColorMatrixElement',\r\n\t'SVGFEComponentTransferElement',\r\n\t'SVGFECompositeElement',\r\n\t'SVGFEConvolveMatrixElement',\r\n\t'SVGFEDiffuseLightingElement',\r\n\t'SVGFEDisplacementMapElement',\r\n\t'SVGFEDistantLightElement',\r\n\t'SVGFEDropShadowElement',\r\n\t'SVGFEFloodElement',\r\n\t'SVGFEFuncAElement',\r\n\t'SVGFEFuncBElement',\r\n\t'SVGFEFuncGElement',\r\n\t'SVGFEFuncRElement',\r\n\t'SVGFEGaussianBlurElement',\r\n\t'SVGFEImageElement',\r\n\t'SVGFEMergeElement',\r\n\t'SVGFEMergeNodeElement',\r\n\t'SVGFEMorphologyElement',\r\n\t'SVGFEOffsetElement',\r\n\t'SVGFEPointLightElement',\r\n\t'SVGFESpecularLightingElement',\r\n\t'SVGFESpotLightElement',\r\n\t'SVGFETileElement',\r\n\t'SVGFETurbulenceElement',\r\n\t'SVGFilterElement',\r\n\t'SVGForeignObjectElement',\r\n\t'SVGGElement',\r\n\t'SVGGeometryElement',\r\n\t'SVGGradientElement',\r\n\t'SVGGraphicsElement',\r\n\t'SVGImageElement',\r\n\t'SVGLength',\r\n\t'SVGLengthList',\r\n\t'SVGLineElement',\r\n\t'SVGLinearGradientElement',\r\n\t'SVGMPathElement',\r\n\t'SVGMarkerElement',\r\n\t'SVGMaskElement',\r\n\t'SVGMatrix',\r\n\t'SVGMetadataElement',\r\n\t'SVGNumber',\r\n\t'SVGNumberList',\r\n\t'SVGPathElement',\r\n\t'SVGPatternElement',\r\n\t'SVGPoint',\r\n\t'SVGPointList',\r\n\t'SVGPolygonElement',\r\n\t'SVGPolylineElement',\r\n\t'SVGPreserveAspectRatio',\r\n\t'SVGRadialGradientElement',\r\n\t'SVGRect',\r\n\t'SVGRectElement',\r\n\t'SVGSVGElement',\r\n\t'SVGScriptElement',\r\n\t'SVGSetElement',\r\n\t'SVGStopElement',\r\n\t'SVGStringList',\r\n\t'SVGStyleElement',\r\n\t'SVGSwitchElement',\r\n\t'SVGSymbolElement',\r\n\t'SVGTSpanElement',\r\n\t'SVGTextContentElement',\r\n\t'SVGTextElement',\r\n\t'SVGTextPathElement',\r\n\t'SVGTextPositioningElement',\r\n\t'SVGTitleElement',\r\n\t'SVGTransform',\r\n\t'SVGTransformList',\r\n\t'SVGUnitTypes',\r\n\t'SVGUseElement',\r\n\t'SVGViewElement',\r\n\t'SafeArray',\r\n\t'Screen',\r\n\t'ScreenOrientation',\r\n\t'ScriptProcessorNode',\r\n\t'SecurityPolicyViolationEvent',\r\n\t'Selection',\r\n\t'ServiceWorker',\r\n\t'ServiceWorkerContainer',\r\n\t'ServiceWorkerRegistration',\r\n\t'Set',\r\n\t'ShadowRoot',\r\n\t'SharedArrayBuffer',\r\n\t'SharedWorker',\r\n\t'SourceBuffer',\r\n\t'SourceBufferList',\r\n\t'SpeechRecognitionAlternative',\r\n\t'SpeechRecognitionErrorEvent',\r\n\t'SpeechRecognitionResult',\r\n\t'SpeechRecognitionResultList',\r\n\t'SpeechSynthesis',\r\n\t'SpeechSynthesisErrorEvent',\r\n\t'SpeechSynthesisEvent',\r\n\t'SpeechSynthesisUtterance',\r\n\t'SpeechSynthesisVoice',\r\n\t'StaticRange',\r\n\t'StereoPannerNode',\r\n\t'Storage',\r\n\t'StorageEvent',\r\n\t'StorageManager',\r\n\t'String',\r\n\t'StyleMedia',\r\n\t'StyleSheet',\r\n\t'StyleSheetList',\r\n\t'SubmitEvent',\r\n\t'SubtleCrypto',\r\n\t'Symbol',\r\n\t'SyntaxError',\r\n\t'Text',\r\n\t'TextDecoder',\r\n\t'TextDecoderStream',\r\n\t'TextEncoder',\r\n\t'TextEncoderStream',\r\n\t'TextMetrics',\r\n\t'TextTrack',\r\n\t'TextTrackCue',\r\n\t'TextTrackCueList',\r\n\t'TextTrackList',\r\n\t'TimeRanges',\r\n\t'Touch',\r\n\t'TouchEvent',\r\n\t'TouchList',\r\n\t'TrackEvent',\r\n\t'TransformStream',\r\n\t'TransformStreamDefaultController',\r\n\t'TransitionEvent',\r\n\t'TreeWalker',\r\n\t'TypeError',\r\n\t'UIEvent',\r\n\t'URIError',\r\n\t'URL',\r\n\t'URLSearchParams',\r\n\t'Uint16Array',\r\n\t'Uint32Array',\r\n\t'Uint8Array',\r\n\t'Uint8ClampedArray',\r\n\t'VBArray',\r\n\t'VTTCue',\r\n\t'VTTRegion',\r\n\t'ValidityState',\r\n\t'VarDate',\r\n\t'VideoColorSpace',\r\n\t'VideoPlaybackQuality',\r\n\t'VisualViewport',\r\n\t'WSH',\r\n\t'WScript',\r\n\t'WaveShaperNode',\r\n\t'WeakMap',\r\n\t'WeakRef',\r\n\t'WeakSet',\r\n\t'WebAssembly',\r\n\t'WebGL2RenderingContext',\r\n\t'WebGLActiveInfo',\r\n\t'WebGLBuffer',\r\n\t'WebGLContextEvent',\r\n\t'WebGLFramebuffer',\r\n\t'WebGLProgram',\r\n\t'WebGLQuery',\r\n\t'WebGLRenderbuffer',\r\n\t'WebGLRenderingContext',\r\n\t'WebGLSampler',\r\n\t'WebGLShader',\r\n\t'WebGLShaderPrecisionFormat',\r\n\t'WebGLSync',\r\n\t'WebGLTexture',\r\n\t'WebGLTransformFeedback',\r\n\t'WebGLUniformLocation',\r\n\t'WebGLVertexArrayObject',\r\n\t'WebKitCSSMatrix',\r\n\t'WebSocket',\r\n\t'WheelEvent',\r\n\t'Window',\r\n\t'Worker',\r\n\t'Worklet',\r\n\t'WritableStream',\r\n\t'WritableStreamDefaultController',\r\n\t'WritableStreamDefaultWriter',\r\n\t'XMLDocument',\r\n\t'XMLHttpRequest',\r\n\t'XMLHttpRequestEventTarget',\r\n\t'XMLHttpRequestUpload',\r\n\t'XMLSerializer',\r\n\t'XPathEvaluator',\r\n\t'XPathExpression',\r\n\t'XPathResult',\r\n\t'XSLTProcessor',\r\n\t'addEventListener',\r\n\t'alert',\r\n\t'atob',\r\n\t'blur',\r\n\t'btoa',\r\n\t'caches',\r\n\t'cancelAnimationFrame',\r\n\t'cancelIdleCallback',\r\n\t'captureEvents',\r\n\t'clearInterval',\r\n\t'clearTimeout',\r\n\t'clientInformation',\r\n\t'close',\r\n\t'closed',\r\n\t'confirm',\r\n\t'console',\r\n\t'createImageBitmap',\r\n\t'crossOriginIsolated',\r\n\t'crypto',\r\n\t'customElements',\r\n\t'decodeURI',\r\n\t'decodeURIComponent',\r\n\t'devicePixelRatio',\r\n\t'dispatchEvent',\r\n\t'document',\r\n\t'encodeURI',\r\n\t'encodeURIComponent',\r\n\t'escape',\r\n\t'eval',\r\n\t'event',\r\n\t'external',\r\n\t'fetch',\r\n\t'focus',\r\n\t'frameElement',\r\n\t'frames',\r\n\t'getComputedStyle',\r\n\t'getSelection',\r\n\t'global',\r\n\t'globalThis',\r\n\t'history',\r\n\t'importScripts',\r\n\t'indexedDB',\r\n\t'innerHeight',\r\n\t'innerWidth',\r\n\t'isFinite',\r\n\t'isNaN',\r\n\t'isSecureContext',\r\n\t'length',\r\n\t'localStorage',\r\n\t'location',\r\n\t'locationbar',\r\n\t'matchMedia',\r\n\t'menubar',\r\n\t'moveBy',\r\n\t'moveTo',\r\n\t'name',\r\n\t'navigator',\r\n\t'onabort',\r\n\t'onafterprint',\r\n\t'onanimationcancel',\r\n\t'onanimationend',\r\n\t'onanimationiteration',\r\n\t'onanimationstart',\r\n\t'onauxclick',\r\n\t'onbeforeprint',\r\n\t'onbeforeunload',\r\n\t'onblur',\r\n\t'oncanplay',\r\n\t'oncanplaythrough',\r\n\t'onchange',\r\n\t'onclick',\r\n\t'onclose',\r\n\t'oncontextmenu',\r\n\t'oncuechange',\r\n\t'ondblclick',\r\n\t'ondevicemotion',\r\n\t'ondeviceorientation',\r\n\t'ondrag',\r\n\t'ondragend',\r\n\t'ondragenter',\r\n\t'ondragleave',\r\n\t'ondragover',\r\n\t'ondragstart',\r\n\t'ondrop',\r\n\t'ondurationchange',\r\n\t'onemptied',\r\n\t'onended',\r\n\t'onerror',\r\n\t'onfocus',\r\n\t'onformdata',\r\n\t'ongamepadconnected',\r\n\t'ongamepaddisconnected',\r\n\t'ongotpointercapture',\r\n\t'onhashchange',\r\n\t'oninput',\r\n\t'oninvalid',\r\n\t'onkeydown',\r\n\t'onkeypress',\r\n\t'onkeyup',\r\n\t'onlanguagechange',\r\n\t'onload',\r\n\t'onloadeddata',\r\n\t'onloadedmetadata',\r\n\t'onloadstart',\r\n\t'onlostpointercapture',\r\n\t'onmessage',\r\n\t'onmessageerror',\r\n\t'onmousedown',\r\n\t'onmouseenter',\r\n\t'onmouseleave',\r\n\t'onmousemove',\r\n\t'onmouseout',\r\n\t'onmouseover',\r\n\t'onmouseup',\r\n\t'onoffline',\r\n\t'ononline',\r\n\t'onorientationchange',\r\n\t'onpagehide',\r\n\t'onpageshow',\r\n\t'onpause',\r\n\t'onplay',\r\n\t'onplaying',\r\n\t'onpointercancel',\r\n\t'onpointerdown',\r\n\t'onpointerenter',\r\n\t'onpointerleave',\r\n\t'onpointermove',\r\n\t'onpointerout',\r\n\t'onpointerover',\r\n\t'onpointerup',\r\n\t'onpopstate',\r\n\t'onprogress',\r\n\t'onratechange',\r\n\t'onrejectionhandled',\r\n\t'onreset',\r\n\t'onresize',\r\n\t'onscroll',\r\n\t'onsecuritypolicyviolation',\r\n\t'onseeked',\r\n\t'onseeking',\r\n\t'onselect',\r\n\t'onselectionchange',\r\n\t'onselectstart',\r\n\t'onslotchange',\r\n\t'onstalled',\r\n\t'onstorage',\r\n\t'onsubmit',\r\n\t'onsuspend',\r\n\t'ontimeupdate',\r\n\t'ontoggle',\r\n\t'ontouchcancel',\r\n\t'ontouchend',\r\n\t'ontouchmove',\r\n\t'ontouchstart',\r\n\t'ontransitioncancel',\r\n\t'ontransitionend',\r\n\t'ontransitionrun',\r\n\t'ontransitionstart',\r\n\t'onunhandledrejection',\r\n\t'onunload',\r\n\t'onvolumechange',\r\n\t'onwaiting',\r\n\t'onwebkitanimationend',\r\n\t'onwebkitanimationiteration',\r\n\t'onwebkitanimationstart',\r\n\t'onwebkittransitionend',\r\n\t'onwheel',\r\n\t'open',\r\n\t'opener',\r\n\t'orientation',\r\n\t'origin',\r\n\t'outerHeight',\r\n\t'outerWidth',\r\n\t'pageXOffset',\r\n\t'pageYOffset',\r\n\t'parent',\r\n\t'parseFloat',\r\n\t'parseInt',\r\n\t'performance',\r\n\t'personalbar',\r\n\t'postMessage',\r\n\t'print',\r\n\t'process',\r\n\t'prompt',\r\n\t'queueMicrotask',\r\n\t'releaseEvents',\r\n\t'removeEventListener',\r\n\t'reportError',\r\n\t'requestAnimationFrame',\r\n\t'requestIdleCallback',\r\n\t'resizeBy',\r\n\t'resizeTo',\r\n\t'screen',\r\n\t'screenLeft',\r\n\t'screenTop',\r\n\t'screenX',\r\n\t'screenY',\r\n\t'scroll',\r\n\t'scrollBy',\r\n\t'scrollTo',\r\n\t'scrollX',\r\n\t'scrollY',\r\n\t'scrollbars',\r\n\t'self',\r\n\t'sessionStorage',\r\n\t'setInterval',\r\n\t'setTimeout',\r\n\t'speechSynthesis',\r\n\t'status',\r\n\t'statusbar',\r\n\t'stop',\r\n\t'structuredClone',\r\n\t'toString',\r\n\t'toolbar',\r\n\t'top',\r\n\t'undefined',\r\n\t'unescape',\r\n\t'visualViewport',\r\n\t'webkitURL',\r\n\t'window'\r\n]);\r\n","import list from '../utils/list';\r\nimport { ModuleFormat } from '../interfaces';\r\nimport { b, x } from 'code-red';\r\nimport { Identifier, ImportDeclaration, ExportNamedDeclaration } from 'estree';\r\n\r\nconst wrappers = { esm, cjs };\r\n\r\ninterface Export {\r\n\tname: string;\r\n\tas: string;\r\n}\r\n\r\nexport default function create_module(\r\n\tprogram: any,\r\n\tformat: ModuleFormat,\r\n\tname: Identifier,\r\n\tbanner: string,\r\n\tsveltePath = 'svelte',\r\n\thelpers: Array<{ name: string; alias: Identifier }>,\r\n\tglobals: Array<{ name: string; alias: Identifier }>,\r\n\timports: ImportDeclaration[],\r\n\tmodule_exports: Export[],\r\n\texports_from: ExportNamedDeclaration[]\r\n) {\r\n\tconst internal_path = `${sveltePath}/internal`;\r\n\r\n\thelpers.sort((a, b) => (a.name < b.name) ? -1 : 1);\r\n\tglobals.sort((a, b) => (a.name < b.name) ? -1 : 1);\r\n\r\n\tconst formatter = wrappers[format];\r\n\r\n\tif (!formatter) {\r\n\t\tthrow new Error(`options.format is invalid (must be ${list(Object.keys(wrappers))})`);\r\n\t}\r\n\r\n\treturn formatter(program, name, banner, sveltePath, internal_path, helpers, globals, imports, module_exports, exports_from);\r\n}\r\n\r\nfunction edit_source(source, sveltePath) {\r\n\treturn source === 'svelte' || source.startsWith('svelte/')\r\n\t\t? source.replace('svelte', sveltePath)\r\n\t\t: source;\r\n}\r\n\r\nfunction get_internal_globals(\r\n\tglobals: Array<{ name: string; alias: Identifier }>,\r\n\thelpers: Array<{ name: string; alias: Identifier }>\r\n) {\r\n\treturn globals.length > 0 && {\r\n\t\ttype: 'VariableDeclaration',\r\n\t\tkind: 'const',\r\n\t\tdeclarations: [{\r\n\t\t\ttype: 'VariableDeclarator',\r\n\t\t\tid: {\r\n\t\t\t\ttype: 'ObjectPattern',\r\n\t\t\t\tproperties: globals.map(g => ({\r\n\t\t\t\t\ttype: 'Property',\r\n\t\t\t\t\tmethod: false,\r\n\t\t\t\t\tshorthand: false,\r\n\t\t\t\t\tcomputed: false,\r\n\t\t\t\t\tkey: { type: 'Identifier', name: g.name },\r\n\t\t\t\t\tvalue: g.alias,\r\n\t\t\t\t\tkind: 'init'\r\n\t\t\t\t}))\r\n\t\t\t},\r\n\t\t\tinit: helpers.find(({ name }) => name === 'globals').alias\r\n\t\t}]\r\n\t};\r\n}\r\n\r\nfunction esm(\r\n\tprogram: any,\r\n\tname: Identifier,\r\n\tbanner: string,\r\n\tsveltePath: string,\r\n\tinternal_path: string,\r\n\thelpers: Array<{ name: string; alias: Identifier }>,\r\n\tglobals: Array<{ name: string; alias: Identifier }>,\r\n\timports: ImportDeclaration[],\r\n\tmodule_exports: Export[],\r\n\texports_from: ExportNamedDeclaration[]\r\n) {\r\n\tconst import_declaration = {\r\n\t\ttype: 'ImportDeclaration',\r\n\t\tspecifiers: helpers.map(h => ({\r\n\t\t\ttype: 'ImportSpecifier',\r\n\t\t\tlocal: h.alias,\r\n\t\t\timported: { type: 'Identifier', name: h.name }\r\n\t\t})),\r\n\t\tsource: { type: 'Literal', value: internal_path }\r\n\t};\r\n\r\n\tconst internal_globals = get_internal_globals(globals, helpers);\r\n\r\n\t// edit user imports\r\n\tfunction rewrite_import(node) {\r\n\t\tconst value = edit_source(node.source.value, sveltePath);\r\n\t\tif (node.source.value !== value) {\r\n\t\t\tnode.source.value = value;\r\n\t\t\tnode.source.raw = null;\r\n\t\t}\r\n\t}\r\n\timports.forEach(rewrite_import);\r\n\texports_from.forEach(rewrite_import);\r\n\r\n\tconst exports = module_exports.length > 0 && {\r\n\t\ttype: 'ExportNamedDeclaration',\r\n\t\tspecifiers: module_exports.map(x => ({\r\n\t\t\ttype: 'Specifier',\r\n\t\t\tlocal: { type: 'Identifier', name: x.name },\r\n\t\t\texported: { type: 'Identifier', name: x.as }\r\n\t\t}))\r\n\t};\r\n\r\n\tprogram.body = b`\r\n\t\t/* ${banner} */\r\n\r\n\t\t${import_declaration}\r\n\t\t${internal_globals}\r\n\t\t${imports}\r\n\t\t${exports_from}\r\n\r\n\t\t${program.body}\r\n\r\n\t\texport default ${name};\r\n\t\t${exports}\r\n\t`;\r\n}\r\n\r\nfunction cjs(\r\n\tprogram: any,\r\n\tname: Identifier,\r\n\tbanner: string,\r\n\tsveltePath: string,\r\n\tinternal_path: string,\r\n\thelpers: Array<{ name: string; alias: Identifier }>,\r\n\tglobals: Array<{ name: string; alias: Identifier }>,\r\n\timports: ImportDeclaration[],\r\n\tmodule_exports: Export[],\r\n\texports_from: ExportNamedDeclaration[]\r\n) {\r\n\tconst internal_requires = {\r\n\t\ttype: 'VariableDeclaration',\r\n\t\tkind: 'const',\r\n\t\tdeclarations: [{\r\n\t\t\ttype: 'VariableDeclarator',\r\n\t\t\tid: {\r\n\t\t\t\ttype: 'ObjectPattern',\r\n\t\t\t\tproperties: helpers.map(h => ({\r\n\t\t\t\t\ttype: 'Property',\r\n\t\t\t\t\tmethod: false,\r\n\t\t\t\t\tshorthand: false,\r\n\t\t\t\t\tcomputed: false,\r\n\t\t\t\t\tkey: { type: 'Identifier', name: h.name },\r\n\t\t\t\t\tvalue: h.alias,\r\n\t\t\t\t\tkind: 'init'\r\n\t\t\t\t}))\r\n\t\t\t},\r\n\t\t\tinit: x`require(\"${internal_path}\")`\r\n\t\t}]\r\n\t};\r\n\r\n\tconst internal_globals = get_internal_globals(globals, helpers);\r\n\r\n\tconst user_requires = imports.map(node => {\r\n\t\tconst init = x`require(\"${edit_source(node.source.value, sveltePath)}\")`;\r\n\t\tif (node.specifiers.length === 0) {\r\n\t\t\treturn b`${init};`;\r\n\t\t}\r\n\t\treturn {\r\n\t\t\ttype: 'VariableDeclaration',\r\n\t\t\tkind: 'const',\r\n\t\t\tdeclarations: [{\r\n\t\t\t\ttype: 'VariableDeclarator',\r\n\t\t\t\tid: node.specifiers[0].type === 'ImportNamespaceSpecifier'\r\n\t\t\t\t\t? { type: 'Identifier', name: node.specifiers[0].local.name }\r\n\t\t\t\t\t: {\r\n\t\t\t\t\t\ttype: 'ObjectPattern',\r\n\t\t\t\t\t\tproperties: node.specifiers.map(s => ({\r\n\t\t\t\t\t\t\ttype: 'Property',\r\n\t\t\t\t\t\t\tmethod: false,\r\n\t\t\t\t\t\t\tshorthand: false,\r\n\t\t\t\t\t\t\tcomputed: false,\r\n\t\t\t\t\t\t\tkey: s.type === 'ImportSpecifier' ? s.imported : { type: 'Identifier', name: 'default' },\r\n\t\t\t\t\t\t\tvalue: s.local,\r\n\t\t\t\t\t\t\tkind: 'init'\r\n\t\t\t\t\t\t}))\r\n\t\t\t\t\t},\r\n\t\t\t\tinit\r\n\t\t\t}]\r\n\t\t};\r\n\t});\r\n\r\n\tconst exports = module_exports.map(x => b`exports.${{ type: 'Identifier', name: x.as }} = ${{ type: 'Identifier', name: x.name }};`);\r\n\r\n\tconst user_exports_from = exports_from.map(node => {\r\n\t\tconst init = x`require(\"${edit_source(node.source.value, sveltePath)}\")`;\r\n\t\treturn node.specifiers.map(specifier => {\r\n\t\t\treturn b`exports.${specifier.exported} = ${init}.${specifier.local};`;\r\n\t\t});\r\n\t});\r\n\r\n\tprogram.body = b`\r\n\t\t/* ${banner} */\r\n\r\n\t\t\"use strict\";\r\n\t\t${internal_requires}\r\n\t\t${internal_globals}\r\n\t\t${user_requires}\r\n\t\t${user_exports_from}\r\n\r\n\t\t${program.body}\r\n\r\n\t\texports.default = ${name};\r\n\t\t${exports}\r\n\t`;\r\n}\r\n","import { Node } from 'estree';\r\n\r\nexport const UNKNOWN = {};\r\n\r\nexport function gather_possible_values(node: Node, set: Set<string | {}>) {\r\n\tif (node.type === 'Literal') {\r\n\t\tset.add(node.value);\r\n\t} else if (node.type === 'ConditionalExpression') {\r\n\t\tgather_possible_values(node.consequent, set);\r\n\t\tgather_possible_values(node.alternate, set);\r\n\t} else {\r\n\t\tset.add(UNKNOWN);\r\n\t}\r\n}\r\n","import MagicString from 'magic-string';\r\nimport Stylesheet from './Stylesheet';\r\nimport { gather_possible_values, UNKNOWN } from './gather_possible_values';\r\nimport { CssNode } from './interfaces';\r\nimport Component from '../Component';\r\nimport Element from '../nodes/Element';\r\nimport { INode } from '../nodes/interfaces';\r\nimport EachBlock from '../nodes/EachBlock';\r\nimport IfBlock from '../nodes/IfBlock';\r\nimport AwaitBlock from '../nodes/AwaitBlock';\r\nimport compiler_errors from '../compiler_errors';\r\nimport { regex_starts_with_whitespace, regex_ends_with_whitespace } from '../../utils/patterns';\r\n\r\nenum BlockAppliesToNode {\r\n\tNotPossible,\r\n\tPossible,\r\n\tUnknownSelectorType\r\n}\r\nenum NodeExist {\r\n\tProbably = 1,\r\n\tDefinitely = 2,\r\n}\r\n\r\nconst whitelist_attribute_selector = new Map([\r\n\t['details', new Set(['open'])],\r\n\t['dialog', new Set(['open'])]\r\n]);\r\n\r\nconst regex_is_single_css_selector = /[^\\\\],(?!([^([]+[^\\\\]|[^([\\\\])[)\\]])/;\r\n\r\nexport default class Selector {\r\n\tnode: CssNode;\r\n\tstylesheet: Stylesheet;\r\n\tblocks: Block[];\r\n\tlocal_blocks: Block[];\r\n\tused: boolean;\r\n\r\n\tconstructor(node: CssNode, stylesheet: Stylesheet) {\r\n\t\tthis.node = node;\r\n\t\tthis.stylesheet = stylesheet;\r\n\r\n\t\tthis.blocks = group_selectors(node);\r\n\r\n\t\t// take trailing :global(...) selectors out of consideration\r\n\t\tlet i = this.blocks.length;\r\n\t\twhile (i > 0) {\r\n\t\t\tif (!this.blocks[i - 1].global) break;\r\n\t\t\ti -= 1;\r\n\t\t}\r\n\r\n\t\tthis.local_blocks = this.blocks.slice(0, i);\r\n\r\n\t\tconst host_only = this.blocks.length === 1 && this.blocks[0].host;\r\n\t\tconst root_only = this.blocks.length === 1 && this.blocks[0].root;\r\n\r\n\t\tthis.used = this.local_blocks.length === 0 || host_only || root_only;\r\n\t}\r\n\r\n\tapply(node: Element) {\r\n\t\tconst to_encapsulate: Array<{ node: Element, block: Block }> = [];\r\n\r\n\t\tapply_selector(this.local_blocks.slice(), node, to_encapsulate);\r\n\r\n\t\tif (to_encapsulate.length > 0) {\r\n\t\t\tto_encapsulate.forEach(({ node, block }) => {\r\n\t\t\t\tthis.stylesheet.nodes_with_css_class.add(node);\r\n\t\t\t\tblock.should_encapsulate = true;\r\n\t\t\t});\r\n\r\n\t\t\tthis.used = true;\r\n\t\t}\r\n\t}\r\n\r\n\tminify(code: MagicString) {\r\n\t\tlet c: number = null;\r\n\t\tthis.blocks.forEach((block, i) => {\r\n\t\t\tif (i > 0) {\r\n\t\t\t\tif (block.start - c > 1) {\r\n\t\t\t\t\tcode.overwrite(c, block.start, block.combinator.name || ' ');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tc = block.end;\r\n\t\t});\r\n\t}\r\n\r\n\ttransform(code: MagicString, attr: string, max_amount_class_specificity_increased: number) {\r\n\t\tconst amount_class_specificity_to_increase = max_amount_class_specificity_increased - this.blocks.filter(block => block.should_encapsulate).length;\r\n\r\n\t\tfunction remove_global_pseudo_class(selector: CssNode) {\r\n\t\t\tconst first = selector.children[0];\r\n\t\t\tconst last = selector.children[selector.children.length - 1];\r\n\t\t\tcode.remove(selector.start, first.start).remove(last.end, selector.end);\r\n\t\t}\r\n\r\n\t\tfunction encapsulate_block(block: Block, attr: string) {\r\n\t\t\tfor (const selector of block.selectors) {\r\n\t\t\t\tif (selector.type === 'PseudoClassSelector' && selector.name === 'global') {\r\n\t\t\t\t\tremove_global_pseudo_class(selector);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet i = block.selectors.length;\r\n\r\n\t\t\twhile (i--) {\r\n\t\t\t\tconst selector = block.selectors[i];\r\n\t\t\t\tif (selector.type === 'PseudoElementSelector' || selector.type === 'PseudoClassSelector') {\r\n\t\t\t\t\tif (selector.name !== 'root' && selector.name !== 'host') {\r\n\t\t\t\t\t\tif (i === 0) code.prependRight(selector.start, attr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (selector.type === 'TypeSelector' && selector.name === '*') {\r\n\t\t\t\t\tcode.overwrite(selector.start, selector.end, attr);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.appendLeft(selector.end, attr);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.blocks.forEach((block, index) => {\r\n\t\t\tif (block.global) {\r\n\t\t\t\tremove_global_pseudo_class(block.selectors[0]);\r\n\t\t\t}\r\n\t\t\tif (block.should_encapsulate) encapsulate_block(block, index === this.blocks.length - 1 ? attr.repeat(amount_class_specificity_to_increase + 1) : attr);\r\n\t\t});\r\n\t}\r\n\r\n\tvalidate(component: Component) {\r\n\t\tlet start = 0;\r\n\t\tlet end = this.blocks.length;\r\n\r\n\t\tfor (; start < end; start += 1) {\r\n\t\t\tif (!this.blocks[start].global) break;\r\n\t\t}\r\n\r\n\t\tfor (; end > start; end -= 1) {\r\n\t\t\tif (!this.blocks[end - 1].global) break;\r\n\t\t}\r\n\r\n\t\tfor (let i = start; i < end; i += 1) {\r\n\t\t\tif (this.blocks[i].global) {\r\n\t\t\t\treturn component.error(this.blocks[i].selectors[0], compiler_errors.css_invalid_global);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.validate_global_with_multiple_selectors(component);\r\n\t\tthis.validate_invalid_combinator_without_selector(component);\r\n\t}\r\n\r\n\tvalidate_global_with_multiple_selectors(component: Component) {\r\n\t\tif (this.blocks.length === 1 && this.blocks[0].selectors.length === 1) {\r\n\t\t\t// standalone :global() with multiple selectors is OK\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfor (const block of this.blocks) {\r\n\t\t\tfor (const selector of block.selectors) {\r\n\t\t\t\tif (selector.type === 'PseudoClassSelector' && selector.name === 'global') {\r\n\t\t\t\t\tif (regex_is_single_css_selector.test(selector.children[0].value)) {\r\n\t\t\t\t\t\tcomponent.error(selector, compiler_errors.css_invalid_global_selector);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvalidate_invalid_combinator_without_selector(component: Component) {\r\n\t\tfor (let i = 0; i < this.blocks.length; i++) {\r\n\t\t\tconst block = this.blocks[i];\r\n\t\t\tif (block.combinator && block.selectors.length === 0) {\r\n\t\t\t\tcomponent.error(this.node, compiler_errors.css_invalid_selector(component.source.slice(this.node.start, this.node.end)));\r\n\t\t\t}\r\n\t\t\tif (!block.combinator && block.selectors.length === 0) {\r\n\t\t\t\tcomponent.error(this.node, compiler_errors.css_invalid_selector(component.source.slice(this.node.start, this.node.end)));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tget_amount_class_specificity_increased() {\r\n\t\tlet count = 0;\r\n\t\tfor (const block of this.blocks) {\r\n\t\t\tif (block.should_encapsulate) {\r\n\t\t\t\tcount ++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}\r\n}\r\n\r\nfunction apply_selector(blocks: Block[], node: Element, to_encapsulate: Array<{ node: Element, block: Block }>): boolean {\r\n\tconst block = blocks.pop();\r\n\tif (!block) return false;\r\n\r\n\tif (!node) {\r\n\t\treturn (\r\n\t\t\t(block.global && blocks.every(block => block.global)) ||\r\n\t\t\t(block.host && blocks.length === 0)\r\n\t\t);\r\n\t}\r\n\r\n\tswitch (block_might_apply_to_node(block, node)) {\r\n\t\tcase BlockAppliesToNode.NotPossible:\r\n\t\t\treturn false;\r\n\r\n\t\tcase BlockAppliesToNode.UnknownSelectorType:\r\n\t\t// bail. TODO figure out what these could be\r\n\t\t\tto_encapsulate.push({ node, block });\r\n\t\t\treturn true;\r\n\t}\r\n\r\n\tif (block.combinator) {\r\n\t\tif (block.combinator.type === 'Combinator' && block.combinator.name === ' ') {\r\n\t\t\tfor (const ancestor_block of blocks) {\r\n\t\t\t\tif (ancestor_block.global) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (ancestor_block.host) {\r\n\t\t\t\t\tto_encapsulate.push({ node, block });\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet parent = node;\r\n\t\t\t\twhile (parent = get_element_parent(parent)) {\r\n\t\t\t\t\tif (block_might_apply_to_node(ancestor_block, parent) !== BlockAppliesToNode.NotPossible) {\r\n\t\t\t\t\t\tto_encapsulate.push({ node: parent, block: ancestor_block });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (to_encapsulate.length) {\r\n\t\t\t\t\tto_encapsulate.push({ node, block });\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (blocks.every(block => block.global)) {\r\n\t\t\t\tto_encapsulate.push({ node, block });\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t} else if (block.combinator.name === '>') {\r\n\t\t\tconst has_global_parent = blocks.every(block => block.global);\r\n\t\t\tif (has_global_parent || apply_selector(blocks, get_element_parent(node), to_encapsulate)) {\r\n\t\t\t\tto_encapsulate.push({ node, block });\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t} else if (block.combinator.name === '+' || block.combinator.name === '~') {\r\n\t\t\tconst siblings = get_possible_element_siblings(node, block.combinator.name === '+');\r\n\t\t\tlet has_match = false;\r\n\r\n\t\t\t// NOTE: if we have :global(), we couldn't figure out what is selected within `:global` due to the\r\n\t\t\t// css-tree limitation that does not parse the inner selector of :global\r\n\t\t\t// so unless we are sure there will be no sibling to match, we will consider it as matched\r\n\t\t\tconst has_global = blocks.some(block => block.global);\r\n\t\t\tif (has_global) {\r\n\t\t\t\tif (siblings.size === 0 && get_element_parent(node) !== null) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tto_encapsulate.push({ node, block });\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tfor (const possible_sibling of siblings.keys()) {\r\n\t\t\t\tif (apply_selector(blocks.slice(), possible_sibling, to_encapsulate)) {\r\n\t\t\t\t\tto_encapsulate.push({ node, block });\r\n\t\t\t\t\thas_match = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn has_match;\r\n\t\t}\r\n\r\n\t\t// TODO other combinators\r\n\t\tto_encapsulate.push({ node, block });\r\n\t\treturn true;\r\n\t}\r\n\r\n\tto_encapsulate.push({ node, block });\r\n\treturn true;\r\n}\r\n\r\nconst regex_backslash_and_following_character = /\\\\(.)/g;\r\n\r\nfunction block_might_apply_to_node(block: Block, node: Element): BlockAppliesToNode {\r\n\tlet i = block.selectors.length;\r\n\r\n\twhile (i--) {\r\n\t\tconst selector = block.selectors[i];\r\n\t\tconst name = typeof selector.name === 'string' && selector.name.replace(regex_backslash_and_following_character, '$1');\r\n\r\n\t\tif (selector.type === 'PseudoClassSelector' && (name === 'host' || name === 'root')) {\r\n\t\t\treturn BlockAppliesToNode.NotPossible;\r\n\t\t}\r\n\r\n\t\tif (block.selectors.length === 1 && selector.type === 'PseudoClassSelector' && name === 'global') {\r\n\t\t\treturn BlockAppliesToNode.NotPossible;\r\n\t\t}\r\n\r\n\t\tif (selector.type === 'PseudoClassSelector' || selector.type === 'PseudoElementSelector') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (selector.type === 'ClassSelector') {\r\n\t\t\tif (!attribute_matches(node, 'class', name, '~=', false) && !node.classes.some(c => c.name === name)) return BlockAppliesToNode.NotPossible;\r\n\t\t} else if (selector.type === 'IdSelector') {\r\n\t\t\tif (!attribute_matches(node, 'id', name, '=', false)) return BlockAppliesToNode.NotPossible;\r\n\t\t} else if (selector.type === 'AttributeSelector') {\r\n\t\t\tif (\r\n\t\t\t\t!(whitelist_attribute_selector.has(node.name.toLowerCase()) && whitelist_attribute_selector.get(node.name.toLowerCase()).has(selector.name.name.toLowerCase())) &&\r\n\t\t\t\t!attribute_matches(node, selector.name.name, selector.value && unquote(selector.value), selector.matcher, selector.flags)) {\r\n\t\t\t\treturn BlockAppliesToNode.NotPossible;\r\n\t\t\t}\r\n\t\t} else if (selector.type === 'TypeSelector') {\r\n\t\t\tif (node.name.toLowerCase() !== name.toLowerCase() && name !== '*' && !node.is_dynamic_element) return BlockAppliesToNode.NotPossible;\r\n\t\t} else {\r\n\t\t\treturn BlockAppliesToNode.UnknownSelectorType;\r\n\t\t}\r\n\t}\r\n\r\n\treturn BlockAppliesToNode.Possible;\r\n}\r\n\r\nfunction test_attribute(operator, expected_value, case_insensitive, value) {\r\n\tif (case_insensitive) {\r\n\t\texpected_value = expected_value.toLowerCase();\r\n\t\tvalue = value.toLowerCase();\r\n\t}\r\n\tswitch (operator) {\r\n\t\tcase '=': return value === expected_value;\r\n\t\tcase '~=': return value.split(/\\s/).includes(expected_value);\r\n\t\tcase '|=': return `${value}-`.startsWith(`${expected_value}-`);\r\n\t\tcase '^=': return value.startsWith(expected_value);\r\n\t\tcase '$=': return value.endsWith(expected_value);\r\n\t\tcase '*=': return value.includes(expected_value);\r\n\t\tdefault: throw new Error(\"this shouldn't happen\");\r\n\t}\r\n}\r\n\r\nfunction attribute_matches(node: CssNode, name: string, expected_value: string, operator: string, case_insensitive: boolean) {\r\n\tconst spread = node.attributes.find(attr => attr.type === 'Spread');\r\n\tif (spread) return true;\r\n\r\n\tif (node.bindings.some((binding: CssNode) => binding.name === name)) return true;\r\n\r\n\tconst attr = node.attributes.find((attr: CssNode) => attr.name === name);\r\n\tif (!attr) return false;\r\n\tif (attr.is_true) return operator === null;\r\n\tif (!expected_value) return true;\r\n\r\n\tif (attr.chunks.length === 1) {\r\n\t\tconst value = attr.chunks[0];\r\n\t\tif (!value) return false;\r\n\t\tif (value.type === 'Text') return test_attribute(operator, expected_value, case_insensitive, value.data);\r\n\t}\r\n\r\n\tconst possible_values = new Set();\r\n\r\n\tlet prev_values = [];\r\n\tfor (const chunk of attr.chunks) {\r\n\t\tconst current_possible_values = new Set();\r\n\t\tif (chunk.type === 'Text') {\r\n\t\t\tcurrent_possible_values.add(chunk.data);\r\n\t\t} else {\r\n\t\t\tgather_possible_values(chunk.node, current_possible_values);\r\n\t\t}\r\n\r\n\t\t// impossible to find out all combinations\r\n\t\tif (current_possible_values.has(UNKNOWN)) return true;\r\n\r\n\t\tif (prev_values.length > 0) {\r\n\t\t\tconst start_with_space = [];\r\n\t\t\tconst remaining = [];\r\n\t\t\tcurrent_possible_values.forEach((current_possible_value: string) => {\r\n\t\t\t\tif (regex_starts_with_whitespace.test(current_possible_value)) {\r\n\t\t\t\t\tstart_with_space.push(current_possible_value);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tremaining.push(current_possible_value);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (remaining.length > 0) {\r\n\t\t\t\tif (start_with_space.length > 0) {\r\n\t\t\t\t\tprev_values.forEach(prev_value => possible_values.add(prev_value));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst combined = [];\r\n\t\t\t\tprev_values.forEach((prev_value: string) => {\r\n\t\t\t\t\tremaining.forEach((value: string) => {\r\n\t\t\t\t\t\tcombined.push(prev_value + value);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\tprev_values = combined;\r\n\r\n\t\t\t\tstart_with_space.forEach((value: string) => {\r\n\t\t\t\t\tif (regex_ends_with_whitespace.test(value)) {\r\n\t\t\t\t\t\tpossible_values.add(value);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tprev_values.push(value);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\tprev_values.forEach(prev_value => possible_values.add(prev_value));\r\n\t\t\t\tprev_values = [];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcurrent_possible_values.forEach((current_possible_value: string) => {\r\n\t\t\tif (regex_ends_with_whitespace.test(current_possible_value)) {\r\n\t\t\t\tpossible_values.add(current_possible_value);\r\n\t\t\t} else {\r\n\t\t\t\tprev_values.push(current_possible_value);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (prev_values.length < current_possible_values.size) {\r\n\t\t\tprev_values.push(' ');\r\n\t\t}\r\n\r\n\t\tif (prev_values.length > 20) {\r\n\t\t\t// might grow exponentially, bail out\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\tprev_values.forEach(prev_value => possible_values.add(prev_value));\r\n\r\n\tif (possible_values.has(UNKNOWN)) return true;\r\n\r\n\tfor (const value of possible_values) {\r\n\t\tif (test_attribute(operator, expected_value, case_insensitive, value)) return true;\r\n\t}\r\n\r\n\treturn false;\r\n}\r\n\r\nfunction unquote(value: CssNode) {\r\n\tif (value.type === 'Identifier') return value.name;\r\n\tconst str = value.value;\r\n\tif (str[0] === str[str.length - 1] && str[0] === \"'\" || str[0] === '\"') {\r\n\t\treturn str.slice(1, str.length - 1);\r\n\t}\r\n\treturn str;\r\n}\r\n\r\nfunction get_element_parent(node: Element): Element | null {\r\n\tlet parent: INode = node;\r\n\twhile ((parent = parent.parent) && parent.type !== 'Element');\r\n\treturn parent as Element | null;\r\n}\r\n\r\nfunction get_possible_element_siblings(node: INode, adjacent_only: boolean): Map<Element, NodeExist> {\r\n\tconst result: Map<Element, NodeExist> = new Map();\r\n\tlet prev: INode = node;\r\n\twhile (prev = prev.prev) {\r\n\t\tif (prev.type === 'Element') {\r\n\t\t\tif (!prev.attributes.find(attr => attr.type === 'Attribute' && attr.name.toLowerCase() === 'slot')) {\r\n\t\t\t\tresult.set(prev, NodeExist.Definitely);\r\n\t\t\t}\r\n\r\n\t\t\tif (adjacent_only) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else if (prev.type === 'EachBlock' || prev.type === 'IfBlock' || prev.type === 'AwaitBlock') {\r\n\t\t\tconst possible_last_child = get_possible_last_child(prev, adjacent_only);\r\n\r\n\t\t\tadd_to_map(possible_last_child, result);\r\n\t\t\tif (adjacent_only && has_definite_elements(possible_last_child)) {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (!prev || !adjacent_only) {\r\n\t\tlet parent: INode = node;\r\n\t\tlet skip_each_for_last_child = node.type === 'ElseBlock';\r\n\t\twhile ((parent = parent.parent) && (parent.type === 'EachBlock' || parent.type === 'IfBlock' || parent.type === 'ElseBlock' || parent.type === 'AwaitBlock')) {\r\n\t\t\tconst possible_siblings = get_possible_element_siblings(parent, adjacent_only);\r\n\t\t\tadd_to_map(possible_siblings, result);\r\n\r\n\t\t\tif (parent.type === 'EachBlock') {\r\n\t\t\t\t// first child of each block can select the last child of each block as previous sibling\r\n\t\t\t\tif (skip_each_for_last_child) {\r\n\t\t\t\t\tskip_each_for_last_child = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tadd_to_map(get_possible_last_child(parent, adjacent_only), result);\r\n\t\t\t\t}\r\n\t\t\t} else if (parent.type === 'ElseBlock') {\r\n\t\t\t\tskip_each_for_last_child = true;\r\n\t\t\t\tparent = parent.parent;\r\n\t\t\t}\r\n\r\n\t\t\tif (adjacent_only && has_definite_elements(possible_siblings)) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction get_possible_last_child(block: EachBlock | IfBlock | AwaitBlock, adjacent_only: boolean): Map<Element, NodeExist> {\r\n\tconst result: Map<Element, NodeExist> = new Map();\r\n\r\n\tif (block.type === 'EachBlock') {\r\n\t\tconst each_result: Map<Element, NodeExist> = loop_child(block.children, adjacent_only);\r\n\t\tconst else_result: Map<Element, NodeExist> = block.else ? loop_child(block.else.children, adjacent_only) : new Map();\r\n\r\n\t\tconst not_exhaustive = !has_definite_elements(else_result);\r\n\r\n\t\tif (not_exhaustive) {\r\n\t\t\tmark_as_probably(each_result);\r\n\t\t\tmark_as_probably(else_result);\r\n\t\t}\r\n\t\tadd_to_map(each_result, result);\r\n\t\tadd_to_map(else_result, result);\r\n\t} else if (block.type === 'IfBlock') {\r\n\t\tconst if_result: Map<Element, NodeExist> = loop_child(block.children, adjacent_only);\r\n\t\tconst else_result: Map<Element, NodeExist> = block.else ? loop_child(block.else.children, adjacent_only) : new Map();\r\n\r\n\t\tconst not_exhaustive = !has_definite_elements(if_result) || !has_definite_elements(else_result);\r\n\r\n\t\tif (not_exhaustive) {\r\n\t\t\tmark_as_probably(if_result);\r\n\t\t\tmark_as_probably(else_result);\r\n\t\t}\r\n\r\n\t\tadd_to_map(if_result, result);\r\n\t\tadd_to_map(else_result, result);\r\n\t} else if (block.type === 'AwaitBlock') {\r\n\t\tconst pending_result: Map<Element, NodeExist> = block.pending ? loop_child(block.pending.children, adjacent_only) : new Map();\r\n\t\tconst then_result: Map<Element, NodeExist> = block.then ? loop_child(block.then.children, adjacent_only) : new Map();\r\n\t\tconst catch_result: Map<Element, NodeExist> = block.catch ? loop_child(block.catch.children, adjacent_only) : new Map();\r\n\r\n\t\tconst not_exhaustive = !has_definite_elements(pending_result) || !has_definite_elements(then_result) || !has_definite_elements(catch_result);\r\n\r\n\t\tif (not_exhaustive) {\r\n\t\t\tmark_as_probably(pending_result);\r\n\t\t\tmark_as_probably(then_result);\r\n\t\t\tmark_as_probably(catch_result);\r\n\t\t}\r\n\r\n\t\tadd_to_map(pending_result, result);\r\n\t\tadd_to_map(then_result, result);\r\n\t\tadd_to_map(catch_result, result);\r\n\t}\r\n\r\n\treturn result;\r\n}\r\n\r\nfunction has_definite_elements(result: Map<Element, NodeExist>): boolean {\r\n\tif (result.size === 0) return false;\r\n\tfor (const exist of result.values()) {\r\n\t\tif (exist === NodeExist.Definitely) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nfunction add_to_map(from: Map<Element, NodeExist>, to: Map<Element, NodeExist>) {\r\n\tfrom.forEach((exist, element) => {\r\n\t\tto.set(element, higher_existence(exist, to.get(element)));\r\n\t});\r\n}\r\n\r\nfunction higher_existence(exist1: NodeExist | null, exist2: NodeExist | null): NodeExist {\r\n\tif (exist1 === undefined || exist2 === undefined) return exist1 || exist2;\r\n\treturn exist1 > exist2 ? exist1 : exist2;\r\n}\r\n\r\nfunction mark_as_probably(result: Map<Element, NodeExist>) {\r\n\tfor (const key of result.keys()) {\r\n\t\tresult.set(key, NodeExist.Probably);\r\n\t}\r\n}\r\n\r\nfunction loop_child(children: INode[], adjacent_only: boolean) {\r\n\tconst result: Map<Element, NodeExist> = new Map();\r\n\tfor (let i = children.length - 1; i >= 0; i--) {\r\n\t\tconst child = children[i];\r\n\t\tif (child.type === 'Element') {\r\n\t\t\tresult.set(child, NodeExist.Definitely);\r\n\t\t\tif (adjacent_only) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} else if (child.type === 'EachBlock' || child.type === 'IfBlock' || child.type === 'AwaitBlock') {\r\n\t\t\tconst child_result = get_possible_last_child(child, adjacent_only);\r\n\t\t\tadd_to_map(child_result, result);\r\n\t\t\tif (adjacent_only && has_definite_elements(child_result)) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}\r\n\r\nclass Block {\r\n\thost: boolean;\r\n\troot: boolean;\r\n\tcombinator: CssNode;\r\n\tselectors: CssNode[];\r\n\tstart: number;\r\n\tend: number;\r\n\tshould_encapsulate: boolean;\r\n\r\n\tconstructor(combinator: CssNode) {\r\n\t\tthis.combinator = combinator;\r\n\t\tthis.host = false;\r\n\t\tthis.root = false;\r\n\t\tthis.selectors = [];\r\n\r\n\t\tthis.start = null;\r\n\t\tthis.end = null;\r\n\r\n\t\tthis.should_encapsulate = false;\r\n\t}\r\n\r\n\tadd(selector: CssNode) {\r\n\t\tif (this.selectors.length === 0) {\r\n\t\t\tthis.start = selector.start;\r\n\t\t\tthis.host = selector.type === 'PseudoClassSelector' && selector.name === 'host';\r\n\t\t}\r\n\t\tthis.root = this.root || selector.type === 'PseudoClassSelector' && selector.name === 'root';\r\n\r\n\t\tthis.selectors.push(selector);\r\n\t\tthis.end = selector.end;\r\n\t}\r\n\r\n\tget global() {\r\n\t\treturn (\r\n\t\t\tthis.selectors.length >= 1 &&\r\n\t\t\tthis.selectors[0].type === 'PseudoClassSelector' &&\r\n\t\t\tthis.selectors[0].name === 'global' &&\r\n\t\t\tthis.selectors.every((selector) => selector.type === 'PseudoClassSelector' || selector.type === 'PseudoElementSelector')\r\n\t\t);\r\n\t}\r\n}\r\n\r\nfunction group_selectors(selector: CssNode) {\r\n\tlet block: Block = new Block(null);\r\n\r\n\tconst blocks = [block];\r\n\r\n\tselector.children.forEach((child: CssNode) => {\r\n\t\tif (child.type === 'WhiteSpace' || child.type === 'Combinator') {\r\n\t\t\tblock = new Block(child);\r\n\t\t\tblocks.push(block);\r\n\t\t} else {\r\n\t\t\tblock.add(child);\r\n\t\t}\r\n\t});\r\n\r\n\treturn blocks;\r\n}\r\n","import MagicString from 'magic-string';\r\nimport { walk } from 'estree-walker';\r\nimport Selector from './Selector';\r\nimport Element from '../nodes/Element';\r\nimport { Ast, CssHashGetter } from '../../interfaces';\r\nimport Component from '../Component';\r\nimport { CssNode } from './interfaces';\r\nimport hash from '../utils/hash';\r\nimport compiler_warnings from '../compiler_warnings';\r\nimport { extract_ignores_above_position } from '../../utils/extract_svelte_ignore';\r\nimport { push_array } from '../../utils/push_array';\r\nimport { regex_only_whitespaces, regex_whitespace } from '../../utils/patterns';\r\n\r\nconst regex_css_browser_prefix = /^-((webkit)|(moz)|(o)|(ms))-/;\r\n\r\nfunction remove_css_prefix(name: string): string {\r\n\treturn name.replace(regex_css_browser_prefix, '');\r\n}\r\n\r\nconst is_keyframes_node = (node: CssNode) =>\r\n\tremove_css_prefix(node.name) === 'keyframes';\r\n\r\nconst at_rule_has_declaration = ({ block }: CssNode): true =>\r\n\tblock &&\r\n\tblock.children &&\r\n\tblock.children.find((node: CssNode) => node.type === 'Declaration');\r\n\r\nfunction minify_declarations(\r\n\tcode: MagicString,\r\n\tstart: number,\r\n\tdeclarations: Declaration[]\r\n): number {\r\n\tlet c = start;\r\n\r\n\tdeclarations.forEach((declaration, i) => {\r\n\t\tconst separator = i > 0 ? ';' : '';\r\n\t\tif ((declaration.node.start - c) > separator.length) {\r\n\t\t\tcode.overwrite(c, declaration.node.start, separator);\r\n\t\t}\r\n\t\tdeclaration.minify(code);\r\n\t\tc = declaration.node.end;\r\n\t});\r\n\r\n\treturn c;\r\n}\r\n\r\nclass Rule {\r\n\tselectors: Selector[];\r\n\tdeclarations: Declaration[];\r\n\tnode: CssNode;\r\n\tparent: Atrule;\r\n\r\n\tconstructor(node: CssNode, stylesheet, parent?: Atrule) {\r\n\t\tthis.node = node;\r\n\t\tthis.parent = parent;\r\n\t\tthis.selectors = node.prelude.children.map((node: CssNode) => new Selector(node, stylesheet));\r\n\t\tthis.declarations = node.block.children.map((node: CssNode) => new Declaration(node));\r\n\t}\r\n\r\n\tapply(node: Element) {\r\n\t\tthis.selectors.forEach(selector => selector.apply(node)); // TODO move the logic in here?\r\n\t}\r\n\r\n\tis_used(dev: boolean) {\r\n\t\tif (this.parent && this.parent.node.type === 'Atrule' && is_keyframes_node(this.parent.node)) return true;\r\n\t\tif (this.declarations.length === 0) return dev;\r\n\t\treturn this.selectors.some(s => s.used);\r\n\t}\r\n\r\n\tminify(code: MagicString, _dev: boolean) {\r\n\t\tlet c = this.node.start;\r\n\t\tlet started = false;\r\n\r\n\t\tthis.selectors.forEach((selector) => {\r\n\t\t\tif (selector.used) {\r\n\t\t\t\tconst separator = started ? ',' : '';\r\n\t\t\t\tif ((selector.node.start - c) > separator.length) {\r\n\t\t\t\t\tcode.overwrite(c, selector.node.start, separator);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tselector.minify(code);\r\n\t\t\t\tc = selector.node.end;\r\n\r\n\t\t\t\tstarted = true;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcode.remove(c, this.node.block.start);\r\n\r\n\t\tc = this.node.block.start + 1;\r\n\t\tc = minify_declarations(code, c, this.declarations);\r\n\r\n\t\tcode.remove(c, this.node.block.end - 1);\r\n\t}\r\n\r\n\ttransform(code: MagicString, id: string, keyframes: Map<string, string>, max_amount_class_specificity_increased: number) {\r\n\t\tif (this.parent && this.parent.node.type === 'Atrule' && is_keyframes_node(this.parent.node)) return true;\r\n\r\n\t\tconst attr = `.${id}`;\r\n\r\n\t\tthis.selectors.forEach(selector => selector.transform(code, attr, max_amount_class_specificity_increased));\r\n\t\tthis.declarations.forEach(declaration => declaration.transform(code, keyframes));\r\n\t}\r\n\r\n\tvalidate(component: Component) {\r\n\t\tthis.selectors.forEach(selector => {\r\n\t\t\tselector.validate(component);\r\n\t\t});\r\n\t}\r\n\r\n\twarn_on_unused_selector(handler: (selector: Selector) => void) {\r\n\t\tthis.selectors.forEach(selector => {\r\n\t\t\tif (!selector.used) handler(selector);\r\n\t\t});\r\n\t}\r\n\r\n\tget_max_amount_class_specificity_increased() {\r\n\t\treturn Math.max(...this.selectors.map(selector => selector.get_amount_class_specificity_increased()));\r\n\t}\r\n}\r\n\r\nclass Declaration {\r\n\tnode: CssNode;\r\n\r\n\tconstructor(node: CssNode) {\r\n\t\tthis.node = node;\r\n\t}\r\n\r\n\ttransform(code: MagicString, keyframes: Map<string, string>) {\r\n\t\tconst property = this.node.property && remove_css_prefix(this.node.property.toLowerCase());\r\n\t\tif (property === 'animation' || property === 'animation-name') {\r\n\t\t\tthis.node.value.children.forEach((block: CssNode) => {\r\n\t\t\t\tif (block.type === 'Identifier') {\r\n\t\t\t\t\tconst name = block.name;\r\n\t\t\t\t\tif (keyframes.has(name)) {\r\n\t\t\t\t\t\tcode.overwrite(block.start, block.end, keyframes.get(name));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tminify(code: MagicString) {\r\n\t\tif (!this.node.property) return; // @apply, and possibly other weird cases?\r\n\r\n\t\tconst c = this.node.start + this.node.property.length;\r\n\t\tconst first = this.node.value.children\r\n\t\t\t? this.node.value.children[0]\r\n\t\t\t: this.node.value;\r\n\r\n\t\t// Don't minify whitespace in custom properties, since some browsers (Chromium < 99)\r\n\t\t// treat --foo: ; and --foo:; differently\r\n\t\tif (first.type === 'Raw' && regex_only_whitespaces.test(first.value)) return;\r\n\r\n\t\tlet start = first.start;\r\n\t\twhile (regex_whitespace.test(code.original[start])) start += 1;\r\n\r\n\t\tif (start - c > 1) {\r\n\t\t\tcode.overwrite(c, start, ':');\r\n\t\t}\r\n\t}\r\n}\r\n\r\nclass Atrule {\r\n\tnode: CssNode;\r\n\tchildren: Array<Atrule | Rule>;\r\n\tdeclarations: Declaration[];\r\n\r\n\tconstructor(node: CssNode) {\r\n\t\tthis.node = node;\r\n\t\tthis.children = [];\r\n\t\tthis.declarations = [];\r\n\t}\r\n\r\n\tapply(node: Element) {\r\n\t\tif (this.node.name === 'media' || this.node.name === 'supports' || this.node.name === 'layer') {\r\n\t\t\tthis.children.forEach(child => {\r\n\t\t\t\tchild.apply(node);\r\n\t\t\t});\r\n\t\t} else if (is_keyframes_node(this.node)) {\r\n\t\t\tthis.children.forEach((rule: Rule) => {\r\n\t\t\t\trule.selectors.forEach(selector => {\r\n\t\t\t\t\tselector.used = true;\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tis_used(_dev: boolean) {\r\n\t\treturn true; // TODO\r\n\t}\r\n\r\n\tminify(code: MagicString, dev: boolean) {\r\n\t\tif (this.node.name === 'media') {\r\n\t\t\tconst expression_char = code.original[this.node.prelude.start];\r\n\t\t\tlet c = this.node.start + (expression_char === '(' ? 6 : 7);\r\n\t\t\tif (this.node.prelude.start > c) code.remove(c, this.node.prelude.start);\r\n\r\n\t\t\tthis.node.prelude.children.forEach((query: CssNode) => {\r\n\t\t\t\t// TODO minify queries\r\n\t\t\t\tc = query.end;\r\n\t\t\t});\r\n\r\n\t\t\tcode.remove(c, this.node.block.start);\r\n\t\t} else if (this.node.name === 'supports') {\r\n\t\t\tlet c = this.node.start + 9;\r\n\t\t\tif (this.node.prelude.start - c > 1) code.overwrite(c, this.node.prelude.start, ' ');\r\n\t\t\tthis.node.prelude.children.forEach((query: CssNode) => {\r\n\t\t\t\t// TODO minify queries\r\n\t\t\t\tc = query.end;\r\n\t\t\t});\r\n\t\t\tcode.remove(c, this.node.block.start);\r\n\t\t} else {\r\n\t\t\tlet c = this.node.start + this.node.name.length + 1;\r\n\t\t\tif (this.node.prelude) {\r\n\t\t\t\tif (this.node.prelude.start - c > 1) code.overwrite(c, this.node.prelude.start, ' ');\r\n\t\t\t\tc = this.node.prelude.end;\r\n\t\t\t}\r\n\t\t\tif (this.node.block && this.node.block.start - c > 0) {\r\n\t\t\t\tcode.remove(c, this.node.block.start);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// TODO other atrules\r\n\r\n\t\tif (this.node.block) {\r\n\t\t\tlet c = this.node.block.start + 1;\r\n\t\t\tif (this.declarations.length) {\r\n\t\t\t\tc = minify_declarations(code, c, this.declarations);\r\n\t\t\t\t// if the atrule has children, leave the last declaration semicolon alone\r\n\t\t\t\tif (this.children.length) c++;\r\n\t\t\t}\r\n\r\n\t\t\tthis.children.forEach(child => {\r\n\t\t\t\tif (child.is_used(dev)) {\r\n\t\t\t\t\tcode.remove(c, child.node.start);\r\n\t\t\t\t\tchild.minify(code, dev);\r\n\t\t\t\t\tc = child.node.end;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tcode.remove(c, this.node.block.end - 1);\r\n\t\t}\r\n\t}\r\n\r\n\ttransform(code: MagicString, id: string, keyframes: Map<string, string>, max_amount_class_specificity_increased: number) {\r\n\t\tif (is_keyframes_node(this.node)) {\r\n\t\t\tthis.node.prelude.children.forEach(({ type, name, start, end }: CssNode) => {\r\n\t\t\t\tif (type === 'Identifier') {\r\n\t\t\t\t\tif (name.startsWith('-global-')) {\r\n\t\t\t\t\t\tcode.remove(start, start + 8);\r\n\t\t\t\t\t\tthis.children.forEach((rule: Rule) => {\r\n\t\t\t\t\t\t\trule.selectors.forEach(selector => {\r\n\t\t\t\t\t\t\t\tselector.used = true;\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcode.overwrite(start, end, keyframes.get(name));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.children.forEach(child => {\r\n\t\t\tchild.transform(code, id, keyframes, max_amount_class_specificity_increased);\r\n\t\t});\r\n\t}\r\n\r\n\tvalidate(component: Component) {\r\n\t\tthis.children.forEach(child => {\r\n\t\t\tchild.validate(component);\r\n\t\t});\r\n\t}\r\n\r\n\twarn_on_unused_selector(handler: (selector: Selector) => void) {\r\n\t\tif (this.node.name !== 'media') return;\r\n\r\n\t\tthis.children.forEach(child => {\r\n\t\t\tchild.warn_on_unused_selector(handler);\r\n\t\t});\r\n\t}\r\n\r\n\tget_max_amount_class_specificity_increased() {\r\n\t\treturn Math.max(...this.children.map(rule => rule.get_max_amount_class_specificity_increased()));\r\n\t}\r\n}\r\n\r\nconst get_default_css_hash: CssHashGetter = ({ css, hash }) => {\r\n\treturn `svelte-${hash(css)}`;\r\n};\r\n\r\nexport default class Stylesheet {\r\n\tsource: string;\r\n\tast: Ast;\r\n\tfilename: string;\r\n\tdev: boolean;\r\n\r\n\thas_styles: boolean;\r\n\tid: string;\r\n\r\n\tchildren: Array<Rule | Atrule> = [];\r\n\tkeyframes: Map<string, string> = new Map();\r\n\r\n\tnodes_with_css_class: Set<CssNode> = new Set();\r\n\r\n\tconstructor({\r\n\t\tsource,\r\n\t\tast,\r\n\t\tcomponent_name,\r\n\t\tfilename,\r\n\t\tdev,\r\n\t\tget_css_hash = get_default_css_hash\r\n\t}: {\r\n\t\tsource: string;\r\n\t\tast: Ast;\r\n\t\tfilename: string | undefined;\r\n\t\tcomponent_name: string | undefined;\r\n\t\tdev: boolean;\r\n\t\tget_css_hash: CssHashGetter;\r\n\t}) {\r\n\t\tthis.source = source;\r\n\t\tthis.ast = ast;\r\n\t\tthis.filename = filename;\r\n\t\tthis.dev = dev;\r\n\r\n\t\tif (ast.css && ast.css.children.length) {\r\n\t\t\tthis.id = get_css_hash({\r\n\t\t\t\tfilename,\r\n\t\t\t\tname: component_name,\r\n\t\t\t\tcss: ast.css.content.styles,\r\n\t\t\t\thash\r\n\t\t\t});\r\n\r\n\t\t\tthis.has_styles = true;\r\n\r\n\t\t\tconst stack: Atrule[] = [];\r\n\t\t\tlet depth = 0;\r\n\t\t\tlet current_atrule: Atrule = null;\r\n\r\n\t\t\twalk(ast.css as any, {\r\n\t\t\t\tenter: (node: any) => {\r\n\t\t\t\t\tif (node.type === 'Atrule') {\r\n\t\t\t\t\t\tconst atrule = new Atrule(node);\r\n\t\t\t\t\t\tstack.push(atrule);\r\n\r\n\t\t\t\t\t\tif (current_atrule) {\r\n\t\t\t\t\t\t\tcurrent_atrule.children.push(atrule);\r\n\t\t\t\t\t\t} else if (depth <= 1) {\r\n\t\t\t\t\t\t\tthis.children.push(atrule);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (is_keyframes_node(node)) {\r\n\t\t\t\t\t\t\tnode.prelude.children.forEach((expression: CssNode) => {\r\n\t\t\t\t\t\t\t\tif (expression.type === 'Identifier' && !expression.name.startsWith('-global-')) {\r\n\t\t\t\t\t\t\t\t\tthis.keyframes.set(expression.name, `${this.id}-${expression.name}`);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else if (at_rule_has_declaration(node)) {\r\n\t\t\t\t\t\t\tconst at_rule_declarations = node.block.children\r\n\t\t\t\t\t\t\t\t.filter(node => node.type === 'Declaration')\r\n\t\t\t\t\t\t\t\t.map(node => new Declaration(node));\r\n\t\t\t\t\t\t\tpush_array(atrule.declarations, at_rule_declarations);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcurrent_atrule = atrule;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (node.type === 'Rule') {\r\n\t\t\t\t\t\tconst rule = new Rule(node, this, current_atrule);\r\n\r\n\t\t\t\t\t\tif (current_atrule) {\r\n\t\t\t\t\t\t\tcurrent_atrule.children.push(rule);\r\n\t\t\t\t\t\t} else if (depth <= 1) {\r\n\t\t\t\t\t\t\tthis.children.push(rule);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdepth += 1;\r\n\t\t\t\t},\r\n\r\n\t\t\t\tleave: (node: any) => {\r\n\t\t\t\t\tif (node.type === 'Atrule') {\r\n\t\t\t\t\t\tstack.pop();\r\n\t\t\t\t\t\tcurrent_atrule = stack[stack.length - 1];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdepth -= 1;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.has_styles = false;\r\n\t\t}\r\n\t}\r\n\r\n\tapply(node: Element) {\r\n\t\tif (!this.has_styles) return;\r\n\r\n\t\tfor (let i = 0; i < this.children.length; i += 1) {\r\n\t\t\tconst child = this.children[i];\r\n\t\t\tchild.apply(node);\r\n\t\t}\r\n\t}\r\n\r\n\treify() {\r\n\t\tthis.nodes_with_css_class.forEach((node: Element) => {\r\n\t\t\tnode.add_css_class();\r\n\t\t});\r\n\t}\r\n\r\n\trender(file: string, should_transform_selectors: boolean) {\r\n\t\tif (!this.has_styles) {\r\n\t\t\treturn { code: null, map: null };\r\n\t\t}\r\n\r\n\t\tconst code = new MagicString(this.source);\r\n\r\n\t\twalk(this.ast.css as any, {\r\n\t\t\tenter: (node: any) => {\r\n\t\t\t\tcode.addSourcemapLocation(node.start);\r\n\t\t\t\tcode.addSourcemapLocation(node.end);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (should_transform_selectors) {\r\n\t\t\tconst max = Math.max(...this.children.map(rule => rule.get_max_amount_class_specificity_increased()));\r\n\t\t\tthis.children.forEach((child: (Atrule | Rule)) => {\r\n\t\t\t\tchild.transform(code, this.id, this.keyframes, max);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tlet c = 0;\r\n\t\tthis.children.forEach(child => {\r\n\t\t\tif (child.is_used(this.dev)) {\r\n\t\t\t\tcode.remove(c, child.node.start);\r\n\t\t\t\tchild.minify(code, this.dev);\r\n\t\t\t\tc = child.node.end;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcode.remove(c, this.source.length);\r\n\r\n\t\treturn {\r\n\t\t\tcode: code.toString(),\r\n\t\t\tmap: code.generateMap({\r\n\t\t\t\tincludeContent: true,\r\n\t\t\t\tsource: this.filename,\r\n\t\t\t\tfile\r\n\t\t\t})\r\n\t\t};\r\n\t}\r\n\r\n\tvalidate(component: Component) {\r\n\t\tthis.children.forEach(child => {\r\n\t\t\tchild.validate(component);\r\n\t\t});\r\n\t}\r\n\r\n\twarn_on_unused_selectors(component: Component) {\r\n\t\tconst ignores = !this.ast.css ? [] : extract_ignores_above_position(this.ast.css.start, this.ast.html.children);\r\n\t\tcomponent.push_ignores(ignores);\r\n\t\tthis.children.forEach(child => {\r\n\t\t\tchild.warn_on_unused_selector((selector: Selector) => {\r\n\t\t\t\tcomponent.warn(selector.node, compiler_warnings.css_unused_selector(this.source.slice(selector.node.start, selector.node.end)));\r\n\t\t\t});\r\n\t\t});\r\n\t\tcomponent.pop_ignores();\r\n\t}\r\n}\r\n","// This file is automatically generated\nexport default new Set([\"HtmlTag\",\"HtmlTagHydration\",\"SvelteComponent\",\"SvelteComponentDev\",\"SvelteComponentTyped\",\"SvelteElement\",\"action_destroyer\",\"add_attribute\",\"add_classes\",\"add_flush_callback\",\"add_location\",\"add_render_callback\",\"add_resize_listener\",\"add_styles\",\"add_transform\",\"afterUpdate\",\"append\",\"append_dev\",\"append_empty_stylesheet\",\"append_hydration\",\"append_hydration_dev\",\"append_styles\",\"assign\",\"attr\",\"attr_dev\",\"attribute_to_object\",\"beforeUpdate\",\"bind\",\"binding_callbacks\",\"blank_object\",\"bubble\",\"check_outros\",\"children\",\"claim_component\",\"claim_element\",\"claim_html_tag\",\"claim_space\",\"claim_svg_element\",\"claim_text\",\"clear_loops\",\"component_subscribe\",\"compute_rest_props\",\"compute_slots\",\"construct_svelte_component\",\"construct_svelte_component_dev\",\"createEventDispatcher\",\"create_animation\",\"create_bidirectional_transition\",\"create_component\",\"create_in_transition\",\"create_out_transition\",\"create_slot\",\"create_ssr_component\",\"current_component\",\"custom_event\",\"dataset_dev\",\"debug\",\"destroy_block\",\"destroy_component\",\"destroy_each\",\"detach\",\"detach_after_dev\",\"detach_before_dev\",\"detach_between_dev\",\"detach_dev\",\"dirty_components\",\"dispatch_dev\",\"each\",\"element\",\"element_is\",\"empty\",\"end_hydrating\",\"escape\",\"escape_attribute_value\",\"escape_object\",\"exclude_internal_props\",\"fix_and_destroy_block\",\"fix_and_outro_and_destroy_block\",\"fix_position\",\"flush\",\"getAllContexts\",\"getContext\",\"get_all_dirty_from_scope\",\"get_binding_group_value\",\"get_current_component\",\"get_custom_elements_slots\",\"get_root_for_style\",\"get_slot_changes\",\"get_spread_object\",\"get_spread_update\",\"get_store_value\",\"globals\",\"group_outros\",\"handle_promise\",\"hasContext\",\"has_prop\",\"head_selector\",\"identity\",\"init\",\"insert\",\"insert_dev\",\"insert_hydration\",\"insert_hydration_dev\",\"intros\",\"invalid_attribute_name_character\",\"is_client\",\"is_crossorigin\",\"is_empty\",\"is_function\",\"is_promise\",\"is_void\",\"listen\",\"listen_dev\",\"loop\",\"loop_guard\",\"merge_ssr_styles\",\"missing_component\",\"mount_component\",\"noop\",\"not_equal\",\"now\",\"null_to_empty\",\"object_without_properties\",\"onDestroy\",\"onMount\",\"once\",\"outro_and_destroy_block\",\"prevent_default\",\"prop_dev\",\"query_selector_all\",\"raf\",\"run\",\"run_all\",\"safe_not_equal\",\"schedule_update\",\"select_multiple_value\",\"select_option\",\"select_options\",\"select_value\",\"self\",\"setContext\",\"set_attributes\",\"set_current_component\",\"set_custom_element_data\",\"set_custom_element_data_map\",\"set_data\",\"set_data_dev\",\"set_input_type\",\"set_input_value\",\"set_now\",\"set_raf\",\"set_store_value\",\"set_style\",\"set_svg_attributes\",\"space\",\"spread\",\"src_url_equal\",\"start_hydrating\",\"stop_propagation\",\"subscribe\",\"svg_element\",\"text\",\"tick\",\"time_ranges_to_array\",\"to_number\",\"toggle_class\",\"transition_in\",\"transition_out\",\"trusted\",\"update_await_block_branch\",\"update_keyed_each\",\"update_slot\",\"update_slot_base\",\"validate_component\",\"validate_dynamic_element\",\"validate_each_argument\",\"validate_each_keys\",\"validate_slots\",\"validate_store\",\"validate_void_dynamic_element\",\"xlink_attr\"]);","import { walk } from 'estree-walker';\r\nimport { getLocator } from 'locate-character';\r\nimport Stats from '../Stats';\r\nimport { reserved, is_valid } from '../utils/names';\r\nimport globals from '../utils/globals';\r\nimport { namespaces, valid_namespaces } from '../utils/namespaces';\r\nimport create_module from './create_module';\r\nimport {\r\n\tcreate_scopes,\r\n\textract_names,\r\n\tScope,\r\n\textract_identifiers\r\n} from './utils/scope';\r\nimport Stylesheet from './css/Stylesheet';\r\nimport { test } from '../config';\r\nimport Fragment from './nodes/Fragment';\r\nimport internal_exports from './internal_exports';\r\nimport { Ast, CompileOptions, Var, Warning, CssResult } from '../interfaces';\r\nimport error from '../utils/error';\r\nimport get_code_frame from '../utils/get_code_frame';\r\nimport flatten_reference from './utils/flatten_reference';\r\nimport is_used_as_reference from './utils/is_used_as_reference';\r\nimport is_reference, { NodeWithPropertyDefinition } from 'is-reference';\r\nimport TemplateScope from './nodes/shared/TemplateScope';\r\nimport fuzzymatch from '../utils/fuzzymatch';\r\nimport get_object from './utils/get_object';\r\nimport Slot from './nodes/Slot';\r\nimport { Node, ImportDeclaration, ExportNamedDeclaration, Identifier, ExpressionStatement, AssignmentExpression, Literal, Property, RestElement, ExportDefaultDeclaration, ExportAllDeclaration, FunctionDeclaration, FunctionExpression } from 'estree';\r\nimport add_to_set from './utils/add_to_set';\r\nimport check_graph_for_cycles from './utils/check_graph_for_cycles';\r\nimport { print, b } from 'code-red';\r\nimport { is_reserved_keyword } from './utils/reserved_keywords';\r\nimport { apply_preprocessor_sourcemap } from '../utils/mapped_code';\r\nimport Element from './nodes/Element';\r\nimport { DecodedSourceMap, RawSourceMap } from '@ampproject/remapping/dist/types/types';\r\nimport { clone } from '../utils/clone';\r\nimport compiler_warnings from './compiler_warnings';\r\nimport compiler_errors from './compiler_errors';\r\nimport { extract_ignores_above_position, extract_svelte_ignore_from_comments } from '../utils/extract_svelte_ignore';\r\nimport check_enable_sourcemap from './utils/check_enable_sourcemap';\r\n\r\ninterface ComponentOptions {\r\n\tnamespace?: string;\r\n\ttag?: string;\r\n\timmutable?: boolean;\r\n\taccessors?: boolean;\r\n\tpreserveWhitespace?: boolean;\r\n}\r\n\r\nconst regex_leading_directory_separator = /^[/\\\\]/;\r\nconst regex_starts_with_term_export = /^Export/;\r\nconst regex_contains_term_function = /Function/;\r\n\r\nexport default class Component {\r\n\tstats: Stats;\r\n\twarnings: Warning[];\r\n\tignores: Set<string>;\r\n\tignore_stack: Array<Set<string>> = [];\r\n\r\n\tast: Ast;\r\n\toriginal_ast: Ast;\r\n\tsource: string;\r\n\tname: Identifier;\r\n\tcompile_options: CompileOptions;\r\n\tfragment: Fragment;\r\n\tmodule_scope: Scope;\r\n\tinstance_scope: Scope;\r\n\tinstance_scope_map: WeakMap<Node, Scope>;\r\n\r\n\tcomponent_options: ComponentOptions;\r\n\tnamespace: string;\r\n\ttag: string;\r\n\taccessors: boolean;\r\n\r\n\tvars: Var[] = [];\r\n\tvar_lookup: Map<string, Var> = new Map();\r\n\r\n\timports: ImportDeclaration[] = [];\r\n\texports_from: ExportNamedDeclaration[] = [];\r\n\tinstance_exports_from: ExportNamedDeclaration[] = [];\r\n\r\n\thoistable_nodes: Set<Node> = new Set();\r\n\tnode_for_declaration: Map<string, Node> = new Map();\r\n\tpartly_hoisted: Array<(Node | Node[])> = [];\r\n\tfully_hoisted: Array<(Node | Node[])> = [];\r\n\treactive_declarations: Array<{\r\n\t\tassignees: Set<string>;\r\n\t\tdependencies: Set<string>;\r\n\t\tnode: Node;\r\n\t\tdeclaration: Node;\r\n\t}> = [];\r\n\treactive_declaration_nodes: Set<Node> = new Set();\r\n\thas_reactive_assignments = false;\r\n\tinjected_reactive_declaration_vars: Set<string> = new Set();\r\n\thelpers: Map<string, Identifier> = new Map();\r\n\tglobals: Map<string, Identifier> = new Map();\r\n\r\n\tindirect_dependencies: Map<string, Set<string>> = new Map();\r\n\r\n\tfile: string;\r\n\tlocate: (c: number) => { line: number; column: number };\r\n\r\n\telements: Element[] = [];\r\n\tstylesheet: Stylesheet;\r\n\r\n\taliases: Map<string, Identifier> = new Map();\r\n\tused_names: Set<string> = new Set();\r\n\tglobally_used_names: Set<string> = new Set();\r\n\r\n\tslots: Map<string, Slot> = new Map();\r\n\tslot_outlets: Set<string> = new Set();\r\n\r\n\tconstructor(\r\n\t\tast: Ast,\r\n\t\tsource: string,\r\n\t\tname: string,\r\n\t\tcompile_options: CompileOptions,\r\n\t\tstats: Stats,\r\n\t\twarnings: Warning[]\r\n\t) {\r\n\t\tthis.name = { type: 'Identifier', name };\r\n\r\n\t\tthis.stats = stats;\r\n\t\tthis.warnings = warnings;\r\n\t\tthis.ast = ast;\r\n\t\tthis.source = source;\r\n\t\tthis.compile_options = compile_options;\r\n\r\n\t\t// the instance JS gets mutated, so we park\r\n\t\t// a copy here for later. TODO this feels gross\r\n\t\tthis.original_ast = clone({\r\n\t\t\thtml: ast.html,\r\n\t\t\tcss: ast.css,\r\n\t\t\tinstance: ast.instance,\r\n\t\t\tmodule: ast.module\r\n\t\t});\r\n\r\n\t\tthis.file =\r\n\t\t\tcompile_options.filename &&\r\n\t\t\t(typeof process !== 'undefined'\r\n\t\t\t\t? compile_options.filename\r\n\t\t\t\t\t.replace(process.cwd(), '')\r\n\t\t\t\t\t.replace(regex_leading_directory_separator, '')\r\n\t\t\t\t: compile_options.filename);\r\n\t\tthis.locate = getLocator(this.source, { offsetLine: 1 });\r\n\r\n\t\t// styles\r\n\t\tthis.stylesheet = new Stylesheet({\r\n\t\t\tsource,\r\n\t\t\tast,\r\n\t\t\tfilename: compile_options.filename,\r\n\t\t\tcomponent_name: name,\r\n\t\t\tdev: compile_options.dev,\r\n\t\t\tget_css_hash: compile_options.cssHash\r\n\t\t});\r\n\t\tthis.stylesheet.validate(this);\r\n\r\n\t\tthis.component_options = process_component_options(\r\n\t\t\tthis,\r\n\t\t\tthis.ast.html.children\r\n\t\t);\r\n\t\tthis.namespace =\r\n\t\t\tnamespaces[this.component_options.namespace] ||\r\n\t\t\tthis.component_options.namespace;\r\n\r\n\t\tif (compile_options.customElement) {\r\n\t\t\tif (\r\n\t\t\t\tthis.component_options.tag === undefined &&\r\n\t\t\t\tcompile_options.tag === undefined\r\n\t\t\t) {\r\n\t\t\t\tconst svelteOptions = ast.html.children.find(\r\n\t\t\t\t\tchild => child.name === 'svelte:options'\r\n\t\t\t\t) || { start: 0, end: 0 };\r\n\t\t\t\tthis.warn(svelteOptions, compiler_warnings.custom_element_no_tag);\r\n\t\t\t}\r\n\t\t\tthis.tag = this.component_options.tag || compile_options.tag;\r\n\t\t} else {\r\n\t\t\tthis.tag = this.name.name;\r\n\t\t}\r\n\r\n\t\tthis.walk_module_js();\r\n\r\n\t\tthis.push_ignores(this.ast.instance ? extract_ignores_above_position(this.ast.instance.start, this.ast.html.children) : []);\r\n\t\tthis.walk_instance_js_pre_template();\r\n\t\tthis.pop_ignores();\r\n\r\n\t\tthis.fragment = new Fragment(this, ast.html);\r\n\t\tthis.name = this.get_unique_name(name);\r\n\r\n\t\tthis.push_ignores(this.ast.instance ? extract_ignores_above_position(this.ast.instance.start, this.ast.html.children) : []);\r\n\t\tthis.walk_instance_js_post_template();\r\n\t\tthis.pop_ignores();\r\n\r\n\t\tthis.elements.forEach(element => this.stylesheet.apply(element));\r\n\t\tif (!compile_options.customElement) this.stylesheet.reify();\r\n\t\tthis.stylesheet.warn_on_unused_selectors(this);\r\n\t}\r\n\r\n\tadd_var(node: Node, variable: Var, add_to_lookup = true) {\r\n\t\tthis.vars.push(variable);\r\n\r\n\t\tif (add_to_lookup) {\r\n\t\t\tif (this.var_lookup.has(variable.name)) {\r\n\t\t\t\tconst exists_var = this.var_lookup.get(variable.name);\r\n\t\t\t\tif (exists_var.module && exists_var.imported) {\r\n\t\t\t\t\tthis.error(node as any, compiler_errors.illegal_variable_declaration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.var_lookup.set(variable.name, variable);\r\n\t\t}\r\n\t}\r\n\r\n\tadd_reference(node: Node, name: string) {\r\n\t\tconst variable = this.var_lookup.get(name);\r\n\r\n\t\tif (variable) {\r\n\t\t\tvariable.referenced = true;\r\n\t\t} else if (is_reserved_keyword(name)) {\r\n\t\t\tthis.add_var(node, {\r\n\t\t\t\tname,\r\n\t\t\t\tinjected: true,\r\n\t\t\t\treferenced: true\r\n\t\t\t});\r\n\t\t} else if (name[0] === '$') {\r\n\t\t\tthis.add_var(node, {\r\n\t\t\t\tname,\r\n\t\t\t\tinjected: true,\r\n\t\t\t\treferenced: true,\r\n\t\t\t\tmutated: true,\r\n\t\t\t\twritable: true\r\n\t\t\t});\r\n\r\n\t\t\tconst subscribable_name = name.slice(1);\r\n\r\n\t\t\tconst variable = this.var_lookup.get(subscribable_name);\r\n\t\t\tif (variable) {\r\n\t\t\t\tvariable.referenced = true;\r\n\t\t\t\tvariable.subscribable = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this.compile_options.varsReport === 'full') {\r\n\t\t\t\tthis.add_var(node, { name, referenced: true }, false);\r\n\t\t\t}\r\n\r\n\t\t\tthis.used_names.add(name);\r\n\t\t}\r\n\t}\r\n\r\n\talias(name: string) {\r\n\t\tif (!this.aliases.has(name)) {\r\n\t\t\tthis.aliases.set(name, this.get_unique_name(name));\r\n\t\t}\r\n\r\n\t\treturn this.aliases.get(name);\r\n\t}\r\n\r\n\tapply_stylesheet(element: Element) {\r\n\t\tthis.elements.push(element);\r\n\t}\r\n\r\n\tglobal(name: string) {\r\n\t\tconst alias = this.alias(name);\r\n\t\tthis.globals.set(name, alias);\r\n\t\treturn alias;\r\n\t}\r\n\r\n\tgenerate(result?: { js: Node[]; css: CssResult }) {\r\n\t\tlet js = null;\r\n\t\tlet css = null;\r\n\r\n\t\tif (result) {\r\n\t\t\tconst { compile_options, name } = this;\r\n\t\t\tconst { format = 'esm' } = compile_options;\r\n\r\n\t\t\tconst banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${'__VERSION__'}`;\r\n\r\n\t\t\tconst program: any = { type: 'Program', body: result.js };\r\n\r\n\t\t\twalk(program, {\r\n\t\t\t\tenter: (node: Node, parent: Node, key) => {\r\n\t\t\t\t\tif (node.type === 'Identifier') {\r\n\t\t\t\t\t\tif (node.name[0] === '@') {\r\n\t\t\t\t\t\t\tif (node.name[1] === '_') {\r\n\t\t\t\t\t\t\t\tconst alias = this.global(node.name.slice(2));\r\n\t\t\t\t\t\t\t\tnode.name = alias.name;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tlet name = node.name.slice(1);\r\n\r\n\t\t\t\t\t\t\t\tif (compile_options.hydratable) {\r\n\t\t\t\t\t\t\t\t\tif (internal_exports.has(`${name}_hydration`)) {\r\n\t\t\t\t\t\t\t\t\t\tname += '_hydration';\r\n\t\t\t\t\t\t\t\t\t} else if (internal_exports.has(`${name}Hydration`)) {\r\n\t\t\t\t\t\t\t\t\t\tname += 'Hydration';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (compile_options.dev) {\r\n\t\t\t\t\t\t\t\t\tif (internal_exports.has(`${name}_dev`)) {\r\n\t\t\t\t\t\t\t\t\t\tname += '_dev';\r\n\t\t\t\t\t\t\t\t\t} else if (internal_exports.has(`${name}Dev`)) {\r\n\t\t\t\t\t\t\t\t\t\tname += 'Dev';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tconst alias = this.alias(name);\r\n\t\t\t\t\t\t\t\tthis.helpers.set(name, alias);\r\n\t\t\t\t\t\t\t\tnode.name = alias.name;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (node.name[0] !== '#' && !is_valid(node.name)) {\r\n\t\t\t\t\t\t\t// this hack allows x`foo.${bar}` where bar could be invalid\r\n\t\t\t\t\t\t\tconst literal: Literal = { type: 'Literal', value: node.name };\r\n\r\n\t\t\t\t\t\t\tif (parent.type === 'Property' && key === 'key') {\r\n\t\t\t\t\t\t\t\tparent.key = literal;\r\n\t\t\t\t\t\t\t} else if (parent.type === 'MemberExpression' && key === 'property') {\r\n\t\t\t\t\t\t\t\tparent.property = literal;\r\n\t\t\t\t\t\t\t\tparent.computed = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tconst referenced_globals = Array.from(\r\n\t\t\t\tthis.globals,\r\n\t\t\t\t([name, alias]) => name !== alias.name && { name, alias }\r\n\t\t\t).filter(Boolean);\r\n\t\t\tif (referenced_globals.length) {\r\n\t\t\t\tthis.helpers.set('globals', this.alias('globals'));\r\n\t\t\t}\r\n\t\t\tconst imported_helpers = Array.from(this.helpers, ([name, alias]) => ({\r\n\t\t\t\tname,\r\n\t\t\t\talias\r\n\t\t\t}));\r\n\r\n\t\t\tcreate_module(\r\n\t\t\t\tprogram,\r\n\t\t\t\tformat,\r\n\t\t\t\tname,\r\n\t\t\t\tbanner,\r\n\t\t\t\tcompile_options.sveltePath,\r\n\t\t\t\timported_helpers,\r\n\t\t\t\treferenced_globals,\r\n\t\t\t\tthis.imports,\r\n\t\t\t\tthis.vars\r\n\t\t\t\t\t.filter(variable => variable.module && variable.export_name)\r\n\t\t\t\t\t.map(variable => ({\r\n\t\t\t\t\t\tname: variable.name,\r\n\t\t\t\t\t\tas: variable.export_name\r\n\t\t\t\t\t})),\r\n\t\t\t\tthis.exports_from\r\n\t\t\t);\r\n\r\n\t\t\tcss = compile_options.customElement\r\n\t\t\t\t? { code: null, map: null }\r\n\t\t\t\t: result.css;\r\n\r\n\t\t\tconst js_sourcemap_enabled = check_enable_sourcemap(compile_options.enableSourcemap, 'js');\r\n\r\n\t\t\tif (!js_sourcemap_enabled) {\r\n\t\t\t\tjs = print(program);\r\n\t\t\t\tjs.map = null;\r\n\t\t\t} else {\r\n\t\t\t\tconst sourcemap_source_filename = get_sourcemap_source_filename(compile_options);\r\n\r\n\t\t\t\tjs = print(program, {\r\n\t\t\t\t\tsourceMapSource: sourcemap_source_filename\r\n\t\t\t\t});\r\n\r\n\t\t\t\tjs.map.sources = [\r\n\t\t\t\t\tsourcemap_source_filename\r\n\t\t\t\t];\r\n\r\n\t\t\t\tjs.map.sourcesContent = [\r\n\t\t\t\t\tthis.source\r\n\t\t\t\t];\r\n\r\n\t\t\t\tjs.map = apply_preprocessor_sourcemap(sourcemap_source_filename, js.map, compile_options.sourcemap as (string | RawSourceMap | DecodedSourceMap));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tjs,\r\n\t\t\tcss,\r\n\t\t\tast: this.original_ast,\r\n\t\t\twarnings: this.warnings,\r\n\t\t\tvars: this.get_vars_report(),\r\n\t\t\tstats: this.stats.render()\r\n\t\t};\r\n\t}\r\n\r\n\tget_unique_name(name: string, scope?: Scope): Identifier {\r\n\t\tif (test) name = `${name}$`;\r\n\t\tlet alias = name;\r\n\t\tfor (\r\n\t\t\tlet i = 1;\r\n\t\t\treserved.has(alias) ||\r\n\t\t\tthis.var_lookup.has(alias) ||\r\n\t\t\tthis.used_names.has(alias) ||\r\n\t\t\tthis.globally_used_names.has(alias) ||\r\n\t\t\t(scope && scope.has(alias));\r\n\t\t\talias = `${name}_${i++}`\r\n\t\t);\r\n\t\tthis.used_names.add(alias);\r\n\t\treturn { type: 'Identifier', name: alias };\r\n\t}\r\n\r\n\tget_unique_name_maker() {\r\n\t\tconst local_used_names = new Set();\r\n\r\n\t\tfunction add(name: string) {\r\n\t\t\tlocal_used_names.add(name);\r\n\t\t}\r\n\r\n\t\treserved.forEach(add);\r\n\t\tinternal_exports.forEach(add);\r\n\t\tthis.var_lookup.forEach((_value, key) => add(key));\r\n\r\n\t\treturn (name: string): Identifier => {\r\n\t\t\tif (test) name = `${name}$`;\r\n\t\t\tlet alias = name;\r\n\t\t\tfor (\r\n\t\t\t\tlet i = 1;\r\n\t\t\t\tthis.used_names.has(alias) || local_used_names.has(alias);\r\n\t\t\t\talias = `${name}_${i++}`\r\n\t\t\t);\r\n\t\t\tlocal_used_names.add(alias);\r\n\t\t\tthis.globally_used_names.add(alias);\r\n\r\n\t\t\treturn {\r\n\t\t\t\ttype: 'Identifier',\r\n\t\t\t\tname: alias\r\n\t\t\t};\r\n\t\t};\r\n\t}\r\n\r\n\tget_vars_report(): Var[] {\r\n\t\tconst { compile_options, vars } = this;\r\n\r\n\t\tconst vars_report = compile_options.varsReport === false\r\n\t\t\t? []\r\n\t\t\t: compile_options.varsReport === 'full'\r\n\t\t\t\t? vars\r\n\t\t\t\t: vars.filter(v => !v.global && !v.internal);\r\n\r\n\t\treturn vars_report.map(v => ({\r\n\t\t\tname: v.name,\r\n\t\t\texport_name: v.export_name || null,\r\n\t\t\tinjected: v.injected || false,\r\n\t\t\tmodule: v.module || false,\r\n\t\t\tmutated: v.mutated || false,\r\n\t\t\treassigned: v.reassigned || false,\r\n\t\t\treferenced: v.referenced || false,\r\n\t\t\twritable: v.writable || false,\r\n\t\t\treferenced_from_script: v.referenced_from_script || false\r\n\t\t}));\r\n\t}\r\n\r\n\terror(\r\n\t\tpos: {\r\n\t\t\tstart: number;\r\n\t\t\tend: number;\r\n\t\t},\r\n\t\te: {\r\n\t\t\tcode: string;\r\n\t\t\tmessage: string;\r\n\t\t}\r\n\t) {\r\n\t\tif (this.compile_options.errorMode === 'warn') {\r\n\t\t\tthis.warn(pos, e);\r\n\t\t} else {\r\n\t\t\terror(e.message, {\r\n\t\t\t\tname: 'ValidationError',\r\n\t\t\t\tcode: e.code,\r\n\t\t\t\tsource: this.source,\r\n\t\t\t\tstart: pos.start,\r\n\t\t\t\tend: pos.end,\r\n\t\t\t\tfilename: this.compile_options.filename\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\twarn(\r\n\t\tpos: {\r\n\t\t\tstart: number;\r\n\t\t\tend: number;\r\n\t\t},\r\n\t\twarning: {\r\n\t\t\tcode: string;\r\n\t\t\tmessage: string;\r\n\t\t}\r\n\t) {\r\n\t\tif (this.ignores && this.ignores.has(warning.code)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst start = this.locate(pos.start);\r\n\t\tconst end = this.locate(pos.end);\r\n\r\n\t\tconst frame = get_code_frame(this.source, start.line - 1, start.column);\r\n\r\n\t\tthis.warnings.push({\r\n\t\t\tcode: warning.code,\r\n\t\t\tmessage: warning.message,\r\n\t\t\tframe,\r\n\t\t\tstart,\r\n\t\t\tend,\r\n\t\t\tpos: pos.start,\r\n\t\t\tfilename: this.compile_options.filename,\r\n\t\t\ttoString: () =>\r\n\t\t\t\t`${warning.message} (${start.line}:${start.column})\\n${frame}`\r\n\t\t});\r\n\t}\r\n\r\n\textract_imports(node) {\r\n\t\tthis.imports.push(node);\r\n\t}\r\n\r\n\textract_exports(node, module_script = false) {\r\n\t\tconst ignores = extract_svelte_ignore_from_comments(node);\r\n\t\tif (ignores.length) this.push_ignores(ignores);\r\n\t\tconst result = this._extract_exports(node, module_script);\r\n\t\tif (ignores.length) this.pop_ignores();\r\n\t\treturn result;\r\n\t}\r\n\r\n\tprivate _extract_exports(node: ExportDefaultDeclaration | ExportNamedDeclaration | ExportAllDeclaration, module_script: boolean) {\r\n\t\tif (node.type === 'ExportDefaultDeclaration') {\r\n\t\t\treturn this.error(node as any, compiler_errors.default_export);\r\n\t\t}\r\n\r\n\t\tif (node.type === 'ExportNamedDeclaration') {\r\n\t\t\tif (node.source) {\r\n\t\t\t\tif (module_script) {\r\n\t\t\t\t\tthis.exports_from.push(node);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.instance_exports_from.push(node);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\tif (node.declaration) {\r\n\t\t\t\tif (node.declaration.type === 'VariableDeclaration') {\r\n\t\t\t\t\tnode.declaration.declarations.forEach(declarator => {\r\n\t\t\t\t\t\textract_names(declarator.id).forEach(name => {\r\n\t\t\t\t\t\t\tconst variable = this.var_lookup.get(name);\r\n\t\t\t\t\t\t\tvariable.export_name = name;\r\n\t\t\t\t\t\t\tif (!module_script && variable.writable && !(variable.referenced || variable.referenced_from_script || variable.subscribable)) {\r\n\t\t\t\t\t\t\t\tthis.warn(declarator as any, compiler_warnings.unused_export_let(this.name.name, name));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst { name } = node.declaration.id;\r\n\r\n\t\t\t\t\tconst variable = this.var_lookup.get(name);\r\n\t\t\t\t\tvariable.export_name = name;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn node.declaration;\r\n\t\t\t} else {\r\n\t\t\t\tnode.specifiers.forEach(specifier => {\r\n\t\t\t\t\tconst variable = this.var_lookup.get(specifier.local.name);\r\n\r\n\t\t\t\t\tif (variable) {\r\n\t\t\t\t\t\tvariable.export_name = specifier.exported.name;\r\n\r\n\t\t\t\t\t\tif (!module_script && variable.writable && !(variable.referenced || variable.referenced_from_script || variable.subscribable)) {\r\n\t\t\t\t\t\t\tthis.warn(specifier as any, compiler_warnings.unused_export_let(this.name.name, specifier.exported.name));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\textract_javascript(script) {\r\n\t\tif (!script) return null;\r\n\r\n\t\treturn script.content.body.filter(node => {\r\n\t\t\tif (!node) return false;\r\n\t\t\tif (this.hoistable_nodes.has(node)) return false;\r\n\t\t\tif (this.reactive_declaration_nodes.has(node)) return false;\r\n\t\t\tif (node.type === 'ImportDeclaration') return false;\r\n\t\t\tif (node.type === 'ExportDeclaration' && node.specifiers.length > 0) return false;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t}\r\n\r\n\twalk_module_js() {\r\n\t\tconst component = this;\r\n\t\tconst script = this.ast.module;\r\n\t\tif (!script) return;\r\n\r\n\t\twalk(script.content, {\r\n\t\t\tenter(node: Node) {\r\n\t\t\t\tif (node.type === 'LabeledStatement' && node.label.name === '$') {\r\n\t\t\t\t\tcomponent.warn(node as any, compiler_warnings.module_script_reactive_declaration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst { scope, globals } = create_scopes(script.content);\r\n\t\tthis.module_scope = scope;\r\n\r\n\t\tscope.declarations.forEach((node, name) => {\r\n\t\t\tif (name[0] === '$') {\r\n\t\t\t\treturn this.error(node as any, compiler_errors.illegal_declaration);\r\n\t\t\t}\r\n\r\n\t\t\tconst writable = node.type === 'VariableDeclaration' && (node.kind === 'var' || node.kind === 'let');\r\n\t\t\tconst imported = node.type.startsWith('Import');\r\n\r\n\t\t\tthis.add_var(node, {\r\n\t\t\t\tname,\r\n\t\t\t\tmodule: true,\r\n\t\t\t\thoistable: true,\r\n\t\t\t\twritable,\r\n\t\t\t\timported\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tglobals.forEach((node, name) => {\r\n\t\t\tif (name[0] === '$') {\r\n\t\t\t\treturn this.error(node as any, compiler_errors.illegal_subscription);\r\n\t\t\t} else {\r\n\t\t\t\tthis.add_var(node, {\r\n\t\t\t\t\tname,\r\n\t\t\t\t\tglobal: true,\r\n\t\t\t\t\thoistable: true\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tconst { body } = script.content;\r\n\t\tlet i = body.length;\r\n\t\twhile (--i >= 0) {\r\n\t\t\tconst node = body[i];\r\n\t\t\tif (node.type === 'ImportDeclaration') {\r\n\t\t\t\tthis.extract_imports(node);\r\n\t\t\t\tbody.splice(i, 1);\r\n\t\t\t}\r\n\r\n\t\t\tif (regex_starts_with_term_export.test(node.type)) {\r\n\t\t\t\tconst replacement = this.extract_exports(node, true);\r\n\t\t\t\tif (replacement) {\r\n\t\t\t\t\tbody[i] = replacement;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbody.splice(i, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\twalk_instance_js_pre_template() {\r\n\t\tconst script = this.ast.instance;\r\n\t\tif (!script) return;\r\n\r\n\t\t// inject vars for reactive declarations\r\n\t\tscript.content.body.forEach(node => {\r\n\t\t\tif (node.type !== 'LabeledStatement') return;\r\n\t\t\tif (node.body.type !== 'ExpressionStatement') return;\r\n\r\n\t\t\tconst { expression } = node.body;\r\n\t\t\tif (expression.type !== 'AssignmentExpression') return;\r\n\t\t\tif (expression.left.type === 'MemberExpression') return;\r\n\r\n\t\t\textract_names(expression.left).forEach(name => {\r\n\t\t\t\tif (!this.var_lookup.has(name) && name[0] !== '$') {\r\n\t\t\t\t\tthis.injected_reactive_declaration_vars.add(name);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tconst { scope: instance_scope, map, globals } = create_scopes(\r\n\t\t\tscript.content\r\n\t\t);\r\n\t\tthis.instance_scope = instance_scope;\r\n\t\tthis.instance_scope_map = map;\r\n\r\n\t\tinstance_scope.declarations.forEach((node, name) => {\r\n\t\t\tif (name[0] === '$') {\r\n\t\t\t\treturn this.error(node as any, compiler_errors.illegal_declaration);\r\n\t\t\t}\r\n\r\n\t\t\tconst writable = node.type === 'VariableDeclaration' && (node.kind === 'var' || node.kind === 'let');\r\n\t\t\tconst imported = node.type.startsWith('Import');\r\n\r\n\t\t\tthis.add_var(node, {\r\n\t\t\t\tname,\r\n\t\t\t\tinitialised: instance_scope.initialised_declarations.has(name),\r\n\t\t\t\twritable,\r\n\t\t\t\timported\r\n\t\t\t});\r\n\r\n\t\t\tthis.node_for_declaration.set(name, node);\r\n\t\t});\r\n\r\n\t\t// NOTE: add store variable first, then only $store value\r\n\t\t// as `$store` will mark `store` variable as referenced and subscribable\r\n\t\tconst global_keys = Array.from(globals.keys());\r\n\t\tconst sorted_globals = [\r\n\t\t\t...global_keys.filter(key => key[0] !== '$'),\r\n\t\t\t...global_keys.filter(key => key[0] === '$')\r\n\t\t];\r\n\r\n\t\tsorted_globals.forEach(name => {\r\n\t\t\tif (this.var_lookup.has(name)) return;\r\n\t\t\tconst node = globals.get(name);\r\n\r\n\t\t\tif (this.injected_reactive_declaration_vars.has(name)) {\r\n\t\t\t\tthis.add_var(node, {\r\n\t\t\t\t\tname,\r\n\t\t\t\t\tinjected: true,\r\n\t\t\t\t\twritable: true,\r\n\t\t\t\t\treassigned: true,\r\n\t\t\t\t\tinitialised: true\r\n\t\t\t\t});\r\n\t\t\t} else if (is_reserved_keyword(name)) {\r\n\t\t\t\tthis.add_var(node, {\r\n\t\t\t\t\tname,\r\n\t\t\t\t\tinjected: true\r\n\t\t\t\t});\r\n\t\t\t} else if (name[0] === '$') {\r\n\t\t\t\tif (name === '$' || name[1] === '$') {\r\n\t\t\t\t\treturn this.error(node as any, compiler_errors.illegal_global(name));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.add_var(node, {\r\n\t\t\t\t\tname,\r\n\t\t\t\t\tinjected: true,\r\n\t\t\t\t\tmutated: true,\r\n\t\t\t\t\twritable: true\r\n\t\t\t\t});\r\n\r\n\t\t\t\tthis.add_reference(node, name.slice(1));\r\n\r\n\t\t\t\tconst variable = this.var_lookup.get(name.slice(1));\r\n\t\t\t\tif (variable) {\r\n\t\t\t\t\tvariable.subscribable = true;\r\n\t\t\t\t\tvariable.referenced_from_script = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tthis.add_var(node, {\r\n\t\t\t\t\tname,\r\n\t\t\t\t\tglobal: true,\r\n\t\t\t\t\thoistable: true\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.track_references_and_mutations();\r\n\t}\r\n\r\n\twalk_instance_js_post_template() {\r\n\t\tconst script = this.ast.instance;\r\n\t\tif (!script) return;\r\n\r\n\t\tthis.post_template_walk();\r\n\r\n\t\tthis.hoist_instance_declarations();\r\n\t\tthis.extract_reactive_declarations();\r\n\t}\r\n\r\n\tpost_template_walk() {\r\n\t\tconst script = this.ast.instance;\r\n\t\tif (!script) return;\r\n\r\n\t\tconst component = this;\r\n\t\tconst { content } = script;\r\n\t\tconst { instance_scope, instance_scope_map: map } = this;\r\n\r\n\t\tlet scope = instance_scope;\r\n\r\n\t\tconst to_remove = [];\r\n\t\tconst remove = (parent, prop, index) => {\r\n\t\t\tto_remove.unshift([parent, prop, index]);\r\n\t\t};\r\n\t\tlet scope_updated = false;\r\n\r\n\t\tconst current_function_stack = [];\r\n\t\tlet current_function: FunctionDeclaration | FunctionExpression = null;\r\n\r\n\t\twalk(content, {\r\n\t\t\tenter(node: Node, parent: Node, prop, index) {\r\n\t\t\t\tif ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression')) {\r\n\t\t\t\t\tcurrent_function_stack.push(current_function = node);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = map.get(node);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet deep = false;\r\n\t\t\t\tlet names: string[] | undefined; \r\n\r\n\t\t\t\tif (node.type === 'AssignmentExpression') {\r\n\t\t\t\t\tdeep = node.left.type === 'MemberExpression';\r\n\t\t\t\t\tnames = deep\r\n\t\t\t\t\t\t? [get_object(node.left).name]\r\n\t\t\t\t\t\t: extract_names(node.left);\r\n\t\t\t\t} else if (node.type === 'UpdateExpression') {\r\n\t\t\t\t\tdeep = node.argument.type === 'MemberExpression';\r\n\t\t\t\t\tconst { name } = get_object(node.argument);\r\n\t\t\t\t\tnames = [name];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (names) {\r\n\t\t\t\t\tnames.forEach(name => {\r\n\t\t\t\t\t\tlet current_scope = scope;\r\n\t\t\t\t\t\tlet declaration;\r\n\r\n\t\t\t\t\t\twhile (current_scope) {\r\n\t\t\t\t\t\t\tif (current_scope.declarations.has(name)) {\r\n\t\t\t\t\t\t\t\tdeclaration = current_scope.declarations.get(name);\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcurrent_scope = current_scope.parent;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (declaration && declaration.kind === 'const' && !deep) {\r\n\t\t\t\t\t\t\tcomponent.error(node as any, {\r\n\t\t\t\t\t\t\t\tcode: 'assignment-to-const',\r\n\t\t\t\t\t\t\t\tmessage: 'You are assigning to a const'\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (node.type === 'ImportDeclaration') {\r\n\t\t\t\t\tcomponent.extract_imports(node);\r\n\t\t\t\t\t// TODO: to use actual remove\r\n\t\t\t\t\tremove(parent, prop, index);\r\n\t\t\t\t\treturn this.skip();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (regex_starts_with_term_export.test(node.type)) {\r\n\t\t\t\t\tconst replacement = component.extract_exports(node);\r\n\t\t\t\t\tif (replacement) {\r\n\t\t\t\t\t\tthis.replace(replacement);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// TODO: to use actual remove\r\n\t\t\t\t\t\tremove(parent, prop, index);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn this.skip();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcomponent.warn_on_undefined_store_value_references(node, parent, prop, scope);\r\n\t\t\t},\r\n\r\n\t\t\tleave(node: Node) {\r\n\t\t\t\tif ((node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression')) {\r\n\t\t\t\t\tcurrent_function_stack.pop();\r\n\t\t\t\t\tcurrent_function = current_function_stack[current_function_stack.length - 1];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// do it on leave, to prevent infinite loop\r\n\t\t\t\tif (component.compile_options.dev && component.compile_options.loopGuardTimeout > 0 && (!current_function || (!current_function.generator && !current_function.async))) {\r\n\t\t\t\t\tconst to_replace_for_loop_protect = component.loop_protect(node, scope, component.compile_options.loopGuardTimeout);\r\n\t\t\t\t\tif (to_replace_for_loop_protect) {\r\n\t\t\t\t\t\tthis.replace(to_replace_for_loop_protect);\r\n\t\t\t\t\t\tscope_updated = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = scope.parent;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tfor (const [parent, prop, index] of to_remove) {\r\n\t\t\tif (parent) {\r\n\t\t\t\tif (index !== null) {\r\n\t\t\t\t\tparent[prop].splice(index, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdelete parent[prop];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (scope_updated) {\r\n\t\t\tconst { scope, map } = create_scopes(script.content);\r\n\t\t\tthis.instance_scope = scope;\r\n\t\t\tthis.instance_scope_map = map;\r\n\t\t}\r\n\t}\r\n\r\n\ttrack_references_and_mutations() {\r\n\t\tconst script = this.ast.instance;\r\n\t\tif (!script) return;\r\n\r\n\t\tconst component = this;\r\n\t\tconst { content } = script;\r\n\t\tconst { instance_scope, module_scope, instance_scope_map: map } = this;\r\n\r\n\t\tlet scope = instance_scope;\r\n\r\n\t\twalk(content, {\r\n\t\t\tenter(node: Node, parent: Node) {\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = map.get(node);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (node.type === 'AssignmentExpression' || node.type === 'UpdateExpression') {\r\n\t\t\t\t\tconst assignee = node.type === 'AssignmentExpression' ? node.left : node.argument;\r\n\t\t\t\t\tconst names = extract_names(assignee as Node);\r\n\r\n\t\t\t\t\tconst deep = assignee.type === 'MemberExpression';\r\n\r\n\t\t\t\t\tnames.forEach(name => {\r\n\t\t\t\t\t\tconst scope_owner = scope.find_owner(name);\r\n\t\t\t\t\t\tif (\r\n\t\t\t\t\t\t\tscope_owner !== null\r\n\t\t\t\t\t\t\t\t? scope_owner === instance_scope\r\n\t\t\t\t\t\t\t\t: module_scope && module_scope.has(name)\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\tconst variable = component.var_lookup.get(name);\r\n\t\t\t\t\t\t\tvariable[deep ? 'mutated' : 'reassigned'] = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (is_used_as_reference(node, parent)) {\r\n\t\t\t\t\tconst object = get_object(node);\r\n\t\t\t\t\tif (scope.find_owner(object.name) === instance_scope) {\r\n\t\t\t\t\t\tconst variable = component.var_lookup.get(object.name);\r\n\t\t\t\t\t\tvariable.referenced_from_script = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tleave(node: Node) {\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = scope.parent;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\twarn_on_undefined_store_value_references(node: Node, parent: Node, prop: string, scope: Scope) {\r\n\t\tif (\r\n\t\t\tnode.type === 'LabeledStatement' &&\r\n\t\t\tnode.label.name === '$' &&\r\n\t\t\tparent.type !== 'Program'\r\n\t\t) {\r\n\t\t\tthis.warn(node as any, compiler_warnings.non_top_level_reactive_declaration);\r\n\t\t}\r\n\r\n\t\tif (is_reference(node as NodeWithPropertyDefinition, parent as NodeWithPropertyDefinition)) {\r\n\t\t\tconst object = get_object(node);\r\n\t\t\tconst { name } = object;\r\n\r\n\t\t\tif (name[0] === '$') {\r\n\t\t\t\tif (!scope.has(name)) {\r\n\t\t\t\t\tthis.warn_if_undefined(name, object, null);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (name[1] !== '$' && scope.has(name.slice(1)) && scope.find_owner(name.slice(1)) !== this.instance_scope) {\r\n\t\t\t\t\tif (!((regex_contains_term_function.test(parent.type) && prop === 'params') || (parent.type === 'VariableDeclarator' && prop === 'id'))) {\r\n\t\t\t\t\t\treturn this.error(node as any, compiler_errors.contextual_store);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tloop_protect(node, scope: Scope, timeout: number): Node | null {\r\n\t\tif (node.type === 'WhileStatement' ||\r\n\t\t\tnode.type === 'ForStatement' ||\r\n\t\t\tnode.type === 'DoWhileStatement') {\r\n\t\t\tconst guard = this.get_unique_name('guard', scope);\r\n\t\t\tthis.used_names.add(guard.name);\r\n\r\n\t\t\tconst before = b`const ${guard} = @loop_guard(${timeout})`;\r\n\t\t\tconst inside = b`${guard}();`;\r\n\r\n\t\t\t// wrap expression statement with BlockStatement\r\n\t\t\tif (node.body.type !== 'BlockStatement') {\r\n\t\t\t\tnode.body = {\r\n\t\t\t\t\ttype: 'BlockStatement',\r\n\t\t\t\t\tbody: [node.body]\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tnode.body.body.push(inside[0]);\r\n\r\n\t\t\treturn {\r\n\t\t\t\ttype: 'BlockStatement',\r\n\t\t\t\tbody: [\r\n\t\t\t\t\tbefore[0],\r\n\t\t\t\t\tnode\r\n\t\t\t\t]\r\n\t\t\t};\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\trewrite_props(get_insert: (variable: Var) => Node[]) {\r\n\t\tif (!this.ast.instance) return;\r\n\r\n\t\tconst component = this;\r\n\t\tconst { instance_scope, instance_scope_map: map } = this;\r\n\t\tlet scope = instance_scope;\r\n\r\n\t\twalk(this.ast.instance.content, {\r\n\t\t\tenter(node: Node) {\r\n\t\t\t\tif (regex_contains_term_function.test(node.type)) {\r\n\t\t\t\t\treturn this.skip();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = map.get(node);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (node.type === 'ExportNamedDeclaration' && node.declaration) {\r\n\t\t\t\t\treturn this.replace(node.declaration);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (node.type === 'VariableDeclaration') {\r\n\t\t\t\t\t// NOTE: `var` does not follow block scoping\r\n\t\t\t\t\tif (node.kind === 'var' || scope === instance_scope) {\r\n\t\t\t\t\t\tconst inserts = [];\r\n\t\t\t\t\t\tconst props = [];\r\n\r\n\t\t\t\t\t\tfunction add_new_props(exported, local, default_value) {\r\n\t\t\t\t\t\t\tprops.push({\r\n\t\t\t\t\t\t\t\ttype: 'Property',\r\n\t\t\t\t\t\t\t\tmethod: false,\r\n\t\t\t\t\t\t\t\tshorthand: false,\r\n\t\t\t\t\t\t\t\tcomputed: false,\r\n\t\t\t\t\t\t\t\tkind: 'init',\r\n\t\t\t\t\t\t\t\tkey: exported,\r\n\t\t\t\t\t\t\t\tvalue: default_value\r\n\t\t\t\t\t\t\t\t\t? {\r\n\t\t\t\t\t\t\t\t\t\ttype: 'AssignmentPattern',\r\n\t\t\t\t\t\t\t\t\t\tleft: local,\r\n\t\t\t\t\t\t\t\t\t\tright: default_value\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t: local\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// transform\r\n\t\t\t\t\t\t// ```\r\n\t\t\t\t\t\t// export let { x, y = 123 } = OBJ, z = 456\r\n\t\t\t\t\t\t// ```\r\n\t\t\t\t\t\t// into\r\n\t\t\t\t\t\t// ```\r\n\t\t\t\t\t\t// let { x: x$, y: y$ = 123 } = OBJ;\r\n\t\t\t\t\t\t// let { x = x$, y = y$, z = 456 } = $$props;\r\n\t\t\t\t\t\t// ```\r\n\t\t\t\t\t\tfor (let index = 0; index < node.declarations.length; index++) {\r\n\t\t\t\t\t\t\tconst declarator = node.declarations[index];\r\n\t\t\t\t\t\t\tif (declarator.id.type !== 'Identifier') {\r\n\t\t\t\t\t\t\t\tfunction get_new_name(local) {\r\n\t\t\t\t\t\t\t\t\tconst variable = component.var_lookup.get(local.name);\r\n\t\t\t\t\t\t\t\t\tif (variable.subscribable) {\r\n\t\t\t\t\t\t\t\t\t\tinserts.push(get_insert(variable));\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif (variable.export_name && variable.writable) {\r\n\t\t\t\t\t\t\t\t\t\tconst alias_name = component.get_unique_name(local.name);\r\n\t\t\t\t\t\t\t\t\t\tadd_new_props({ type: 'Identifier', name: variable.export_name }, local, alias_name);\r\n\t\t\t\t\t\t\t\t\t\treturn alias_name;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\treturn local;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tfunction rename_identifiers(param: Node) {\r\n\t\t\t\t\t\t\t\t\tswitch (param.type) {\r\n\t\t\t\t\t\t\t\t\t\tcase 'ObjectPattern': {\r\n\t\t\t\t\t\t\t\t\t\t\tconst handle_prop = (prop: Property | RestElement) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (prop.type === 'RestElement') {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\trename_identifiers(prop);\r\n\t\t\t\t\t\t\t\t\t\t\t\t} else if (prop.value.type === 'Identifier') {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tprop.value = get_new_name(prop.value);\r\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\trename_identifiers(prop.value);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tparam.properties.forEach(handle_prop);\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tcase 'ArrayPattern': {\r\n\t\t\t\t\t\t\t\t\t\t\tconst handle_element = (element: Node, index: number, array: Node[]) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (element) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (element.type === 'Identifier') {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray[index] = get_new_name(element);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trename_identifiers(element);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tparam.elements.forEach(handle_element);\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\tcase 'RestElement':\r\n\t\t\t\t\t\t\t\t\t\t\tparam.argument = get_new_name(param.argument);\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\t\t\tcase 'AssignmentPattern':\r\n\t\t\t\t\t\t\t\t\t\t\tif (param.left.type === 'Identifier') {\r\n\t\t\t\t\t\t\t\t\t\t\t\tparam.left = get_new_name(param.left);\r\n\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\trename_identifiers(param.left);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\trename_identifiers(declarator.id);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tconst { name } = declarator.id;\r\n\t\t\t\t\t\t\t\tconst variable = component.var_lookup.get(name);\r\n\t\t\t\t\t\t\t\tconst is_props = variable.export_name && variable.writable;\r\n\t\t\t\t\t\t\t\tif (is_props) {\r\n\t\t\t\t\t\t\t\t\tadd_new_props({ type: 'Identifier', name: variable.export_name }, declarator.id, declarator.init);\r\n\t\t\t\t\t\t\t\t\tnode.declarations.splice(index--, 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (variable.subscribable && (is_props || declarator.init)) {\r\n\t\t\t\t\t\t\t\t\tinserts.push(get_insert(variable));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.replace(b`\r\n\t\t\t\t\t\t\t${node.declarations.length ? node : null}\r\n\t\t\t\t\t\t\t${ props.length > 0 && b`let { ${props} } = $$props;`}\r\n\t\t\t\t\t\t\t${inserts}\r\n\t\t\t\t\t\t` as any);\r\n\t\t\t\t\t\treturn this.skip();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\tleave(node: Node) {\r\n\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\tscope = scope.parent;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\thoist_instance_declarations() {\r\n\t\t// we can safely hoist variable declarations that are\r\n\t\t// initialised to literals, and functions that don't\r\n\t\t// reference instance variables other than other\r\n\t\t// hoistable functions. TODO others?\r\n\r\n\t\tconst {\r\n\t\t\thoistable_nodes,\r\n\t\t\tvar_lookup,\r\n\t\t\tinjected_reactive_declaration_vars,\r\n\t\t\timports\r\n\t\t} = this;\r\n\r\n\t\tconst top_level_function_declarations = new Map();\r\n\r\n\t\tconst { body } = this.ast.instance.content;\r\n\r\n\t\tfor (let i = 0; i < body.length; i += 1) {\r\n\t\t\tconst node = body[i];\r\n\r\n\t\t\tif (node.type === 'VariableDeclaration') {\r\n\t\t\t\tconst all_hoistable = node.declarations.every(d => {\r\n\t\t\t\t\tif (!d.init) return false;\r\n\t\t\t\t\tif (d.init.type !== 'Literal') return false;\r\n\r\n\t\t\t\t\t// everything except const values can be changed by e.g. svelte devtools\r\n\t\t\t\t\t// which means we can't hoist it\r\n\t\t\t\t\tif (node.kind !== 'const' && this.compile_options.dev) return false;\r\n\r\n\t\t\t\t\tconst { name } = d.id as Identifier;\r\n\r\n\t\t\t\t\tconst v = this.var_lookup.get(name);\r\n\t\t\t\t\tif (v.reassigned) return false;\r\n\t\t\t\t\tif (v.export_name) return false;\r\n\r\n\t\t\t\t\tif (this.var_lookup.get(name).reassigned) return false;\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tthis.vars.find(\r\n\t\t\t\t\t\t\tvariable => variable.name === name && variable.module\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (all_hoistable) {\r\n\t\t\t\t\tnode.declarations.forEach(d => {\r\n\t\t\t\t\t\tconst variable = this.var_lookup.get((d.id as Identifier).name);\r\n\t\t\t\t\t\tvariable.hoistable = true;\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\thoistable_nodes.add(node);\r\n\r\n\t\t\t\t\tbody.splice(i--, 1);\r\n\t\t\t\t\tthis.fully_hoisted.push(node);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (\r\n\t\t\t\tnode.type === 'ExportNamedDeclaration' &&\r\n\t\t\t\tnode.declaration &&\r\n\t\t\t\tnode.declaration.type === 'FunctionDeclaration'\r\n\t\t\t) {\r\n\t\t\t\ttop_level_function_declarations.set(node.declaration.id.name, node);\r\n\t\t\t}\r\n\r\n\t\t\tif (node.type === 'FunctionDeclaration') {\r\n\t\t\t\ttop_level_function_declarations.set(node.id.name, node);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst checked = new Set();\r\n\t\tconst walking = new Set();\r\n\r\n\t\tconst is_hoistable = fn_declaration => {\r\n\t\t\tif (fn_declaration.type === 'ExportNamedDeclaration') {\r\n\t\t\t\tfn_declaration = fn_declaration.declaration;\r\n\t\t\t}\r\n\r\n\t\t\tconst instance_scope = this.instance_scope;\r\n\t\t\tlet scope = this.instance_scope;\r\n\t\t\tconst map = this.instance_scope_map;\r\n\r\n\t\t\tlet hoistable = true;\r\n\r\n\t\t\t// handle cycles\r\n\t\t\twalking.add(fn_declaration);\r\n\r\n\t\t\twalk(fn_declaration, {\r\n\t\t\t\tenter(node: Node, parent) {\r\n\t\t\t\t\tif (!hoistable) return this.skip();\r\n\r\n\t\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\t\tscope = map.get(node);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (is_reference(node as NodeWithPropertyDefinition, parent as NodeWithPropertyDefinition)) {\r\n\t\t\t\t\t\tconst { name } = flatten_reference(node);\r\n\t\t\t\t\t\tconst owner = scope.find_owner(name);\r\n\r\n\t\t\t\t\t\tif (injected_reactive_declaration_vars.has(name)) {\r\n\t\t\t\t\t\t\thoistable = false;\r\n\t\t\t\t\t\t} else if (name[0] === '$' && !owner) {\r\n\t\t\t\t\t\t\thoistable = false;\r\n\t\t\t\t\t\t} else if (owner === instance_scope) {\r\n\t\t\t\t\t\t\tconst variable = var_lookup.get(name);\r\n\r\n\t\t\t\t\t\t\tif (variable.reassigned || variable.mutated) hoistable = false;\r\n\r\n\t\t\t\t\t\t\tif (name === fn_declaration.id.name) return;\r\n\r\n\t\t\t\t\t\t\tif (variable.hoistable) return;\r\n\r\n\t\t\t\t\t\t\tif (top_level_function_declarations.has(name)) {\r\n\t\t\t\t\t\t\t\tconst other_declaration = top_level_function_declarations.get(\r\n\t\t\t\t\t\t\t\t\tname\r\n\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\tif (walking.has(other_declaration)) {\r\n\t\t\t\t\t\t\t\t\thoistable = false;\r\n\t\t\t\t\t\t\t\t} else if (\r\n\t\t\t\t\t\t\t\t\tother_declaration.type === 'ExportNamedDeclaration' &&\r\n\t\t\t\t\t\t\t\t\twalking.has(other_declaration.declaration)\r\n\t\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\t\t\thoistable = false;\r\n\t\t\t\t\t\t\t\t} else if (!is_hoistable(other_declaration)) {\r\n\t\t\t\t\t\t\t\t\thoistable = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\thoistable = false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tthis.skip();\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\r\n\t\t\t\tleave(node: Node) {\r\n\t\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\t\tscope = scope.parent;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tchecked.add(fn_declaration);\r\n\t\t\twalking.delete(fn_declaration);\r\n\r\n\t\t\treturn hoistable;\r\n\t\t};\r\n\r\n\t\tfor (const [name, node] of top_level_function_declarations) {\r\n\t\t\tif (is_hoistable(node)) {\r\n\t\t\t\tconst variable = this.var_lookup.get(name);\r\n\t\t\t\tvariable.hoistable = true;\r\n\t\t\t\thoistable_nodes.add(node);\r\n\r\n\t\t\t\tconst i = body.indexOf(node);\r\n\t\t\t\tbody.splice(i, 1);\r\n\t\t\t\tthis.fully_hoisted.push(node);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (const { specifiers } of imports) {\r\n\t\t\tfor (const specifier of specifiers) {\r\n\t\t\t\tconst variable = var_lookup.get(specifier.local.name);\r\n\r\n\t\t\t\tif (!variable.mutated || variable.subscribable) {\r\n\t\t\t\t\tvariable.hoistable = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\textract_reactive_declarations() {\r\n\t\tconst component = this;\r\n\r\n\t\tconst unsorted_reactive_declarations: Array<{\r\n\t\t\tassignees: Set<string>;\r\n\t\t\tdependencies: Set<string>;\r\n\t\t\tnode: Node;\r\n\t\t\tdeclaration: Node;\r\n\t\t}> = [];\r\n\r\n\t\tthis.ast.instance.content.body.forEach(node => {\r\n\t\t\tconst ignores = extract_svelte_ignore_from_comments(node);\r\n\t\t\tif (ignores.length) this.push_ignores(ignores);\r\n\r\n\t\t\tif (node.type === 'LabeledStatement' && node.label.name === '$') {\r\n\t\t\t\tthis.reactive_declaration_nodes.add(node);\r\n\r\n\t\t\t\tconst assignees = new Set<string>();\r\n\t\t\t\tconst assignee_nodes = new Set();\r\n\t\t\t\tconst dependencies = new Set<string>();\r\n\t\t\t\tconst module_dependencies = new Set<string>();\r\n\r\n\t\t\t\tlet scope = this.instance_scope;\r\n\t\t\t\tconst map = this.instance_scope_map;\r\n\r\n\t\t\t\twalk(node.body, {\r\n\t\t\t\t\tenter(node: Node, parent) {\r\n\t\t\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\t\t\tscope = map.get(node);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (node.type === 'AssignmentExpression') {\r\n\t\t\t\t\t\t\tconst left = get_object(node.left);\r\n\r\n\t\t\t\t\t\t\textract_identifiers(left).forEach(node => {\r\n\t\t\t\t\t\t\t\tassignee_nodes.add(node);\r\n\t\t\t\t\t\t\t\tassignees.add(node.name);\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tif (node.operator !== '=') {\r\n\t\t\t\t\t\t\t\tdependencies.add(left.name);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (node.type === 'UpdateExpression') {\r\n\t\t\t\t\t\t\tconst identifier = get_object(node.argument);\r\n\t\t\t\t\t\t\tassignees.add(identifier.name);\r\n\t\t\t\t\t\t} else if (is_reference(node as NodeWithPropertyDefinition, parent as NodeWithPropertyDefinition)) {\r\n\t\t\t\t\t\t\tconst identifier = get_object(node);\r\n\t\t\t\t\t\t\tif (!assignee_nodes.has(identifier)) {\r\n\t\t\t\t\t\t\t\tconst { name } = identifier;\r\n\t\t\t\t\t\t\t\tconst owner = scope.find_owner(name);\r\n\t\t\t\t\t\t\t\tconst variable = component.var_lookup.get(name);\r\n\t\t\t\t\t\t\t\tlet should_add_as_dependency = true;\r\n\r\n\t\t\t\t\t\t\t\tif (variable) {\r\n\t\t\t\t\t\t\t\t\tvariable.is_reactive_dependency = true;\r\n\t\t\t\t\t\t\t\t\tif (variable.module && variable.writable) {\r\n\t\t\t\t\t\t\t\t\t\tshould_add_as_dependency = false;\r\n\t\t\t\t\t\t\t\t\t\tmodule_dependencies.add(name);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tconst is_writable_or_mutated =\r\n\t\t\t\t\t\t\t\t\tvariable && (variable.writable || variable.mutated);\r\n\t\t\t\t\t\t\t\tif (\r\n\t\t\t\t\t\t\t\t\tshould_add_as_dependency &&\r\n\t\t\t\t\t\t\t\t\t(!owner || owner === component.instance_scope) &&\r\n\t\t\t\t\t\t\t\t\t(name[0] === '$' || is_writable_or_mutated)\r\n\t\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\t\t\tdependencies.add(name);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.skip();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\r\n\t\t\t\t\tleave(node: Node) {\r\n\t\t\t\t\t\tif (map.has(node)) {\r\n\t\t\t\t\t\t\tscope = scope.parent;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (module_dependencies.size > 0 && dependencies.size === 0) {\r\n\t\t\t\t\tcomponent.warn(node.body as any, compiler_warnings.module_script_variable_reactive_declaration(Array.from(module_dependencies)));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst { expression } = node.body as ExpressionStatement;\r\n\t\t\t\tconst declaration = expression && (expression as AssignmentExpression).left;\r\n\r\n\t\t\t\tunsorted_reactive_declarations.push({\r\n\t\t\t\t\tassignees,\r\n\t\t\t\t\tdependencies,\r\n\t\t\t\t\tnode,\r\n\t\t\t\t\tdeclaration\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (ignores.length) this.pop_ignores();\r\n\t\t});\r\n\r\n\t\tconst lookup = new Map();\r\n\r\n\t\tunsorted_reactive_declarations.forEach(declaration => {\r\n\t\t\tdeclaration.assignees.forEach(name => {\r\n\t\t\t\tif (!lookup.has(name)) {\r\n\t\t\t\t\tlookup.set(name, []);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// TODO warn or error if a name is assigned to in\r\n\t\t\t\t// multiple reactive declarations?\r\n\t\t\t\tlookup.get(name).push(declaration);\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tconst cycle = check_graph_for_cycles(unsorted_reactive_declarations.reduce((acc, declaration) => {\r\n\t\t\tdeclaration.assignees.forEach(v => {\r\n\t\t\t\tdeclaration.dependencies.forEach(w => {\r\n\t\t\t\t\tif (!declaration.assignees.has(w)) {\r\n\t\t\t\t\t\tacc.push([v, w]);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\treturn acc;\r\n\t\t}, []));\r\n\r\n\t\tif (cycle && cycle.length) {\r\n\t\t\tconst declarationList = lookup.get(cycle[0]);\r\n\t\t\tconst declaration = declarationList[0];\r\n\t\t\treturn this.error(declaration.node, compiler_errors.cyclical_reactive_declaration(cycle));\r\n\t\t}\r\n\r\n\t\tconst add_declaration = declaration => {\r\n\t\t\tif (this.reactive_declarations.includes(declaration)) return;\r\n\r\n\t\t\tdeclaration.dependencies.forEach(name => {\r\n\t\t\t\tif (declaration.assignees.has(name)) return;\r\n\t\t\t\tconst earlier_declarations = lookup.get(name);\r\n\t\t\t\tif (earlier_declarations) {\r\n\t\t\t\t\tearlier_declarations.forEach(add_declaration);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tthis.reactive_declarations.push(declaration);\r\n\t\t};\r\n\r\n\t\tunsorted_reactive_declarations.forEach(add_declaration);\r\n\t}\r\n\r\n\twarn_if_undefined(name: string, node, template_scope: TemplateScope) {\r\n\t\tif (name[0] === '$') {\r\n\t\t\tif (name === '$' || name[1] === '$' && !is_reserved_keyword(name)) {\r\n\t\t\t\treturn this.error(node, compiler_errors.illegal_global(name));\r\n\t\t\t}\r\n\r\n\t\t\tthis.has_reactive_assignments = true; // TODO does this belong here?\r\n\r\n\t\t\tif (is_reserved_keyword(name)) return;\r\n\r\n\t\t\tname = name.slice(1);\r\n\t\t}\r\n\r\n\t\tif (this.var_lookup.has(name) && !this.var_lookup.get(name).global) return;\r\n\t\tif (template_scope && template_scope.names.has(name)) return;\r\n\t\tif (globals.has(name) && node.type !== 'InlineComponent') return;\r\n\r\n\t\tthis.warn(node, compiler_warnings.missing_declaration(name, !!this.ast.instance));\r\n\t}\r\n\r\n\tpush_ignores(ignores) {\r\n\t\tthis.ignores = new Set(this.ignores || []);\r\n\t\tadd_to_set(this.ignores, ignores);\r\n\t\tthis.ignore_stack.push(this.ignores);\r\n\t}\r\n\r\n\tpop_ignores() {\r\n\t\tthis.ignore_stack.pop();\r\n\t\tthis.ignores = this.ignore_stack[this.ignore_stack.length - 1];\r\n\t}\r\n}\r\n\r\nconst regex_valid_tag_name = /^[a-zA-Z][a-zA-Z0-9]*-[a-zA-Z0-9-]+$/;\r\n\r\nfunction process_component_options(component: Component, nodes) {\r\n\tconst component_options: ComponentOptions = {\r\n\t\timmutable: component.compile_options.immutable || false,\r\n\t\taccessors:\r\n\t\t\t'accessors' in component.compile_options\r\n\t\t\t\t? component.compile_options.accessors\r\n\t\t\t\t: !!component.compile_options.customElement,\r\n\t\tpreserveWhitespace: !!component.compile_options.preserveWhitespace,\r\n\t\tnamespace: component.compile_options.namespace\r\n\t};\r\n\r\n\tconst node = nodes.find(node => node.name === 'svelte:options');\r\n\r\n\tfunction get_value(attribute, { code, message }) {\r\n\t\tconst { value } = attribute;\r\n\t\tconst chunk = value[0];\r\n\r\n\t\tif (!chunk) return true;\r\n\r\n\t\tif (value.length > 1) {\r\n\t\t\treturn component.error(attribute, { code, message });\r\n\t\t}\r\n\r\n\t\tif (chunk.type === 'Text') return chunk.data;\r\n\r\n\t\tif (chunk.expression.type !== 'Literal') {\r\n\t\t\treturn component.error(attribute, { code, message });\r\n\t\t}\r\n\r\n\t\treturn chunk.expression.value;\r\n\t}\r\n\r\n\tif (node) {\r\n\t\tnode.attributes.forEach(attribute => {\r\n\t\t\tif (attribute.type === 'Attribute') {\r\n\t\t\t\tconst { name } = attribute;\r\n\r\n\t\t\t\tswitch (name) {\r\n\t\t\t\t\tcase 'tag': {\r\n\t\t\t\t\t\tconst tag = get_value(attribute, compiler_errors.invalid_tag_attribute);\r\n\r\n\t\t\t\t\t\tif (typeof tag !== 'string' && tag !== null) {\r\n\t\t\t\t\t\t\treturn component.error(attribute, compiler_errors.invalid_tag_attribute);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (tag && !regex_valid_tag_name.test(tag)) {\r\n\t\t\t\t\t\t\treturn component.error(attribute, compiler_errors.invalid_tag_property);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (tag && !component.compile_options.customElement) {\r\n\t\t\t\t\t\t\tcomponent.warn(attribute, compiler_warnings.missing_custom_element_compile_options);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcomponent_options.tag = tag;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcase 'namespace': {\r\n\t\t\t\t\t\tconst ns = get_value(attribute, compiler_errors.invalid_namespace_attribute);\r\n\r\n\t\t\t\t\t\tif (typeof ns !== 'string') {\r\n\t\t\t\t\t\t\treturn component.error(attribute, compiler_errors.invalid_namespace_attribute);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (valid_namespaces.indexOf(ns) === -1) {\r\n\t\t\t\t\t\t\tconst match = fuzzymatch(ns, valid_namespaces);\r\n\t\t\t\t\t\t\treturn component.error(attribute, compiler_errors.invalid_namespace_property(ns, match));\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcomponent_options.namespace = ns;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcase 'accessors':\r\n\t\t\t\t\tcase 'immutable':\r\n\t\t\t\t\tcase 'preserveWhitespace': {\r\n\t\t\t\t\t\tconst value = get_value(attribute, compiler_errors.invalid_attribute_value(name));\r\n\r\n\t\t\t\t\t\tif (typeof value !== 'boolean') {\r\n\t\t\t\t\t\t\treturn component.error(attribute, compiler_errors.invalid_attribute_value(name));\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tcomponent_options[name] = value;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treturn component.error(attribute, compiler_errors.invalid_options_attribute_unknown);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn component.error(attribute, compiler_errors.invalid_options_attribute);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\treturn component_options;\r\n}\r\n\r\nfunction get_relative_path(from: string, to: string) {\r\n\tconst from_parts = from.split(/[/\\\\]/);\r\n\tconst to_parts = to.split(/[/\\\\]/);\r\n\r\n\tfrom_parts.pop(); // get dirname\r\n\r\n\twhile (from_parts[0] === to_parts[0]) {\r\n\t\tfrom_parts.shift();\r\n\t\tto_parts.shift();\r\n\t}\r\n\r\n\tif (from_parts.length) {\r\n\t\tlet i = from_parts.length;\r\n\t\twhile (i--) from_parts[i] = '..';\r\n\t}\r\n\r\n\treturn from_parts.concat(to_parts).join('/');\r\n}\r\n\r\nfunction get_basename(filename: string) {\r\n\treturn filename.split(/[/\\\\]/).pop();\r\n}\r\n\r\nfunction get_sourcemap_source_filename(compile_options: CompileOptions) {\r\n\tif (!compile_options.filename) return null;\r\n\r\n\treturn compile_options.outputFilename\r\n\t\t? get_relative_path(compile_options.outputFilename, compile_options.filename)\r\n\t\t: get_basename(compile_options.filename);\r\n}\r\n","import { regex_starts_with_underscore, regex_ends_with_underscore } from '../../utils/patterns';\r\n\r\nconst regex_percentage_characters = /%/g;\r\nconst regex_file_ending = /\\.[^.]+$/;\r\nconst regex_repeated_invalid_variable_identifier_characters = /[^a-zA-Z_$0-9]+/g;\r\nconst regex_starts_with_digit = /^(\\d)/;\r\n\r\nexport default function get_name_from_filename(filename: string) {\r\n\tif (!filename) return null;\r\n\r\n\tconst parts = filename.split(/[/\\\\]/).map(encodeURI);\r\n\r\n\tif (parts.length > 1) {\r\n\t\tconst index_match = parts[parts.length - 1].match(/^index(\\.\\w+)/);\r\n\t\tif (index_match) {\r\n\t\t\tparts.pop();\r\n\t\t\tparts[parts.length - 1] += index_match[1];\r\n\t\t}\r\n\t}\r\n\r\n\tconst base = parts.pop()\r\n\t\t.replace(regex_percentage_characters, 'u')\r\n\t\t.replace(regex_file_ending, '')\r\n\t\t.replace(regex_repeated_invalid_variable_identifier_characters, '_')\r\n\t\t.replace(regex_starts_with_underscore, '')\r\n\t\t.replace(regex_ends_with_underscore, '')\r\n\t\t.replace(regex_starts_with_digit, '_$1');\r\n\r\n\tif (!base) {\r\n\t\tthrow new Error(`Could not derive component name from file ${filename}`);\r\n\t}\r\n\r\n\treturn base[0].toUpperCase() + base.slice(1);\r\n}\r\n","import Stats from '../Stats';\r\nimport parse from '../parse/index';\r\nimport render_dom from './render_dom/index';\r\nimport render_ssr from './render_ssr/index';\r\nimport { CompileOptions, Warning } from '../interfaces';\r\nimport Component from './Component';\r\nimport fuzzymatch from '../utils/fuzzymatch';\r\nimport get_name_from_filename from './utils/get_name_from_filename';\r\nimport { valid_namespaces } from '../utils/namespaces';\r\n\r\nconst valid_options = [\r\n\t'format',\r\n\t'name',\r\n\t'filename',\r\n\t'sourcemap',\r\n\t'enableSourcemap',\r\n\t'generate',\r\n\t'errorMode',\r\n\t'varsReport',\r\n\t'outputFilename',\r\n\t'cssOutputFilename',\r\n\t'sveltePath',\r\n\t'dev',\r\n\t'accessors',\r\n\t'immutable',\r\n\t'hydratable',\r\n\t'legacy',\r\n\t'customElement',\r\n\t'namespace',\r\n\t'tag',\r\n\t'css',\r\n\t'loopGuardTimeout',\r\n\t'preserveComments',\r\n\t'preserveWhitespace',\r\n\t'cssHash'\r\n];\r\n\r\nconst valid_css_values = [\r\n\ttrue,\r\n\tfalse,\r\n\t'injected',\r\n\t'external',\r\n\t'none'\r\n];\r\n\r\nconst regex_valid_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\r\nconst regex_starts_with_lowercase_character = /^[a-z]/;\r\n\r\nfunction validate_options(options: CompileOptions, warnings: Warning[]) {\r\n\tconst { name, filename, loopGuardTimeout, dev, namespace, css } = options;\r\n\r\n\tObject.keys(options).forEach(key => {\r\n\t\tif (!valid_options.includes(key)) {\r\n\t\t\tconst match = fuzzymatch(key, valid_options);\r\n\t\t\tlet message = `Unrecognized option '${key}'`;\r\n\t\t\tif (match) message += ` (did you mean '${match}'?)`;\r\n\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\t});\r\n\r\n\tif (name && !regex_valid_identifier.test(name)) {\r\n\t\tthrow new Error(`options.name must be a valid identifier (got '${name}')`);\r\n\t}\r\n\r\n\tif (name && regex_starts_with_lowercase_character.test(name)) {\r\n\t\tconst message = 'options.name should be capitalised';\r\n\t\twarnings.push({\r\n\t\t\tcode: 'options-lowercase-name',\r\n\t\t\tmessage,\r\n\t\t\tfilename,\r\n\t\t\ttoString: () => message\r\n\t\t});\r\n\t}\r\n\r\n\tif (loopGuardTimeout && !dev) {\r\n\t\tconst message = 'options.loopGuardTimeout is for options.dev = true only';\r\n\t\twarnings.push({\r\n\t\t\tcode: 'options-loop-guard-timeout',\r\n\t\t\tmessage,\r\n\t\t\tfilename,\r\n\t\t\ttoString: () => message\r\n\t\t});\r\n\t}\r\n\r\n\tif (valid_css_values.indexOf(css) === -1) {\r\n\t\tthrow new Error(`options.css must be true, false, 'injected', 'external', or 'none' (got '${css}')`);\r\n\t}\r\n\r\n\tif (css === true || css === false) {\r\n\t\toptions.css = css === true ? 'injected' : 'external';\r\n\t\t// possibly show this warning once we decided how Svelte 4 looks like\r\n\t\t// const message = `options.css as a boolean is deprecated. Use '${options.css}' instead of ${css}.`;\r\n\t\t// warnings.push({\r\n\t\t// \tcode: 'options-css-boolean-deprecated',\r\n\t\t// \tmessage,\r\n\t\t// \tfilename,\r\n\t\t// \ttoString: () => message\r\n\t\t// });\r\n\t\t// }\r\n\t}\r\n\r\n\tif (namespace && valid_namespaces.indexOf(namespace) === -1) {\r\n\t\tconst match = fuzzymatch(namespace, valid_namespaces);\r\n\t\tif (match) {\r\n\t\t\tthrow new Error(`Invalid namespace '${namespace}' (did you mean '${match}'?)`);\r\n\t\t} else {\r\n\t\t\tthrow new Error(`Invalid namespace '${namespace}'`);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default function compile(source: string, options: CompileOptions = {}) {\r\n\toptions = Object.assign({ generate: 'dom', dev: false, enableSourcemap: true, css: 'injected' }, options);\r\n\r\n\tconst stats = new Stats();\r\n\tconst warnings = [];\r\n\r\n\tvalidate_options(options, warnings);\r\n\r\n\tstats.start('parse');\r\n\tconst ast = parse(source, options);\r\n\tstats.stop('parse');\r\n\r\n\tstats.start('create component');\r\n\tconst component = new Component(\r\n\t\tast,\r\n\t\tsource,\r\n\t\toptions.name || get_name_from_filename(options.filename) || 'Component',\r\n\t\toptions,\r\n\t\tstats,\r\n\t\twarnings\r\n\t);\r\n\tstats.stop('create component');\r\n\r\n\tconst result = options.generate === false\r\n\t\t? null\r\n\t\t: options.generate === 'ssr'\r\n\t\t\t? render_ssr(component, options)\r\n\t\t\t: render_dom(component, options);\r\n\r\n\treturn component.generate(result);\r\n}\r\n","import { decode as decode_mappings } from 'sourcemap-codec';\r\nimport { Processed } from './types';\r\n\r\n/**\r\n * Import decoded sourcemap from mozilla/source-map/SourceMapGenerator\r\n * Forked from source-map/lib/source-map-generator.js\r\n * from methods _serializeMappings and toJSON.\r\n * We cannot use source-map.d.ts types, because we access hidden properties.\r\n */\r\nfunction decoded_sourcemap_from_generator(generator: any) {\r\n\tlet previous_generated_line = 1;\r\n\tconst converted_mappings = [[]];\r\n\tlet result_line;\r\n\tlet result_segment;\r\n\tlet mapping;\r\n\r\n\tconst source_idx = generator._sources.toArray()\r\n\t\t.reduce((acc, val, idx) => (acc[val] = idx, acc), {});\r\n\r\n\tconst name_idx = generator._names.toArray()\r\n\t\t.reduce((acc, val, idx) => (acc[val] = idx, acc), {});\r\n\r\n\tconst mappings = generator._mappings.toArray();\r\n\tresult_line = converted_mappings[0];\r\n\r\n\tfor (let i = 0, len = mappings.length; i < len; i++) {\r\n\t\tmapping = mappings[i];\r\n\r\n\t\tif (mapping.generatedLine > previous_generated_line) {\r\n\t\t\twhile (mapping.generatedLine > previous_generated_line) {\r\n\t\t\t\tconverted_mappings.push([]);\r\n\t\t\t\tprevious_generated_line++;\r\n\t\t\t}\r\n\t\t\tresult_line = converted_mappings[mapping.generatedLine - 1]; // line is one-based\r\n\t\t} else if (i > 0) {\r\n\t\t\tconst previous_mapping = mappings[i - 1];\r\n\t\t\tif (\r\n\t\t\t\t// sorted by selectivity\r\n\t\t\t\tmapping.generatedColumn === previous_mapping.generatedColumn &&\r\n\t\t\t\tmapping.originalColumn === previous_mapping.originalColumn &&\r\n\t\t\t\tmapping.name === previous_mapping.name &&\r\n\t\t\t\tmapping.generatedLine === previous_mapping.generatedLine &&\r\n\t\t\t\tmapping.originalLine === previous_mapping.originalLine &&\r\n\t\t\t\tmapping.source === previous_mapping.source\r\n\t\t) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t\tresult_line.push([mapping.generatedColumn]);\r\n\t\tresult_segment = result_line[result_line.length - 1];\r\n\r\n\t\tif (mapping.source != null) {\r\n\t\t\tresult_segment.push(...[\r\n\t\t\t\tsource_idx[mapping.source],\r\n\t\t\t\tmapping.originalLine - 1, // line is one-based\r\n\t\t\t\tmapping.originalColumn\r\n\t\t\t]);\r\n\t\t\tif (mapping.name != null) {\r\n\t\t\t\tresult_segment.push(name_idx[mapping.name]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tconst map = {\r\n\t\tversion: generator._version,\r\n\t\tsources: generator._sources.toArray(),\r\n\t\tnames: generator._names.toArray(),\r\n\t\tmappings: converted_mappings\r\n\t};\r\n\tif (generator._file != null) {\r\n\t\t(map as any).file = generator._file;\r\n\t}\r\n\t// not needed: map.sourcesContent and map.sourceRoot\r\n\treturn map;\r\n}\r\n\r\nexport function decode_map(processed: Processed) {\r\n\tlet decoded_map = typeof processed.map === 'string' ? JSON.parse(processed.map) : processed.map;\r\n\tif (typeof(decoded_map.mappings) === 'string') {\r\n\t\tdecoded_map.mappings = decode_mappings(decoded_map.mappings);\r\n\t}\r\n\tif ((decoded_map as any)._mappings && decoded_map.constructor.name === 'SourceMapGenerator') {\r\n\t\t// import decoded sourcemap from mozilla/source-map/SourceMapGenerator\r\n\t\tdecoded_map = decoded_sourcemap_from_generator(decoded_map);\r\n\t}\r\n\r\n\treturn decoded_map;\r\n}\r\n","import { MappedCode } from '../utils/mapped_code';\r\nimport { Source } from './types';\r\n\r\ninterface Replacement {\r\n\toffset: number;\r\n\tlength: number;\r\n\treplacement: MappedCode;\r\n}\r\n\r\nexport function slice_source(\r\n\tcode_slice: string,\r\n\toffset: number,\r\n\t{ file_basename, filename, get_location }: Source\r\n): Source {\r\n\treturn {\r\n\t\tsource: code_slice,\r\n\t\tget_location: (index: number) => get_location(index + offset),\r\n\t\tfile_basename,\r\n\t\tfilename\r\n\t};\r\n}\r\n\r\nfunction calculate_replacements(\r\n\tre: RegExp,\r\n\tget_replacement: (...match: any[]) => Promise<MappedCode>,\r\n\tsource: string\r\n) {\r\n\tconst replacements: Array<Promise<Replacement>> = [];\r\n\r\n\tsource.replace(re, (...match) => {\r\n\t\treplacements.push(\r\n\t\t\tget_replacement(...match).then(\r\n\t\t\t\treplacement => {\r\n\t\t\t\t\tconst matched_string = match[0];\r\n\t\t\t\t\tconst offset = match[match.length - 2];\r\n\r\n\t\t\t\t\treturn ({ offset, length: matched_string.length, replacement });\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t);\r\n\t\treturn '';\r\n\t});\r\n\r\n\treturn Promise.all(replacements);\r\n}\r\n\r\nfunction perform_replacements(\r\n\treplacements: Replacement[],\r\n\tsource: Source\r\n): MappedCode {\r\n\tconst out = new MappedCode();\r\n\tlet last_end = 0;\r\n\r\n\tfor (const { offset, length, replacement } of replacements) {\r\n\t\tconst unchanged_prefix = MappedCode.from_source(\r\n\t\t\tslice_source(source.source.slice(last_end, offset), last_end, source)\r\n\t\t);\r\n\t\tout.concat(unchanged_prefix).concat(replacement);\r\n\t\tlast_end = offset + length;\r\n\t}\r\n\r\n\tconst unchanged_suffix = MappedCode.from_source(slice_source(source.source.slice(last_end), last_end, source));\r\n\r\n\treturn out.concat(unchanged_suffix);\r\n}\r\n\r\nexport async function replace_in_code(\r\n\tregex: RegExp,\r\n\tget_replacement: (...match: any[]) => Promise<MappedCode>,\r\n\tlocation: Source\r\n): Promise<MappedCode> {\r\n\tconst replacements = await calculate_replacements(regex, get_replacement, location.source);\r\n\r\n\treturn perform_replacements(replacements, location);\r\n}\r\n","import { RawSourceMap, DecodedSourceMap } from '@ampproject/remapping/dist/types/types';\r\nimport { getLocator } from 'locate-character';\r\nimport { MappedCode, SourceLocation, parse_attached_sourcemap, sourcemap_add_offset, combine_sourcemaps } from '../utils/mapped_code';\r\nimport { decode_map } from './decode_sourcemap';\r\nimport { replace_in_code, slice_source } from './replace_in_code';\r\nimport { MarkupPreprocessor, Source, Preprocessor, PreprocessorGroup, Processed } from './types';\r\nimport { regex_whitespaces } from '../utils/patterns';\r\n\r\nexport * from './types';\r\n\r\ninterface SourceUpdate {\r\n\tstring?: string;\r\n\tmap?: DecodedSourceMap;\r\n\tdependencies?: string[];\r\n}\r\n\r\nconst regex_filepath_separator = /[/\\\\]/;\r\n\r\nfunction get_file_basename(filename: string) {\r\n\treturn filename.split(regex_filepath_separator).pop();\r\n}\r\n\r\n/**\r\n * Represents intermediate states of the preprocessing.\r\n */\r\nclass PreprocessResult implements Source {\r\n\t// sourcemap_list is sorted in reverse order from last map (index 0) to first map (index -1)\r\n\t// so we use sourcemap_list.unshift() to add new maps\r\n\t// https://github.com/ampproject/remapping#multiple-transformations-of-a-file\r\n\tsourcemap_list: Array<DecodedSourceMap | RawSourceMap> = [];\r\n\tdependencies: string[] = [];\r\n\tfile_basename: string;\r\n\r\n\tget_location: ReturnType<typeof getLocator>;\r\n\r\n\tconstructor(public source: string, public filename?: string) {\r\n\t\tthis.update_source({ string: source });\r\n\r\n\t\t// preprocess source must be relative to itself or equal null\r\n\t\tthis.file_basename = filename == null ? null : get_file_basename(filename);\r\n\t}\r\n\r\n\tupdate_source({ string: source, map, dependencies }: SourceUpdate) {\r\n\t\tif (source != null) {\r\n\t\t\tthis.source = source;\r\n\t\t\tthis.get_location = getLocator(source);\r\n\t\t}\r\n\r\n\t\tif (map) {\r\n\t\t\tthis.sourcemap_list.unshift(map);\r\n\t\t}\r\n\r\n\t\tif (dependencies) {\r\n\t\t\tthis.dependencies.push(...dependencies);\r\n\t\t}\r\n\t}\r\n\r\n\tto_processed(): Processed {\r\n\t\t// Combine all the source maps for each preprocessor function into one\r\n\t\tconst map: RawSourceMap = combine_sourcemaps(this.file_basename, this.sourcemap_list);\r\n\r\n\t\treturn {\r\n\t\t\t// TODO return separated output, in future version where svelte.compile supports it:\r\n\t\t\t// style: { code: styleCode, map: styleMap },\r\n\t\t\t// script { code: scriptCode, map: scriptMap },\r\n\t\t\t// markup { code: markupCode, map: markupMap },\r\n\r\n\t\t\tcode: this.source,\r\n\t\t\tdependencies: [...new Set(this.dependencies)],\r\n\t\t\tmap: map as object,\r\n\t\t\ttoString: () => this.source\r\n\t\t};\r\n\t}\r\n}\r\n\r\n/**\r\n * Convert preprocessor output for the tag content into MappedCode\r\n */\r\nfunction processed_content_to_code(processed: Processed, location: SourceLocation, file_basename: string): MappedCode {\r\n\t// Convert the preprocessed code and its sourcemap to a MappedCode\r\n\tlet decoded_map: DecodedSourceMap;\r\n\tif (processed.map) {\r\n\t\tdecoded_map = decode_map(processed);\r\n\r\n\t\t// decoded map may not have sources for empty maps like `{ mappings: '' }`\r\n\t\tif (decoded_map.sources) {\r\n\t\t\t// offset only segments pointing at original component source\r\n\t\t\tconst source_index = decoded_map.sources.indexOf(file_basename);\r\n\t\t\tif (source_index !== -1) {\r\n\t\t\t\tsourcemap_add_offset(decoded_map, location, source_index);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn MappedCode.from_processed(processed.code, decoded_map);\r\n}\r\n\r\n/**\r\n * Given the whole tag including content, return a `MappedCode`\r\n * representing the tag content replaced with `processed`.\r\n */\r\nfunction processed_tag_to_code(\r\n\tprocessed: Processed,\r\n\ttag_name: 'style' | 'script',\r\n\tattributes: string,\r\n\tsource: Source\r\n): MappedCode {\r\n\tconst { file_basename, get_location } = source;\r\n\r\n\tconst build_mapped_code = (code: string, offset: number) =>\r\n\t\tMappedCode.from_source(slice_source(code, offset, source));\r\n\r\n\tconst tag_open = `<${tag_name}${attributes || ''}>`;\r\n\tconst tag_close = `</${tag_name}>`;\r\n\r\n\tconst tag_open_code = build_mapped_code(tag_open, 0);\r\n\tconst tag_close_code = build_mapped_code(tag_close, tag_open.length + source.source.length);\r\n\r\n\tparse_attached_sourcemap(processed, tag_name);\r\n\r\n\tconst content_code = processed_content_to_code(processed, get_location(tag_open.length), file_basename);\r\n\r\n\treturn tag_open_code.concat(content_code).concat(tag_close_code);\r\n}\r\n\r\nconst regex_quoted_value = /^['\"](.*)['\"]$/;\r\n\r\nfunction parse_tag_attributes(str: string) {\r\n\t// note: won't work with attribute values containing spaces.\r\n\treturn str\r\n\t\t.split(regex_whitespaces)\r\n\t\t.filter(Boolean)\r\n\t\t.reduce((attrs, attr) => {\r\n\t\t\tconst i = attr.indexOf('=');\r\n\t\t\tconst [key, value] = i > 0 ? [attr.slice(0, i), attr.slice(i + 1)] : [attr];\r\n\t\t\tconst [, unquoted] = (value && value.match(regex_quoted_value)) || [];\r\n\r\n\t\t\treturn { ...attrs, [key]: unquoted ?? value ?? true };\r\n\t\t}, {});\r\n}\r\n\r\n\r\nconst regex_style_tags = /<!--[^]*?-->|<style(\\s[^]*?)?(?:>([^]*?)<\\/style>|\\/>)/gi;\r\nconst regex_script_tags = /<!--[^]*?-->|<script(\\s[^]*?)?(?:>([^]*?)<\\/script>|\\/>)/gi;\r\n\r\n/**\r\n * Calculate the updates required to process all instances of the specified tag.\r\n */\r\nasync function process_tag(\r\n\ttag_name: 'style' | 'script',\r\n\tpreprocessor: Preprocessor,\r\n\tsource: Source\r\n): Promise<SourceUpdate> {\r\n\tconst { filename, source: markup } = source;\r\n\tconst tag_regex = tag_name === 'style' ? regex_style_tags : regex_script_tags;\r\n\r\n\tconst dependencies: string[] = [];\r\n\r\n\tasync function process_single_tag(\r\n\t\ttag_with_content: string,\r\n\t\tattributes = '',\r\n\t\tcontent = '',\r\n\t\ttag_offset: number\r\n\t): Promise<MappedCode> {\r\n\t\tconst no_change = () => MappedCode.from_source(slice_source(tag_with_content, tag_offset, source));\r\n\r\n\t\tif (!attributes && !content) return no_change();\r\n\r\n\t\tconst processed = await preprocessor({\r\n\t\t\tcontent: content || '',\r\n\t\t\tattributes: parse_tag_attributes(attributes || ''),\r\n\t\t\tmarkup,\r\n\t\t\tfilename\r\n\t\t});\r\n\r\n\t\tif (!processed) return no_change();\r\n\t\tif (processed.dependencies) dependencies.push(...processed.dependencies);\r\n\t\tif (!processed.map && processed.code === content) return no_change();\r\n\r\n\t\treturn processed_tag_to_code(processed, tag_name, attributes, slice_source(content, tag_offset, source));\r\n\t}\r\n\r\n\tconst { string, map } = await replace_in_code(tag_regex, process_single_tag, source);\r\n\r\n\treturn { string, map, dependencies };\r\n}\r\n\r\nasync function process_markup(process: MarkupPreprocessor, source: Source) {\r\n\tconst processed = await process({\r\n\t\tcontent: source.source,\r\n\t\tfilename: source.filename\r\n\t});\r\n\r\n\tif (processed) {\r\n\t\treturn {\r\n\t\t\tstring: processed.code,\r\n\t\t\tmap: processed.map\r\n\t\t\t\t? // TODO: can we use decode_sourcemap?\r\n\t\t\t\ttypeof processed.map === 'string'\r\n\t\t\t\t\t? JSON.parse(processed.map)\r\n\t\t\t\t\t: processed.map\r\n\t\t\t\t: undefined,\r\n\t\t\tdependencies: processed.dependencies\r\n\t\t};\r\n\t} else {\r\n\t\treturn {};\r\n\t}\r\n}\r\n\r\nexport default async function preprocess(\r\n\tsource: string,\r\n\tpreprocessor: PreprocessorGroup | PreprocessorGroup[],\r\n\toptions?: { filename?: string }\r\n): Promise<Processed> {\r\n\tconst filename: string | undefined = (options && options.filename) || (preprocessor as any).filename; // legacy\r\n\r\n\tconst preprocessors = preprocessor ? (Array.isArray(preprocessor) ? preprocessor : [preprocessor]) : [];\r\n\r\n\tconst markup = preprocessors.map(p => p.markup).filter(Boolean);\r\n\tconst script = preprocessors.map(p => p.script).filter(Boolean);\r\n\tconst style = preprocessors.map(p => p.style).filter(Boolean);\r\n\r\n\tconst result = new PreprocessResult(source, filename);\r\n\r\n\t// TODO keep track: what preprocessor generated what sourcemap?\r\n\t// to make debugging easier = detect low-resolution sourcemaps in fn combine_mappings\r\n\r\n\tfor (const process of markup) {\r\n\t\tresult.update_source(await process_markup(process, result));\r\n\t}\r\n\r\n\tfor (const process of script) {\r\n\t\tresult.update_source(await process_tag('script', process, result));\r\n\t}\r\n\r\n\tfor (const preprocess of style) {\r\n\t\tresult.update_source(await process_tag('style', preprocess, result));\r\n\t}\r\n\r\n\treturn result.to_processed();\r\n}\r\n"],"names":["keysShim","define","defineProperties","elementRoles","elementAXObjects"],"mappings":";;;;AAAA;;;;;;;;;;;;;;AAcA;;;;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,AAEA;AACA;;ACnBA;;AAEA;;;;;AAKA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLA;AACA;;;AAGA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;AAEA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;AAgBA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9FA;AACA;;AAEA;;AAEA;;AAEA;;;;AAIA;;;;AAIA;;;;;;;;;;;ACfA;AACA,AAEA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACPA;;;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTA;AACA,AACA;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdA;AACA,AAEA;;;;;;;;;;;;;;AAcA;;;;;ACjBA;AACA;AACA;;ACAA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzBA;;;;;;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACXA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgHA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA8BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;;;;;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjMA;;;;;;;AAOA;;;;;;ACPA;AACA,AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;;;;;;;;;;;;AAaA;;;;;;;;AAQA;;;;;;;;;;;;AAYA;;;;;;;AAOA;;;;;;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAs/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACx2CA;AACA;AACA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA;;;;;;;;;;;;;;ACxGA;AACA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3BA;;;;;;;;;AASA;;;;;;AAMA;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0HA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;;;;;;;;;;;;;;AAeA,AAEA;;;;;AAKA;;;;;;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;ACrXA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACFA;;AAEA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1BA;AACA,AAMA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA;;;;;;;;;;AChGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;;;;;;;;;ACnIA;AACA;;AAEA;;;;;;;AAOA;;AAEA;;;;;;;;;;;;;;;;;AAiBA;AACA;AACA;AACA;;AAEA;;;;;;;;;;AAUA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuLA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4JA;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3fA;;;AAGA;;;;;;;;ACHA;AACA;AACA;AACA;;AAEA;;;;AAIA;;;;AAIA;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACIA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkBA;;;;;;;;;;;;;AAaA;AACA;;AAEA;;;;;;;;ACvEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,AACA;;AAEA;;;;;;;ACnCA;;AAEA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHA;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;;;;;;;;;;;;ACCA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrNA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACDA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACuBA;;;;;;;;;;;;;;;;;;;;AC7BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACgFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJA,AAmBA;;;AAGA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClSA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA;;;;;;;;;;;;;;;;;AChLA;;AAEA;;;;;;;;;;;;+LAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+ECAA;;;;;;;;;;;;;;;;;;;;;;ACrBA;;AAEA;;;;;;;;;;oIAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2GCPA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qHCqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA;;;AAGA;;;;;;;;;;AC/EA,AAMA;AACA;;;;;;;;AAQA;;AAEA;;;;AAIA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdA;AACA;;;;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9GA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJA;;;AAGA;;;;;;;;;AASA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrBA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;AAiBA;;ACnBA;;AAEA;;;;;;;wEAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClBA,AACA;AACA;;;AAGA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;;;ACbA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;AAEA;;;;;;AC5LA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;AAEA;;;;;;ACjVA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;AAkBA;AACA;;;;;;ACzBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;;;;;;AC7BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;AAmBA;AACA;;;;;;AC1BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA;AACA;;;;;;ACvDA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AACA;;;;;;ACrCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;AAiBA;AACA;;;;;;ACxBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;AAiBA;AACA;;;;;;ACxBA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;;;;;ACnCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;;;;;AC9BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;;;;;AC9BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;AAqBA;AACA;;;;;;AC5BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiGA;AACA;;;;;;ACxGA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;AACA;;;;;;AC7CA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgIA;AACA;;;;;;ACvIA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;AAqBA;AACA;;;;;;AC5BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;AAiBA;AACA;;;;;;ACxBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AACA;;;;;;AC/BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;AACA;;;;;;ACjDA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;;;;;;AChCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;AACA;;;;;;AClCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;AACA;;;;;;ACxCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;AACA;;;;;;ACxCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA;AACA;;;;;;ACxDA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;AACA;;;;;;AC7CA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA;AACA;;;;;;AClDA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AACA;;;;;;ACrCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA;AACA;;;;;;ACzEA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AACA;;;;;;ACrCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;AAiBA;AACA;;;;;;ACxBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA;AACA;;;;;;AC5CA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;;;;;;AC7BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;AACA;;;;;;AChDA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;;;;;;AC7BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;;;;;;AC7BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;AAqBA;AACA;;;;;;AC5BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA;AACA;;;;;;AC5CA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;AACA;;;;;;AClCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AACA;;;;;;ACrCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;;;;;;AChCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;AACA;;;;;;ACjDA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA;AACA;;;;;;ACnCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AACA;;;;;;ACrCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;AACA;;;;;;AC1CA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AACA;;;;;;AC/BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;AACA;;;;;;AClCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;AACA;;;;;;AClCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;AACA;;;;;;AC1CA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;AACA;;;;;;ACtCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;;;;;AC9BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;;;;;;AC7BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;;;;;;AC7BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;;;;;AC9BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;AACA;;;;;;AC/BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;;;;;;AChCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA;AACA;;;;;;ACtGA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA;;;;;;AC7BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;AAqBA;AACA;;;;;;AC5BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;AAeA;AACA;;;;;;ACtBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;;;;;AC/KA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;;;;;AC9BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;;;;;AC9BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;AAqBA;AACA;;;;;;AC5BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;;;;;AC9BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;;;;;AC9BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;;;;;;AChCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;AAoBA;AACA;;;;;;AC3BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;;;;;ACzFA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;AAEA;;;;;AC3IA;;AAEA;;;;;;;;;;;;;;ACFA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsHA;;ACvHA;;;AAGA;AACA;;AAEA;;AAEAA;;;;;;;;;;;;;;;;;;;;;AAqBA;;AC7BA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACCA;;;;ACFA;;;AAGA;;;;;;;;;ACHA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLA;;ACAA;;ACFA;;AAEA;AACA;AACA;;;AAGA;;;;;;AAMA;AACA;;;;;;;;AAQA;;;AAGA;;;;;;;;;;;;;;;;;AAiBA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5PA,AACA;;;;AAIA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;AASA;;;;;;;;;;;;;;;;AAgBA;;;;AAIA;;;;;;;;ACpCA;;AAEA;;;;;;;;ACNA;;;AAGA;;AAEA;;;;;;;AAOA;;;;;;;;;;;;AAYA;;;;AAIA;;AAEA;;AC5BA;;AAEA;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;AAaA;;AC7BA;;AAEA;AACA;AACA;;AAEA;;;;AAIA;;AAEA;;AAEA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;AAWA;;AAEA;;AC5CA;;;;AAIA;;;;;;;;;;;;;ACFA;;;;ACCA;;;;;;;;;;ACIA;;AAEAC;;;;;;AAMA;;ACdA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;AAkBA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7BA;;;;AAIA;AACA;;;;;;;;;AASA;;;;;;;;AAQA;;AAEA;;;;AAIA;;;AC9BA,AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA;;;;;AChCA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACLA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;ACDA;;AAEAA;;;;;;AAMA;;ACjBA;;AAEA;;;;ACAA;AACA;;;;;;;;;AASA;AACA;AACA;;AAEA;;;;;;;ACdA;AACA;;;;;;;;AAQA;AACA;AACA;;AAEA;;;;;;;;;;ACbA;AACA;;;;;;;;AAQA;AACA;AACA;;AAEA;;;;;;;;;;ACZA;AACA;;AAEA;;;;;;;;AAQA;AACA;;AAEA;;;;;;;;;;;ACjBA,AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHA;;AAEA;;;;;;;;ACJA,AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACIA;AACA;;;;;;;;;;;;;;;;;;;;;;ACPA;AACA;;AAEA;;AAEA;;;;;;;;AAQA;AACA;AACA;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;ACvBA;AACA;;AAEA;;AAEA;;;;;;;;AAQA;AACA;AACA;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;ACvBA;AACA;;AAEA;;AAEA;;;;;;;;AAQA;AACA;AACA;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;ACzBA,AACA;;;;AAIA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACFA;;;;;;;;;;;;;;;;;;ACPA;;;AAGA;;AAEA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AASA;;AAEA;;;;;;;;;;;;;;;;;;;;;AChBA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AAmBA;AACA;;;;;;;;;AASA;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;;;;;;;;;;;;;;;;;;;;;;AC3EA;AACA;;AAEA;;;;;;;;;;;;AAYA;;;;;;;;;;;AAWA;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;AAmBA;;AC3DA;;;;;;;;;;;;;;AAcA;;AAEA;;;;;;;;;;ACdA;AACA;;;;;;;;;AASA;;ACRA;AACA;;AAEA;AACA;;AAEA;;;;;;;;AAQA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;AAYA;;;;;;;;;;AC7CA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;AClDA,AAIA;;;;;;AAMA;;;;AAIA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;;;AAIA;;;;AAIA;;;;;;;;;;;;AAYA;AACA;AACA;;;;AAIA;;;;;;;;;;;;;;AAcA;;AAEA;;;;;;;;;;AAUA;;;AAGA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;;;;AAKA;;;;;;;;;AASA;;AAEA;;;AAGA;;;;AAIA;;;;;;;;;AASA;;AAEA;;;AAGA;;;;AAIA;;;;;;;;;AASA;;AAEA;;;AAGA;;;;AAIA;;;AAGA;;AAEA;;;AAGA;;;;AAIA;;;;;;;;;AASA;;AAEA;;;AAGA;;;;;AAKA;;;;;;;;;AASA;;;AAGA;AACA;;;AAGA;;;;;;;;;;;;;AAaA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;;;;;;;AASA;;AAEA;;;;;;AAMA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtUA;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACqBA;;;;;;;;;;AAUA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;AACA;AACA,AASA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;;;;AAIA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;;;AAaA;;;;;;;;;;;;AAYA;;;;;AAKA;;;;;;;;;;;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiHA;;;;;;;;;;;;;;;;;;;AAmBA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA;AACA,AACA;AACA,AACA;;;;;;;;;;;;;;;;;;;AAmBA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;;AAEA;;;AAGA;AACA;;AAEA;;;AAGA;;AAEA;;;AAGA;AACA;;AAEA;;;;AAIA;AACA;;AAEA;;;AAGA;;AAEA;;;;;;;;AAQA;;AAEA;;AAEA;;;;;AAKA;;;;;AAKA;;;;AAIA;;;;;;;;;;AAUA;;;;;;;;;;;;;;;;;;AAkBA;;AAEA;;;;;;;;;;;;AAYA;;;;AAIA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA;;AAEA;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1sBA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGA;;AAEA;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsLA;;;;;AAKA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;AAWA;AACA;;;;AAIA;;;;AAIA;;;;;;;AAOA;;;;;;;;AAQA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;AAWA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;AAQA;;;;;;;;;;;AAWA;;;;;;;;;;;;;AAaA;;;;AAIA;;;;AAIA;;;;;AAKA;;;;;;;;;AASA;;;;;;;;;;;;;;;AAeA;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACndA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;AAUA;;;;;;;;;;;AAWA;;;;AAIA;;;;;;;;;;;;;AAaA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvDA;;AAEA;;AAEA;AACA;AACA;AACA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACRA;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;;;ACtCA;;;;;;;;;;ACIA;;AAEA;;;;AAIAC;;;;;;AAMA;;;;ACHA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;AAkBA;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;AAUA;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA;;;;;;;;;;;;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA;;;;;ACvWA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;AAEA;;;;;;ACvIA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;AAEA;;;;;;AC1HA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC5BA,AACA;AACA;;;AAGA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;AACA;;;;;;ACjCA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;;;ACbA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;AAYA;AACA;;;;;;ACnBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;AAmBA;AACA;;;;;;AC1BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;AAkBA;AACA;;;;;;ACzBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;AAaA;AACA;;;;;;ACpBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;AAaA;AACA;;;;;;ACpBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;AAaA;AACA;;;;;;ACpBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA;AACA;;;;;;AC9CA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;AAYA;AACA;;;;;;ACnBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;AAaA;AACA;;;;;;ACpBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;AAiBA;AACA;;;;;;ACxBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;AAmBA;AACA;;;;;;AC1BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;AAmBA;AACA;;;;;;AC1BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;AAkBA;AACA;;;;;;ACzBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;AAkBA;AACA;;;;;;ACzBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;AAkBA;AACA;;;;;;ACzBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;AAkBA;AACA;;;;;;ACzBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;AAkBA;AACA;;;;;;ACzBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;AAkBA;AACA;;;;;;ACzBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;AAcA;AACA;;;;;;ACrBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;;;;;;AC9BA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;;;AAWA;AACA;;;;;;AClBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;;;;;;AASA;AACA;;;;;;AChBA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;AACA;;;;AAIA;AACA;;;;;;ACXA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;AAEA;;;;;;ACrUA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;AAEA;;;;;;AC/HA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;AAEA;;;;;;AC/HA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;AAEA;;;;;;AClJA,AACA;AACA;;;AAGA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;qgBCjBA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;;;;;AAmBA;;;;AAIA;;;;AAIA;;AAEA;;;;AAIA;;;;;;;;;;;;;;;;AAgBA;;AAEAC;;;;;;AAMA;;AAEAA;;;;;;AAMA;;;;AAIA;;AAEAC;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;;;;;;;;;;;;;;;;;;;;qgBCnIA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;;AAaA;;;;;AAKA;;;;;;;;;;;;;AAaA;;;;;;;;;;;AAWA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA;;AAEA;;;;;;;;;;;AAWA;;;;;;;;AAQA;;;;;AAKA;;AAEA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;;;;;;;AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;0ZAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2xBA;;AAEA;;;;;;;;;;;;;AAaA;;AAEA;;;;;;;;;ACthCA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wQCyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0IA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yEC1JA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2HCSA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACdA;;;;;;;;;;AAUA;;;;;;;mJAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9BA;;;;;;;AAOA;;;;;;ACiBA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACZA;;;;;;;;ACDA;;;;;;;;;;;;;;;;;;;;;;;;oFAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA;;;;;;;;;;;;;;;;;sFAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChIA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACGA;;;;;;;;;;;;;;;;ACEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oFCaA;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mIA+BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1EA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTA;;AAEA;;AAEA;;;;AAIA;;;;;;;;;;;;;;;;;;ACRA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACaA;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;AAmBA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmRA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA;;;;;AAKA;;;;AAIA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9TA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACkDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sFCnYA;;;;;;;;;;;;;;;;;;;;;;;;;;yFCQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACcA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;8HAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA88BA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9rCA;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;iFAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA;;;;;;;;;;;;;;;+HAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mFCjFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACCA;;AAEA;;;;;;;;;;;;;;;8IAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnBA;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;iKCRA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrBA;;;;;;;;;;AAUA;;;;;AAKA;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTA;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACrDA;AACA;AACA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA;;;;;;;;;;;;;;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;AAmBA;;;AAGA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;;;;;;;;;;;;;;AAeA;;;;AAIA;AACA;;;;;;;;;;;AAWA;;;;;;;;;;;;;AAaA;;;;;;;;;AASA;;;;;;;;AAQA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA;;;;;AC3vBA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;AAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsJA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtRA;;;;;;;;;;;;AAYA;;;;;;;ACzBA;;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1DA;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjBA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC8KA;;;;;;;;;;;;;;;;;;;;;;AChOA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7HA;;;;;;;;;;;ACSA;;;;;AAKA;;;;;AAKA;;;;;AAKA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA;;;;;;;;;AASA;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA;;;;;;;;;;AAUA;;;;;;AAMA;;;;;AAKA;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;;;;;;;;;;;;;;;;ACrnBA;;AAEA;;;;AAIA;;;AAGA;;;;;AAKA;;;;;;;;;;;;;;;;;;;AAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4HA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACnSA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACgDA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAy6CA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkGA;;;;;;;;;;;;;;;;;;;AAmBA;;;;AAIA;;;;;;;;ACvlDA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACGA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;;;;;AAQA;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7GA;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA;;;;;;;;;;;;;;;;;;;;;;;;;;ACtDA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;;;;;;;;;;;;;;;;;;;;AAoBA;;;;;;;;;;;ACjEA,AAQA;;;;;;;AAOA;;AAEA;;;;;;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA;;;;;;;;;;;;;;;;;;;;;;;AAuBA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;;AAEA;;;;;;;;;;;;;;;AAeA;AACA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA;;;;;;;;;;;;;;;;;;;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}