@rankingcoach/vanguard 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/icons/Icon-tools-active-1.svg +3 -0
- package/dist/icons/Icon-tools-active.svg +3 -0
- package/dist/index-AMPMMidnightParser.js +1 -1
- package/dist/index-AMPMParser.js +1 -1
- package/dist/index-Accordion2.js +1 -1
- package/dist/index-AccordionDetails.js +1 -1
- package/dist/index-AccordionSummary.js +1 -1
- package/dist/index-AppBar2.js +1 -1
- package/dist/index-Autocomplete2.js +1 -1
- package/dist/index-Backdrop.js +1 -1
- package/dist/index-BasePopper.js +1 -1
- package/dist/index-Box.js +1 -1
- package/dist/index-Button2.js +1 -1
- package/dist/index-ButtonBase.js +1 -1
- package/dist/index-CSSTransition.js +1 -1
- package/dist/index-Calendar.js +20 -20
- package/dist/index-CalendarPicker.js +1 -1
- package/dist/index-Chip.js +1 -1
- package/dist/index-ClickAwayListener.js +1 -1
- package/dist/index-ClockPicker.js +1 -1
- package/dist/index-Collapse2.js +1 -1
- package/dist/index-ControlledValuePlugin.js +1 -1
- package/dist/index-CreditCard.js +1 -1
- package/dist/index-DateInput.js +1 -1
- package/dist/index-DateParser.js +1 -1
- package/dist/index-DatePicker2.js +1 -1
- package/dist/index-DateRange2.js +7 -7
- package/dist/index-DateRangePicker2.js +1 -1
- package/dist/index-DayCell.js +7 -7
- package/dist/index-DayOfYearParser.js +1 -1
- package/dist/index-DayParser.js +1 -1
- package/dist/index-DayPeriodParser.js +1 -1
- package/dist/index-DefaultPropsProvider.js +1 -1
- package/dist/index-DefaultPropsProvider2.js +1 -1
- package/dist/index-DefaultValuePlugin.js +1 -1
- package/dist/index-DefinedRange.js +1 -1
- package/dist/index-DesktopDatePicker.js +1 -1
- package/dist/index-Dialog.js +1 -1
- package/dist/index-DialogActions.js +1 -1
- package/dist/index-DialogContent.js +1 -1
- package/dist/index-Drawer2.js +1 -1
- package/dist/index-EraParser.js +1 -1
- package/dist/index-ExtendedYearParser.js +1 -1
- package/dist/index-Fade.js +1 -1
- package/dist/index-FilledInput.js +1 -1
- package/dist/index-FocusTrap.js +1 -1
- package/dist/index-FormControl2.js +1 -1
- package/dist/index-FormHelperText.js +1 -1
- package/dist/index-FormLabel.js +1 -1
- package/dist/index-FractionOfSecondParser.js +1 -1
- package/dist/index-GlobalStyles.js +1 -1
- package/dist/index-GlobalStyles2.js +1 -1
- package/dist/index-GlobalStyles3.js +1 -1
- package/dist/index-Grid.js +1 -1
- package/dist/index-Grow.js +1 -1
- package/dist/index-Hour0To11Parser.js +1 -1
- package/dist/index-Hour0to23Parser.js +1 -1
- package/dist/index-Hour1To24Parser.js +1 -1
- package/dist/index-Hour1to12Parser.js +1 -1
- package/dist/index-HyperlinkPlugin.js +1 -1
- package/dist/index-ISODayParser.js +1 -1
- package/dist/index-ISOTimezoneParser.js +1 -1
- package/dist/index-ISOTimezoneWithZParser.js +1 -1
- package/dist/index-ISOWeekParser.js +1 -1
- package/dist/index-ISOWeekYearParser.js +1 -1
- package/dist/index-Icon-tools-active-1.svg.js +4 -0
- package/dist/index-Icon-tools-active.svg.js +4 -0
- package/dist/index-IconButton2.js +1 -1
- package/dist/index-Input2.js +1 -1
- package/dist/index-InputAdornment.js +1 -1
- package/dist/index-InputBase.js +48 -43
- package/dist/index-InputBase2.js +1 -1
- package/dist/index-InputLabel.js +1 -1
- package/dist/index-InputRangeField.js +1 -1
- package/dist/index-KeywordNode.js +1 -1
- package/dist/index-KeywordPlugin.js +1 -1
- package/dist/index-LinearProgress.js +1 -1
- package/dist/index-List2.js +1 -1
- package/dist/index-ListSubheader.js +1 -1
- package/dist/index-LocalDayParser.js +1 -1
- package/dist/index-LocalWeekParser.js +1 -1
- package/dist/index-LocalWeekYearParser.js +1 -1
- package/dist/index-LocalizationProvider.js +1 -1
- package/dist/index-LoginButton.js +1 -1
- package/dist/index-Menu.js +1 -1
- package/dist/index-MenuItem.js +1 -1
- package/dist/index-MenuList.js +1 -1
- package/dist/index-MinuteParser.js +1 -1
- package/dist/index-MobileDatePicker.js +1 -1
- package/dist/index-Modal2.js +1 -1
- package/dist/index-Month.js +10 -10
- package/dist/index-MonthParser.js +1 -1
- package/dist/index-MonthPicker.js +1 -1
- package/dist/index-NativeSelectInput.js +1 -1
- package/dist/index-NotchedOutline.js +1 -1
- package/dist/index-OnChangeContentPlugin.js +1 -1
- package/dist/index-OnFocusOnBlurPlugin.js +1 -1
- package/dist/index-OutlinedInput.js +1 -1
- package/dist/index-Paper.js +1 -1
- package/dist/index-Parser2.js +314 -255
- package/dist/index-Parser3.js +129 -2
- package/dist/index-PickersDay.js +1 -1
- package/dist/index-Popover2.js +1 -1
- package/dist/index-Popper.js +1 -1
- package/dist/index-Portal.js +1 -1
- package/dist/index-PropTypes.js +1 -1
- package/dist/index-QuarterParser.js +1 -1
- package/dist/index-Ripple.js +1 -1
- package/dist/index-RtlProvider.js +1 -1
- package/dist/index-ScrollbarSize.js +1 -1
- package/dist/index-SecondParser.js +1 -1
- package/dist/index-Select2.js +1 -1
- package/dist/index-SelectInput2.js +1 -1
- package/dist/index-Skeleton2.js +1 -1
- package/dist/index-Slide.js +1 -1
- package/dist/index-Slider2.js +1 -1
- package/dist/index-SliderValueLabel.js +1 -1
- package/dist/index-Snackbar2.js +1 -1
- package/dist/index-SnackbarContent.js +1 -1
- package/dist/index-StandAloneLocalDayParser.js +1 -1
- package/dist/index-StandAloneMonthParser.js +1 -1
- package/dist/index-StandAloneQuarterParser.js +1 -1
- package/dist/index-StyledEngineProvider.js +1 -1
- package/dist/index-StyledSVG2.js +1 -1
- package/dist/index-SvgIcon.js +1 -1
- package/dist/index-Tab2.js +1 -1
- package/dist/index-TabScrollButton.js +1 -1
- package/dist/index-Tabs2.js +1 -1
- package/dist/index-Text.js +18 -18
- package/dist/index-TextField.js +1 -1
- package/dist/index-TextHighlighted.js +23 -19
- package/dist/index-TextareaAutosize.js +1 -1
- package/dist/index-TimestampMillisecondsParser.js +1 -1
- package/dist/index-TimestampSecondsParser.js +1 -1
- package/dist/index-ToggleButton2.js +1 -1
- package/dist/index-ToggleButtonGroup2.js +1 -1
- package/dist/index-Tokenizer.js +411 -334
- package/dist/index-Tokenizer2.js +139 -2
- package/dist/index-Toolbar2.js +1 -1
- package/dist/index-Tooltip.js +1 -1
- package/dist/index-TouchRipple.js +1 -1
- package/dist/index-Transition.js +1 -1
- package/dist/index-TransitionGroup.js +1 -1
- package/dist/index-Typography.js +1 -1
- package/dist/index-YearParser.js +1 -1
- package/dist/index-YearPicker.js +1 -1
- package/dist/index-_virtual12.js +1 -1
- package/dist/index-_virtual15.js +2 -5
- package/dist/index-_virtual16.js +5 -3
- package/dist/index-_virtual17.js +5 -2
- package/dist/index-_virtual18.js +2 -7
- package/dist/index-_virtual19.js +4 -4
- package/dist/index-_virtual21.js +2 -2
- package/dist/index-_virtual22.js +2 -2
- package/dist/index-_virtual23.js +2 -3
- package/dist/index-_virtual24.js +2 -2
- package/dist/index-_virtual25.js +2 -2
- package/dist/index-_virtual26.js +2 -2
- package/dist/index-_virtual27.js +2 -2
- package/dist/index-_virtual28.js +2 -2
- package/dist/index-_virtual30.js +2 -2
- package/dist/index-_virtual31.js +2 -2
- package/dist/index-_virtual32.js +3 -2
- package/dist/index-_virtual34.js +2 -2
- package/dist/index-_virtual35.js +2 -4
- package/dist/index-_virtual36.js +1 -1
- package/dist/index-_virtual37.js +1 -1
- package/dist/index-_virtual38.js +1 -1
- package/dist/index-_virtual39.js +1 -1
- package/dist/index-_virtual40.js +1 -1
- package/dist/index-_virtual41.js +4 -2
- package/dist/index-_virtual42.js +2 -4
- package/dist/index-_virtual43.js +1 -1
- package/dist/index-_virtual44.js +1 -1
- package/dist/index-_virtual45.js +1 -1
- package/dist/index-_virtual46.js +1 -1
- package/dist/index-_virtual47.js +1 -1
- package/dist/index-_virtual48.js +1 -1
- package/dist/index-_virtual49.js +1 -1
- package/dist/index-_virtual50.js +1 -1
- package/dist/index-_virtual51.js +1 -1
- package/dist/index-_virtual52.js +1 -1
- package/dist/index-_virtual53.js +1 -1
- package/dist/index-_virtual54.js +1 -1
- package/dist/index-_virtual55.js +1 -1
- package/dist/index-_virtual56.js +1 -1
- package/dist/index-_virtual57.js +1 -1
- package/dist/index-_virtual58.js +4 -2
- package/dist/index-_virtual60.js +2 -4
- package/dist/index-_virtual61.js +1 -1
- package/dist/index-_virtual62.js +4 -2
- package/dist/index-_virtual63.js +2 -2
- package/dist/index-_virtual66.js +2 -2
- package/dist/index-_virtual67.js +2 -4
- package/dist/index-_virtual68.js +4 -2
- package/dist/index-_virtual74.js +1 -1
- package/dist/index-_virtual76.js +2 -2
- package/dist/index-_virtual77.js +4 -2
- package/dist/index-_virtual78.js +1 -1
- package/dist/index-_virtual79.js +1 -1
- package/dist/index-_virtual80.js +1 -1
- package/dist/index-_virtual81.js +1 -1
- package/dist/index-_virtual82.js +1 -1
- package/dist/index-_virtual83.js +1 -1
- package/dist/index-_virtual84.js +1 -1
- package/dist/index-_virtual85.js +2 -4
- package/dist/index-_virtual86.js +2 -2
- package/dist/index-applyInternationalSeparatorStyle.js +1 -1
- package/dist/index-attributes-to-props.js +1 -1
- package/dist/index-cjs.js +19 -75
- package/dist/index-colorManipulator3.js +2 -2
- package/dist/index-constants.js +38 -8
- package/dist/index-constants2.js +8 -38
- package/dist/index-createExtensionPattern.js +1 -1
- package/dist/index-createStyled2.js +6 -6
- package/dist/index-decode-data-html.js +5 -11
- package/dist/index-decode-data-xml.js +5 -11
- package/dist/index-decode.js +263 -216
- package/dist/index-decode_codepoint.js +43 -53
- package/dist/index-defaultRanges.js +10 -10
- package/dist/index-dist5.js +1 -1
- package/dist/index-elementAcceptingRef.js +1 -1
- package/dist/index-elementTypeAcceptingRef.js +1 -1
- package/dist/index-emotion-cache.browser.esm.js +2 -2
- package/dist/index-escape.js +43 -48
- package/dist/index-esm2.js +108 -129
- package/dist/index-esm3.js +12 -301
- package/dist/index-esm4.js +135 -17
- package/dist/index-esm5.js +303 -0
- package/dist/index-esm6.js +21 -0
- package/dist/index-esm7.js +102 -0
- package/dist/index-exenv.js +1 -1
- package/dist/index-extractCountryCallingCode.js +1 -1
- package/dist/index-extractPhoneContext.js +1 -1
- package/dist/index-foreignNames.js +101 -108
- package/dist/index-helpers3.js +1 -1
- package/dist/index-http.store.js +1 -1
- package/dist/index-isViablePhoneNumber.js +1 -1
- package/dist/index-keycode.js +1 -1
- package/dist/index-lib.js +2 -2
- package/dist/index-lib2.js +424 -111
- package/dist/index-lib3.js +14 -433
- package/dist/index-lib4.js +120 -14
- package/dist/index-lib5.js +10 -69
- package/dist/index-mpd-parser.es.js +1 -1
- package/dist/index-node.js +1 -1
- package/dist/index-node2.js +1 -1
- package/dist/index-parse2.js +1 -1
- package/dist/index-parse3.js +122 -20
- package/dist/index-refType.js +1 -1
- package/dist/index-responsivePropType.js +1 -1
- package/dist/index-sanitize-html.js +91 -48
- package/dist/index-stripIddPrefix.js +1 -1
- package/dist/index-style-to-object.js +1 -1
- package/dist/index-text-animate-words-style.js +12 -12
- package/dist/index-tiny-emitter.js +1 -1
- package/dist/index-use-dynamic-import.js +2 -0
- package/dist/index-useHyperlinkEditor.js +1 -1
- package/dist/index-useLexicalToolbar.js +1 -1
- package/dist/index-useRteAiAssistant-selection.js +5 -5
- package/dist/index-useThemeWithoutDefault3.js +1 -1
- package/dist/index-utilities.js +1 -1
- package/dist/index-utilities2.js +1 -1
- package/dist/index-utils2.js +1 -1
- package/dist/index-utils6.js +7 -7
- package/dist/index.js +428 -426
- package/dist/types/core/RichTextEditor/stories/RichTextEditorStory.story.d.ts +2 -0
- package/dist/types/core/RichTextEditor/stories/RichTextEditorWithXSSAttackStory.story.d.ts +2 -0
- package/dist/types/core/RichTextEditor/stories/_RichTextEditor.default.d.ts +4 -0
- package/dist/types/core/RichTextEditor/stories/bootstrap/richtexteditor.test.slice.d.ts +1 -0
- package/dist/types/core/TextHighlighted/stories/TextHighlightedStory.story.d.ts +2 -0
- package/dist/types/core/TextHighlighted/stories/TextHighlightedStory2.story.d.ts +2 -0
- package/dist/types/core/TextHighlighted/stories/TextHighlightedWithEmphasisStory.story.d.ts +2 -0
- package/dist/types/core/TextHighlighted/stories/TextHighlightedWithXSSAttackStory.story.d.ts +2 -0
- package/dist/types/core/TextHighlighted/stories/_TextHighlighted.default.d.ts +7 -0
- package/dist/types/core/_internal/InputBase/stories/HighlightLengthExceededTest.story.d.ts +2 -0
- package/dist/types/core/_internal/InputBase/stories/HighlightUrlTest.story.d.ts +2 -0
- package/dist/types/core/_internal/InputBase/stories/HighlightWordsTest.story.d.ts +2 -0
- package/dist/types/helpers/sanitize-html.d.ts +18 -3
- package/dist/types/index.d.ts +2 -0
- package/dist/vanguard-asset-analysis.json +1 -1
- package/dist-wordpress/Icon-tools-active-1-B-9tOuX0.mjs +4 -0
- package/dist-wordpress/Icon-tools-active-t9IjG2pg.mjs +4 -0
- package/dist-wordpress/index.js +23653 -22245
- package/package.json +5 -2
- package/scripts/check-meta-coverage.js +117 -0
- package/scripts/generate-exports-props.js +855 -0
- package/dist/index-Parser5.js +0 -131
- package/dist/index-Tokenizer3.js +0 -141
- package/dist/index-_virtual87.js +0 -4
- package/dist/index-_virtual88.js +0 -4
- package/dist/index-_virtual89.js +0 -4
- package/dist/index-_virtual90.js +0 -4
- package/dist/index-_virtual91.js +0 -4
- package/dist/index-at-rule.js +0 -22
- package/dist/index-cjs2.js +0 -23
- package/dist/index-comment.js +0 -16
- package/dist/index-container.js +0 -223
- package/dist/index-css-syntax-error.js +0 -56
- package/dist/index-declaration.js +0 -19
- package/dist/index-decode-data-html2.js +0 -4
- package/dist/index-decode-data-xml2.js +0 -4
- package/dist/index-decode2.js +0 -4
- package/dist/index-decode_codepoint2.js +0 -4
- package/dist/index-document3.js +0 -23
- package/dist/index-encode-html.js +0 -15
- package/dist/index-encode-html2.js +0 -4
- package/dist/index-encode.js +0 -49
- package/dist/index-encode2.js +0 -4
- package/dist/index-escape-string-regexp.js +0 -11
- package/dist/index-escape2.js +0 -4
- package/dist/index-feeds.js +0 -92
- package/dist/index-feeds2.js +0 -4
- package/dist/index-foreignNames2.js +0 -4
- package/dist/index-fromJSON.js +0 -46
- package/dist/index-helpers4.js +0 -54
- package/dist/index-helpers5.js +0 -4
- package/dist/index-input3.js +0 -139
- package/dist/index-is-plain-object.js +0 -17
- package/dist/index-is-plain-object2.js +0 -4
- package/dist/index-lazy-result.js +0 -343
- package/dist/index-legacy.js +0 -75
- package/dist/index-legacy2.js +0 -4
- package/dist/index-lib6.js +0 -13
- package/dist/index-lib7.js +0 -43
- package/dist/index-lib8.js +0 -147
- package/dist/index-lib9.js +0 -90
- package/dist/index-list3.js +0 -25
- package/dist/index-manipulation.js +0 -61
- package/dist/index-manipulation2.js +0 -4
- package/dist/index-map-generator.js +0 -171
- package/dist/index-no-work-result.js +0 -94
- package/dist/index-node4.js +0 -259
- package/dist/index-non-secure.js +0 -20
- package/dist/index-parse-srcset.js +0 -71
- package/dist/index-parse-srcset2.js +0 -4
- package/dist/index-parse4.js +0 -127
- package/dist/index-parser4.js +0 -322
- package/dist/index-picocolors.browser.js +0 -13
- package/dist/index-picocolors.browser2.js +0 -4
- package/dist/index-postcss.js +0 -46
- package/dist/index-previous-map.js +0 -92
- package/dist/index-processor.js +0 -43
- package/dist/index-querying.js +0 -63
- package/dist/index-querying2.js +0 -4
- package/dist/index-result.js +0 -30
- package/dist/index-root.js +0 -38
- package/dist/index-rule.js +0 -24
- package/dist/index-sanitize-html2.js +0 -672
- package/dist/index-stringifier.js +0 -196
- package/dist/index-stringify.js +0 -14
- package/dist/index-stringify2.js +0 -36
- package/dist/index-stringify3.js +0 -4
- package/dist/index-symbols.js +0 -8
- package/dist/index-symbols2.js +0 -4
- package/dist/index-tokenize.js +0 -114
- package/dist/index-traversal.js +0 -48
- package/dist/index-traversal2.js +0 -4
- package/dist/index-warn-once.js +0 -12
- package/dist/index-warning2.js +0 -25
- /package/dist/{index-Parser6.js → index-Parser4.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import R from "./index-objectWithoutPropertiesLoose.js";
|
|
2
2
|
import a from "./index-extends.js";
|
|
3
3
|
import * as m from "react";
|
|
4
|
-
import r from "./index-
|
|
4
|
+
import r from "./index-_virtual16.js";
|
|
5
5
|
import { clsx as N } from "./index-clsx.js";
|
|
6
6
|
import p, { getNativeSelectUtilityClasses as C } from "./index-nativeSelectClasses.js";
|
|
7
7
|
import b from "./index-styled.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import u from "./index-objectWithoutPropertiesLoose.js";
|
|
2
2
|
import n from "./index-extends.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import e from "./index-
|
|
4
|
+
import e from "./index-_virtual16.js";
|
|
5
5
|
import l from "./index-styled.js";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
7
7
|
import c from "./index-rootShouldForwardProp.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __exports as e } from "./index-
|
|
1
|
+
import { __exports as e } from "./index-_virtual28.js";
|
|
2
2
|
import p from "react";
|
|
3
3
|
import { __require as P } from "./index-LexicalComposerContext2.js";
|
|
4
4
|
import { __require as O } from "./index-LexicalOnChangePlugin.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import j from "./index-objectWithoutPropertiesLoose.js";
|
|
2
2
|
import l from "./index-extends.js";
|
|
3
3
|
import * as I from "react";
|
|
4
|
-
import o from "./index-
|
|
4
|
+
import o from "./index-_virtual16.js";
|
|
5
5
|
import A from "./index-NotchedOutline.js";
|
|
6
6
|
import N from "./index-useFormControl.js";
|
|
7
7
|
import w from "./index-formControlState.js";
|
package/dist/index-Paper.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import b from "./index-objectWithoutPropertiesLoose.js";
|
|
2
2
|
import s from "./index-extends.js";
|
|
3
3
|
import * as g from "react";
|
|
4
|
-
import r from "./index-
|
|
4
|
+
import r from "./index-_virtual16.js";
|
|
5
5
|
import { clsx as y } from "./index-clsx.js";
|
|
6
6
|
import { c as v } from "./index-colorManipulator2.js";
|
|
7
7
|
import P from "./index-styled.js";
|
package/dist/index-Parser2.js
CHANGED
|
@@ -1,260 +1,319 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
1
|
+
import S, { QuoteType as u } from "./index-Tokenizer.js";
|
|
2
|
+
import { fromCodePoint as p } from "./index-decode_codepoint.js";
|
|
3
|
+
const f = /* @__PURE__ */ new Set([
|
|
4
|
+
"input",
|
|
5
|
+
"option",
|
|
6
|
+
"optgroup",
|
|
7
|
+
"select",
|
|
8
|
+
"button",
|
|
9
|
+
"datalist",
|
|
10
|
+
"textarea"
|
|
11
|
+
]), n = /* @__PURE__ */ new Set(["p"]), v = /* @__PURE__ */ new Set(["thead", "tbody"]), w = /* @__PURE__ */ new Set(["dd", "dt"]), x = /* @__PURE__ */ new Set(["rt", "rp"]), C = /* @__PURE__ */ new Map([
|
|
12
|
+
["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
|
|
13
|
+
["th", /* @__PURE__ */ new Set(["th"])],
|
|
14
|
+
["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
|
|
15
|
+
["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
|
|
16
|
+
["li", /* @__PURE__ */ new Set(["li"])],
|
|
17
|
+
["p", n],
|
|
18
|
+
["h1", n],
|
|
19
|
+
["h2", n],
|
|
20
|
+
["h3", n],
|
|
21
|
+
["h4", n],
|
|
22
|
+
["h5", n],
|
|
23
|
+
["h6", n],
|
|
24
|
+
["select", f],
|
|
25
|
+
["input", f],
|
|
26
|
+
["output", f],
|
|
27
|
+
["button", f],
|
|
28
|
+
["datalist", f],
|
|
29
|
+
["textarea", f],
|
|
30
|
+
["option", /* @__PURE__ */ new Set(["option"])],
|
|
31
|
+
["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
|
|
32
|
+
["dd", w],
|
|
33
|
+
["dt", w],
|
|
34
|
+
["address", n],
|
|
35
|
+
["article", n],
|
|
36
|
+
["aside", n],
|
|
37
|
+
["blockquote", n],
|
|
38
|
+
["details", n],
|
|
39
|
+
["div", n],
|
|
40
|
+
["dl", n],
|
|
41
|
+
["fieldset", n],
|
|
42
|
+
["figcaption", n],
|
|
43
|
+
["figure", n],
|
|
44
|
+
["footer", n],
|
|
45
|
+
["form", n],
|
|
46
|
+
["header", n],
|
|
47
|
+
["hr", n],
|
|
48
|
+
["main", n],
|
|
49
|
+
["nav", n],
|
|
50
|
+
["ol", n],
|
|
51
|
+
["pre", n],
|
|
52
|
+
["section", n],
|
|
53
|
+
["table", n],
|
|
54
|
+
["ul", n],
|
|
55
|
+
["rt", x],
|
|
56
|
+
["rp", x],
|
|
57
|
+
["tbody", v],
|
|
58
|
+
["tfoot", v]
|
|
59
|
+
]), T = /* @__PURE__ */ new Set([
|
|
60
|
+
"area",
|
|
61
|
+
"base",
|
|
62
|
+
"basefont",
|
|
63
|
+
"br",
|
|
64
|
+
"col",
|
|
65
|
+
"command",
|
|
66
|
+
"embed",
|
|
67
|
+
"frame",
|
|
68
|
+
"hr",
|
|
69
|
+
"img",
|
|
70
|
+
"input",
|
|
71
|
+
"isindex",
|
|
72
|
+
"keygen",
|
|
73
|
+
"link",
|
|
74
|
+
"meta",
|
|
75
|
+
"param",
|
|
76
|
+
"source",
|
|
77
|
+
"track",
|
|
78
|
+
"wbr"
|
|
79
|
+
]), _ = /* @__PURE__ */ new Set(["math", "svg"]), k = /* @__PURE__ */ new Set([
|
|
80
|
+
"mi",
|
|
81
|
+
"mo",
|
|
82
|
+
"mn",
|
|
83
|
+
"ms",
|
|
84
|
+
"mtext",
|
|
85
|
+
"annotation-xml",
|
|
86
|
+
"foreignobject",
|
|
87
|
+
"desc",
|
|
88
|
+
"title"
|
|
89
|
+
]), I = /\s|\//;
|
|
90
|
+
class E {
|
|
91
|
+
constructor(t, e = {}) {
|
|
92
|
+
var s, i, o, h, a;
|
|
93
|
+
this.options = e, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.foreignContext = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = t ?? {}, this.lowerCaseTagNames = (s = e.lowerCaseTags) !== null && s !== void 0 ? s : !e.xmlMode, this.lowerCaseAttributeNames = (i = e.lowerCaseAttributeNames) !== null && i !== void 0 ? i : !e.xmlMode, this.tokenizer = new ((o = e.Tokenizer) !== null && o !== void 0 ? o : S)(this.options, this), (a = (h = this.cbs).onparserinit) === null || a === void 0 || a.call(h, this);
|
|
94
|
+
}
|
|
95
|
+
// Tokenizer event handlers
|
|
96
|
+
/** @internal */
|
|
97
|
+
ontext(t, e) {
|
|
98
|
+
var s, i;
|
|
99
|
+
const o = this.getSlice(t, e);
|
|
100
|
+
this.endIndex = e - 1, (i = (s = this.cbs).ontext) === null || i === void 0 || i.call(s, o), this.startIndex = e;
|
|
101
|
+
}
|
|
102
|
+
/** @internal */
|
|
103
|
+
ontextentity(t) {
|
|
104
|
+
var e, s;
|
|
105
|
+
const i = this.tokenizer.getSectionStart();
|
|
106
|
+
this.endIndex = i - 1, (s = (e = this.cbs).ontext) === null || s === void 0 || s.call(e, p(t)), this.startIndex = i;
|
|
107
|
+
}
|
|
108
|
+
isVoidElement(t) {
|
|
109
|
+
return !this.options.xmlMode && T.has(t);
|
|
110
|
+
}
|
|
111
|
+
/** @internal */
|
|
112
|
+
onopentagname(t, e) {
|
|
113
|
+
this.endIndex = e;
|
|
114
|
+
let s = this.getSlice(t, e);
|
|
115
|
+
this.lowerCaseTagNames && (s = s.toLowerCase()), this.emitOpenTag(s);
|
|
116
|
+
}
|
|
117
|
+
emitOpenTag(t) {
|
|
118
|
+
var e, s, i, o;
|
|
119
|
+
this.openTagStart = this.startIndex, this.tagname = t;
|
|
120
|
+
const h = !this.options.xmlMode && C.get(t);
|
|
121
|
+
if (h)
|
|
122
|
+
for (; this.stack.length > 0 && h.has(this.stack[this.stack.length - 1]); ) {
|
|
123
|
+
const a = this.stack.pop();
|
|
124
|
+
(s = (e = this.cbs).onclosetag) === null || s === void 0 || s.call(e, a, !0);
|
|
120
125
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
this.isVoidElement(t) || (this.stack.push(t), x.has(t) ? this.foreignContext.push(!0) : y.has(t) && this.foreignContext.push(!1)), (r = (n = this.cbs).onopentagname) === null || r === void 0 || r.call(n, t), this.cbs.onopentag && (this.attribs = {});
|
|
143
|
-
}, s.prototype.endOpenTag = function(t) {
|
|
144
|
-
var e, i;
|
|
145
|
-
this.startIndex = this.openTagStart, this.attribs && ((i = (e = this.cbs).onopentag) === null || i === void 0 || i.call(e, this.tagname, this.attribs, t), this.attribs = null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = "";
|
|
146
|
-
}, s.prototype.onopentagend = function(t) {
|
|
147
|
-
this.endIndex = t, this.endOpenTag(!1), this.startIndex = t + 1;
|
|
148
|
-
}, s.prototype.onclosetag = function(t, e) {
|
|
149
|
-
var i, n, r, h, a, u;
|
|
150
|
-
this.endIndex = e;
|
|
151
|
-
var l = this.getSlice(t, e);
|
|
152
|
-
if (this.lowerCaseTagNames && (l = l.toLowerCase()), (x.has(l) || y.has(l)) && this.foreignContext.pop(), this.isVoidElement(l))
|
|
153
|
-
!this.options.xmlMode && l === "br" && ((n = (i = this.cbs).onopentagname) === null || n === void 0 || n.call(i, "br"), (h = (r = this.cbs).onopentag) === null || h === void 0 || h.call(r, "br", {}, !0), (u = (a = this.cbs).onclosetag) === null || u === void 0 || u.call(a, "br", !1));
|
|
154
|
-
else {
|
|
155
|
-
var d = this.stack.lastIndexOf(l);
|
|
156
|
-
if (d !== -1)
|
|
157
|
-
if (this.cbs.onclosetag)
|
|
158
|
-
for (var p = this.stack.length - d; p--; )
|
|
159
|
-
this.cbs.onclosetag(this.stack.pop(), p !== 0);
|
|
160
|
-
else
|
|
161
|
-
this.stack.length = d;
|
|
162
|
-
else !this.options.xmlMode && l === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
|
|
163
|
-
}
|
|
164
|
-
this.startIndex = e + 1;
|
|
165
|
-
}, s.prototype.onselfclosingtag = function(t) {
|
|
166
|
-
this.endIndex = t, this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1] ? (this.closeCurrentTag(!1), this.startIndex = t + 1) : this.onopentagend(t);
|
|
167
|
-
}, s.prototype.closeCurrentTag = function(t) {
|
|
168
|
-
var e, i, n = this.tagname;
|
|
169
|
-
this.endOpenTag(t), this.stack[this.stack.length - 1] === n && ((i = (e = this.cbs).onclosetag) === null || i === void 0 || i.call(e, n, !t), this.stack.pop());
|
|
170
|
-
}, s.prototype.onattribname = function(t, e) {
|
|
171
|
-
this.startIndex = t;
|
|
172
|
-
var i = this.getSlice(t, e);
|
|
173
|
-
this.attribname = this.lowerCaseAttributeNames ? i.toLowerCase() : i;
|
|
174
|
-
}, s.prototype.onattribdata = function(t, e) {
|
|
175
|
-
this.attribvalue += this.getSlice(t, e);
|
|
176
|
-
}, s.prototype.onattribentity = function(t) {
|
|
177
|
-
this.attribvalue += (0, g.fromCodePoint)(t);
|
|
178
|
-
}, s.prototype.onattribend = function(t, e) {
|
|
179
|
-
var i, n;
|
|
180
|
-
this.endIndex = e, (n = (i = this.cbs).onattribute) === null || n === void 0 || n.call(i, this.attribname, this.attribvalue, t === b.QuoteType.Double ? '"' : t === b.QuoteType.Single ? "'" : t === b.QuoteType.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
|
|
181
|
-
}, s.prototype.getInstructionName = function(t) {
|
|
182
|
-
var e = t.search(M), i = e < 0 ? t : t.substr(0, e);
|
|
183
|
-
return this.lowerCaseTagNames && (i = i.toLowerCase()), i;
|
|
184
|
-
}, s.prototype.ondeclaration = function(t, e) {
|
|
185
|
-
this.endIndex = e;
|
|
186
|
-
var i = this.getSlice(t, e);
|
|
187
|
-
if (this.cbs.onprocessinginstruction) {
|
|
188
|
-
var n = this.getInstructionName(i);
|
|
189
|
-
this.cbs.onprocessinginstruction("!".concat(n), "!".concat(i));
|
|
190
|
-
}
|
|
191
|
-
this.startIndex = e + 1;
|
|
192
|
-
}, s.prototype.onprocessinginstruction = function(t, e) {
|
|
193
|
-
this.endIndex = e;
|
|
194
|
-
var i = this.getSlice(t, e);
|
|
195
|
-
if (this.cbs.onprocessinginstruction) {
|
|
196
|
-
var n = this.getInstructionName(i);
|
|
197
|
-
this.cbs.onprocessinginstruction("?".concat(n), "?".concat(i));
|
|
198
|
-
}
|
|
199
|
-
this.startIndex = e + 1;
|
|
200
|
-
}, s.prototype.oncomment = function(t, e, i) {
|
|
201
|
-
var n, r, h, a;
|
|
202
|
-
this.endIndex = e, (r = (n = this.cbs).oncomment) === null || r === void 0 || r.call(n, this.getSlice(t, e - i)), (a = (h = this.cbs).oncommentend) === null || a === void 0 || a.call(h), this.startIndex = e + 1;
|
|
203
|
-
}, s.prototype.oncdata = function(t, e, i) {
|
|
204
|
-
var n, r, h, a, u, l, d, p, S, v;
|
|
205
|
-
this.endIndex = e;
|
|
206
|
-
var C = this.getSlice(t, e - i);
|
|
207
|
-
this.options.xmlMode || this.options.recognizeCDATA ? ((r = (n = this.cbs).oncdatastart) === null || r === void 0 || r.call(n), (a = (h = this.cbs).ontext) === null || a === void 0 || a.call(h, C), (l = (u = this.cbs).oncdataend) === null || l === void 0 || l.call(u)) : ((p = (d = this.cbs).oncomment) === null || p === void 0 || p.call(d, "[CDATA[".concat(C, "]]")), (v = (S = this.cbs).oncommentend) === null || v === void 0 || v.call(S)), this.startIndex = e + 1;
|
|
208
|
-
}, s.prototype.onend = function() {
|
|
209
|
-
var t, e;
|
|
126
|
+
this.isVoidElement(t) || (this.stack.push(t), _.has(t) ? this.foreignContext.push(!0) : k.has(t) && this.foreignContext.push(!1)), (o = (i = this.cbs).onopentagname) === null || o === void 0 || o.call(i, t), this.cbs.onopentag && (this.attribs = {});
|
|
127
|
+
}
|
|
128
|
+
endOpenTag(t) {
|
|
129
|
+
var e, s;
|
|
130
|
+
this.startIndex = this.openTagStart, this.attribs && ((s = (e = this.cbs).onopentag) === null || s === void 0 || s.call(e, this.tagname, this.attribs, t), this.attribs = null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = "";
|
|
131
|
+
}
|
|
132
|
+
/** @internal */
|
|
133
|
+
onopentagend(t) {
|
|
134
|
+
this.endIndex = t, this.endOpenTag(!1), this.startIndex = t + 1;
|
|
135
|
+
}
|
|
136
|
+
/** @internal */
|
|
137
|
+
onclosetag(t, e) {
|
|
138
|
+
var s, i, o, h, a, l;
|
|
139
|
+
this.endIndex = e;
|
|
140
|
+
let r = this.getSlice(t, e);
|
|
141
|
+
if (this.lowerCaseTagNames && (r = r.toLowerCase()), (_.has(r) || k.has(r)) && this.foreignContext.pop(), this.isVoidElement(r))
|
|
142
|
+
!this.options.xmlMode && r === "br" && ((i = (s = this.cbs).onopentagname) === null || i === void 0 || i.call(s, "br"), (h = (o = this.cbs).onopentag) === null || h === void 0 || h.call(o, "br", {}, !0), (l = (a = this.cbs).onclosetag) === null || l === void 0 || l.call(a, "br", !1));
|
|
143
|
+
else {
|
|
144
|
+
const c = this.stack.lastIndexOf(r);
|
|
145
|
+
if (c !== -1)
|
|
210
146
|
if (this.cbs.onclosetag) {
|
|
211
|
-
|
|
212
|
-
for (
|
|
213
|
-
;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
147
|
+
let d = this.stack.length - c;
|
|
148
|
+
for (; d--; )
|
|
149
|
+
this.cbs.onclosetag(this.stack.pop(), d !== 0);
|
|
150
|
+
} else
|
|
151
|
+
this.stack.length = c;
|
|
152
|
+
else !this.options.xmlMode && r === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
|
|
153
|
+
}
|
|
154
|
+
this.startIndex = e + 1;
|
|
155
|
+
}
|
|
156
|
+
/** @internal */
|
|
157
|
+
onselfclosingtag(t) {
|
|
158
|
+
this.endIndex = t, this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1] ? (this.closeCurrentTag(!1), this.startIndex = t + 1) : this.onopentagend(t);
|
|
159
|
+
}
|
|
160
|
+
closeCurrentTag(t) {
|
|
161
|
+
var e, s;
|
|
162
|
+
const i = this.tagname;
|
|
163
|
+
this.endOpenTag(t), this.stack[this.stack.length - 1] === i && ((s = (e = this.cbs).onclosetag) === null || s === void 0 || s.call(e, i, !t), this.stack.pop());
|
|
164
|
+
}
|
|
165
|
+
/** @internal */
|
|
166
|
+
onattribname(t, e) {
|
|
167
|
+
this.startIndex = t;
|
|
168
|
+
const s = this.getSlice(t, e);
|
|
169
|
+
this.attribname = this.lowerCaseAttributeNames ? s.toLowerCase() : s;
|
|
170
|
+
}
|
|
171
|
+
/** @internal */
|
|
172
|
+
onattribdata(t, e) {
|
|
173
|
+
this.attribvalue += this.getSlice(t, e);
|
|
174
|
+
}
|
|
175
|
+
/** @internal */
|
|
176
|
+
onattribentity(t) {
|
|
177
|
+
this.attribvalue += p(t);
|
|
178
|
+
}
|
|
179
|
+
/** @internal */
|
|
180
|
+
onattribend(t, e) {
|
|
181
|
+
var s, i;
|
|
182
|
+
this.endIndex = e, (i = (s = this.cbs).onattribute) === null || i === void 0 || i.call(s, this.attribname, this.attribvalue, t === u.Double ? '"' : t === u.Single ? "'" : t === u.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
|
|
183
|
+
}
|
|
184
|
+
getInstructionName(t) {
|
|
185
|
+
const e = t.search(I);
|
|
186
|
+
let s = e < 0 ? t : t.substr(0, e);
|
|
187
|
+
return this.lowerCaseTagNames && (s = s.toLowerCase()), s;
|
|
188
|
+
}
|
|
189
|
+
/** @internal */
|
|
190
|
+
ondeclaration(t, e) {
|
|
191
|
+
this.endIndex = e;
|
|
192
|
+
const s = this.getSlice(t, e);
|
|
193
|
+
if (this.cbs.onprocessinginstruction) {
|
|
194
|
+
const i = this.getInstructionName(s);
|
|
195
|
+
this.cbs.onprocessinginstruction(`!${i}`, `!${s}`);
|
|
196
|
+
}
|
|
197
|
+
this.startIndex = e + 1;
|
|
198
|
+
}
|
|
199
|
+
/** @internal */
|
|
200
|
+
onprocessinginstruction(t, e) {
|
|
201
|
+
this.endIndex = e;
|
|
202
|
+
const s = this.getSlice(t, e);
|
|
203
|
+
if (this.cbs.onprocessinginstruction) {
|
|
204
|
+
const i = this.getInstructionName(s);
|
|
205
|
+
this.cbs.onprocessinginstruction(`?${i}`, `?${s}`);
|
|
206
|
+
}
|
|
207
|
+
this.startIndex = e + 1;
|
|
208
|
+
}
|
|
209
|
+
/** @internal */
|
|
210
|
+
oncomment(t, e, s) {
|
|
211
|
+
var i, o, h, a;
|
|
212
|
+
this.endIndex = e, (o = (i = this.cbs).oncomment) === null || o === void 0 || o.call(i, this.getSlice(t, e - s)), (a = (h = this.cbs).oncommentend) === null || a === void 0 || a.call(h), this.startIndex = e + 1;
|
|
213
|
+
}
|
|
214
|
+
/** @internal */
|
|
215
|
+
oncdata(t, e, s) {
|
|
216
|
+
var i, o, h, a, l, r, c, d, g, b;
|
|
217
|
+
this.endIndex = e;
|
|
218
|
+
const m = this.getSlice(t, e - s);
|
|
219
|
+
this.options.xmlMode || this.options.recognizeCDATA ? ((o = (i = this.cbs).oncdatastart) === null || o === void 0 || o.call(i), (a = (h = this.cbs).ontext) === null || a === void 0 || a.call(h, m), (r = (l = this.cbs).oncdataend) === null || r === void 0 || r.call(l)) : ((d = (c = this.cbs).oncomment) === null || d === void 0 || d.call(c, `[CDATA[${m}]]`), (b = (g = this.cbs).oncommentend) === null || b === void 0 || b.call(g)), this.startIndex = e + 1;
|
|
220
|
+
}
|
|
221
|
+
/** @internal */
|
|
222
|
+
onend() {
|
|
223
|
+
var t, e;
|
|
224
|
+
if (this.cbs.onclosetag) {
|
|
225
|
+
this.endIndex = this.startIndex;
|
|
226
|
+
for (let s = this.stack.length; s > 0; this.cbs.onclosetag(this.stack[--s], !0))
|
|
227
|
+
;
|
|
228
|
+
}
|
|
229
|
+
(e = (t = this.cbs).onend) === null || e === void 0 || e.call(t);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Resets the parser to a blank state, ready to parse a new HTML document
|
|
233
|
+
*/
|
|
234
|
+
reset() {
|
|
235
|
+
var t, e, s, i;
|
|
236
|
+
(e = (t = this.cbs).onreset) === null || e === void 0 || e.call(t), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, (i = (s = this.cbs).onparserinit) === null || i === void 0 || i.call(s, this), this.buffers.length = 0, this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Resets the parser, then parses a complete document and
|
|
240
|
+
* pushes it to the handler.
|
|
241
|
+
*
|
|
242
|
+
* @param data Document to parse.
|
|
243
|
+
*/
|
|
244
|
+
parseComplete(t) {
|
|
245
|
+
this.reset(), this.end(t);
|
|
246
|
+
}
|
|
247
|
+
getSlice(t, e) {
|
|
248
|
+
for (; t - this.bufferOffset >= this.buffers[0].length; )
|
|
249
|
+
this.shiftBuffer();
|
|
250
|
+
let s = this.buffers[0].slice(t - this.bufferOffset, e - this.bufferOffset);
|
|
251
|
+
for (; e - this.bufferOffset > this.buffers[0].length; )
|
|
252
|
+
this.shiftBuffer(), s += this.buffers[0].slice(0, e - this.bufferOffset);
|
|
253
|
+
return s;
|
|
254
|
+
}
|
|
255
|
+
shiftBuffer() {
|
|
256
|
+
this.bufferOffset += this.buffers[0].length, this.writeIndex--, this.buffers.shift();
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Parses a chunk of data and calls the corresponding callbacks.
|
|
260
|
+
*
|
|
261
|
+
* @param chunk Chunk to parse.
|
|
262
|
+
*/
|
|
263
|
+
write(t) {
|
|
264
|
+
var e, s;
|
|
265
|
+
if (this.ended) {
|
|
266
|
+
(s = (e = this.cbs).onerror) === null || s === void 0 || s.call(e, new Error(".write() after done!"));
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
this.buffers.push(t), this.tokenizer.running && (this.tokenizer.write(t), this.writeIndex++);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Parses the end of the buffer and clears the stack, calls onend.
|
|
273
|
+
*
|
|
274
|
+
* @param chunk Optional final chunk to parse.
|
|
275
|
+
*/
|
|
276
|
+
end(t) {
|
|
277
|
+
var e, s;
|
|
278
|
+
if (this.ended) {
|
|
279
|
+
(s = (e = this.cbs).onerror) === null || s === void 0 || s.call(e, new Error(".end() after done!"));
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
t && this.write(t), this.ended = !0, this.tokenizer.end();
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Pauses parsing. The parser won't emit events until `resume` is called.
|
|
286
|
+
*/
|
|
287
|
+
pause() {
|
|
288
|
+
this.tokenizer.pause();
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Resumes parsing after `pause` was called.
|
|
292
|
+
*/
|
|
293
|
+
resume() {
|
|
294
|
+
for (this.tokenizer.resume(); this.tokenizer.running && this.writeIndex < this.buffers.length; )
|
|
295
|
+
this.tokenizer.write(this.buffers[this.writeIndex++]);
|
|
296
|
+
this.ended && this.tokenizer.end();
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Alias of `write`, for backwards compatibility.
|
|
300
|
+
*
|
|
301
|
+
* @param chunk Chunk to parse.
|
|
302
|
+
* @deprecated
|
|
303
|
+
*/
|
|
304
|
+
parseChunk(t) {
|
|
305
|
+
this.write(t);
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Alias of `end`, for backwards compatibility.
|
|
309
|
+
*
|
|
310
|
+
* @param chunk Optional final chunk to parse.
|
|
311
|
+
* @deprecated
|
|
312
|
+
*/
|
|
313
|
+
done(t) {
|
|
314
|
+
this.end(t);
|
|
315
|
+
}
|
|
257
316
|
}
|
|
258
317
|
export {
|
|
259
|
-
|
|
318
|
+
E as Parser
|
|
260
319
|
};
|